@univer-cli/content-inspection 1.0.0-rc.0 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function _0x3473(_0x5a8608,_0x1351d6){_0x5a8608=_0x5a8608-0x16b;const _0x273398=_0x2733();let _0x34731b=_0x273398[_0x5a8608];return _0x34731b;}function _0x2733(){const _0x468859=['object','values','doc','173pMaNQC','number','execute','worksheet-range','message','top','routing','start','presentation','group','INSPECTION_SELECTOR_AMBIGUOUS',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20document\x20=\x20univerAPI.getDocument(input.unitId);\x0aif\x20(!document)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Document\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20document.save();\x0aconst\x20body\x20=\x20snapshot.body\x20||\x20{};\x0aconst\x20stream\x20=\x20typeof\x20body.dataStream\x20===\x20\x22string\x22\x20?\x20body.dataStream\x20:\x20\x22\x22;\x0aconst\x20rawParagraphs\x20=\x20Array.isArray(body.paragraphs)\x20?\x20body.paragraphs\x20:\x20[];\x0a\x0afunction\x20cleanPreview(text)\x20{\x0a\x20\x20const\x20normalized\x20=\x20text.replace(/[\x5cu0000-\x5cu001f]+/g,\x20\x22\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20return\x20normalized.length\x20<=\x20120\x20?\x20normalized\x20:\x20normalized.slice(0,\x20117)\x20+\x20\x22...\x22;\x0a}\x0a\x0afunction\x20resolveParagraphs()\x20{\x0a\x20\x20let\x20start\x20=\x200;\x0a\x20\x20return\x20rawParagraphs.map((paragraph,\x20index)\x20=>\x20{\x0a\x20\x20\x20\x20const\x20end\x20=\x20Number.isInteger(paragraph.startIndex)\x20?\x20paragraph.startIndex\x20:\x20start;\x0a\x20\x20\x20\x20const\x20result\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20id:\x20typeof\x20paragraph.paragraphId\x20===\x20\x22string\x22\x20?\x20paragraph.paragraphId\x20:\x20String(index),\x0a\x20\x20\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20\x20\x20text:\x20stream.slice(start,\x20end),\x0a\x20\x20\x20\x20\x20\x20start,\x0a\x20\x20\x20\x20\x20\x20end,\x0a\x20\x20\x20\x20\x20\x20raw:\x20paragraph,\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20start\x20=\x20end\x20+\x201;\x0a\x20\x20\x20\x20return\x20result;\x0a\x20\x20});\x0a}\x0a\x0aconst\x20paragraphs\x20=\x20resolveParagraphs();\x0a\x0afunction\x20resolveParagraph(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20paragraphs[selector.index]\x20?\x20[paragraphs[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Paragraph\x20selector\x20did\x20not\x20match\x20a\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Paragraph\x20selector\x20matched\x20more\x20than\x20one\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20paragraph:\x20matches[0]\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22document\x22)\x20{\x0a\x20\x20const\x20mode\x20=\x20typeof\x20document.isModern\x20===\x20\x22function\x22\x20&&\x20document.isModern()\x0a\x20\x20\x20\x20?\x20\x22modern\x22\x0a\x20\x20\x20\x20:\x20typeof\x20document.isTraditional\x20===\x20\x22function\x22\x20&&\x20document.isTraditional()\x0a\x20\x20\x20\x20\x20\x20?\x20\x22paginated\x22\x0a\x20\x20\x20\x20\x20\x20:\x20\x22unspecified\x22;\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22document\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20title:\x20document.getName(),\x0a\x20\x20\x20\x20mode,\x0a\x20\x20\x20\x20paragraphCount:\x20paragraphs.length,\x0a\x20\x20\x20\x20characterCount:\x20paragraphs.reduce((total,\x20paragraph)\x20=>\x20total\x20+\x20paragraph.text.length,\x200),\x0a\x20\x20\x20\x20features:\x20{\x0a\x20\x20\x20\x20\x20\x20tables:\x20Array.isArray(body.tables)\x20?\x20body.tables.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20lists:\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.raw.bullet\x20!==\x20undefined).length,\x0a\x20\x20\x20\x20\x20\x20drawings:\x20snapshot.drawings\x20&&\x20typeof\x20snapshot.drawings\x20===\x20\x22object\x22\x20?\x20Object.keys(snapshot.drawings).length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20customBlocks:\x20Array.isArray(body.customBlocks)\x20?\x20body.customBlocks.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20blockRanges:\x20Array.isArray(body.blockRanges)\x20?\x20body.blockRanges.length\x20:\x200,\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20paragraphs:\x20paragraphs.map((paragraph)\x20=>\x20({\x20id:\x20paragraph.id,\x20index:\x20paragraph.index,\x20textPreview:\x20cleanPreview(paragraph.text)\x20})),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22paragraph\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.paragraphs\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveParagraph(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20const\x20paragraph\x20=\x20item.paragraph;\x0a\x20\x20\x20\x20const\x20runs\x20=\x20(Array.isArray(body.textRuns)\x20?\x20body.textRuns\x20:\x20[]).filter((run)\x20=>\x20(run.ed\x20||\x200)\x20>\x20paragraph.start\x20&&\x20(run.st\x20||\x200)\x20<\x20paragraph.end);\x0a\x20\x20\x20\x20const\x20bullet\x20=\x20paragraph.raw.bullet;\x0a\x20\x20\x20\x20const\x20listId\x20=\x20bullet\x20&&\x20bullet.listId;\x0a\x20\x20\x20\x20const\x20list\x20=\x20typeof\x20listId\x20===\x20\x22string\x22\x20&&\x20snapshot.lists\x20&&\x20snapshot.lists[listId];\x0a\x20\x20\x20\x20selected.push({\x0a\x20\x20\x20\x20\x20\x20id:\x20paragraph.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20paragraph.index,\x0a\x20\x20\x20\x20\x20\x20text:\x20paragraph.text,\x0a\x20\x20\x20\x20\x20\x20...(paragraph.raw.paragraphStyle\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20paragraph.raw.paragraphStyle\x20}),\x0a\x20\x20\x20\x20\x20\x20...(bullet\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20bullet\x20}),\x0a\x20\x20\x20\x20\x20\x20...(list\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20list\x20}),\x0a\x20\x20\x20\x20\x20\x20textRuns:\x20runs,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22paragraph\x22,\x20unitId:\x20input.unitId,\x20paragraphs:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20document\x20inspection\x20target\x22);\x0a','unitId','data','elements','slides','subtype','string','length','\x0aconst\x20input\x20=\x20','elementCounts','views','INSPECTION_RANGE_OUT_OF_BOUNDS','9364904bLpNDI','ranges','selectable','connectionPosition','labelStyle','parentId','total','waypoints','transform','freePolyline','segmentIndex','byType','orderIndex','auto',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20workbook\x20=\x20univerAPI.getWorkbook(input.unitId);\x0aif\x20(!workbook)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Workbook\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20sheets\x20=\x20workbook.getSheets();\x0aconst\x20snapshot\x20=\x20workbook.save();\x0a\x0afunction\x20columnName(column)\x20{\x0a\x20\x20let\x20value\x20=\x20column\x20+\x201;\x0a\x20\x20let\x20name\x20=\x20\x22\x22;\x0a\x20\x20while\x20(value\x20>\x200)\x20{\x0a\x20\x20\x20\x20const\x20remainder\x20=\x20(value\x20-\x201)\x20%\x2026;\x0a\x20\x20\x20\x20name\x20=\x20String.fromCharCode(65\x20+\x20remainder)\x20+\x20name;\x0a\x20\x20\x20\x20value\x20=\x20Math.floor((value\x20-\x201)\x20/\x2026);\x0a\x20\x20}\x0a\x20\x20return\x20name;\x0a}\x0a\x0afunction\x20rangeNotation(range)\x20{\x0a\x20\x20const\x20start\x20=\x20columnName(range.startColumn)\x20+\x20String(range.startRow\x20+\x201);\x0a\x20\x20const\x20end\x20=\x20columnName(range.endColumn)\x20+\x20String(range.endRow\x20+\x201);\x0a\x20\x20return\x20start\x20===\x20end\x20?\x20start\x20:\x20start\x20+\x20\x22:\x22\x20+\x20end;\x0a}\x0a\x0afunction\x20parseA1Range(notation)\x20{\x0a\x20\x20const\x20match\x20=\x20/^\x5c$?([A-Za-z]+)\x5c$?(\x5cd+)(?::\x5c$?([A-Za-z]+)\x5c$?(\x5cd+))?$/.exec(notation);\x0a\x20\x20if\x20(!match)\x20return\x20null;\x0a\x20\x20const\x20columnIndex\x20=\x20(name)\x20=>\x20{\x0a\x20\x20\x20\x20let\x20column\x20=\x200;\x0a\x20\x20\x20\x20for\x20(const\x20character\x20of\x20name.toUpperCase())\x20column\x20=\x20column\x20*\x2026\x20+\x20character.charCodeAt(0)\x20-\x2064;\x0a\x20\x20\x20\x20return\x20column\x20-\x201;\x0a\x20\x20};\x0a\x20\x20const\x20startColumn\x20=\x20columnIndex(match[1]);\x0a\x20\x20const\x20startRow\x20=\x20Number(match[2])\x20-\x201;\x0a\x20\x20const\x20endColumn\x20=\x20columnIndex(match[3]\x20||\x20match[1]);\x0a\x20\x20const\x20endRow\x20=\x20Number(match[4]\x20||\x20match[2])\x20-\x201;\x0a\x20\x20if\x20(!Number.isSafeInteger(startRow)\x20||\x20!Number.isSafeInteger(endRow)\x20||\x20startRow\x20<\x200\x20||\x20endRow\x20<\x20startRow\x20||\x20endColumn\x20<\x20startColumn)\x20return\x20null;\x0a\x20\x20return\x20{\x20startRow,\x20endRow,\x20startColumn,\x20endColumn\x20};\x0a}\x0a\x0afunction\x20normalizeCellData(cellData)\x20{\x0a\x20\x20const\x20cells\x20=\x20[];\x0a\x20\x20for\x20(const\x20[rowKey,\x20columns]\x20of\x20Object.entries(cellData\x20||\x20{}))\x20{\x0a\x20\x20\x20\x20const\x20row\x20=\x20Number(rowKey);\x0a\x20\x20\x20\x20if\x20(!Number.isInteger(row)\x20||\x20!columns\x20||\x20typeof\x20columns\x20!==\x20\x22object\x22)\x20continue;\x0a\x20\x20\x20\x20for\x20(const\x20[columnKey,\x20cell]\x20of\x20Object.entries(columns))\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20column\x20=\x20Number(columnKey);\x0a\x20\x20\x20\x20\x20\x20if\x20(Number.isInteger(column)\x20&&\x20cell\x20&&\x20typeof\x20cell\x20===\x20\x22object\x22)\x20cells.push({\x20row,\x20column,\x20cell\x20});\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20cells.sort((left,\x20right)\x20=>\x20left.row\x20-\x20right.row\x20||\x20left.column\x20-\x20right.column);\x0a\x20\x20return\x20cells;\x0a}\x0a\x0a//\x20TODO:\x20profile\x20large\x20sparse\x20worksheets\x20and\x20move\x20this\x20scan\x20behind\x20an\x20incremental\x20index\x20if\x20needed.\x0afunction\x20compactUsedRanges(cells,\x20predicate)\x20{\x0a\x20\x20const\x20horizontal\x20=\x20[];\x0a\x20\x20let\x20active\x20=\x20null;\x0a\x20\x20for\x20(const\x20entry\x20of\x20cells)\x20{\x0a\x20\x20\x20\x20if\x20(!predicate(entry.cell))\x20continue;\x0a\x20\x20\x20\x20if\x20(active\x20&&\x20active.startRow\x20===\x20entry.row\x20&&\x20active.endColumn\x20+\x201\x20===\x20entry.column)\x20{\x0a\x20\x20\x20\x20\x20\x20active.endColumn\x20=\x20entry.column;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20active\x20=\x20{\x20startRow:\x20entry.row,\x20endRow:\x20entry.row,\x20startColumn:\x20entry.column,\x20endColumn:\x20entry.column\x20};\x0a\x20\x20\x20\x20\x20\x20horizontal.push(active);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20const\x20rectangles\x20=\x20[];\x0a\x20\x20const\x20previousRow\x20=\x20new\x20Map();\x0a\x20\x20let\x20currentRow\x20=\x20-1;\x0a\x20\x20let\x20current\x20=\x20new\x20Map();\x0a\x20\x20for\x20(const\x20span\x20of\x20horizontal)\x20{\x0a\x20\x20\x20\x20if\x20(span.startRow\x20!==\x20currentRow)\x20{\x0a\x20\x20\x20\x20\x20\x20previousRow.clear();\x0a\x20\x20\x20\x20\x20\x20for\x20(const\x20[key,\x20value]\x20of\x20current)\x20previousRow.set(key,\x20value);\x0a\x20\x20\x20\x20\x20\x20current\x20=\x20new\x20Map();\x0a\x20\x20\x20\x20\x20\x20currentRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20key\x20=\x20span.startColumn\x20+\x20\x22:\x22\x20+\x20span.endColumn;\x0a\x20\x20\x20\x20const\x20prior\x20=\x20previousRow.get(key);\x0a\x20\x20\x20\x20if\x20(prior\x20&&\x20prior.endRow\x20+\x201\x20===\x20span.startRow)\x20{\x0a\x20\x20\x20\x20\x20\x20prior.endRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20prior);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20rectangle\x20=\x20{\x20...span\x20};\x0a\x20\x20\x20\x20\x20\x20rectangles.push(rectangle);\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20rectangle);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20rectangles.map(rangeNotation);\x0a}\x0a\x0afunction\x20hasValue(cell)\x20{\x0a\x20\x20return\x20Object.entries(cell).some(([key,\x20value])\x20=>\x20key\x20!==\x20\x22s\x22\x20&&\x20key\x20!==\x20\x22t\x22\x20&&\x20value\x20!==\x20null\x20&&\x20value\x20!==\x20undefined\x20&&\x20value\x20!==\x20\x22\x22);\x0a}\x0a\x0afunction\x20hasFormula(cell)\x20{\x0a\x20\x20return\x20(typeof\x20cell.f\x20===\x20\x22string\x22\x20&&\x20cell.f.length\x20>\x200)\x20||\x20cell.si\x20!==\x20null\x20&&\x20cell.si\x20!==\x20undefined\x20&&\x20cell.si\x20!==\x20\x22\x22;\x0a}\x0a\x0afunction\x20hasStyle(cell)\x20{\x0a\x20\x20return\x20cell.s\x20!==\x20null\x20&&\x20cell.s\x20!==\x20undefined;\x0a}\x0a\x0afunction\x20uniqueRanges(ranges)\x20{\x0a\x20\x20return\x20[...new\x20Set(ranges.map(rangeNotation))].sort();\x0a}\x0a\x0afunction\x20worksheetIdentity(sheet,\x20index)\x20{\x0a\x20\x20return\x20{\x20id:\x20sheet.getSheetId(),\x20index,\x20name:\x20sheet.getSheetName()\x20};\x0a}\x0a\x0afunction\x20worksheetOverview(sheet,\x20index)\x20{\x0a\x20\x20const\x20identity\x20=\x20worksheetIdentity(sheet,\x20index);\x0a\x20\x20const\x20sheetData\x20=\x20snapshot.sheets\x20&&\x20snapshot.sheets[identity.id]\x20||\x20{};\x0a\x20\x20const\x20cells\x20=\x20normalizeCellData(sheetData.cellData);\x0a\x20\x20const\x20conditionalRules\x20=\x20typeof\x20sheet.getConditionalFormattingRules\x20===\x20\x22function\x22\x20?\x20sheet.getConditionalFormattingRules()\x20:\x20[];\x0a\x20\x20const\x20validationRules\x20=\x20typeof\x20sheet.getDataValidations\x20===\x20\x22function\x22\x20?\x20sheet.getDataValidations()\x20:\x20[];\x0a\x20\x20const\x20tables\x20=\x20typeof\x20sheet.getSubTableInfos\x20===\x20\x22function\x22\x20?\x20sheet.getSubTableInfos()\x20:\x20[];\x0a\x20\x20const\x20images\x20=\x20typeof\x20sheet.getImages\x20===\x20\x22function\x22\x20?\x20sheet.getImages().length\x20:\x200;\x0a\x20\x20const\x20shapes\x20=\x20typeof\x20sheet.getShapes\x20===\x20\x22function\x22\x20?\x20sheet.getShapes().length\x20:\x200;\x0a\x20\x20const\x20charts\x20=\x20sheet.charts\x20&&\x20typeof\x20sheet.charts.list\x20===\x20\x22function\x22\x20?\x20sheet.charts.list().length\x20:\x200;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...identity,\x0a\x20\x20\x20\x20rowCount:\x20sheet.getMaxRows(),\x0a\x20\x20\x20\x20columnCount:\x20sheet.getMaxColumns(),\x0a\x20\x20\x20\x20valueUsedRanges:\x20compactUsedRanges(cells,\x20hasValue),\x0a\x20\x20\x20\x20formulaUsedRanges:\x20compactUsedRanges(cells,\x20hasFormula),\x0a\x20\x20\x20\x20styleUsedRanges:\x20compactUsedRanges(cells,\x20hasStyle),\x0a\x20\x20\x20\x20mergedRanges:\x20sheet.getMergedRanges().map((range)\x20=>\x20range.getA1Notation()),\x0a\x20\x20\x20\x20tables:\x20tables.map((table)\x20=>\x20({\x20id:\x20table.id,\x20name:\x20table.name,\x20range:\x20rangeNotation(table.range)\x20})),\x0a\x20\x20\x20\x20conditionalFormatting:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20conditionalRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(conditionalRules.flatMap((rule)\x20=>\x20Array.isArray(rule.ranges)\x20?\x20rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20dataValidation:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20validationRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(validationRules.flatMap((validation)\x20=>\x20Array.isArray(validation.rule\x20&&\x20validation.rule.ranges)\x20?\x20validation.rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20drawings:\x20{\x20total:\x20charts\x20+\x20images\x20+\x20shapes,\x20charts,\x20images,\x20shapes\x20},\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveWorksheet(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22,\x20\x22name\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id,\x20index,\x20or\x20name\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetId()\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22name\x22\x20&&\x20typeof\x20selector.name\x20===\x20\x22string\x22\x20&&\x20selector.name.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetName()\x20===\x20selector.name);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20sheets[selector.index]\x20?\x20[sheets[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Worksheet\x20selector\x20did\x20not\x20match\x20a\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Worksheet\x20selector\x20matched\x20more\x20than\x20one\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20const\x20sheet\x20=\x20matches[0];\x0a\x20\x20return\x20{\x20sheet,\x20index:\x20sheets.indexOf(sheet)\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22workbook\x22)\x20{\x0a\x20\x20return\x20success({\x20kind:\x20\x22workbook\x22,\x20unitId:\x20input.unitId,\x20name:\x20workbook.getName(),\x20worksheets:\x20sheets.map(worksheetOverview)\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.worksheets\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20resolved.push(worksheetOverview(item.sheet,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet\x22,\x20unitId:\x20input.unitId,\x20worksheets:\x20resolved\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet-range\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20request\x20of\x20input.query.ranges\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(request.worksheet);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20if\x20(typeof\x20request.range\x20!==\x20\x22string\x22\x20||\x20request.range.length\x20===\x200)\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20range\x20must\x20be\x20a\x20non-empty\x20A1\x20notation\x22,\x20request);\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20parseA1Range(request.range);\x0a\x20\x20\x20\x20if\x20(!parsed)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Invalid\x20worksheet\x20A1\x20range:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20maxRow\x20=\x20item.sheet.getMaxRows()\x20-\x201;\x0a\x20\x20\x20\x20const\x20maxColumn\x20=\x20item.sheet.getMaxColumns()\x20-\x201;\x0a\x20\x20\x20\x20if\x20(parsed.endRow\x20<\x200\x20||\x20parsed.endColumn\x20<\x200\x20||\x20parsed.startRow\x20>\x20maxRow\x20||\x20parsed.startColumn\x20>\x20maxColumn)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RANGE_OUT_OF_BOUNDS\x22,\x20\x22Worksheet\x20range\x20is\x20outside\x20the\x20worksheet\x20bounds:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20clippedRange\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20startRow:\x20Math.max(0,\x20parsed.startRow),\x0a\x20\x20\x20\x20\x20\x20endRow:\x20Math.min(maxRow,\x20parsed.endRow),\x0a\x20\x20\x20\x20\x20\x20startColumn:\x20Math.max(0,\x20parsed.startColumn),\x0a\x20\x20\x20\x20\x20\x20endColumn:\x20Math.min(maxColumn,\x20parsed.endColumn),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20const\x20facadeRange\x20=\x20item.sheet.getRange(clippedRange.startRow,\x20clippedRange.startColumn,\x20clippedRange.endRow\x20-\x20clippedRange.startRow\x20+\x201,\x20clippedRange.endColumn\x20-\x20clippedRange.startColumn\x20+\x201);\x0a\x20\x20\x20\x20const\x20rawCells\x20=\x20facadeRange.getCellDatas();\x0a\x20\x20\x20\x20const\x20displayValues\x20=\x20facadeRange.getDisplayValues();\x0a\x20\x20\x20\x20const\x20cellData\x20=\x20rawCells.map((row)\x20=>\x20row.map((cell)\x20=>\x20cell\x20===\x20undefined\x20?\x20null\x20:\x20cell));\x0a\x20\x20\x20\x20const\x20clipped\x20=\x20clippedRange.startRow\x20!==\x20parsed.startRow\x20||\x20clippedRange.endRow\x20!==\x20parsed.endRow\x20||\x20clippedRange.startColumn\x20!==\x20parsed.startColumn\x20||\x20clippedRange.endColumn\x20!==\x20parsed.endColumn;\x0a\x20\x20\x20\x20resolved.push({\x0a\x20\x20\x20\x20\x20\x20worksheet:\x20worksheetIdentity(item.sheet,\x20item.index),\x0a\x20\x20\x20\x20\x20\x20requestedRange:\x20request.range,\x0a\x20\x20\x20\x20\x20\x20resolvedRange:\x20rangeNotation(clippedRange),\x0a\x20\x20\x20\x20\x20\x20clipped,\x0a\x20\x20\x20\x20\x20\x20cellData,\x0a\x20\x20\x20\x20\x20\x20displayValues,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet-range\x22,\x20unitId:\x20input.unitId,\x20ranges:\x20resolved\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20sheet\x20inspection\x20target\x22);\x0a','board','connectionSiteId','config','locked','name','worksheet','straight','routingMode','2742fnKBbX','base','shapeId','chartId','463337knqiMH','placeholder','chart','primaryFieldId','12awlRzv','containerData','startElementId','image','endElementId','error',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20presentation\x20=\x20univerAPI.getPresentation(input.unitId);\x0aif\x20(!presentation)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Presentation\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20presentation.save();\x0aconst\x20slideIds\x20=\x20Array.isArray(snapshot.slideOrder)\x20?\x20snapshot.slideOrder\x20:\x20Object.keys(snapshot.slides\x20||\x20{});\x0aconst\x20slides\x20=\x20slideIds.map((id)\x20=>\x20snapshot.slides\x20&&\x20snapshot.slides[id]).filter(Boolean);\x0a\x0afunction\x20documentText(documentData)\x20{\x0a\x20\x20const\x20stream\x20=\x20documentData\x20&&\x20documentData.body\x20&&\x20documentData.body.dataStream;\x0a\x20\x20return\x20typeof\x20stream\x20===\x20\x22string\x22\x20?\x20stream.replace(/\x5cr/g,\x20\x22\x5cn\x22).replace(/[\x5cu0000-\x5cu0009\x5cu000b-\x5cu001f]+/g,\x20\x22\x22).replace(/\x5cn+$/g,\x20\x22\x22)\x20:\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementText(element)\x20{\x0a\x20\x20if\x20(typeof\x20element.text\x20===\x20\x22string\x22)\x20return\x20element.text;\x0a\x20\x20if\x20(element.textData)\x20return\x20documentText(element.textData);\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData;\x0a\x20\x20const\x20shapeText\x20=\x20shapeData\x20&&\x20shapeData.shapeText;\x0a\x20\x20if\x20(shapeText\x20&&\x20typeof\x20shapeText.text\x20===\x20\x22string\x22)\x20return\x20shapeText.text;\x0a\x20\x20if\x20(shapeText\x20&&\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.doc)\x20return\x20documentText(shapeText.dataModel.doc);\x0a\x20\x20return\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementCountType(type)\x20{\x0a\x20\x20if\x20(type\x20===\x20\x22chart\x22)\x20return\x20\x22charts\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22image\x22)\x20return\x20\x22images\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22table\x22)\x20return\x20\x22tables\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22group\x22)\x20return\x20\x22groups\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22text\x22\x20||\x20type\x20===\x20\x22placeholder\x22)\x20return\x20\x22text\x22;\x0a\x20\x20return\x20\x22shapes\x22;\x0a}\x0a\x0afunction\x20collectElements(slide)\x20{\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20visited\x20=\x20new\x20Set();\x0a\x20\x20const\x20output\x20=\x20[];\x0a\x20\x20function\x20visit(id)\x20{\x0a\x20\x20\x20\x20if\x20(visited.has(id))\x20return;\x0a\x20\x20\x20\x20visited.add(id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20elements[id];\x0a\x20\x20\x20\x20if\x20(!element)\x20return;\x0a\x20\x20\x20\x20output.push(element);\x0a\x20\x20\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20element.children.forEach(visit);\x0a\x20\x20}\x0a\x20\x20(Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements)).forEach(visit);\x0a\x20\x20Object.keys(elements).forEach(visit);\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20elementCounts(slide)\x20{\x0a\x20\x20const\x20counts\x20=\x20{\x20total:\x200,\x20text:\x200,\x20shapes:\x200,\x20images:\x200,\x20charts:\x200,\x20tables:\x200,\x20groups:\x200\x20};\x0a\x20\x20for\x20(const\x20element\x20of\x20collectElements(slide))\x20{\x0a\x20\x20\x20\x20counts.total\x20+=\x201;\x0a\x20\x20\x20\x20counts[elementCountType(element.type)]\x20+=\x201;\x0a\x20\x20}\x0a\x20\x20return\x20counts;\x0a}\x0a\x0afunction\x20slideSummary(slide,\x20index)\x20{\x0a\x20\x20const\x20text\x20=\x20collectElements(slide).map(elementText).filter(Boolean).join(\x22\x20|\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20const\x20preview\x20=\x20text.length\x20<=\x20160\x20?\x20text\x20:\x20text.slice(0,\x20157)\x20+\x20\x22...\x22;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20slide.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20slide.name\x20||\x20\x22\x22,\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(slide),\x0a\x20\x20\x20\x20...(preview\x20===\x20\x22\x22\x20?\x20{}\x20:\x20{\x20textPreview:\x20preview\x20}),\x0a\x20\x20\x20\x20hasSpeakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20&&\x20slide.speakerNotes.length\x20>\x200,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20parseTableResources()\x20{\x0a\x20\x20const\x20resource\x20=\x20(Array.isArray(snapshot.resources)\x20?\x20snapshot.resources\x20:\x20[]).find((item)\x20=>\x20item\x20&&\x20item.name\x20===\x20\x22SLIDE_TABLE_PLUGIN\x22);\x0a\x20\x20if\x20(!resource\x20||\x20typeof\x20resource.data\x20!==\x20\x22string\x22)\x20return\x20{};\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20JSON.parse(resource.data);\x0a\x20\x20\x20\x20return\x20parsed\x20&&\x20typeof\x20parsed.tables\x20===\x20\x22object\x22\x20?\x20parsed.tables\x20:\x20{};\x0a\x20\x20}\x20catch\x20{\x0a\x20\x20\x20\x20return\x20{};\x0a\x20\x20}\x0a}\x0a\x0aconst\x20tableResources\x20=\x20parseTableResources();\x0a\x0afunction\x20tableText(tableId)\x20{\x0a\x20\x20const\x20table\x20=\x20tableResources[tableId];\x0a\x20\x20if\x20(!table\x20||\x20!Array.isArray(table.rows))\x20return\x20undefined;\x0a\x20\x20return\x20table.rows.map((row)\x20=>\x20(Array.isArray(row.cells)\x20?\x20row.cells\x20:\x20[]).map((cell)\x20=>\x20documentText(cell\x20&&\x20cell.textData)));\x0a}\x0a\x0afunction\x20finite(value)\x20{\x0a\x20\x20return\x20typeof\x20value\x20===\x20\x22number\x22\x20&&\x20Number.isFinite(value)\x20?\x20value\x20:\x20undefined;\x0a}\x0a\x0afunction\x20transformOf(element)\x20{\x0a\x20\x20const\x20transform\x20=\x20element.transform\x20||\x20{};\x0a\x20\x20const\x20result\x20=\x20{};\x0a\x20\x20const\x20left\x20=\x20finite(transform.left\x20??\x20transform.x);\x0a\x20\x20const\x20top\x20=\x20finite(transform.top\x20??\x20transform.y);\x0a\x20\x20const\x20width\x20=\x20finite(transform.width);\x0a\x20\x20const\x20height\x20=\x20finite(transform.height);\x0a\x20\x20const\x20angle\x20=\x20finite(transform.angle\x20??\x20transform.rotation);\x0a\x20\x20if\x20(left\x20!==\x20undefined)\x20result.left\x20=\x20left;\x0a\x20\x20if\x20(top\x20!==\x20undefined)\x20result.top\x20=\x20top;\x0a\x20\x20if\x20(width\x20!==\x20undefined)\x20result.width\x20=\x20width;\x0a\x20\x20if\x20(height\x20!==\x20undefined)\x20result.height\x20=\x20height;\x0a\x20\x20if\x20(angle\x20!==\x20undefined)\x20result.angle\x20=\x20angle;\x0a\x20\x20return\x20Object.keys(result).length\x20===\x200\x20?\x20undefined\x20:\x20result;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20elements,\x20ancestors)\x20{\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData\x20||\x20{};\x0a\x20\x20const\x20shapeText\x20=\x20shapeData.shapeText\x20||\x20{};\x0a\x20\x20const\x20text\x20=\x20elementText(element);\x0a\x20\x20const\x20output\x20=\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20name:\x20typeof\x20element.name\x20===\x20\x22string\x22\x20?\x20element.name\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20visible:\x20element.visible\x20!==\x20false,\x0a\x20\x20};\x0a\x20\x20const\x20transform\x20=\x20transformOf(element);\x0a\x20\x20if\x20(transform)\x20output.transform\x20=\x20transform;\x0a\x20\x20if\x20(shapeData.fill\x20!==\x20undefined)\x20output.fill\x20=\x20shapeData.fill;\x0a\x20\x20if\x20((shapeData.stroke\x20??\x20element.stroke)\x20!==\x20undefined)\x20output.stroke\x20=\x20shapeData.stroke\x20??\x20element.stroke;\x0a\x20\x20if\x20(text\x20!==\x20\x22\x22)\x20{\x0a\x20\x20\x20\x20const\x20textDetails\x20=\x20{\x20text\x20};\x0a\x20\x20\x20\x20const\x20horizontal\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.ha;\x0a\x20\x20\x20\x20const\x20vertical\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.va;\x0a\x20\x20\x20\x20if\x20(horizontal\x20!==\x20undefined\x20||\x20vertical\x20!==\x20undefined)\x20textDetails.alignment\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20...(horizontal\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20horizontal\x20}),\x0a\x20\x20\x20\x20\x20\x20...(vertical\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20vertical\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20if\x20(shapeText.padding\x20!==\x20undefined\x20||\x20shapeText.insets\x20!==\x20undefined)\x20textDetails.insets\x20=\x20shapeText.padding\x20??\x20shapeText.insets;\x0a\x20\x20\x20\x20output.text\x20=\x20textDetails;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.chartId\x20===\x20\x22string\x22)\x20output.chartId\x20=\x20element.chartId;\x0a\x20\x20if\x20(typeof\x20element.tableId\x20===\x20\x22string\x22)\x20{\x0a\x20\x20\x20\x20output.tableId\x20=\x20element.tableId;\x0a\x20\x20\x20\x20const\x20grid\x20=\x20tableText(element.tableId);\x0a\x20\x20\x20\x20if\x20(grid)\x20output.tableText\x20=\x20grid;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.mediaType\x20===\x20\x22string\x22)\x20output.mediaType\x20=\x20element.mediaType;\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20{\x0a\x20\x20\x20\x20output.children\x20=\x20element.children.filter((id)\x20=>\x20!ancestors.has(id)\x20&&\x20elements[id]).map((id)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20next\x20=\x20new\x20Set(ancestors);\x0a\x20\x20\x20\x20\x20\x20next.add(id);\x0a\x20\x20\x20\x20\x20\x20return\x20inspectElement(elements[id],\x20elements,\x20next);\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20slideDetails(slide,\x20index)\x20{\x0a\x20\x20const\x20summary\x20=\x20slideSummary(slide,\x20index);\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20ordered\x20=\x20Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements);\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...summary,\x0a\x20\x20\x20\x20speakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20?\x20slide.speakerNotes\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20elements:\x20ordered.filter((id)\x20=>\x20elements[id]).map((id)\x20=>\x20inspectElement(elements[id],\x20elements,\x20new\x20Set([id]))),\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveSlide(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20slides.filter((slide)\x20=>\x20slide.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20slides[selector.index]\x20?\x20[slides[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Slide\x20selector\x20did\x20not\x20match\x20a\x20slide\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Slide\x20selector\x20matched\x20more\x20than\x20one\x20slide\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20slide:\x20matches[0],\x20index:\x20slides.indexOf(matches[0])\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22presentation\x22)\x20{\x0a\x20\x20const\x20size\x20=\x20presentation.getPageSize();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22presentation\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20presentation.getName(),\x0a\x20\x20\x20\x20size:\x20{\x20width:\x20size.width,\x20height:\x20size.height\x20},\x0a\x20\x20\x20\x20masterSlideCount:\x20Array.isArray(snapshot.masterPageOrder)\x20?\x20snapshot.masterPageOrder.length\x20:\x20Object.keys(snapshot.masterPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20layoutSlideCount:\x20Array.isArray(snapshot.layoutPageOrder)\x20?\x20snapshot.layoutPageOrder.length\x20:\x20Object.keys(snapshot.layoutPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20slides:\x20slides.map(slideSummary),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22slide\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.slides\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveSlide(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20selected.push(slideDetails(item.slide,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22slide\x22,\x20unitId:\x20input.unitId,\x20slides:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20slide\x20inspection\x20target\x22);\x0a','originalType','laneId','paragraphs','document','9932754JfWZCC','stringify','code','shape','isFinite','INSPECTION_SELECTOR_INVALID','children','9564845emqUZC','isSafeInteger','height','diagram','shapeData','curve','title','text','media','boolean','Inspection\x20runtime\x20returned\x20an\x20invalid\x20envelope','Inspection\x20runtime\x20returned\x20an\x20invalid\x20','slide','board-element','19864062rAPwlu','connector','INSPECTION_SELECTOR_NOT_FOUND','108699flMnAW','paragraph','isArray','tables','shapeSite','type','segmentT','source','worksheets','reduce','labels','tableId','descriptor','unknown','read','description','value','INSPECTION_RESULT_INVALID',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20base\x20=\x20univerAPI.getBase(input.unitId);\x0aif\x20(!base)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Base\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20schema\x20=\x20base.getSchema();\x0areturn\x20success({\x0a\x20\x20kind:\x20\x22base\x22,\x0a\x20\x20unitId:\x20input.unitId,\x0a\x20\x20name:\x20schema.name,\x0a\x20\x20tables:\x20schema.tables.map((table,\x20index)\x20=>\x20({\x0a\x20\x20\x20\x20id:\x20table.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20table.name,\x0a\x20\x20\x20\x20formulaName:\x20table.formulaName,\x0a\x20\x20\x20\x20primaryFieldId:\x20table.primaryFieldId,\x0a\x20\x20\x20\x20recordCount:\x20table.recordCount,\x0a\x20\x20\x20\x20fields:\x20table.fields.map((field,\x20fieldIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20field.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20fieldIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20field.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20field.type,\x0a\x20\x20\x20\x20\x20\x20config:\x20field.config\x20??\x20{},\x0a\x20\x20\x20\x20\x20\x20isReadonly:\x20field.readonly\x20===\x20true,\x0a\x20\x20\x20\x20})),\x0a\x20\x20\x20\x20views:\x20table.views.map((view,\x20viewIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20view.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20viewIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20view.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20view.type,\x0a\x20\x20\x20\x20})),\x0a\x20\x20})),\x0a});\x0a','sheet','isReadonly','free','end','manual','container','textStyle','labelText','workbook','lifeline','offsetY','details','fields','style','every','bounds','Inspection\x20runtime\x20returned\x20an\x20invalid\x20error\x20envelope','index','kind'];_0x2733=function(){return _0x468859;};return _0x2733();}const _0x16f9f6=_0x3473;(function(_0x383039,_0x3fbe69){const _0x27c3ba=_0x3473,_0x400efa=_0x383039();while(!![]){try{const _0x436e2e=parseInt(_0x27c3ba(0x1d2))/0x1*(parseInt(_0x27c3ba(0x17e))/0x2)+parseInt(_0x27c3ba(0x1a9))/0x3*(-parseInt(_0x27c3ba(0x186))/0x4)+-parseInt(_0x27c3ba(0x198))/0x5+parseInt(_0x27c3ba(0x191))/0x6+parseInt(_0x27c3ba(0x182))/0x7+-parseInt(_0x27c3ba(0x1e9))/0x8+parseInt(_0x27c3ba(0x1a6))/0x9;if(_0x436e2e===_0x3fbe69)break;else _0x400efa['push'](_0x400efa['shift']());}catch(_0x46a900){_0x400efa['push'](_0x400efa['shift']());}}}(_0x2733,0xedb66));var e=class extends Error{['code'];[_0x16f9f6(0x1c7)];constructor(_0x587c35,_0x275b61,_0x27b90b){const _0x30633e=_0x16f9f6;super(_0x275b61),this[_0x30633e(0x193)]=_0x587c35,this[_0x30633e(0x1c7)]=_0x27b90b,this[_0x30633e(0x17a)]='ContentInspectionError';}};function t(_0x516902){const _0x2516b6=_0x16f9f6;if(!_(_0x516902)||typeof _0x516902['ok']!=_0x2516b6(0x1a1))throw g(_0x2516b6(0x1a2));if(_0x516902['ok']===!0x0&&_0x2516b6(0x1b9)in _0x516902)return _0x516902[_0x2516b6(0x1b9)];let _0x3b4326=_0x516902[_0x2516b6(0x18b)];if(_0x516902['ok']===!0x1&&_(_0x3b4326)){let _0x3a16ad=_0x3b4326[_0x2516b6(0x193)],_0x31d0fc=_0x3b4326[_0x2516b6(0x1d6)];if(v(_0x3a16ad)&&typeof _0x31d0fc==_0x2516b6(0x1e3))throw new e(_0x3a16ad,_0x31d0fc,_0x3b4326[_0x2516b6(0x1c7)]);}throw g(_0x2516b6(0x1cc));}function n(_0x30e5bd,_0x28d8b3){const _0x3e284f=_0x16f9f6;if(!_(_0x30e5bd)||_0x30e5bd[_0x3e284f(0x1ce)]!==_0x28d8b3||typeof _0x30e5bd[_0x3e284f(0x1de)]!=_0x3e284f(0x1e3)||!(_0x28d8b3===_0x3e284f(0x17f)?p(_0x30e5bd):_0x28d8b3===_0x3e284f(0x1c4)?typeof _0x30e5bd[_0x3e284f(0x17a)]=='string'&&Array['isArray'](_0x30e5bd[_0x3e284f(0x1b1)]):_0x28d8b3===_0x3e284f(0x17b)?Array[_0x3e284f(0x1ab)](_0x30e5bd[_0x3e284f(0x1b1)]):_0x28d8b3===_0x3e284f(0x1d5)?Array[_0x3e284f(0x1ab)](_0x30e5bd['ranges']):_0x28d8b3===_0x3e284f(0x1da)?typeof _0x30e5bd['name']==_0x3e284f(0x1e3)&&Array[_0x3e284f(0x1ab)](_0x30e5bd[_0x3e284f(0x1e1)]):_0x28d8b3===_0x3e284f(0x1a4)?Array[_0x3e284f(0x1ab)](_0x30e5bd[_0x3e284f(0x1e1)]):_0x28d8b3===_0x3e284f(0x190)?typeof _0x30e5bd[_0x3e284f(0x19e)]=='string'&&Array[_0x3e284f(0x1ab)](_0x30e5bd[_0x3e284f(0x18f)]):_0x28d8b3===_0x3e284f(0x1aa)?Array[_0x3e284f(0x1ab)](_0x30e5bd[_0x3e284f(0x18f)]):_0x28d8b3===_0x3e284f(0x176)?r(_0x30e5bd):_0x28d8b3===_0x3e284f(0x1a5)&&i(_0x30e5bd)))throw g(_0x3e284f(0x1a3)+_0x28d8b3+'\x20result');}function r(_0x23b530){const _0x32786e=_0x16f9f6;let _0x25758d=_0x23b530[_0x32786e(0x1e6)];return typeof _0x23b530[_0x32786e(0x17a)]==_0x32786e(0x1e3)&&'themeData'in _0x23b530&&_(_0x25758d)&&m(_0x25758d[_0x32786e(0x16d)])&&_(_0x25758d['byType'])&&Object[_0x32786e(0x1d0)](_0x25758d[_0x32786e(0x172)])[_0x32786e(0x1ca)](m)&&Array[_0x32786e(0x1ab)](_0x23b530[_0x32786e(0x1e0)])&&_0x25758d[_0x32786e(0x16d)]===_0x23b530[_0x32786e(0x1e0)]['length']&&Object['values'](_0x25758d['byType'])[_0x32786e(0x1b2)]((_0x2e825d,_0x254408)=>_0x2e825d+Number(_0x254408),0x0)===_0x25758d[_0x32786e(0x16d)]&&_0x23b530[_0x32786e(0x1e0)][_0x32786e(0x1ca)](a);}function i(_0x4dcc07){const _0x3cc5a7=_0x16f9f6;return Array[_0x3cc5a7(0x1ab)](_0x4dcc07[_0x3cc5a7(0x1e0)])&&_0x4dcc07['elements']['every'](o);}function a(_0x4152ef){const _0xbc4407=_0x16f9f6;return _(_0x4152ef)&&typeof _0x4152ef['id']==_0xbc4407(0x1e3)&&m(_0x4152ef[_0xbc4407(0x173)])&&typeof _0x4152ef[_0xbc4407(0x1ae)]=='string'&&typeof _0x4152ef['visible']==_0xbc4407(0x1a1)&&typeof _0x4152ef[_0xbc4407(0x1eb)]==_0xbc4407(0x1a1)&&typeof _0x4152ef[_0xbc4407(0x179)]==_0xbc4407(0x1a1)&&_(_0x4152ef[_0xbc4407(0x16f)])&&f(_0x4152ef[_0xbc4407(0x17a)])&&f(_0x4152ef[_0xbc4407(0x1b8)])&&f(_0x4152ef[_0xbc4407(0x16c)])&&f(_0x4152ef[_0xbc4407(0x18e)])&&(_0x4152ef[_0xbc4407(0x1cb)]===null||l(_0x4152ef[_0xbc4407(0x1cb)]));}function o(_0x1bdfd2){const _0x124b7b=_0x16f9f6;return!a(_0x1bdfd2)||_0x124b7b(0x1b5)in _0x1bdfd2||_0x124b7b(0x1c7)in _0x1bdfd2||'connectorData'in _0x1bdfd2?!0x1:_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x194)?_0x124b7b(0x19c)in _0x1bdfd2:_0x1bdfd2['type']===_0x124b7b(0x1a7)?!(_0x124b7b(0x188)in _0x1bdfd2)&&!(_0x124b7b(0x18a)in _0x1bdfd2)&&!(_0x124b7b(0x1e2)in _0x1bdfd2)&&!('text'in _0x1bdfd2)&&s(_0x1bdfd2['connection'])&&_0x124b7b(0x1c9)in _0x1bdfd2&&Array['isArray'](_0x1bdfd2[_0x124b7b(0x1b3)])&&_0x1bdfd2[_0x124b7b(0x1b3)][_0x124b7b(0x1ca)](_0xcabdc4=>_(_0xcabdc4)&&typeof _0xcabdc4['id']==_0x124b7b(0x1e3))&&_0x124b7b(0x1c3)in _0x1bdfd2&&_0x124b7b(0x16b)in _0x1bdfd2:_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x19f)?'textContent'in _0x1bdfd2&&_0x124b7b(0x1c2)in _0x1bdfd2:_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x189)||_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x1a0)?typeof _0x1bdfd2[_0x124b7b(0x1b0)]==_0x124b7b(0x1e3):_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x184)?typeof _0x1bdfd2[_0x124b7b(0x181)]==_0x124b7b(0x1e3):_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x1c1)?_0x124b7b(0x187)in _0x1bdfd2:_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x19b)?_0x124b7b(0x1df)in _0x1bdfd2:_0x1bdfd2[_0x124b7b(0x1ae)]==='table'?typeof _0x1bdfd2[_0x124b7b(0x1b4)]=='string':_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x1db)?Array['isArray'](_0x1bdfd2[_0x124b7b(0x197)])&&_0x1bdfd2[_0x124b7b(0x197)][_0x124b7b(0x1ca)](_0x319db0=>typeof _0x319db0=='string'):_0x1bdfd2['type']==='placeholder'?_0x124b7b(0x183)in _0x1bdfd2:_0x1bdfd2[_0x124b7b(0x1ae)]===_0x124b7b(0x1b6)&&typeof _0x1bdfd2[_0x124b7b(0x18d)]==_0x124b7b(0x1e3)&&_0x124b7b(0x1df)in _0x1bdfd2;}function s(_0x3b874e){const _0x3e7f2e=_0x16f9f6;return _(_0x3b874e)&&c(_0x3b874e[_0x3e7f2e(0x1d9)])&&c(_0x3b874e[_0x3e7f2e(0x1bf)])&&(_0x3b874e[_0x3e7f2e(0x1d8)]===_0x3e7f2e(0x17c)||_0x3b874e[_0x3e7f2e(0x1d8)]==='orthogonal'||_0x3b874e[_0x3e7f2e(0x1d8)]===_0x3e7f2e(0x19d)||_0x3b874e[_0x3e7f2e(0x1d8)]===_0x3e7f2e(0x170))&&(_0x3b874e[_0x3e7f2e(0x17d)]==='auto'||_0x3b874e[_0x3e7f2e(0x17d)]===_0x3e7f2e(0x1c0)||_0x3b874e[_0x3e7f2e(0x17d)]==='mixed')&&Array[_0x3e7f2e(0x1ab)](_0x3b874e[_0x3e7f2e(0x16e)])&&_0x3b874e[_0x3e7f2e(0x16e)]['every'](_0x27e7bf=>_(_0x27e7bf)&&typeof _0x27e7bf['id']==_0x3e7f2e(0x1e3)&&(_0x27e7bf[_0x3e7f2e(0x1ce)]===_0x3e7f2e(0x174)||_0x27e7bf[_0x3e7f2e(0x1ce)]===_0x3e7f2e(0x1c0))&&u(_0x27e7bf));}function c(_0x618314){const _0x1ac25a=_0x16f9f6;return!_(_0x618314)||typeof _0x618314[_0x1ac25a(0x1ce)]!=_0x1ac25a(0x1e3)?!0x1:_0x618314['kind']===_0x1ac25a(0x1be)?u(_0x618314):_0x618314[_0x1ac25a(0x1ce)]===_0x1ac25a(0x1c5)?typeof _0x618314[_0x1ac25a(0x180)]==_0x1ac25a(0x1e3)&&typeof _0x618314[_0x1ac25a(0x1c6)]==_0x1ac25a(0x1d3):_0x618314[_0x1ac25a(0x1ce)]===_0x1ac25a(0x1ad)?typeof _0x618314[_0x1ac25a(0x180)]==_0x1ac25a(0x1e3)&&typeof _0x618314[_0x1ac25a(0x177)]==_0x1ac25a(0x1d3)&&d(_0x618314[_0x1ac25a(0x1ec)]):_0x618314[_0x1ac25a(0x1ce)]==='shapeBoundary'&&typeof _0x618314[_0x1ac25a(0x180)]=='string'&&typeof _0x618314['outlineIndex']==_0x1ac25a(0x1d3)&&typeof _0x618314[_0x1ac25a(0x171)]==_0x1ac25a(0x1d3)&&typeof _0x618314[_0x1ac25a(0x1af)]==_0x1ac25a(0x1d3);}function l(_0x58d7dd){const _0x4e30d5=_0x16f9f6;return _(_0x58d7dd)&&typeof _0x58d7dd['left']=='number'&&typeof _0x58d7dd[_0x4e30d5(0x1d7)]=='number'&&typeof _0x58d7dd['width']==_0x4e30d5(0x1d3)&&typeof _0x58d7dd[_0x4e30d5(0x19a)]==_0x4e30d5(0x1d3);}function u(_0x112d17){const _0x5bd4ed=_0x16f9f6;return _(_0x112d17)&&typeof _0x112d17['x']==_0x5bd4ed(0x1d3)&&typeof _0x112d17['y']==_0x5bd4ed(0x1d3);}function d(_0x1e53ce){const _0x359ce1=_0x16f9f6;return _0x1e53ce===void 0x0||typeof _0x1e53ce==_0x359ce1(0x1d3);}function f(_0x50f8f4){return _0x50f8f4===void 0x0||typeof _0x50f8f4=='string';}function p(_0x5f3dde){const _0x564fcf=_0x16f9f6;return typeof _0x5f3dde[_0x564fcf(0x17a)]==_0x564fcf(0x1e3)&&Array[_0x564fcf(0x1ab)](_0x5f3dde[_0x564fcf(0x1ac)])&&_0x5f3dde[_0x564fcf(0x1ac)][_0x564fcf(0x1ca)]((_0x210bc9,_0x4851f2)=>_(_0x210bc9)&&m(_0x210bc9[_0x564fcf(0x1cd)])&&_0x210bc9['index']===_0x4851f2&&typeof _0x210bc9['id']=='string'&&typeof _0x210bc9[_0x564fcf(0x17a)]==_0x564fcf(0x1e3)&&typeof _0x210bc9['formulaName']==_0x564fcf(0x1e3)&&typeof _0x210bc9[_0x564fcf(0x185)]==_0x564fcf(0x1e3)&&m(_0x210bc9['recordCount'])&&Array[_0x564fcf(0x1ab)](_0x210bc9[_0x564fcf(0x1c8)])&&_0x210bc9[_0x564fcf(0x1c8)][_0x564fcf(0x1ca)]((_0x228cd0,_0x1301fb)=>_(_0x228cd0)&&m(_0x228cd0['index'])&&_0x228cd0[_0x564fcf(0x1cd)]===_0x1301fb&&typeof _0x228cd0['id']=='string'&&typeof _0x228cd0['name']=='string'&&typeof _0x228cd0[_0x564fcf(0x1ae)]==_0x564fcf(0x1e3)&&typeof _0x228cd0[_0x564fcf(0x1bd)]==_0x564fcf(0x1a1)&&_0x564fcf(0x178)in _0x228cd0&&h(_0x228cd0['config']))&&Array[_0x564fcf(0x1ab)](_0x210bc9['views'])&&_0x210bc9[_0x564fcf(0x1e7)][_0x564fcf(0x1ca)]((_0x3084ed,_0x4314ee)=>_(_0x3084ed)&&m(_0x3084ed[_0x564fcf(0x1cd)])&&_0x3084ed[_0x564fcf(0x1cd)]===_0x4314ee&&typeof _0x3084ed['id']==_0x564fcf(0x1e3)&&typeof _0x3084ed[_0x564fcf(0x17a)]==_0x564fcf(0x1e3)&&typeof _0x3084ed[_0x564fcf(0x1ae)]==_0x564fcf(0x1e3)));}function m(_0x4a7a31){const _0x47c72b=_0x16f9f6;return typeof _0x4a7a31=='number'&&Number[_0x47c72b(0x199)](_0x4a7a31)&&_0x4a7a31>=0x0;}function h(_0x12b8f6){const _0x434d31=_0x16f9f6;return _0x12b8f6===null||typeof _0x12b8f6==_0x434d31(0x1a1)||typeof _0x12b8f6=='string'||typeof _0x12b8f6=='number'&&Number[_0x434d31(0x195)](_0x12b8f6)?!0x0:Array[_0x434d31(0x1ab)](_0x12b8f6)?_0x12b8f6['every'](h):_(_0x12b8f6)&&Object[_0x434d31(0x1d0)](_0x12b8f6)[_0x434d31(0x1ca)](h);}function g(_0x1c2bf9){const _0x1d5e04=_0x16f9f6;return new e(_0x1d5e04(0x1ba),_0x1c2bf9);}function _(_0x3e22f5){const _0x1d5afa=_0x16f9f6;return typeof _0x3e22f5==_0x1d5afa(0x1cf)&&!!_0x3e22f5&&!Array[_0x1d5afa(0x1ab)](_0x3e22f5);}function v(_0x30cef3){const _0x5b133f=_0x16f9f6;return _0x30cef3===_0x5b133f(0x1e8)||_0x30cef3===_0x5b133f(0x1ba)||_0x30cef3===_0x5b133f(0x1dc)||_0x30cef3==='INSPECTION_SELECTOR_INVALID'||_0x30cef3===_0x5b133f(0x1a8)||_0x30cef3==='INSPECTION_UNIT_TYPE_MISMATCH';}function y(_0x2e0c3f){const _0xfd06f7=_0x16f9f6;return'\x0aconst\x20input\x20=\x20'+JSON[_0xfd06f7(0x192)]({'unitId':_0x2e0c3f})+_0xfd06f7(0x1bb);}function b(_0x328c4e,_0x5c642c){const _0x5dfced=_0x16f9f6;return'\x0aconst\x20input\x20=\x20'+JSON[_0x5dfced(0x192)]({'query':_0x5c642c,'unitId':_0x328c4e})+';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value:\x20JSON.parse(JSON.stringify(value))\x20});\x0aconst\x20board\x20=\x20univerAPI.getBoard(input.unitId);\x0aif\x20(!board)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0a\x0aconst\x20descriptors\x20=\x20board.describeElements();\x0aconst\x20descriptorsById\x20=\x20new\x20Map(descriptors.map((descriptor)\x20=>\x20[descriptor.id,\x20descriptor]));\x0a\x0afunction\x20elementCounts()\x20{\x0a\x20\x20const\x20byType\x20=\x20{};\x0a\x20\x20for\x20(const\x20descriptor\x20of\x20descriptors)\x20{\x0a\x20\x20\x20\x20const\x20type\x20=\x20String(descriptor.type\x20||\x20\x22unknown\x22);\x0a\x20\x20\x20\x20byType[type]\x20=\x20(byType[type]\x20||\x200)\x20+\x201;\x0a\x20\x20}\x0a\x20\x20return\x20{\x20total:\x20descriptors.length,\x20byType\x20};\x0a}\x0a\x0afunction\x20inspectionBase(element,\x20descriptor)\x20{\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20orderIndex:\x20descriptor.orderIndex,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20...(descriptor.name\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20name:\x20descriptor.name\x20}),\x0a\x20\x20\x20\x20...(descriptor.description\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20description:\x20descriptor.description\x20}),\x0a\x20\x20\x20\x20...(descriptor.parentId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20parentId:\x20descriptor.parentId\x20}),\x0a\x20\x20\x20\x20...(descriptor.laneId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20laneId:\x20descriptor.laneId\x20}),\x0a\x20\x20\x20\x20visible:\x20descriptor.visible,\x0a\x20\x20\x20\x20selectable:\x20descriptor.selectable,\x0a\x20\x20\x20\x20locked:\x20descriptor.locked,\x0a\x20\x20\x20\x20transform:\x20element.transform\x20||\x20{},\x0a\x20\x20\x20\x20bounds:\x20descriptor.bounds,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20richTextData(value)\x20{\x0a\x20\x20return\x20value\x20?\x20value.getData()\x20:\x20null;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20descriptor)\x20{\x0a\x20\x20const\x20base\x20=\x20inspectionBase(element,\x20descriptor);\x0a\x20\x20if\x20(element.type\x20===\x20\x22shape\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22shape\x22,\x20shapeData:\x20element.shapeData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22connector\x22)\x20{\x0a\x20\x20\x20\x20const\x20connection\x20=\x20board.getConnectorConnection(element.id);\x0a\x20\x20\x20\x20if\x20(!connection)\x20return\x20null;\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22connector\x22,\x0a\x20\x20\x20\x20\x20\x20connection,\x0a\x20\x20\x20\x20\x20\x20style:\x20board.getConnectorStyle(element.id),\x0a\x20\x20\x20\x20\x20\x20labels:\x20board.getConnectorLabels(element.id),\x0a\x20\x20\x20\x20\x20\x20labelText:\x20richTextData(board.getConnectorLabelText(element.id)),\x0a\x20\x20\x20\x20\x20\x20labelStyle:\x20board.getConnectorLabelStyle(element.id),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22text\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22text\x22,\x0a\x20\x20\x20\x20\x20\x20textContent:\x20richTextData(board.getTextContent(element.id)),\x0a\x20\x20\x20\x20\x20\x20textStyle:\x20element.textStyle\x20||\x20null,\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22image\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22image\x22,\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.imageSourceType\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20imageSourceType:\x20element.imageSourceType\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.crop\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20crop:\x20element.crop\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.prstGeom\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20prstGeom:\x20element.prstGeom\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.adjustValues\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20adjustValues:\x20element.adjustValues\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22chart\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22chart\x22,\x0a\x20\x20\x20\x20\x20\x20chartId:\x20element.chartId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.stroke\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20stroke:\x20element.stroke\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22container\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22container\x22,\x20containerData:\x20element.containerData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22diagram\x22)\x20{\x0a\x20\x20\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22diagram\x22,\x20data\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22table\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22table\x22,\x0a\x20\x20\x20\x20\x20\x20tableId:\x20element.tableId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22group\x22,\x20children:\x20Array.isArray(element.children)\x20?\x20element.children\x20:\x20[]\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22media\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22media\x22,\x0a\x20\x20\x20\x20\x20\x20mediaType:\x20String(element.mediaType\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.poster\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20poster:\x20element.poster\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22placeholder\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22placeholder\x22,\x0a\x20\x20\x20\x20\x20\x20placeholder:\x20element.placeholder\x20||\x20{},\x0a\x20\x20\x20\x20\x20\x20...(element.text\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20text:\x20element.text\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.style\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20element.style\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20return\x20{\x20...base,\x20type:\x20\x22unknown\x22,\x20originalType:\x20String(type\x20||\x20\x22unknown\x22),\x20data\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board\x22)\x20{\x0a\x20\x20const\x20background\x20=\x20board.getBackground();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22board\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20board.getName(),\x0a\x20\x20\x20\x20...(background\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20background\x20}),\x0a\x20\x20\x20\x20themeData:\x20board.getThemeData(),\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(),\x0a\x20\x20\x20\x20elements:\x20descriptors,\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board-element\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.elements\x20||\x20[])\x20{\x0a\x20\x20\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22\x20||\x20Object.keys(selector).length\x20!==\x201\x20||\x20typeof\x20selector.id\x20!==\x20\x22string\x22\x20||\x20selector.id.length\x20===\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Board\x20element\x20selector\x20must\x20contain\x20exactly\x20one\x20non-empty\x20id\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20descriptor\x20=\x20descriptorsById.get(selector.id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20board.getElement(selector.id);\x0a\x20\x20\x20\x20if\x20(!descriptor\x20||\x20!element)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Board\x20element\x20selector\x20did\x20not\x20match\x20an\x20element\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20inspection\x20=\x20inspectElement(element,\x20descriptor);\x0a\x20\x20\x20\x20if\x20(!inspection)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20element\x20\x22\x20+\x20selector.id\x20+\x20\x22\x20could\x20not\x20be\x20inspected\x22);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20selected.push(inspection);\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22board-element\x22,\x20unitId:\x20input.unitId,\x20elements:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20Board\x20inspection\x20target\x22);\x0a';}function x(_0x1175ae,_0x5d695e){const _0x3f4194=_0x16f9f6;return'\x0aconst\x20input\x20=\x20'+JSON[_0x3f4194(0x192)]({'query':_0x5d695e,'unitId':_0x1175ae})+_0x3f4194(0x1dd);}function S(_0x26b5e3,_0x3e443d){const _0x5d7566=_0x16f9f6;return'\x0aconst\x20input\x20=\x20'+JSON[_0x5d7566(0x192)]({'query':_0x3e443d,'unitId':_0x26b5e3})+_0x5d7566(0x175);}function C(_0x4e7f5e,_0x26b05d){const _0x2fbc74=_0x16f9f6;return _0x2fbc74(0x1e5)+JSON[_0x2fbc74(0x192)]({'query':_0x26b05d,'unitId':_0x4e7f5e})+_0x2fbc74(0x18c);}async function w(_0x1c7a1b,_0x52445b){const _0x5da196=_0x16f9f6;E(_0x52445b),D(_0x1c7a1b['unitType'],_0x52445b[_0x5da196(0x1ce)]);let _0x17e937=T(_0x1c7a1b[_0x5da196(0x1de)],_0x52445b),_0x576ad4=t((await _0x1c7a1b[_0x5da196(0x1d4)]({'code':_0x17e937,'mode':_0x5da196(0x1b7)}))[_0x5da196(0x1b9)]);return n(_0x576ad4,_0x52445b[_0x5da196(0x1ce)]),_0x576ad4;}function T(_0x3ece7e,_0x51a5e2){const _0x5010aa=_0x16f9f6;switch(_0x51a5e2[_0x5010aa(0x1ce)]){case _0x5010aa(0x1c4):case _0x5010aa(0x17b):case _0x5010aa(0x1d5):return S(_0x3ece7e,_0x51a5e2);case _0x5010aa(0x190):case _0x5010aa(0x1aa):return x(_0x3ece7e,_0x51a5e2);case _0x5010aa(0x1da):case _0x5010aa(0x1a4):return C(_0x3ece7e,_0x51a5e2);case'base':return y(_0x3ece7e);case _0x5010aa(0x176):case'board-element':return b(_0x3ece7e,_0x51a5e2);}}function E(_0x4f60dc){const _0x5134e8=_0x16f9f6;let _0x2faecf=_0x4f60dc[_0x5134e8(0x1ce)]==='worksheet'?_0x4f60dc[_0x5134e8(0x1b1)]:_0x4f60dc[_0x5134e8(0x1ce)]===_0x5134e8(0x1d5)?_0x4f60dc[_0x5134e8(0x1ea)]:_0x4f60dc[_0x5134e8(0x1ce)]===_0x5134e8(0x1a4)?_0x4f60dc[_0x5134e8(0x1e1)]:_0x4f60dc[_0x5134e8(0x1ce)]===_0x5134e8(0x1aa)?_0x4f60dc[_0x5134e8(0x18f)]:_0x4f60dc[_0x5134e8(0x1ce)]===_0x5134e8(0x1a5)?_0x4f60dc[_0x5134e8(0x1e0)]:null;if(_0x2faecf!==null&&_0x2faecf[_0x5134e8(0x1e4)]===0x0)throw new e(_0x5134e8(0x196),_0x4f60dc[_0x5134e8(0x1ce)]+'\x20inspection\x20requires\x20at\x20least\x20one\x20selector');}function D(_0x47016d,_0xd2c1ac){const _0x3b37f9=_0x16f9f6;let _0x4236bb=_0xd2c1ac==='base'?'base':_0xd2c1ac===_0x3b37f9(0x176)||_0xd2c1ac===_0x3b37f9(0x1a5)?_0x3b37f9(0x176):_0xd2c1ac===_0x3b37f9(0x1c4)||_0xd2c1ac===_0x3b37f9(0x17b)||_0xd2c1ac===_0x3b37f9(0x1d5)?_0x3b37f9(0x1bc):_0xd2c1ac===_0x3b37f9(0x1da)||_0xd2c1ac==='slide'?_0x3b37f9(0x1a4):_0x3b37f9(0x1d1);if(_0x47016d!==_0x4236bb)throw new e('INSPECTION_UNIT_TYPE_MISMATCH',_0xd2c1ac+'\x20inspection\x20requires\x20a\x20'+_0x4236bb+'\x20runtime,\x20received\x20'+_0x47016d,{'actual':_0x47016d,'expected':_0x4236bb,'kind':_0xd2c1ac});}export{e as ContentInspectionError,w as inspectContent};
1
+ const _0x3141af=_0x53a1;(function(_0xd22bc9,_0x2b3051){const _0x342bdb=_0x53a1,_0x4a4cbd=_0xd22bc9();while(!![]){try{const _0x3b7d1f=parseInt(_0x342bdb(0x152))/0x1+parseInt(_0x342bdb(0x1c1))/0x2+-parseInt(_0x342bdb(0x1bb))/0x3*(-parseInt(_0x342bdb(0x1a7))/0x4)+-parseInt(_0x342bdb(0x158))/0x5*(-parseInt(_0x342bdb(0x16f))/0x6)+-parseInt(_0x342bdb(0x157))/0x7*(-parseInt(_0x342bdb(0x172))/0x8)+-parseInt(_0x342bdb(0x1b3))/0x9*(parseInt(_0x342bdb(0x155))/0xa)+-parseInt(_0x342bdb(0x1ac))/0xb;if(_0x3b7d1f===_0x2b3051)break;else _0x4a4cbd['push'](_0x4a4cbd['shift']());}catch(_0x2d3521){_0x4a4cbd['push'](_0x4a4cbd['shift']());}}}(_0x9729,0x219b8));var e=class extends Error{['code'];[_0x3141af(0x1b1)];constructor(_0xd9090b,_0x2762dc,_0xd4f9bc){const _0x456685=_0x3141af;super(_0x2762dc),this[_0x456685(0x16b)]=_0xd9090b,this['details']=_0xd4f9bc,this[_0x456685(0x182)]=_0x456685(0x180);}};function t(_0xeb78ea){const _0x366188=_0x3141af;if(!_(_0xeb78ea)||typeof _0xeb78ea['ok']!=_0x366188(0x193))throw g('Inspection\x20runtime\x20returned\x20an\x20invalid\x20envelope');if(_0xeb78ea['ok']===!0x0&&_0x366188(0x189)in _0xeb78ea)return _0xeb78ea[_0x366188(0x189)];let _0x2ac952=_0xeb78ea[_0x366188(0x164)];if(_0xeb78ea['ok']===!0x1&&_(_0x2ac952)){let _0x5bc109=_0x2ac952[_0x366188(0x16b)],_0x59e024=_0x2ac952[_0x366188(0x198)];if(v(_0x5bc109)&&typeof _0x59e024==_0x366188(0x1c3))throw new e(_0x5bc109,_0x59e024,_0x2ac952[_0x366188(0x1b1)]);}throw g(_0x366188(0x195));}function n(_0x230e67,_0x9b5c02){const _0x1d469a=_0x3141af;if(!_(_0x230e67)||_0x230e67[_0x1d469a(0x174)]!==_0x9b5c02||typeof _0x230e67[_0x1d469a(0x19b)]!=_0x1d469a(0x1c3)||!(_0x9b5c02===_0x1d469a(0x1b4)?p(_0x230e67):_0x9b5c02===_0x1d469a(0x171)?typeof _0x230e67['name']==_0x1d469a(0x1c3)&&Array['isArray'](_0x230e67[_0x1d469a(0x17b)]):_0x9b5c02===_0x1d469a(0x178)?Array[_0x1d469a(0x1ca)](_0x230e67[_0x1d469a(0x17b)]):_0x9b5c02===_0x1d469a(0x18e)?Array['isArray'](_0x230e67[_0x1d469a(0x1bf)]):_0x9b5c02===_0x1d469a(0x17f)?typeof _0x230e67[_0x1d469a(0x182)]==_0x1d469a(0x1c3)&&Array[_0x1d469a(0x1ca)](_0x230e67['slides']):_0x9b5c02===_0x1d469a(0x167)?Array[_0x1d469a(0x1ca)](_0x230e67['slides']):_0x9b5c02===_0x1d469a(0x168)?typeof _0x230e67[_0x1d469a(0x188)]=='string'&&Array['isArray'](_0x230e67[_0x1d469a(0x1c0)]):_0x9b5c02===_0x1d469a(0x1c6)?Array[_0x1d469a(0x1ca)](_0x230e67[_0x1d469a(0x1c0)]):_0x9b5c02===_0x1d469a(0x1c7)?r(_0x230e67):_0x9b5c02==='board-element'&&i(_0x230e67)))throw g(_0x1d469a(0x175)+_0x9b5c02+_0x1d469a(0x1c2));}function r(_0x4299f9){const _0x1274f2=_0x3141af;let _0x583d3e=_0x4299f9[_0x1274f2(0x15d)];return typeof _0x4299f9[_0x1274f2(0x182)]==_0x1274f2(0x1c3)&&'themeData'in _0x4299f9&&_(_0x583d3e)&&m(_0x583d3e[_0x1274f2(0x150)])&&_(_0x583d3e[_0x1274f2(0x17d)])&&Object[_0x1274f2(0x15b)](_0x583d3e['byType'])['every'](m)&&Array[_0x1274f2(0x1ca)](_0x4299f9[_0x1274f2(0x186)])&&_0x583d3e[_0x1274f2(0x150)]===_0x4299f9[_0x1274f2(0x186)][_0x1274f2(0x179)]&&Object[_0x1274f2(0x15b)](_0x583d3e[_0x1274f2(0x17d)])[_0x1274f2(0x14f)]((_0x182118,_0x2c1ec7)=>_0x182118+Number(_0x2c1ec7),0x0)===_0x583d3e[_0x1274f2(0x150)]&&_0x4299f9['elements'][_0x1274f2(0x19c)](a);}function i(_0x1a3f9e){const _0x2c374b=_0x3141af;return Array[_0x2c374b(0x1ca)](_0x1a3f9e[_0x2c374b(0x186)])&&_0x1a3f9e[_0x2c374b(0x186)][_0x2c374b(0x19c)](o);}function _0x53a1(_0x2873b7,_0x18e115){_0x2873b7=_0x2873b7-0x14f;const _0x9729a2=_0x9729();let _0x53a1b5=_0x9729a2[_0x2873b7];return _0x53a1b5;}function _0x9729(){const _0x538b31=['read','left','worksheet-range','data','mixed','endElementId','group','boolean','manual','Inspection\x20runtime\x20returned\x20an\x20invalid\x20error\x20envelope','table','container','message','connector','\x20inspection\x20requires\x20a\x20','unitId','every','locked','parentId','\x0aconst\x20input\x20=\x20','connectionPosition','connectorData','textStyle','auto','bounds','outlineIndex','startElementId','157492rvlBnf','descriptor','top','chart','image','3245957tyuehO','freePolyline','board-element','shapeId','subtype','details','source','254601DApXnf','base',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20base\x20=\x20univerAPI.getBase(input.unitId);\x0aif\x20(!base)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Base\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20schema\x20=\x20base.getSchema();\x0areturn\x20success({\x0a\x20\x20kind:\x20\x22base\x22,\x0a\x20\x20unitId:\x20input.unitId,\x0a\x20\x20name:\x20schema.name,\x0a\x20\x20tables:\x20schema.tables.map((table,\x20index)\x20=>\x20({\x0a\x20\x20\x20\x20id:\x20table.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20table.name,\x0a\x20\x20\x20\x20formulaName:\x20table.formulaName,\x0a\x20\x20\x20\x20primaryFieldId:\x20table.primaryFieldId,\x0a\x20\x20\x20\x20recordCount:\x20table.recordCount,\x0a\x20\x20\x20\x20fields:\x20table.fields.map((field,\x20fieldIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20field.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20fieldIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20field.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20field.type,\x0a\x20\x20\x20\x20\x20\x20config:\x20field.config\x20??\x20{},\x0a\x20\x20\x20\x20\x20\x20isReadonly:\x20field.readonly\x20===\x20true,\x0a\x20\x20\x20\x20})),\x0a\x20\x20\x20\x20views:\x20table.views.map((view,\x20viewIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20view.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20viewIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20view.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20view.type,\x0a\x20\x20\x20\x20})),\x0a\x20\x20})),\x0a});\x0a','INSPECTION_SELECTOR_INVALID','type','laneId','routing','selectable','9gHMpIN','containerData','segmentIndex','connection','ranges','paragraphs','121302RAHsXU','\x20result','string','slides','height','paragraph','board','unitType','shapeSite','isArray','straight','shapeBoundary','style','routingMode','fields','text','views','chartId','reduce','total','labels','126121QpIugl','sheet','children','50UaIFgW','visible','42QTjywX','5dGirfO','free','tables','values',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20document\x20=\x20univerAPI.getDocument(input.unitId);\x0aif\x20(!document)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Document\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20document.save();\x0aconst\x20body\x20=\x20snapshot.body\x20||\x20{};\x0aconst\x20stream\x20=\x20typeof\x20body.dataStream\x20===\x20\x22string\x22\x20?\x20body.dataStream\x20:\x20\x22\x22;\x0aconst\x20rawParagraphs\x20=\x20Array.isArray(body.paragraphs)\x20?\x20body.paragraphs\x20:\x20[];\x0a\x0afunction\x20cleanPreview(text)\x20{\x0a\x20\x20const\x20normalized\x20=\x20text.replace(/[\x5cu0000-\x5cu001f]+/g,\x20\x22\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20return\x20normalized.length\x20<=\x20120\x20?\x20normalized\x20:\x20normalized.slice(0,\x20117)\x20+\x20\x22...\x22;\x0a}\x0a\x0afunction\x20resolveParagraphs()\x20{\x0a\x20\x20let\x20start\x20=\x200;\x0a\x20\x20return\x20rawParagraphs.map((paragraph,\x20index)\x20=>\x20{\x0a\x20\x20\x20\x20const\x20end\x20=\x20Number.isInteger(paragraph.startIndex)\x20?\x20paragraph.startIndex\x20:\x20start;\x0a\x20\x20\x20\x20const\x20result\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20id:\x20typeof\x20paragraph.paragraphId\x20===\x20\x22string\x22\x20?\x20paragraph.paragraphId\x20:\x20String(index),\x0a\x20\x20\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20\x20\x20text:\x20stream.slice(start,\x20end),\x0a\x20\x20\x20\x20\x20\x20start,\x0a\x20\x20\x20\x20\x20\x20end,\x0a\x20\x20\x20\x20\x20\x20raw:\x20paragraph,\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20start\x20=\x20end\x20+\x201;\x0a\x20\x20\x20\x20return\x20result;\x0a\x20\x20});\x0a}\x0a\x0aconst\x20paragraphs\x20=\x20resolveParagraphs();\x0a\x0afunction\x20resolveParagraph(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20paragraphs[selector.index]\x20?\x20[paragraphs[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Paragraph\x20selector\x20did\x20not\x20match\x20a\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Paragraph\x20selector\x20matched\x20more\x20than\x20one\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20paragraph:\x20matches[0]\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22document\x22)\x20{\x0a\x20\x20const\x20mode\x20=\x20typeof\x20document.isModern\x20===\x20\x22function\x22\x20&&\x20document.isModern()\x0a\x20\x20\x20\x20?\x20\x22modern\x22\x0a\x20\x20\x20\x20:\x20typeof\x20document.isTraditional\x20===\x20\x22function\x22\x20&&\x20document.isTraditional()\x0a\x20\x20\x20\x20\x20\x20?\x20\x22paginated\x22\x0a\x20\x20\x20\x20\x20\x20:\x20\x22unspecified\x22;\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22document\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20title:\x20document.getName(),\x0a\x20\x20\x20\x20mode,\x0a\x20\x20\x20\x20paragraphCount:\x20paragraphs.length,\x0a\x20\x20\x20\x20characterCount:\x20paragraphs.reduce((total,\x20paragraph)\x20=>\x20total\x20+\x20paragraph.text.length,\x200),\x0a\x20\x20\x20\x20features:\x20{\x0a\x20\x20\x20\x20\x20\x20tables:\x20Array.isArray(body.tables)\x20?\x20body.tables.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20lists:\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.raw.bullet\x20!==\x20undefined).length,\x0a\x20\x20\x20\x20\x20\x20drawings:\x20snapshot.drawings\x20&&\x20typeof\x20snapshot.drawings\x20===\x20\x22object\x22\x20?\x20Object.keys(snapshot.drawings).length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20customBlocks:\x20Array.isArray(body.customBlocks)\x20?\x20body.customBlocks.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20blockRanges:\x20Array.isArray(body.blockRanges)\x20?\x20body.blockRanges.length\x20:\x200,\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20paragraphs:\x20paragraphs.map((paragraph)\x20=>\x20({\x20id:\x20paragraph.id,\x20index:\x20paragraph.index,\x20textPreview:\x20cleanPreview(paragraph.text)\x20})),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22paragraph\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.paragraphs\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveParagraph(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20const\x20paragraph\x20=\x20item.paragraph;\x0a\x20\x20\x20\x20const\x20runs\x20=\x20(Array.isArray(body.textRuns)\x20?\x20body.textRuns\x20:\x20[]).filter((run)\x20=>\x20(run.ed\x20||\x200)\x20>\x20paragraph.start\x20&&\x20(run.st\x20||\x200)\x20<\x20paragraph.end);\x0a\x20\x20\x20\x20const\x20bullet\x20=\x20paragraph.raw.bullet;\x0a\x20\x20\x20\x20const\x20listId\x20=\x20bullet\x20&&\x20bullet.listId;\x0a\x20\x20\x20\x20const\x20list\x20=\x20typeof\x20listId\x20===\x20\x22string\x22\x20&&\x20snapshot.lists\x20&&\x20snapshot.lists[listId];\x0a\x20\x20\x20\x20selected.push({\x0a\x20\x20\x20\x20\x20\x20id:\x20paragraph.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20paragraph.index,\x0a\x20\x20\x20\x20\x20\x20text:\x20paragraph.text,\x0a\x20\x20\x20\x20\x20\x20...(paragraph.raw.paragraphStyle\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20paragraph.raw.paragraphStyle\x20}),\x0a\x20\x20\x20\x20\x20\x20...(bullet\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20bullet\x20}),\x0a\x20\x20\x20\x20\x20\x20...(list\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20list\x20}),\x0a\x20\x20\x20\x20\x20\x20textRuns:\x20runs,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22paragraph\x22,\x20unitId:\x20input.unitId,\x20paragraphs:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20document\x20inspection\x20target\x22);\x0a','elementCounts','\x20inspection\x20requires\x20at\x20least\x20one\x20selector',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20presentation\x20=\x20univerAPI.getPresentation(input.unitId);\x0aif\x20(!presentation)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Presentation\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20presentation.save();\x0aconst\x20slideIds\x20=\x20Array.isArray(snapshot.slideOrder)\x20?\x20snapshot.slideOrder\x20:\x20Object.keys(snapshot.slides\x20||\x20{});\x0aconst\x20slides\x20=\x20slideIds.map((id)\x20=>\x20snapshot.slides\x20&&\x20snapshot.slides[id]).filter(Boolean);\x0a\x0afunction\x20documentText(documentData)\x20{\x0a\x20\x20const\x20stream\x20=\x20documentData\x20&&\x20documentData.body\x20&&\x20documentData.body.dataStream;\x0a\x20\x20return\x20typeof\x20stream\x20===\x20\x22string\x22\x20?\x20stream.replace(/\x5cr/g,\x20\x22\x5cn\x22).replace(/[\x5cu0000-\x5cu0009\x5cu000b-\x5cu001f]+/g,\x20\x22\x22).replace(/\x5cn+$/g,\x20\x22\x22)\x20:\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementText(element)\x20{\x0a\x20\x20if\x20(typeof\x20element.text\x20===\x20\x22string\x22)\x20return\x20element.text;\x0a\x20\x20if\x20(element.textData)\x20return\x20documentText(element.textData);\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData;\x0a\x20\x20const\x20shapeText\x20=\x20shapeData\x20&&\x20shapeData.shapeText;\x0a\x20\x20if\x20(shapeText\x20&&\x20typeof\x20shapeText.text\x20===\x20\x22string\x22)\x20return\x20shapeText.text;\x0a\x20\x20if\x20(shapeText\x20&&\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.doc)\x20return\x20documentText(shapeText.dataModel.doc);\x0a\x20\x20return\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementCountType(type)\x20{\x0a\x20\x20if\x20(type\x20===\x20\x22chart\x22)\x20return\x20\x22charts\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22image\x22)\x20return\x20\x22images\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22table\x22)\x20return\x20\x22tables\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22group\x22)\x20return\x20\x22groups\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22text\x22\x20||\x20type\x20===\x20\x22placeholder\x22)\x20return\x20\x22text\x22;\x0a\x20\x20return\x20\x22shapes\x22;\x0a}\x0a\x0afunction\x20collectElements(slide)\x20{\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20visited\x20=\x20new\x20Set();\x0a\x20\x20const\x20output\x20=\x20[];\x0a\x20\x20function\x20visit(id)\x20{\x0a\x20\x20\x20\x20if\x20(visited.has(id))\x20return;\x0a\x20\x20\x20\x20visited.add(id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20elements[id];\x0a\x20\x20\x20\x20if\x20(!element)\x20return;\x0a\x20\x20\x20\x20output.push(element);\x0a\x20\x20\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20element.children.forEach(visit);\x0a\x20\x20}\x0a\x20\x20(Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements)).forEach(visit);\x0a\x20\x20Object.keys(elements).forEach(visit);\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20elementCounts(slide)\x20{\x0a\x20\x20const\x20counts\x20=\x20{\x20total:\x200,\x20text:\x200,\x20shapes:\x200,\x20images:\x200,\x20charts:\x200,\x20tables:\x200,\x20groups:\x200\x20};\x0a\x20\x20for\x20(const\x20element\x20of\x20collectElements(slide))\x20{\x0a\x20\x20\x20\x20counts.total\x20+=\x201;\x0a\x20\x20\x20\x20counts[elementCountType(element.type)]\x20+=\x201;\x0a\x20\x20}\x0a\x20\x20return\x20counts;\x0a}\x0a\x0afunction\x20slideSummary(slide,\x20index)\x20{\x0a\x20\x20const\x20text\x20=\x20collectElements(slide).map(elementText).filter(Boolean).join(\x22\x20|\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20const\x20preview\x20=\x20text.length\x20<=\x20160\x20?\x20text\x20:\x20text.slice(0,\x20157)\x20+\x20\x22...\x22;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20slide.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20slide.name\x20||\x20\x22\x22,\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(slide),\x0a\x20\x20\x20\x20...(preview\x20===\x20\x22\x22\x20?\x20{}\x20:\x20{\x20textPreview:\x20preview\x20}),\x0a\x20\x20\x20\x20hasSpeakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20&&\x20slide.speakerNotes.length\x20>\x200,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20parseTableResources()\x20{\x0a\x20\x20const\x20resource\x20=\x20(Array.isArray(snapshot.resources)\x20?\x20snapshot.resources\x20:\x20[]).find((item)\x20=>\x20item\x20&&\x20item.name\x20===\x20\x22SLIDE_TABLE_PLUGIN\x22);\x0a\x20\x20if\x20(!resource\x20||\x20typeof\x20resource.data\x20!==\x20\x22string\x22)\x20return\x20{};\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20JSON.parse(resource.data);\x0a\x20\x20\x20\x20return\x20parsed\x20&&\x20typeof\x20parsed.tables\x20===\x20\x22object\x22\x20?\x20parsed.tables\x20:\x20{};\x0a\x20\x20}\x20catch\x20{\x0a\x20\x20\x20\x20return\x20{};\x0a\x20\x20}\x0a}\x0a\x0aconst\x20tableResources\x20=\x20parseTableResources();\x0a\x0afunction\x20tableText(tableId)\x20{\x0a\x20\x20const\x20table\x20=\x20tableResources[tableId];\x0a\x20\x20if\x20(!table\x20||\x20!Array.isArray(table.rows))\x20return\x20undefined;\x0a\x20\x20return\x20table.rows.map((row)\x20=>\x20(Array.isArray(row.cells)\x20?\x20row.cells\x20:\x20[]).map((cell)\x20=>\x20documentText(cell\x20&&\x20cell.textData)));\x0a}\x0a\x0afunction\x20finite(value)\x20{\x0a\x20\x20return\x20typeof\x20value\x20===\x20\x22number\x22\x20&&\x20Number.isFinite(value)\x20?\x20value\x20:\x20undefined;\x0a}\x0a\x0afunction\x20transformOf(element)\x20{\x0a\x20\x20const\x20transform\x20=\x20element.transform\x20||\x20{};\x0a\x20\x20const\x20result\x20=\x20{};\x0a\x20\x20const\x20left\x20=\x20finite(transform.left\x20??\x20transform.x);\x0a\x20\x20const\x20top\x20=\x20finite(transform.top\x20??\x20transform.y);\x0a\x20\x20const\x20width\x20=\x20finite(transform.width);\x0a\x20\x20const\x20height\x20=\x20finite(transform.height);\x0a\x20\x20const\x20angle\x20=\x20finite(transform.angle\x20??\x20transform.rotation);\x0a\x20\x20if\x20(left\x20!==\x20undefined)\x20result.left\x20=\x20left;\x0a\x20\x20if\x20(top\x20!==\x20undefined)\x20result.top\x20=\x20top;\x0a\x20\x20if\x20(width\x20!==\x20undefined)\x20result.width\x20=\x20width;\x0a\x20\x20if\x20(height\x20!==\x20undefined)\x20result.height\x20=\x20height;\x0a\x20\x20if\x20(angle\x20!==\x20undefined)\x20result.angle\x20=\x20angle;\x0a\x20\x20return\x20Object.keys(result).length\x20===\x200\x20?\x20undefined\x20:\x20result;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20elements,\x20ancestors)\x20{\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData\x20||\x20{};\x0a\x20\x20const\x20shapeText\x20=\x20shapeData.shapeText\x20||\x20{};\x0a\x20\x20const\x20text\x20=\x20elementText(element);\x0a\x20\x20const\x20output\x20=\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20name:\x20typeof\x20element.name\x20===\x20\x22string\x22\x20?\x20element.name\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20visible:\x20element.visible\x20!==\x20false,\x0a\x20\x20};\x0a\x20\x20const\x20transform\x20=\x20transformOf(element);\x0a\x20\x20if\x20(transform)\x20output.transform\x20=\x20transform;\x0a\x20\x20if\x20(shapeData.fill\x20!==\x20undefined)\x20output.fill\x20=\x20shapeData.fill;\x0a\x20\x20if\x20((shapeData.stroke\x20??\x20element.stroke)\x20!==\x20undefined)\x20output.stroke\x20=\x20shapeData.stroke\x20??\x20element.stroke;\x0a\x20\x20if\x20(text\x20!==\x20\x22\x22)\x20{\x0a\x20\x20\x20\x20const\x20textDetails\x20=\x20{\x20text\x20};\x0a\x20\x20\x20\x20const\x20horizontal\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.ha;\x0a\x20\x20\x20\x20const\x20vertical\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.va;\x0a\x20\x20\x20\x20if\x20(horizontal\x20!==\x20undefined\x20||\x20vertical\x20!==\x20undefined)\x20textDetails.alignment\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20...(horizontal\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20horizontal\x20}),\x0a\x20\x20\x20\x20\x20\x20...(vertical\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20vertical\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20if\x20(shapeText.padding\x20!==\x20undefined\x20||\x20shapeText.insets\x20!==\x20undefined)\x20textDetails.insets\x20=\x20shapeText.padding\x20??\x20shapeText.insets;\x0a\x20\x20\x20\x20output.text\x20=\x20textDetails;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.chartId\x20===\x20\x22string\x22)\x20output.chartId\x20=\x20element.chartId;\x0a\x20\x20if\x20(typeof\x20element.tableId\x20===\x20\x22string\x22)\x20{\x0a\x20\x20\x20\x20output.tableId\x20=\x20element.tableId;\x0a\x20\x20\x20\x20const\x20grid\x20=\x20tableText(element.tableId);\x0a\x20\x20\x20\x20if\x20(grid)\x20output.tableText\x20=\x20grid;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.mediaType\x20===\x20\x22string\x22)\x20output.mediaType\x20=\x20element.mediaType;\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20{\x0a\x20\x20\x20\x20output.children\x20=\x20element.children.filter((id)\x20=>\x20!ancestors.has(id)\x20&&\x20elements[id]).map((id)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20next\x20=\x20new\x20Set(ancestors);\x0a\x20\x20\x20\x20\x20\x20next.add(id);\x0a\x20\x20\x20\x20\x20\x20return\x20inspectElement(elements[id],\x20elements,\x20next);\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20slideDetails(slide,\x20index)\x20{\x0a\x20\x20const\x20summary\x20=\x20slideSummary(slide,\x20index);\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20ordered\x20=\x20Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements);\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...summary,\x0a\x20\x20\x20\x20speakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20?\x20slide.speakerNotes\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20elements:\x20ordered.filter((id)\x20=>\x20elements[id]).map((id)\x20=>\x20inspectElement(elements[id],\x20elements,\x20new\x20Set([id]))),\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveSlide(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20slides.filter((slide)\x20=>\x20slide.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20slides[selector.index]\x20?\x20[slides[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Slide\x20selector\x20did\x20not\x20match\x20a\x20slide\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Slide\x20selector\x20matched\x20more\x20than\x20one\x20slide\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20slide:\x20matches[0],\x20index:\x20slides.indexOf(matches[0])\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22presentation\x22)\x20{\x0a\x20\x20const\x20size\x20=\x20presentation.getPageSize();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22presentation\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20presentation.getName(),\x0a\x20\x20\x20\x20size:\x20{\x20width:\x20size.width,\x20height:\x20size.height\x20},\x0a\x20\x20\x20\x20masterSlideCount:\x20Array.isArray(snapshot.masterPageOrder)\x20?\x20snapshot.masterPageOrder.length\x20:\x20Object.keys(snapshot.masterPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20layoutSlideCount:\x20Array.isArray(snapshot.layoutPageOrder)\x20?\x20snapshot.layoutPageOrder.length\x20:\x20Object.keys(snapshot.layoutPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20slides:\x20slides.map(slideSummary),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22slide\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.slides\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveSlide(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20selected.push(slideDetails(item.slide,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22slide\x22,\x20unitId:\x20input.unitId,\x20slides:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20slide\x20inspection\x20target\x22);\x0a','doc','tableId','INSPECTION_SELECTOR_NOT_FOUND','INSPECTION_RESULT_INVALID','error','placeholder','labelStyle','slide','document','orderIndex','originalType','code','INSPECTION_SELECTOR_AMBIGUOUS','config','waypoints','851394VURXcc','curve','workbook','169864DQnxyx','labelText','kind','Inspection\x20runtime\x20returned\x20an\x20invalid\x20','number','index','worksheet','length','transform','worksheets','textContent','byType','width','presentation','ContentInspectionError','stringify','name','isSafeInteger','connectionSiteId','start','elements','\x20runtime,\x20received\x20','title','value','primaryFieldId','offsetY'];_0x9729=function(){return _0x538b31;};return _0x9729();}function a(_0x168fd8){const _0x12f8b4=_0x3141af;return _(_0x168fd8)&&typeof _0x168fd8['id']==_0x12f8b4(0x1c3)&&m(_0x168fd8[_0x12f8b4(0x169)])&&typeof _0x168fd8[_0x12f8b4(0x1b7)]==_0x12f8b4(0x1c3)&&typeof _0x168fd8[_0x12f8b4(0x156)]=='boolean'&&typeof _0x168fd8[_0x12f8b4(0x1ba)]==_0x12f8b4(0x193)&&typeof _0x168fd8[_0x12f8b4(0x19d)]==_0x12f8b4(0x193)&&_(_0x168fd8[_0x12f8b4(0x17a)])&&f(_0x168fd8[_0x12f8b4(0x182)])&&f(_0x168fd8['description'])&&f(_0x168fd8[_0x12f8b4(0x19e)])&&f(_0x168fd8[_0x12f8b4(0x1b8)])&&(_0x168fd8[_0x12f8b4(0x1a4)]===null||l(_0x168fd8[_0x12f8b4(0x1a4)]));}function o(_0x4332e5){const _0x1e89eb=_0x3141af;return!a(_0x4332e5)||_0x1e89eb(0x1a8)in _0x4332e5||_0x1e89eb(0x1b1)in _0x4332e5||_0x1e89eb(0x1a1)in _0x4332e5?!0x1:_0x4332e5[_0x1e89eb(0x1b7)]==='shape'?'shapeData'in _0x4332e5:_0x4332e5[_0x1e89eb(0x1b7)]===_0x1e89eb(0x199)?!(_0x1e89eb(0x1a6)in _0x4332e5)&&!(_0x1e89eb(0x191)in _0x4332e5)&&!(_0x1e89eb(0x1b0)in _0x4332e5)&&!(_0x1e89eb(0x1d0)in _0x4332e5)&&s(_0x4332e5[_0x1e89eb(0x1be)])&&_0x1e89eb(0x1cd)in _0x4332e5&&Array[_0x1e89eb(0x1ca)](_0x4332e5[_0x1e89eb(0x151)])&&_0x4332e5['labels'][_0x1e89eb(0x19c)](_0x4da3e2=>_(_0x4da3e2)&&typeof _0x4da3e2['id']==_0x1e89eb(0x1c3))&&_0x1e89eb(0x173)in _0x4332e5&&_0x1e89eb(0x166)in _0x4332e5:_0x4332e5[_0x1e89eb(0x1b7)]==='text'?_0x1e89eb(0x17c)in _0x4332e5&&_0x1e89eb(0x1a2)in _0x4332e5:_0x4332e5['type']===_0x1e89eb(0x1ab)||_0x4332e5[_0x1e89eb(0x1b7)]==='media'?typeof _0x4332e5[_0x1e89eb(0x1b2)]==_0x1e89eb(0x1c3):_0x4332e5[_0x1e89eb(0x1b7)]===_0x1e89eb(0x1aa)?typeof _0x4332e5[_0x1e89eb(0x1d2)]==_0x1e89eb(0x1c3):_0x4332e5[_0x1e89eb(0x1b7)]===_0x1e89eb(0x197)?_0x1e89eb(0x1bc)in _0x4332e5:_0x4332e5['type']==='diagram'?_0x1e89eb(0x18f)in _0x4332e5:_0x4332e5[_0x1e89eb(0x1b7)]===_0x1e89eb(0x196)?typeof _0x4332e5[_0x1e89eb(0x161)]==_0x1e89eb(0x1c3):_0x4332e5[_0x1e89eb(0x1b7)]===_0x1e89eb(0x192)?Array[_0x1e89eb(0x1ca)](_0x4332e5[_0x1e89eb(0x154)])&&_0x4332e5['children'][_0x1e89eb(0x19c)](_0x339e5f=>typeof _0x339e5f==_0x1e89eb(0x1c3)):_0x4332e5[_0x1e89eb(0x1b7)]===_0x1e89eb(0x165)?_0x1e89eb(0x165)in _0x4332e5:_0x4332e5[_0x1e89eb(0x1b7)]==='unknown'&&typeof _0x4332e5[_0x1e89eb(0x16a)]=='string'&&'data'in _0x4332e5;}function s(_0x8679b2){const _0x1dab52=_0x3141af;return _(_0x8679b2)&&c(_0x8679b2[_0x1dab52(0x185)])&&c(_0x8679b2['end'])&&(_0x8679b2['routing']===_0x1dab52(0x1cb)||_0x8679b2[_0x1dab52(0x1b9)]==='orthogonal'||_0x8679b2[_0x1dab52(0x1b9)]===_0x1dab52(0x170)||_0x8679b2[_0x1dab52(0x1b9)]===_0x1dab52(0x1ad))&&(_0x8679b2[_0x1dab52(0x1ce)]===_0x1dab52(0x1a3)||_0x8679b2[_0x1dab52(0x1ce)]===_0x1dab52(0x194)||_0x8679b2[_0x1dab52(0x1ce)]===_0x1dab52(0x190))&&Array[_0x1dab52(0x1ca)](_0x8679b2[_0x1dab52(0x16e)])&&_0x8679b2[_0x1dab52(0x16e)][_0x1dab52(0x19c)](_0x3e28dd=>_(_0x3e28dd)&&typeof _0x3e28dd['id']=='string'&&(_0x3e28dd[_0x1dab52(0x174)]===_0x1dab52(0x1a3)||_0x3e28dd[_0x1dab52(0x174)]===_0x1dab52(0x194))&&u(_0x3e28dd));}function c(_0x384e8d){const _0x160080=_0x3141af;return!_(_0x384e8d)||typeof _0x384e8d[_0x160080(0x174)]!='string'?!0x1:_0x384e8d['kind']===_0x160080(0x159)?u(_0x384e8d):_0x384e8d[_0x160080(0x174)]==='lifeline'?typeof _0x384e8d[_0x160080(0x1af)]==_0x160080(0x1c3)&&typeof _0x384e8d[_0x160080(0x18b)]==_0x160080(0x176):_0x384e8d['kind']===_0x160080(0x1c9)?typeof _0x384e8d[_0x160080(0x1af)]==_0x160080(0x1c3)&&typeof _0x384e8d[_0x160080(0x184)]=='number'&&d(_0x384e8d[_0x160080(0x1a0)]):_0x384e8d[_0x160080(0x174)]===_0x160080(0x1cc)&&typeof _0x384e8d['shapeId']==_0x160080(0x1c3)&&typeof _0x384e8d[_0x160080(0x1a5)]==_0x160080(0x176)&&typeof _0x384e8d[_0x160080(0x1bd)]==_0x160080(0x176)&&typeof _0x384e8d['segmentT']=='number';}function l(_0x1878e1){const _0x46e89b=_0x3141af;return _(_0x1878e1)&&typeof _0x1878e1[_0x46e89b(0x18d)]=='number'&&typeof _0x1878e1[_0x46e89b(0x1a9)]==_0x46e89b(0x176)&&typeof _0x1878e1[_0x46e89b(0x17e)]=='number'&&typeof _0x1878e1[_0x46e89b(0x1c5)]==_0x46e89b(0x176);}function u(_0x262fc9){const _0x391e76=_0x3141af;return _(_0x262fc9)&&typeof _0x262fc9['x']==_0x391e76(0x176)&&typeof _0x262fc9['y']==_0x391e76(0x176);}function d(_0x2d07a3){const _0xe33ebc=_0x3141af;return _0x2d07a3===void 0x0||typeof _0x2d07a3==_0xe33ebc(0x176);}function f(_0x5680c7){return _0x5680c7===void 0x0||typeof _0x5680c7=='string';}function p(_0x4c3ec3){const _0x305092=_0x3141af;return typeof _0x4c3ec3[_0x305092(0x182)]=='string'&&Array[_0x305092(0x1ca)](_0x4c3ec3[_0x305092(0x15a)])&&_0x4c3ec3['tables'][_0x305092(0x19c)]((_0x33991c,_0x398331)=>_(_0x33991c)&&m(_0x33991c[_0x305092(0x177)])&&_0x33991c[_0x305092(0x177)]===_0x398331&&typeof _0x33991c['id']==_0x305092(0x1c3)&&typeof _0x33991c[_0x305092(0x182)]=='string'&&typeof _0x33991c['formulaName']=='string'&&typeof _0x33991c[_0x305092(0x18a)]=='string'&&m(_0x33991c['recordCount'])&&Array['isArray'](_0x33991c[_0x305092(0x1cf)])&&_0x33991c[_0x305092(0x1cf)]['every']((_0x114119,_0x1010b3)=>_(_0x114119)&&m(_0x114119['index'])&&_0x114119[_0x305092(0x177)]===_0x1010b3&&typeof _0x114119['id']==_0x305092(0x1c3)&&typeof _0x114119[_0x305092(0x182)]==_0x305092(0x1c3)&&typeof _0x114119[_0x305092(0x1b7)]=='string'&&typeof _0x114119['isReadonly']==_0x305092(0x193)&&_0x305092(0x16d)in _0x114119&&h(_0x114119[_0x305092(0x16d)]))&&Array[_0x305092(0x1ca)](_0x33991c[_0x305092(0x1d1)])&&_0x33991c[_0x305092(0x1d1)][_0x305092(0x19c)]((_0x134d5f,_0x48980c)=>_(_0x134d5f)&&m(_0x134d5f[_0x305092(0x177)])&&_0x134d5f[_0x305092(0x177)]===_0x48980c&&typeof _0x134d5f['id']=='string'&&typeof _0x134d5f[_0x305092(0x182)]==_0x305092(0x1c3)&&typeof _0x134d5f[_0x305092(0x1b7)]==_0x305092(0x1c3)));}function m(_0x128854){const _0x2482c2=_0x3141af;return typeof _0x128854=='number'&&Number[_0x2482c2(0x183)](_0x128854)&&_0x128854>=0x0;}function h(_0x2ca08b){const _0x35594e=_0x3141af;return _0x2ca08b===null||typeof _0x2ca08b==_0x35594e(0x193)||typeof _0x2ca08b==_0x35594e(0x1c3)||typeof _0x2ca08b==_0x35594e(0x176)&&Number['isFinite'](_0x2ca08b)?!0x0:Array[_0x35594e(0x1ca)](_0x2ca08b)?_0x2ca08b['every'](h):_(_0x2ca08b)&&Object[_0x35594e(0x15b)](_0x2ca08b)['every'](h);}function g(_0x39fa77){const _0x21997d=_0x3141af;return new e(_0x21997d(0x163),_0x39fa77);}function _(_0x5d18f7){const _0x21f862=_0x3141af;return typeof _0x5d18f7=='object'&&!!_0x5d18f7&&!Array[_0x21f862(0x1ca)](_0x5d18f7);}function v(_0x2cb681){const _0x5bffd7=_0x3141af;return _0x2cb681==='INSPECTION_RANGE_OUT_OF_BOUNDS'||_0x2cb681===_0x5bffd7(0x163)||_0x2cb681===_0x5bffd7(0x16c)||_0x2cb681===_0x5bffd7(0x1b6)||_0x2cb681===_0x5bffd7(0x162)||_0x2cb681==='INSPECTION_UNIT_TYPE_MISMATCH';}function y(_0x155628){const _0x15345a=_0x3141af;return'\x0aconst\x20input\x20=\x20'+JSON[_0x15345a(0x181)]({'unitId':_0x155628})+_0x15345a(0x1b5);}function b(_0x1064e7,_0x252b12){return'\x0aconst\x20input\x20=\x20'+JSON['stringify']({'query':_0x252b12,'unitId':_0x1064e7})+';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value:\x20JSON.parse(JSON.stringify(value))\x20});\x0aconst\x20board\x20=\x20univerAPI.getBoard(input.unitId);\x0aif\x20(!board)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0a\x0aconst\x20descriptors\x20=\x20board.describeElements();\x0aconst\x20descriptorsById\x20=\x20new\x20Map(descriptors.map((descriptor)\x20=>\x20[descriptor.id,\x20descriptor]));\x0a\x0afunction\x20elementCounts()\x20{\x0a\x20\x20const\x20byType\x20=\x20{};\x0a\x20\x20for\x20(const\x20descriptor\x20of\x20descriptors)\x20{\x0a\x20\x20\x20\x20const\x20type\x20=\x20String(descriptor.type\x20||\x20\x22unknown\x22);\x0a\x20\x20\x20\x20byType[type]\x20=\x20(byType[type]\x20||\x200)\x20+\x201;\x0a\x20\x20}\x0a\x20\x20return\x20{\x20total:\x20descriptors.length,\x20byType\x20};\x0a}\x0a\x0afunction\x20inspectionBase(element,\x20descriptor)\x20{\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20orderIndex:\x20descriptor.orderIndex,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20...(descriptor.name\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20name:\x20descriptor.name\x20}),\x0a\x20\x20\x20\x20...(descriptor.description\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20description:\x20descriptor.description\x20}),\x0a\x20\x20\x20\x20...(descriptor.parentId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20parentId:\x20descriptor.parentId\x20}),\x0a\x20\x20\x20\x20...(descriptor.laneId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20laneId:\x20descriptor.laneId\x20}),\x0a\x20\x20\x20\x20visible:\x20descriptor.visible,\x0a\x20\x20\x20\x20selectable:\x20descriptor.selectable,\x0a\x20\x20\x20\x20locked:\x20descriptor.locked,\x0a\x20\x20\x20\x20transform:\x20element.transform\x20||\x20{},\x0a\x20\x20\x20\x20bounds:\x20descriptor.bounds,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20richTextData(value)\x20{\x0a\x20\x20return\x20value\x20?\x20value.getData()\x20:\x20null;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20descriptor)\x20{\x0a\x20\x20const\x20base\x20=\x20inspectionBase(element,\x20descriptor);\x0a\x20\x20if\x20(element.type\x20===\x20\x22shape\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22shape\x22,\x20shapeData:\x20element.shapeData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22connector\x22)\x20{\x0a\x20\x20\x20\x20const\x20connection\x20=\x20board.getConnectorConnection(element.id);\x0a\x20\x20\x20\x20if\x20(!connection)\x20return\x20null;\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22connector\x22,\x0a\x20\x20\x20\x20\x20\x20connection,\x0a\x20\x20\x20\x20\x20\x20style:\x20board.getConnectorStyle(element.id),\x0a\x20\x20\x20\x20\x20\x20labels:\x20board.getConnectorLabels(element.id),\x0a\x20\x20\x20\x20\x20\x20labelText:\x20richTextData(board.getConnectorLabelText(element.id)),\x0a\x20\x20\x20\x20\x20\x20labelStyle:\x20board.getConnectorLabelStyle(element.id),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22text\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22text\x22,\x0a\x20\x20\x20\x20\x20\x20textContent:\x20richTextData(board.getTextContent(element.id)),\x0a\x20\x20\x20\x20\x20\x20textStyle:\x20element.textStyle\x20||\x20null,\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22image\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22image\x22,\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.imageSourceType\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20imageSourceType:\x20element.imageSourceType\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.crop\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20crop:\x20element.crop\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.prstGeom\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20prstGeom:\x20element.prstGeom\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.adjustValues\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20adjustValues:\x20element.adjustValues\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22chart\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22chart\x22,\x0a\x20\x20\x20\x20\x20\x20chartId:\x20element.chartId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.stroke\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20stroke:\x20element.stroke\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22container\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22container\x22,\x20containerData:\x20element.containerData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22diagram\x22)\x20{\x0a\x20\x20\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22diagram\x22,\x20data\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22table\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22table\x22,\x0a\x20\x20\x20\x20\x20\x20tableId:\x20element.tableId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22group\x22,\x20children:\x20Array.isArray(element.children)\x20?\x20element.children\x20:\x20[]\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22media\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22media\x22,\x0a\x20\x20\x20\x20\x20\x20mediaType:\x20String(element.mediaType\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.poster\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20poster:\x20element.poster\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22placeholder\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22placeholder\x22,\x0a\x20\x20\x20\x20\x20\x20placeholder:\x20element.placeholder\x20||\x20{},\x0a\x20\x20\x20\x20\x20\x20...(element.text\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20text:\x20element.text\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.style\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20element.style\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20return\x20{\x20...base,\x20type:\x20\x22unknown\x22,\x20originalType:\x20String(type\x20||\x20\x22unknown\x22),\x20data\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board\x22)\x20{\x0a\x20\x20const\x20background\x20=\x20board.getBackground();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22board\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20board.getName(),\x0a\x20\x20\x20\x20...(background\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20background\x20}),\x0a\x20\x20\x20\x20themeData:\x20board.getThemeData(),\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(),\x0a\x20\x20\x20\x20elements:\x20descriptors,\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board-element\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.elements\x20||\x20[])\x20{\x0a\x20\x20\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22\x20||\x20Object.keys(selector).length\x20!==\x201\x20||\x20typeof\x20selector.id\x20!==\x20\x22string\x22\x20||\x20selector.id.length\x20===\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Board\x20element\x20selector\x20must\x20contain\x20exactly\x20one\x20non-empty\x20id\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20descriptor\x20=\x20descriptorsById.get(selector.id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20board.getElement(selector.id);\x0a\x20\x20\x20\x20if\x20(!descriptor\x20||\x20!element)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Board\x20element\x20selector\x20did\x20not\x20match\x20an\x20element\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20inspection\x20=\x20inspectElement(element,\x20descriptor);\x0a\x20\x20\x20\x20if\x20(!inspection)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20element\x20\x22\x20+\x20selector.id\x20+\x20\x22\x20could\x20not\x20be\x20inspected\x22);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20selected.push(inspection);\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22board-element\x22,\x20unitId:\x20input.unitId,\x20elements:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20Board\x20inspection\x20target\x22);\x0a';}function x(_0x43a477,_0x4c4a5f){const _0x4d19b2=_0x3141af;return'\x0aconst\x20input\x20=\x20'+JSON[_0x4d19b2(0x181)]({'query':_0x4c4a5f,'unitId':_0x43a477})+_0x4d19b2(0x15c);}function S(_0xe247ce,_0x1a29e7){const _0x32877a=_0x3141af;return _0x32877a(0x19f)+JSON[_0x32877a(0x181)]({'query':_0x1a29e7,'unitId':_0xe247ce})+';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20workbook\x20=\x20univerAPI.getWorkbook(input.unitId);\x0aif\x20(!workbook)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Workbook\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20sheets\x20=\x20workbook.getSheets();\x0aconst\x20snapshot\x20=\x20workbook.save();\x0a\x0afunction\x20columnName(column)\x20{\x0a\x20\x20let\x20value\x20=\x20column\x20+\x201;\x0a\x20\x20let\x20name\x20=\x20\x22\x22;\x0a\x20\x20while\x20(value\x20>\x200)\x20{\x0a\x20\x20\x20\x20const\x20remainder\x20=\x20(value\x20-\x201)\x20%\x2026;\x0a\x20\x20\x20\x20name\x20=\x20String.fromCharCode(65\x20+\x20remainder)\x20+\x20name;\x0a\x20\x20\x20\x20value\x20=\x20Math.floor((value\x20-\x201)\x20/\x2026);\x0a\x20\x20}\x0a\x20\x20return\x20name;\x0a}\x0a\x0afunction\x20rangeNotation(range)\x20{\x0a\x20\x20const\x20start\x20=\x20columnName(range.startColumn)\x20+\x20String(range.startRow\x20+\x201);\x0a\x20\x20const\x20end\x20=\x20columnName(range.endColumn)\x20+\x20String(range.endRow\x20+\x201);\x0a\x20\x20return\x20start\x20===\x20end\x20?\x20start\x20:\x20start\x20+\x20\x22:\x22\x20+\x20end;\x0a}\x0a\x0afunction\x20parseA1Range(notation)\x20{\x0a\x20\x20const\x20match\x20=\x20/^\x5c$?([A-Za-z]+)\x5c$?(\x5cd+)(?::\x5c$?([A-Za-z]+)\x5c$?(\x5cd+))?$/.exec(notation);\x0a\x20\x20if\x20(!match)\x20return\x20null;\x0a\x20\x20const\x20columnIndex\x20=\x20(name)\x20=>\x20{\x0a\x20\x20\x20\x20let\x20column\x20=\x200;\x0a\x20\x20\x20\x20for\x20(const\x20character\x20of\x20name.toUpperCase())\x20column\x20=\x20column\x20*\x2026\x20+\x20character.charCodeAt(0)\x20-\x2064;\x0a\x20\x20\x20\x20return\x20column\x20-\x201;\x0a\x20\x20};\x0a\x20\x20const\x20startColumn\x20=\x20columnIndex(match[1]);\x0a\x20\x20const\x20startRow\x20=\x20Number(match[2])\x20-\x201;\x0a\x20\x20const\x20endColumn\x20=\x20columnIndex(match[3]\x20||\x20match[1]);\x0a\x20\x20const\x20endRow\x20=\x20Number(match[4]\x20||\x20match[2])\x20-\x201;\x0a\x20\x20if\x20(!Number.isSafeInteger(startRow)\x20||\x20!Number.isSafeInteger(endRow)\x20||\x20startRow\x20<\x200\x20||\x20endRow\x20<\x20startRow\x20||\x20endColumn\x20<\x20startColumn)\x20return\x20null;\x0a\x20\x20return\x20{\x20startRow,\x20endRow,\x20startColumn,\x20endColumn\x20};\x0a}\x0a\x0afunction\x20normalizeCellData(cellData)\x20{\x0a\x20\x20const\x20cells\x20=\x20[];\x0a\x20\x20for\x20(const\x20[rowKey,\x20columns]\x20of\x20Object.entries(cellData\x20||\x20{}))\x20{\x0a\x20\x20\x20\x20const\x20row\x20=\x20Number(rowKey);\x0a\x20\x20\x20\x20if\x20(!Number.isInteger(row)\x20||\x20!columns\x20||\x20typeof\x20columns\x20!==\x20\x22object\x22)\x20continue;\x0a\x20\x20\x20\x20for\x20(const\x20[columnKey,\x20cell]\x20of\x20Object.entries(columns))\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20column\x20=\x20Number(columnKey);\x0a\x20\x20\x20\x20\x20\x20if\x20(Number.isInteger(column)\x20&&\x20cell\x20&&\x20typeof\x20cell\x20===\x20\x22object\x22)\x20cells.push({\x20row,\x20column,\x20cell\x20});\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20cells.sort((left,\x20right)\x20=>\x20left.row\x20-\x20right.row\x20||\x20left.column\x20-\x20right.column);\x0a\x20\x20return\x20cells;\x0a}\x0a\x0a//\x20TODO:\x20profile\x20large\x20sparse\x20worksheets\x20and\x20move\x20this\x20scan\x20behind\x20an\x20incremental\x20index\x20if\x20needed.\x0afunction\x20compactUsedRanges(cells,\x20predicate)\x20{\x0a\x20\x20const\x20horizontal\x20=\x20[];\x0a\x20\x20let\x20active\x20=\x20null;\x0a\x20\x20for\x20(const\x20entry\x20of\x20cells)\x20{\x0a\x20\x20\x20\x20if\x20(!predicate(entry.cell))\x20continue;\x0a\x20\x20\x20\x20if\x20(active\x20&&\x20active.startRow\x20===\x20entry.row\x20&&\x20active.endColumn\x20+\x201\x20===\x20entry.column)\x20{\x0a\x20\x20\x20\x20\x20\x20active.endColumn\x20=\x20entry.column;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20active\x20=\x20{\x20startRow:\x20entry.row,\x20endRow:\x20entry.row,\x20startColumn:\x20entry.column,\x20endColumn:\x20entry.column\x20};\x0a\x20\x20\x20\x20\x20\x20horizontal.push(active);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20const\x20rectangles\x20=\x20[];\x0a\x20\x20const\x20previousRow\x20=\x20new\x20Map();\x0a\x20\x20let\x20currentRow\x20=\x20-1;\x0a\x20\x20let\x20current\x20=\x20new\x20Map();\x0a\x20\x20for\x20(const\x20span\x20of\x20horizontal)\x20{\x0a\x20\x20\x20\x20if\x20(span.startRow\x20!==\x20currentRow)\x20{\x0a\x20\x20\x20\x20\x20\x20previousRow.clear();\x0a\x20\x20\x20\x20\x20\x20for\x20(const\x20[key,\x20value]\x20of\x20current)\x20previousRow.set(key,\x20value);\x0a\x20\x20\x20\x20\x20\x20current\x20=\x20new\x20Map();\x0a\x20\x20\x20\x20\x20\x20currentRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20key\x20=\x20span.startColumn\x20+\x20\x22:\x22\x20+\x20span.endColumn;\x0a\x20\x20\x20\x20const\x20prior\x20=\x20previousRow.get(key);\x0a\x20\x20\x20\x20if\x20(prior\x20&&\x20prior.endRow\x20+\x201\x20===\x20span.startRow)\x20{\x0a\x20\x20\x20\x20\x20\x20prior.endRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20prior);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20rectangle\x20=\x20{\x20...span\x20};\x0a\x20\x20\x20\x20\x20\x20rectangles.push(rectangle);\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20rectangle);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20rectangles.map(rangeNotation);\x0a}\x0a\x0afunction\x20hasValue(cell)\x20{\x0a\x20\x20return\x20Object.entries(cell).some(([key,\x20value])\x20=>\x20key\x20!==\x20\x22s\x22\x20&&\x20key\x20!==\x20\x22t\x22\x20&&\x20value\x20!==\x20null\x20&&\x20value\x20!==\x20undefined\x20&&\x20value\x20!==\x20\x22\x22);\x0a}\x0a\x0afunction\x20hasFormula(cell)\x20{\x0a\x20\x20return\x20(typeof\x20cell.f\x20===\x20\x22string\x22\x20&&\x20cell.f.length\x20>\x200)\x20||\x20cell.si\x20!==\x20null\x20&&\x20cell.si\x20!==\x20undefined\x20&&\x20cell.si\x20!==\x20\x22\x22;\x0a}\x0a\x0afunction\x20hasStyle(cell)\x20{\x0a\x20\x20return\x20cell.s\x20!==\x20null\x20&&\x20cell.s\x20!==\x20undefined;\x0a}\x0a\x0afunction\x20uniqueRanges(ranges)\x20{\x0a\x20\x20return\x20[...new\x20Set(ranges.map(rangeNotation))].sort();\x0a}\x0a\x0afunction\x20worksheetIdentity(sheet,\x20index)\x20{\x0a\x20\x20return\x20{\x20id:\x20sheet.getSheetId(),\x20index,\x20name:\x20sheet.getSheetName()\x20};\x0a}\x0a\x0afunction\x20worksheetOverview(sheet,\x20index)\x20{\x0a\x20\x20const\x20identity\x20=\x20worksheetIdentity(sheet,\x20index);\x0a\x20\x20const\x20sheetData\x20=\x20snapshot.sheets\x20&&\x20snapshot.sheets[identity.id]\x20||\x20{};\x0a\x20\x20const\x20cells\x20=\x20normalizeCellData(sheetData.cellData);\x0a\x20\x20const\x20conditionalRules\x20=\x20typeof\x20sheet.getConditionalFormattingRules\x20===\x20\x22function\x22\x20?\x20sheet.getConditionalFormattingRules()\x20:\x20[];\x0a\x20\x20const\x20validationRules\x20=\x20typeof\x20sheet.getDataValidations\x20===\x20\x22function\x22\x20?\x20sheet.getDataValidations()\x20:\x20[];\x0a\x20\x20const\x20tables\x20=\x20typeof\x20sheet.getSubTableInfos\x20===\x20\x22function\x22\x20?\x20sheet.getSubTableInfos()\x20:\x20[];\x0a\x20\x20const\x20images\x20=\x20typeof\x20sheet.getImages\x20===\x20\x22function\x22\x20?\x20sheet.getImages().length\x20:\x200;\x0a\x20\x20const\x20shapes\x20=\x20typeof\x20sheet.getShapes\x20===\x20\x22function\x22\x20?\x20sheet.getShapes().length\x20:\x200;\x0a\x20\x20const\x20charts\x20=\x20sheet.charts\x20&&\x20typeof\x20sheet.charts.list\x20===\x20\x22function\x22\x20?\x20sheet.charts.list().length\x20:\x200;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...identity,\x0a\x20\x20\x20\x20rowCount:\x20sheet.getMaxRows(),\x0a\x20\x20\x20\x20columnCount:\x20sheet.getMaxColumns(),\x0a\x20\x20\x20\x20valueUsedRanges:\x20compactUsedRanges(cells,\x20hasValue),\x0a\x20\x20\x20\x20formulaUsedRanges:\x20compactUsedRanges(cells,\x20hasFormula),\x0a\x20\x20\x20\x20styleUsedRanges:\x20compactUsedRanges(cells,\x20hasStyle),\x0a\x20\x20\x20\x20mergedRanges:\x20sheet.getMergedRanges().map((range)\x20=>\x20range.getA1Notation()),\x0a\x20\x20\x20\x20tables:\x20tables.map((table)\x20=>\x20({\x20id:\x20table.id,\x20name:\x20table.name,\x20range:\x20rangeNotation(table.range)\x20})),\x0a\x20\x20\x20\x20conditionalFormatting:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20conditionalRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(conditionalRules.flatMap((rule)\x20=>\x20Array.isArray(rule.ranges)\x20?\x20rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20dataValidation:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20validationRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(validationRules.flatMap((validation)\x20=>\x20Array.isArray(validation.rule\x20&&\x20validation.rule.ranges)\x20?\x20validation.rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20drawings:\x20{\x20total:\x20charts\x20+\x20images\x20+\x20shapes,\x20charts,\x20images,\x20shapes\x20},\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveWorksheet(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22,\x20\x22name\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id,\x20index,\x20or\x20name\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetId()\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22name\x22\x20&&\x20typeof\x20selector.name\x20===\x20\x22string\x22\x20&&\x20selector.name.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetName()\x20===\x20selector.name);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20sheets[selector.index]\x20?\x20[sheets[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Worksheet\x20selector\x20did\x20not\x20match\x20a\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Worksheet\x20selector\x20matched\x20more\x20than\x20one\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20const\x20sheet\x20=\x20matches[0];\x0a\x20\x20return\x20{\x20sheet,\x20index:\x20sheets.indexOf(sheet)\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22workbook\x22)\x20{\x0a\x20\x20return\x20success({\x20kind:\x20\x22workbook\x22,\x20unitId:\x20input.unitId,\x20name:\x20workbook.getName(),\x20worksheets:\x20sheets.map(worksheetOverview)\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.worksheets\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20resolved.push(worksheetOverview(item.sheet,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet\x22,\x20unitId:\x20input.unitId,\x20worksheets:\x20resolved\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet-range\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20request\x20of\x20input.query.ranges\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(request.worksheet);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20if\x20(typeof\x20request.range\x20!==\x20\x22string\x22\x20||\x20request.range.length\x20===\x200)\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20range\x20must\x20be\x20a\x20non-empty\x20A1\x20notation\x22,\x20request);\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20parseA1Range(request.range);\x0a\x20\x20\x20\x20if\x20(!parsed)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Invalid\x20worksheet\x20A1\x20range:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20maxRow\x20=\x20item.sheet.getMaxRows()\x20-\x201;\x0a\x20\x20\x20\x20const\x20maxColumn\x20=\x20item.sheet.getMaxColumns()\x20-\x201;\x0a\x20\x20\x20\x20if\x20(parsed.endRow\x20<\x200\x20||\x20parsed.endColumn\x20<\x200\x20||\x20parsed.startRow\x20>\x20maxRow\x20||\x20parsed.startColumn\x20>\x20maxColumn)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RANGE_OUT_OF_BOUNDS\x22,\x20\x22Worksheet\x20range\x20is\x20outside\x20the\x20worksheet\x20bounds:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20clippedRange\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20startRow:\x20Math.max(0,\x20parsed.startRow),\x0a\x20\x20\x20\x20\x20\x20endRow:\x20Math.min(maxRow,\x20parsed.endRow),\x0a\x20\x20\x20\x20\x20\x20startColumn:\x20Math.max(0,\x20parsed.startColumn),\x0a\x20\x20\x20\x20\x20\x20endColumn:\x20Math.min(maxColumn,\x20parsed.endColumn),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20const\x20facadeRange\x20=\x20item.sheet.getRange(clippedRange.startRow,\x20clippedRange.startColumn,\x20clippedRange.endRow\x20-\x20clippedRange.startRow\x20+\x201,\x20clippedRange.endColumn\x20-\x20clippedRange.startColumn\x20+\x201);\x0a\x20\x20\x20\x20const\x20rawCells\x20=\x20facadeRange.getCellDatas();\x0a\x20\x20\x20\x20const\x20displayValues\x20=\x20facadeRange.getDisplayValues();\x0a\x20\x20\x20\x20const\x20cellData\x20=\x20rawCells.map((row)\x20=>\x20row.map((cell)\x20=>\x20cell\x20===\x20undefined\x20?\x20null\x20:\x20cell));\x0a\x20\x20\x20\x20const\x20clipped\x20=\x20clippedRange.startRow\x20!==\x20parsed.startRow\x20||\x20clippedRange.endRow\x20!==\x20parsed.endRow\x20||\x20clippedRange.startColumn\x20!==\x20parsed.startColumn\x20||\x20clippedRange.endColumn\x20!==\x20parsed.endColumn;\x0a\x20\x20\x20\x20resolved.push({\x0a\x20\x20\x20\x20\x20\x20worksheet:\x20worksheetIdentity(item.sheet,\x20item.index),\x0a\x20\x20\x20\x20\x20\x20requestedRange:\x20request.range,\x0a\x20\x20\x20\x20\x20\x20resolvedRange:\x20rangeNotation(clippedRange),\x0a\x20\x20\x20\x20\x20\x20clipped,\x0a\x20\x20\x20\x20\x20\x20cellData,\x0a\x20\x20\x20\x20\x20\x20displayValues,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet-range\x22,\x20unitId:\x20input.unitId,\x20ranges:\x20resolved\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20sheet\x20inspection\x20target\x22);\x0a';}function C(_0x4fe7f0,_0x189727){const _0x391349=_0x3141af;return _0x391349(0x19f)+JSON[_0x391349(0x181)]({'query':_0x189727,'unitId':_0x4fe7f0})+_0x391349(0x15f);}async function w(_0xd2f44,_0x5879e0){const _0x5d0287=_0x3141af;E(_0x5879e0),D(_0xd2f44[_0x5d0287(0x1c8)],_0x5879e0[_0x5d0287(0x174)]);let _0x1bf671=T(_0xd2f44['unitId'],_0x5879e0),_0x22ebe9=t((await _0xd2f44['execute']({'code':_0x1bf671,'mode':_0x5d0287(0x18c)}))[_0x5d0287(0x189)]);return n(_0x22ebe9,_0x5879e0['kind']),_0x22ebe9;}function T(_0x3694eb,_0x510a00){const _0x4f9efb=_0x3141af;switch(_0x510a00[_0x4f9efb(0x174)]){case _0x4f9efb(0x171):case'worksheet':case'worksheet-range':return S(_0x3694eb,_0x510a00);case _0x4f9efb(0x168):case _0x4f9efb(0x1c6):return x(_0x3694eb,_0x510a00);case _0x4f9efb(0x17f):case'slide':return C(_0x3694eb,_0x510a00);case'base':return y(_0x3694eb);case _0x4f9efb(0x1c7):case'board-element':return b(_0x3694eb,_0x510a00);}}function E(_0x18dec5){const _0x4b460c=_0x3141af;let _0x13c2dc=_0x18dec5[_0x4b460c(0x174)]===_0x4b460c(0x178)?_0x18dec5[_0x4b460c(0x17b)]:_0x18dec5[_0x4b460c(0x174)]===_0x4b460c(0x18e)?_0x18dec5[_0x4b460c(0x1bf)]:_0x18dec5[_0x4b460c(0x174)]===_0x4b460c(0x167)?_0x18dec5[_0x4b460c(0x1c4)]:_0x18dec5[_0x4b460c(0x174)]===_0x4b460c(0x1c6)?_0x18dec5[_0x4b460c(0x1c0)]:_0x18dec5[_0x4b460c(0x174)]==='board-element'?_0x18dec5[_0x4b460c(0x186)]:null;if(_0x13c2dc!==null&&_0x13c2dc['length']===0x0)throw new e(_0x4b460c(0x1b6),_0x18dec5['kind']+_0x4b460c(0x15e));}function D(_0x44a068,_0x313fe2){const _0x1d4134=_0x3141af;let _0x2ee8c5=_0x313fe2===_0x1d4134(0x1b4)?_0x1d4134(0x1b4):_0x313fe2===_0x1d4134(0x1c7)||_0x313fe2===_0x1d4134(0x1ae)?_0x1d4134(0x1c7):_0x313fe2===_0x1d4134(0x171)||_0x313fe2===_0x1d4134(0x178)||_0x313fe2===_0x1d4134(0x18e)?_0x1d4134(0x153):_0x313fe2===_0x1d4134(0x17f)||_0x313fe2===_0x1d4134(0x167)?_0x1d4134(0x167):_0x1d4134(0x160);if(_0x44a068!==_0x2ee8c5)throw new e('INSPECTION_UNIT_TYPE_MISMATCH',_0x313fe2+_0x1d4134(0x19a)+_0x2ee8c5+_0x1d4134(0x187)+_0x44a068,{'actual':_0x44a068,'expected':_0x2ee8c5,'kind':_0x313fe2});}export{e as ContentInspectionError,w as inspectContent};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/content-inspection",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.0",
4
+ "version": "1.0.0",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -18,6 +18,6 @@
18
18
  "README.zh-CN.md"
19
19
  ],
20
20
  "dependencies": {
21
- "@univerjs/core": "1.0.0-rc.0"
21
+ "@univerjs/core": "1.0.0"
22
22
  }
23
23
  }