@univer-cli/unit-layout-lint 1.4.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -5
- package/README.zh-CN.md +44 -6
- package/dist/index.d.ts +67 -6
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Check Slide text overflow and overlap, and Board elements, connectors, and labels, returning structured findings with SDK geometry evidence.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Slide uses browser layout facts. Board supports model-only, rendered, and combined analysis. If the goal is to take a screenshot rather than diagnose, use `@univer-cli/unit-screenshot`.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ Currently only Slide is supported. If the goal is to take a screenshot rather th
|
|
|
12
12
|
pnpm add @univer-cli/unit-layout-lint @univer-cli/univer-render-runtime
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Slide and rendered Board analysis require a caller-built Render Page and Chrome, Chromium, or Edge. Board model analysis uses an injected headless adapter and does not require a browser.
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
@@ -38,7 +38,7 @@ try {
|
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Slide rules
|
|
42
42
|
|
|
43
43
|
- `text-off-page`: actual glyph ink extends beyond the page.
|
|
44
44
|
- `text-escapes-container`: text visibly escapes a smaller opaque container.
|
|
@@ -46,7 +46,57 @@ try {
|
|
|
46
46
|
|
|
47
47
|
A finding is an evidence-backed review suggestion, not a content error that must always be fixed. When `pages` is omitted, every page is checked. Numeric page selectors are one-based; string selectors use page IDs from `slideOrder`.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
## Board analysis
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import {
|
|
53
|
+
createHeadlessBoardLayoutRuntime,
|
|
54
|
+
createStandardHeadlessUniverFactory,
|
|
55
|
+
} from "@univer-cli/headless-univer";
|
|
56
|
+
|
|
57
|
+
const modelRuntime = createHeadlessBoardLayoutRuntime({
|
|
58
|
+
createUniver: createStandardHeadlessUniverFactory({ license: "" }),
|
|
59
|
+
});
|
|
60
|
+
const lint = createUnitLayoutLint({ modelRuntime });
|
|
61
|
+
const report = await lint.lint({ unitType: "board", unitData: boardData, mode: "model" });
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Board `mode` is `model`, `rendered`, or `both` (default). For rendered analysis, also provide `runtime` from `createUniverRenderRuntime()`. Custom adapters can implement `UniverBoardModelLayoutRuntime` or `UniverBoardLayoutRuntime`. Both phases receive detached copies of the same snapshot; `snapshotHash` identifies that input. `pages` accepts one-based positions or IDs from `pageOrder`, defaulting to all pages. Formula reference and embedded Unit snapshots can accompany the host.
|
|
65
|
+
|
|
66
|
+
Set `includeLabelPlan: true` with rendered or combined analysis to include native measured label repair plans in `analyses[].labelPlan`. Planning is read-only and opt-in. Apply only a `ready` plan through `board.applyLayoutPlan(plan)` and re-run lint; stale plans must be regenerated. A missing requested plan makes coverage incomplete.
|
|
67
|
+
|
|
68
|
+
Set `includePortPlan: true` in rendered or combined mode to return native automatic port-order plans in `analyses[].portPlan`. Missing or incomplete requested plans make coverage incomplete. Original findings remain visible until a fresh snapshot proves the repair. Apply one ready plan through `board.applyLayoutPlan(plan)`, then lint again; any other plans from the previous snapshot must be regenerated. The native planner preserves node frames, authored ports/routes and editing ownership.
|
|
69
|
+
|
|
70
|
+
For generated shape text, pass `textPlanElementIds: ["decision-id"]` in rendered or both mode. Each `analyses[]` entry can contain the native read-only `textPlan`; the report checks its Unit/page identity and limits every proposed resize to the selected shapes. Missing planning support adds `text-plan-unavailable`; an incomplete native plan adds `text-plan-incomplete`. Neither is clean coverage. No plan is applied automatically. Apply a ready plan with the Board Facade, replan graph/container layout and lint the updated snapshot.
|
|
71
|
+
|
|
72
|
+
Optional `textPlanMaximumWidthGrowth` must be a finite number from 1 to 2 and requires non-empty `textPlanElementIds`; 1 preserves authored widths, while omission keeps the native twofold search. Native planning preserves complete text and fonts. Callers still require complete coverage; `unit-layout-lint` rejects returned plans that exceed the requested width budget.
|
|
73
|
+
|
|
74
|
+
Apply only a plan for the current Board page; `applyLayoutPlan` rejects a mismatched page.
|
|
75
|
+
|
|
76
|
+
If a rendered label plan is incomplete with `connector-label-endpoint-constrained` or `no-free-position`, check whether the affected nodes can move and their connectors use ordinary automatic endpoints. In the browser, re-plan with `board.planLayout({ ...graphOptions, mode: "graph", layerGap: 160 })`, retaining the same `elementIds`, `fixedElementIds`, `direction`, and other constraints; choose a gap larger than the previous one. Apply only a `ready` graph plan, then lint a fresh snapshot with `includeLabelPlan: true`, apply only its new `ready` label plan, and lint again. A graph edit invalidates prior label plans. Preserve manual routes, native ownership, and hard constraints; if either plan remains incomplete, report the unresolved evidence and remaining raw findings.
|
|
77
|
+
|
|
78
|
+
`analyses` retains original SDK issues, routes, summaries, label IDs, and focus bounds per page and source. `findings` adds page/source identities and fingerprints without changing rule codes or severity. Geometry and rule evaluation remain owned by Univer; the package does not route or rearrange objects.
|
|
79
|
+
|
|
80
|
+
Optional `analysis.connectorLabelLayouts` retains native label rectangles, rotation, sizes, and flags when the runtime supplies them. Malformed measurements fail explicitly. An `unresolved` entry contributes the existing `unresolved-label` coverage reason once per page and final source, including when a native issue reports the same label. Ready measurements preserve overflow and endpoint constraints without adding findings. Older runtimes may omit the field; their reports remain compatible, but a `clean` result then does not establish complete label measurements or proximity to connector lines.
|
|
81
|
+
|
|
82
|
+
Set `maximumAutomaticLabelDistance` to a finite non-negative number (zero is valid) with rendered or combined analysis to inspect automatic label proximity. Native `labelDistanceInspection` echoes the exact policy; each measured label records a ready distance, an exclusion reason, or unresolved status. Older producers remain compatible when the option is omitted. When requested, missing support/status or unresolved distance adds `automatic-label-distance-unavailable` and makes coverage incomplete; malformed or contradictory evidence is rejected. Native exceeded-distance findings are errors. This is distance to the sampled, marker-trimmed stroke centerline before dash gaps and label clipping, not raster ink; curves use the native bounded polyline approximation. Inspection never moves labels.
|
|
83
|
+
|
|
84
|
+
`connector-route-retrace` identifies a resolved connector drawing back over its own line. Its route points and focus bounds locate the repeated ink. Inspection preserves authored guides; use rendered evidence to check the final automatic route.
|
|
85
|
+
|
|
86
|
+
`coverage.complete` describes the requested phases. Missing runtimes or page evidence and unresolved final routes, connector labels, or element text measurements produce `status: "incomplete"`, even with no findings. In combined mode, final rendered evidence can resolve model-only unknown routes. Rendered findings preserve native shape-text overflow and collisions involving container captions and swimlane header regions. Native table findings also retain the zero-based inclusive `tableRange` of the measured cell, including merged cells, and `textLayout` sizes when resolved. Use that range to address the owning rows and columns; do not infer a cell from the table's outer frame. Model-only coverage explicitly excludes final font metrics and automatic rendered routes. A `clean` report only proves the requested checks; it does not prove visual or interaction coverage that was not requested. Intentional overlaps remain in the report for review.
|
|
87
|
+
|
|
88
|
+
The application materializes UnitData and provides runtimes. The package does not load remote targets, save reports, mutate content, or manage runtime lifecycles.
|
|
50
89
|
|
|
51
90
|
For the preset command, see
|
|
52
91
|
[`@univer-cli/unit-layout-lint-command`](../unit-layout-lint-command/README.md).
|
|
92
|
+
|
|
93
|
+
### Board layout plans
|
|
94
|
+
|
|
95
|
+
`layoutPlan` requests one native plan per rendered Board page. Select `graph` for complete layout,
|
|
96
|
+
`routes` for automatic path coordination, `ports` for automatic endpoints, `labels` for caption
|
|
97
|
+
placement, or `text` for grow-only frame sizing. Use element IDs for graph and text or connector IDs
|
|
98
|
+
for the other modes. The Render Page must use a Board SDK with `FBoard.planLayout()`.
|
|
99
|
+
|
|
100
|
+
With the Commander preset, use `lint --unit <id> --mode rendered --plan routes --plan-ids edge-a edge-b --json`.
|
|
101
|
+
Read `analyses[].plan` from the lint report. A ready plan can be applied on its original Board page
|
|
102
|
+
through `board.applyLayoutPlan(plan)`. Reinspect the new snapshot after application.
|
package/README.zh-CN.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
检查 Slide 文字越界、重叠与 Board 元素、连接线和标签,返回带 SDK 几何证据的结构化 findings。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Slide 使用浏览器 layout facts;Board 支持 model、rendered 和组合分析。若目标是截图而不是诊断,使用 `@univer-cli/unit-screenshot`。
|
|
8
8
|
|
|
9
9
|
## 安装
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
pnpm add @univer-cli/unit-layout-lint @univer-cli/univer-render-runtime
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Slide 与 Board rendered 分析需要 application 构建 Render Page,并提供 Chrome、Chromium 或 Edge。Board model 分析使用注入的 headless adapter,无需浏览器。
|
|
16
16
|
|
|
17
17
|
## 快速开始
|
|
18
18
|
|
|
@@ -38,7 +38,7 @@ try {
|
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Slide 规则
|
|
42
42
|
|
|
43
43
|
- `text-off-page`:实际 glyph ink 超出页面;
|
|
44
44
|
- `text-escapes-container`:文字明显冲出较小、不透明的容器;
|
|
@@ -47,8 +47,46 @@ try {
|
|
|
47
47
|
Finding 是带证据的复查建议,不是必须清零的内容错误。省略 `pages` 时检查全部页面;page number 从 1 开始,
|
|
48
48
|
字符串 selector 使用 `slideOrder` 中的 page ID。
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
## Board 分析
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import {
|
|
54
|
+
createHeadlessBoardLayoutRuntime,
|
|
55
|
+
createStandardHeadlessUniverFactory,
|
|
56
|
+
} from "@univer-cli/headless-univer";
|
|
57
|
+
|
|
58
|
+
const modelRuntime = createHeadlessBoardLayoutRuntime({
|
|
59
|
+
createUniver: createStandardHeadlessUniverFactory({ license: "" }),
|
|
60
|
+
});
|
|
61
|
+
const lint = createUnitLayoutLint({ modelRuntime });
|
|
62
|
+
const report = await lint.lint({ unitType: "board", unitData: boardData, mode: "model" });
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Board `mode` 为 `model`、`rendered` 或默认的 `both`。Rendered 分析还需提供 `createUniverRenderRuntime()` 返回的 `runtime`;自定义 adapter 可实现 `UniverBoardModelLayoutRuntime` 或 `UniverBoardLayoutRuntime`。两阶段接收同一 snapshot 的独立副本,`snapshotHash` 标识其输入。`pages` 使用从 1 开始的位置或 `pageOrder` 中的 ID,默认检查全部页面。Host 可附带 formula reference 与 embedded Unit snapshots。
|
|
66
|
+
|
|
67
|
+
Rendered 或组合分析可显式设置 `includeLabelPlan: true`,通过 `analyses[].labelPlan` 返回原生 SDK 实测标签修复 plan。规划只读且默认关闭。仅通过 `board.applyLayoutPlan(plan)` 应用 `ready` plan,然后重新 lint;过期 plan 必须重新生成。请求后缺少 plan 会使 coverage 不完整。
|
|
68
|
+
|
|
69
|
+
Rendered 或组合模式可设置 `includePortPlan: true`,通过 `analyses[].portPlan` 返回原生自动端口排序计划。请求后计划缺失或不完整会使 coverage 不完整。原始 findings 会保留,直到新 snapshot 的检查证明修复。通过 `board.applyLayoutPlan(plan)` 应用一个 ready 计划后重新 lint;旧 snapshot 的其他计划必须重新生成。原生规划保留节点框、人工端口/路由和编辑所有权。
|
|
70
|
+
|
|
71
|
+
对于生成图形的文字,在 rendered 或 both 模式传入 `textPlanElementIds: ["decision-id"]`。各 `analyses[]` 可包含原生只读 `textPlan`;report 检查 Unit/page 身份,并限制所有尺寸建议只针对所选图形。缺少规划支持会增加 `text-plan-unavailable`,原生计划不完整会增加 `text-plan-incomplete`,均不算完整覆盖。不会自动应用计划。通过 Board Facade 应用 ready 计划后,重新规划图和容器布局,并对更新的 snapshot 再次 lint。
|
|
72
|
+
|
|
73
|
+
可选的 `textPlanMaximumWidthGrowth` 必须是 1 到 2 的有限数,并与非空 `textPlanElementIds` 一起提供;1 保留原宽,默认沿用原生最多两倍宽度搜索。原生计划保留完整文字和字号,调用方仍须检查完整覆盖。`unit-layout-lint` 拒绝超过请求宽度预算的返回计划。
|
|
74
|
+
|
|
75
|
+
仅应用当前 Board page 对应的 plan;`applyLayoutPlan` 会拒绝页面不匹配的 plan。
|
|
76
|
+
|
|
77
|
+
若 rendered label plan 因 `connector-label-endpoint-constrained` 或 `no-free-position` 不完整,先确认相关节点可移动且连接线使用普通自动端点。保留相同的 `elementIds`、`fixedElementIds`、`direction` 与其他约束,在浏览器中通过 `board.planLayout({ ...graphOptions, mode: "graph", layerGap: 160 })` 增加层间距;新间距应大于原值。仅应用 `ready` graph plan,再对新 snapshot 设置 `includeLabelPlan: true` 重新 lint,仅应用这次新生成的 `ready` label plan,然后再次 lint。Graph 编辑会使旧 label plan 失效。保留手工路由、原生布局所有权与硬约束;若任一 plan 仍不完整,报告未解决证据和剩余原始 findings。
|
|
78
|
+
|
|
79
|
+
`analyses` 按页面、来源保留 SDK 原始 issues、routes、summary、label IDs 和 focus bounds;`findings` 仅补充页面、来源与 fingerprint,不更改规则代码或 severity。几何与规则计算委托 Univer;本 package 不布线或移动对象。
|
|
80
|
+
|
|
81
|
+
Runtime 提供可选的 `analysis.connectorLabelLayouts` 时,结果保留原生标签矩形、旋转、尺寸与标志;无效度量会明确失败。`unresolved` 项计入既有的 `unresolved-label` coverage reason,每个页面的最终来源仅记录一次,即使原生 issue 同时报告了该标签。Ready 度量保留溢出与端点约束,不额外生成 findings。旧 runtime 可缺少此字段,报告保持兼容,但此时 `clean` 不证明完整的标签度量或标签贴近连接线。
|
|
82
|
+
|
|
83
|
+
Rendered 或组合分析可设置有限、非负的 `maximumAutomaticLabelDistance`(0 有效),显式检查自动标签与连接线的距离。原生 `labelDistanceInspection` 回传精确 policy,每个已测量标签记录 ready 距离、排除原因或 unresolved 状态。省略选项时保持旧 producer 兼容;请求后缺少支持、状态或距离未解析会增加 `automatic-label-distance-unavailable` 并使 coverage 不完整,无效或矛盾证据会被拒绝。原生距离超限 finding 为 error。度量针对采样、裁去 marker 的 stroke 中心线,在 dash gaps 和 label clipping 之前计算,不是 raster ink;曲线采用原生有界折线近似。检查不会移动标签。
|
|
84
|
+
|
|
85
|
+
`connector-route-retrace` 表示已解析的连接线沿自身线段反向重复绘制。报告通过 route points 和 focus bounds 定位重复线段。检查保留手工路径;最终自动路由应通过 rendered evidence 验证。
|
|
86
|
+
|
|
87
|
+
`coverage.complete` 描述请求阶段的覆盖。缺少 runtime、页面证据或最终 route、连接线标签或元素文字度量未解析时返回 `status: "incomplete"`,即使 findings 为空。组合模式下,最终 rendered 证据可解决 model 阶段无法确定的自动路由。Rendered findings 保留原生 shape 文字溢出、容器标题和泳道标题区域碰撞。原生表格 findings 还保留实际测量单元格的零基、两端包含的 `tableRange`(含合并单元格),度量成功时附 `textLayout` 尺寸。根据该范围定位所属行列,不从整个表格的外框推断单元格。Model-only 明确不涵盖最终字体度量与自动渲染路径。`clean` 只证明请求的检查,不证明未请求的视觉或交互覆盖。刻意重叠也保留 findings 供复查。
|
|
88
|
+
|
|
89
|
+
Application 负责物化 UnitData、提供 runtime。Package 不加载远程 target、不保存报告、不修改内容,也不管理 runtime 生命周期。
|
|
52
90
|
|
|
53
91
|
预设 command 见
|
|
54
92
|
[`@univer-cli/unit-layout-lint-command`](../unit-layout-lint-command/README.zh-CN.md)。
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UniverRenderFormulaReferenceUnit, UniverRenderUnit, UniverSlideLayoutRuntime } from "@univer-cli/univer-render-runtime";
|
|
1
|
+
import { UniverBoardLayoutAnalysis, UniverBoardLayoutIssue, UniverBoardLayoutPlan, UniverBoardLayoutPlanOptions, UniverBoardLayoutRuntime, UniverBoardModelLayoutRuntime, UniverRenderEmbeddedUnit, UniverRenderFormulaReferenceUnit, UniverRenderUnit, UniverSlideLayoutRuntime } from "@univer-cli/univer-render-runtime";
|
|
2
2
|
//#region src/errors.d.ts
|
|
3
3
|
type UnitLayoutLintErrorCode = "INVALID_INPUT" | "INVALID_RENDER_RESULT";
|
|
4
4
|
declare class UnitLayoutLintError extends Error {
|
|
@@ -65,8 +65,28 @@ interface SlideUnitLayoutLintInput {
|
|
|
65
65
|
readonly unitData: SlideUnitData;
|
|
66
66
|
readonly unitType: "slide";
|
|
67
67
|
}
|
|
68
|
-
type
|
|
69
|
-
|
|
68
|
+
type BoardLayoutLintMode = "model" | "rendered" | "both";
|
|
69
|
+
interface BoardUnitLayoutLintInput {
|
|
70
|
+
readonly embeddedUnits?: readonly UniverRenderEmbeddedUnit[];
|
|
71
|
+
readonly formulaReferenceUnits?: readonly UniverRenderFormulaReferenceUnit[];
|
|
72
|
+
readonly mode?: BoardLayoutLintMode;
|
|
73
|
+
readonly layoutPlan?: UniverBoardLayoutPlanOptions;
|
|
74
|
+
readonly includeLabelPlan?: boolean;
|
|
75
|
+
readonly includePortPlan?: boolean;
|
|
76
|
+
/** Explicit generated shape IDs; requires native rendered text planning. */
|
|
77
|
+
readonly textPlanElementIds?: readonly string[];
|
|
78
|
+
/** Optional native width-growth limit from 1 to 2; requires an explicit text-plan selection. */
|
|
79
|
+
readonly textPlanMaximumWidthGrowth?: number;
|
|
80
|
+
readonly maximumAutomaticLabelDistance?: number;
|
|
81
|
+
readonly pages?: readonly SlideLayoutLintPageSelector[];
|
|
82
|
+
readonly signal?: AbortSignal;
|
|
83
|
+
readonly unitData: Extract<UniverRenderUnit, {
|
|
84
|
+
readonly unitType: "board";
|
|
85
|
+
}>["unitData"];
|
|
86
|
+
readonly unitType: "board";
|
|
87
|
+
}
|
|
88
|
+
type UnitLayoutLintInput = SlideUnitLayoutLintInput | BoardUnitLayoutLintInput;
|
|
89
|
+
type UnitLayoutLintSource = Omit<SlideUnitLayoutLintInput, "pages"> | Omit<BoardUnitLayoutLintInput, "pages" | "mode" | "layoutPlan" | "includeLabelPlan" | "includePortPlan" | "textPlanElementIds" | "textPlanMaximumWidthGrowth" | "maximumAutomaticLabelDistance">;
|
|
70
90
|
interface SlideUnitLayoutLintReport {
|
|
71
91
|
readonly coverage: {
|
|
72
92
|
readonly pages: readonly {
|
|
@@ -80,15 +100,56 @@ interface SlideUnitLayoutLintReport {
|
|
|
80
100
|
readonly unitId: string;
|
|
81
101
|
readonly unitType: "slide";
|
|
82
102
|
}
|
|
83
|
-
type
|
|
103
|
+
type BoardLayoutLintFinding = UniverBoardLayoutIssue & {
|
|
104
|
+
readonly fingerprint: string;
|
|
105
|
+
readonly page: number;
|
|
106
|
+
readonly pageId: string;
|
|
107
|
+
readonly source: "model" | "rendered";
|
|
108
|
+
};
|
|
109
|
+
interface BoardUnitLayoutLintReport {
|
|
110
|
+
readonly kind: "unit-layout-lint";
|
|
111
|
+
readonly unitId: string;
|
|
112
|
+
readonly unitType: "board";
|
|
113
|
+
readonly mode: BoardLayoutLintMode;
|
|
114
|
+
readonly snapshotHash: string;
|
|
115
|
+
readonly status: "clean" | "findings" | "incomplete";
|
|
116
|
+
readonly coverage: {
|
|
117
|
+
readonly pages: readonly {
|
|
118
|
+
readonly page: number;
|
|
119
|
+
readonly pageId: string;
|
|
120
|
+
}[];
|
|
121
|
+
readonly sources: readonly ("model" | "rendered")[];
|
|
122
|
+
readonly complete: boolean;
|
|
123
|
+
readonly incomplete: readonly {
|
|
124
|
+
readonly pageId: string;
|
|
125
|
+
readonly source: "model" | "rendered";
|
|
126
|
+
readonly reason: "runtime-unavailable" | "analysis-missing" | "layout-plan-unavailable" | "layout-plan-incomplete" | "unresolved-route" | "unresolved-label" | "unresolved-element-text" | "label-plan-unavailable" | "port-plan-unavailable" | "port-plan-incomplete" | "text-plan-unavailable" | "text-plan-incomplete" | "automatic-label-distance-unavailable";
|
|
127
|
+
}[];
|
|
128
|
+
readonly limitations: readonly string[];
|
|
129
|
+
};
|
|
130
|
+
/** Original SDK analyses, including routes, summaries, and all issue evidence. */
|
|
131
|
+
readonly analyses: readonly {
|
|
132
|
+
readonly page: number;
|
|
133
|
+
readonly pageId: string;
|
|
134
|
+
readonly model?: UniverBoardLayoutAnalysis;
|
|
135
|
+
readonly rendered?: UniverBoardLayoutAnalysis;
|
|
136
|
+
readonly plan?: UniverBoardLayoutPlan;
|
|
137
|
+
readonly labelPlan?: UniverBoardLayoutPlan;
|
|
138
|
+
readonly portPlan?: UniverBoardLayoutPlan;
|
|
139
|
+
readonly textPlan?: UniverBoardLayoutPlan;
|
|
140
|
+
}[];
|
|
141
|
+
readonly findings: readonly BoardLayoutLintFinding[];
|
|
142
|
+
}
|
|
143
|
+
type UnitLayoutLintReport = SlideUnitLayoutLintReport | BoardUnitLayoutLintReport;
|
|
84
144
|
interface UnitLayoutLint {
|
|
85
145
|
lint(input: UnitLayoutLintInput): Promise<UnitLayoutLintReport>;
|
|
86
146
|
}
|
|
87
147
|
interface UnitLayoutLintOptions {
|
|
88
|
-
readonly runtime
|
|
148
|
+
readonly runtime?: UniverSlideLayoutRuntime | UniverBoardLayoutRuntime;
|
|
149
|
+
readonly modelRuntime?: UniverBoardModelLayoutRuntime;
|
|
89
150
|
}
|
|
90
151
|
//#endregion
|
|
91
152
|
//#region src/unit-layout-lint.d.ts
|
|
92
153
|
declare function createUnitLayoutLint(options: UnitLayoutLintOptions): UnitLayoutLint;
|
|
93
154
|
//#endregion
|
|
94
|
-
export { type SlideLayoutLintBox, type SlideLayoutLintContainer, type SlideLayoutLintFinding, type SlideLayoutLintOverflow, type SlideLayoutLintPageSelector, type SlideLayoutLintRule, type SlideLayoutLintText, type SlideUnitLayoutLintInput, type SlideUnitLayoutLintReport, type UnitLayoutLint, UnitLayoutLintError, type UnitLayoutLintErrorCode, type UnitLayoutLintInput, type UnitLayoutLintOptions, type UnitLayoutLintReport, type UnitLayoutLintSource, createUnitLayoutLint, isUnitLayoutLintError };
|
|
155
|
+
export { type BoardLayoutLintFinding, type BoardLayoutLintMode, type UniverBoardLayoutPlanOptions as BoardLayoutPlanOptions, type BoardUnitLayoutLintInput, type BoardUnitLayoutLintReport, type SlideLayoutLintBox, type SlideLayoutLintContainer, type SlideLayoutLintFinding, type SlideLayoutLintOverflow, type SlideLayoutLintPageSelector, type SlideLayoutLintRule, type SlideLayoutLintText, type SlideUnitLayoutLintInput, type SlideUnitLayoutLintReport, type UnitLayoutLint, UnitLayoutLintError, type UnitLayoutLintErrorCode, type UnitLayoutLintInput, type UnitLayoutLintOptions, type UnitLayoutLintReport, type UnitLayoutLintSource, createUnitLayoutLint, isUnitLayoutLintError };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x4037ef=_0x8b3d;(function(_0x2be0c1,_0x2b4799){const _0x2e6992=_0x8b3d,_0x2f7f24=_0x2be0c1();while(!![]){try{const _0x31c6a0=parseInt(_0x2e6992(0x17d))/0x1+parseInt(_0x2e6992(0x171))/0x2+-parseInt(_0x2e6992(0x1ad))/0x3+-parseInt(_0x2e6992(0x19b))/0x4+-parseInt(_0x2e6992(0x16b))/0x5*(parseInt(_0x2e6992(0x1b7))/0x6)+-parseInt(_0x2e6992(0x167))/0x7*(-parseInt(_0x2e6992(0x181))/0x8)+parseInt(_0x2e6992(0x187))/0x9;if(_0x31c6a0===_0x2b4799)break;else _0x2f7f24['push'](_0x2f7f24['shift']());}catch(_0x23928a){_0x2f7f24['push'](_0x2f7f24['shift']());}}}(_0x48af,0x80f6c));var e=class extends Error{[_0x4037ef(0x18b)];constructor(_0x5b5a7b,_0x55b503,_0x1d1410){const _0x153639=_0x4037ef;super(_0x55b503,_0x1d1410),this['name']=_0x153639(0x162),this['code']=_0x5b5a7b;}};function t(_0xe504d4){return _0xe504d4 instanceof e;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0x4037ef(0x183),_0x4037ef(0x163)]),c=[_0x4037ef(0x16a),_0x4037ef(0x160),_0x4037ef(0x1b4)];function l(_0x1dfbd5){return{async 'lint'(_0x41c49){const _0x4eefc5=_0x8b3d;if(_0x41c49[_0x4eefc5(0x172)]!==_0x4eefc5(0x16d))throw new e(_0x4eefc5(0x18d),'Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only');let _0x579d63=O(_0x41c49[_0x4eefc5(0x1a4)]['id']),_0x42c436=u(_0x41c49[_0x4eefc5(0x1a4)][_0x4eefc5(0x1a9)]??[],_0x41c49[_0x4eefc5(0x1b5)]),_0x306d14=await _0x1dfbd5[_0x4eefc5(0x1b1)][_0x4eefc5(0x1a1)]({'unitType':_0x4eefc5(0x16d),'unitData':_0x41c49[_0x4eefc5(0x1a4)],..._0x41c49[_0x4eefc5(0x17f)]===void 0x0?{}:{'formulaReferenceUnits':_0x41c49[_0x4eefc5(0x17f)]},'pages':_0x42c436[_0x4eefc5(0x16f)](({page:_0x2e915c})=>_0x2e915c),..._0x41c49[_0x4eefc5(0x15d)]===void 0x0?{}:{'signal':_0x41c49[_0x4eefc5(0x15d)]}});return d(_0x306d14,_0x42c436),{'kind':_0x4eefc5(0x166),'unitId':_0x579d63,'unitType':_0x4eefc5(0x16d),'coverage':{'pages':_0x42c436,'rules':c},'findings':f(_0x306d14)};}};}function u(_0x190aad,_0x4a3110){const _0x5bfc52=_0x4037ef;if(_0x190aad[_0x5bfc52(0x17c)]===0x0)throw new e(_0x5bfc52(0x18d),'Slide\x20has\x20no\x20pages\x20to\x20lint');if(_0x4a3110!==void 0x0&&_0x4a3110[_0x5bfc52(0x17c)]===0x0)throw new e(_0x5bfc52(0x18d),_0x5bfc52(0x18f));let _0x53a22c=_0x4a3110??_0x190aad['map']((_0x287f86,_0x4ec611)=>_0x4ec611+0x1),_0x1adbac=new Set(),_0x5e61b5=[];for(let _0x3b158f of _0x53a22c){let _0x24110e=typeof _0x3b158f=='number'?_0x3b158f:_0x190aad[_0x5bfc52(0x17b)](_0x464c7d=>_0x464c7d===_0x3b158f)+0x1;if(!Number[_0x5bfc52(0x195)](_0x24110e)||_0x24110e<0x1||_0x24110e>_0x190aad[_0x5bfc52(0x17c)])throw new e(_0x5bfc52(0x18d),'Slide\x20page\x20selector\x20is\x20invalid:\x20'+String(_0x3b158f));let _0x1a326c=_0x190aad[_0x24110e-0x1];_0x1adbac[_0x5bfc52(0x169)](_0x1a326c)||(_0x1adbac[_0x5bfc52(0x1a7)](_0x1a326c),_0x5e61b5[_0x5bfc52(0x164)]({'page':_0x24110e,'pageId':_0x1a326c}));}return _0x5e61b5;}function d(_0xd6c6ce,_0x3c96e1){const _0x319ec1=_0x4037ef;let _0x4891aa=new Map();for(let _0x3a29cd of _0xd6c6ce['pages']){let _0xc8d074=_0x4891aa[_0x319ec1(0x1ae)](_0x3a29cd[_0x319ec1(0x15c)])??[];_0xc8d074[_0x319ec1(0x164)](_0x3a29cd),_0x4891aa[_0x319ec1(0x1a0)](_0x3a29cd['pageId'],_0xc8d074);}for(let _0x133b9b of _0x3c96e1){let _0x28dc2c=_0x4891aa[_0x319ec1(0x1ae)](_0x133b9b[_0x319ec1(0x15c)])??[];if(_0x28dc2c[_0x319ec1(0x17c)]!==0x1||_0x28dc2c[0x0]?.[_0x319ec1(0x197)]!==_0x133b9b['page'])throw new e('INVALID_RENDER_RESULT',_0x319ec1(0x178)+_0x133b9b[_0x319ec1(0x15c)]);let _0x43b09c=_0x28dc2c[0x0][_0x319ec1(0x1af)]['map'](({elementId:_0x1c318e})=>_0x1c318e);if(new Set(_0x43b09c)['size']!==_0x43b09c['length'])throw new e('INVALID_RENDER_RESULT',_0x319ec1(0x18e)+_0x133b9b[_0x319ec1(0x15c)]);}if(_0xd6c6ce[_0x319ec1(0x1b5)][_0x319ec1(0x17c)]!==_0x3c96e1['length'])throw new e(_0x319ec1(0x180),_0x319ec1(0x182));}function f(_0x2f6065){const _0x2ec414=_0x4037ef;let _0x4520be=[];for(let _0x49c629 of _0x2f6065[_0x2ec414(0x1b5)]){let _0x35e53c=_0x49c629[_0x2ec414(0x1af)][_0x2ec414(0x158)](_0xaec813=>!_0xaec813[_0x2ec414(0x16e)][_0x2ec414(0x175)](_0x2ec414(0x15e))),_0x184e07=_0x35e53c[_0x2ec414(0x158)](_0x2088de=>_0x2088de[_0x2ec414(0x1b2)]!==void 0x0&&_0x2088de[_0x2ec414(0x1b2)]['content']['trim']()!=='');for(let _0x2a5d71 of _0x184e07){let _0x5e7245=m(_0x2a5d71[_0x2ec414(0x1b2)]['ink']),_0xf573c1={..._0x5e7245[_0x2ec414(0x1a5)]<-0x2?{'left':_(-_0x5e7245[_0x2ec414(0x1a5)])}:{},..._0x5e7245[_0x2ec414(0x1a3)]<-0x2?{'top':_(-_0x5e7245[_0x2ec414(0x1a3)])}:{},..._0x5e7245[_0x2ec414(0x1b3)]>_0x49c629['pageWidth']+n?{'right':_(_0x5e7245[_0x2ec414(0x1b3)]-_0x49c629['pageWidth'])}:{},..._0x5e7245[_0x2ec414(0x176)]>_0x49c629[_0x2ec414(0x196)]+n?{'bottom':_(_0x5e7245['bottom']-_0x49c629[_0x2ec414(0x196)])}:{}},_0x21da8c=D(_0xf573c1);if(_0x21da8c!=='-'){let _0x5727a3=b(_0x2a5d71),_0x5f9ad2=y({'left':0x0,'top':0x0,'width':_0x49c629[_0x2ec414(0x15a)],'height':_0x49c629[_0x2ec414(0x196)]});_0x4520be[_0x2ec414(0x164)](p({'page':_0x49c629[_0x2ec414(0x197)],'pageId':_0x49c629[_0x2ec414(0x15c)],'rule':_0x2ec414(0x16a),'id':_0x2a5d71[_0x2ec414(0x16e)],'text':_0x5727a3,'pageBox':_0x5f9ad2,'overflow':_0xf573c1,'detail':_0x2ec414(0x159)+v(_0x5727a3[_0x2ec414(0x177)])+_0x2ec414(0x179)+_0x21da8c+_0x2ec414(0x18c)+w(_0x5727a3[_0x2ec414(0x16c)])+_0x2ec414(0x189)+w(_0x5f9ad2)}));}}for(let _0x4c99d3 of _0x184e07){let _0x407d51=E(_0x4c99d3,_0x35e53c,_0x49c629);if(_0x407d51===void 0x0)continue;let _0x2376d0=m(_0x4c99d3[_0x2ec414(0x1b2)]['ink']),_0x164536=m(_0x407d51[_0x2ec414(0x1a8)]),_0x1bb2f1=Math[_0x2ec414(0x198)](r,i*(_0x164536[_0x2ec414(0x1b3)]-_0x164536[_0x2ec414(0x1a5)])),_0x493c40={..._0x164536[_0x2ec414(0x1a5)]-_0x2376d0['left']>_0x1bb2f1?{'left':_(_0x164536[_0x2ec414(0x1a5)]-_0x2376d0[_0x2ec414(0x1a5)])}:{},..._0x2376d0[_0x2ec414(0x1b3)]-_0x164536[_0x2ec414(0x1b3)]>_0x1bb2f1?{'right':_(_0x2376d0[_0x2ec414(0x1b3)]-_0x164536[_0x2ec414(0x1b3)])}:{},..._0x2376d0[_0x2ec414(0x176)]-_0x164536[_0x2ec414(0x176)]>_0x1bb2f1?{'bottom':_(_0x2376d0[_0x2ec414(0x176)]-_0x164536[_0x2ec414(0x176)])}:{}},_0x329524=D(_0x493c40);if(_0x329524!=='-'){let _0x4a04c3=b(_0x4c99d3),_0x581e94=S(_0x407d51);_0x4520be['push'](p({'page':_0x49c629['page'],'pageId':_0x49c629['pageId'],'rule':_0x2ec414(0x160),'id':_0x4c99d3[_0x2ec414(0x16e)],'related':_0x407d51['elementId'],'text':_0x4a04c3,'container':_0x581e94,'overflow':_0x493c40,'detail':_0x2ec414(0x159)+v(_0x4a04c3[_0x2ec414(0x177)])+_0x2ec414(0x188)+_0x581e94['id']+'\x20('+_0x329524+_0x2ec414(0x18c)+w(_0x4a04c3[_0x2ec414(0x16c)])+',\x20'+_0x581e94['id']+'\x20=\x20'+_0x581e94[_0x2ec414(0x194)]+'\x20'+C(_0x581e94['fill'])+'\x20'+w(_0x581e94[_0x2ec414(0x1b6)])}));}}for(let _0x4e28b4=0x0;_0x4e28b4<_0x184e07['length'];_0x4e28b4+=0x1)for(let _0x5c13a9=_0x4e28b4+0x1;_0x5c13a9<_0x184e07[_0x2ec414(0x17c)];_0x5c13a9+=0x1){let _0x502e27=_0x184e07[_0x4e28b4],_0x428d1e=_0x184e07[_0x5c13a9],_0x58faa6=m(_0x502e27[_0x2ec414(0x1b2)][_0x2ec414(0x16c)]),_0x3209b7=m(_0x428d1e[_0x2ec414(0x1b2)][_0x2ec414(0x16c)]),_0x366fce=h(g(_0x58faa6,_0x3209b7));if(_0x366fce<=0x1)continue;let _0x199e68=_0x366fce/Math['max'](0x1,Math[_0x2ec414(0x17e)](h(_0x58faa6),h(_0x3209b7)));if(_0x199e68<=a)continue;let _0x597a97=b(_0x502e27),_0x4f8de0=b(_0x428d1e);_0x4520be[_0x2ec414(0x164)](p({'page':_0x49c629[_0x2ec414(0x197)],'pageId':_0x49c629[_0x2ec414(0x15c)],'rule':'text-overlaps-text','id':_0x502e27[_0x2ec414(0x16e)],'related':_0x428d1e[_0x2ec414(0x16e)],'text':_0x597a97,'other':_0x4f8de0,'overlapRatio':Math['round'](_0x199e68*0x64)/0x64,'detail':_0x2ec414(0x159)+v(_0x597a97[_0x2ec414(0x177)])+'\x22'+x(_0x597a97)+_0x2ec414(0x1a2)+v(_0x4f8de0[_0x2ec414(0x177)])+'\x22'+x(_0x4f8de0)+_0x2ec414(0x15b)+Math[_0x2ec414(0x1a6)](_0x199e68*0x64)+_0x2ec414(0x19e)+w(_0x597a97['ink'])+',\x20'+w(_0x4f8de0[_0x2ec414(0x16c)])}));}}return _0x4520be[_0x2ec414(0x170)]((_0x234939,_0x126d97)=>_0x234939[_0x2ec414(0x190)]['localeCompare'](_0x126d97[_0x2ec414(0x190)]));}function p(_0x16de96){const _0x217d0b=_0x4037ef;return{..._0x16de96,'fingerprint':[_0x16de96[_0x217d0b(0x19a)],_0x16de96[_0x217d0b(0x15c)],_0x16de96['id'],_0x16de96['related']??''][_0x217d0b(0x173)](':'),'severity':_0x217d0b(0x17a)};}function m(_0x539211){const _0x4a33f6=_0x4037ef;return{'left':_0x539211[_0x4a33f6(0x1a5)],'top':_0x539211[_0x4a33f6(0x1a3)],'right':_0x539211[_0x4a33f6(0x1a5)]+_0x539211[_0x4a33f6(0x15f)],'bottom':_0x539211[_0x4a33f6(0x1a3)]+_0x539211[_0x4a33f6(0x174)]};}function h(_0xdf5e1){const _0x96f3bd=_0x4037ef;return Math[_0x96f3bd(0x198)](0x0,_0xdf5e1[_0x96f3bd(0x1b3)]-_0xdf5e1[_0x96f3bd(0x1a5)])*Math[_0x96f3bd(0x198)](0x0,_0xdf5e1[_0x96f3bd(0x176)]-_0xdf5e1[_0x96f3bd(0x1a3)]);}function g(_0x5f3d22,_0x351e29){const _0x598d38=_0x4037ef;return{'left':Math[_0x598d38(0x198)](_0x5f3d22[_0x598d38(0x1a5)],_0x351e29[_0x598d38(0x1a5)]),'top':Math['max'](_0x5f3d22['top'],_0x351e29[_0x598d38(0x1a3)]),'right':Math[_0x598d38(0x17e)](_0x5f3d22[_0x598d38(0x1b3)],_0x351e29[_0x598d38(0x1b3)]),'bottom':Math['min'](_0x5f3d22[_0x598d38(0x176)],_0x351e29[_0x598d38(0x176)])};}function _(_0x560feb){return Math['round'](_0x560feb);}function v(_0x37a956){const _0x399da2=_0x4037ef;let _0x2f53e1=_0x37a956[_0x399da2(0x1aa)](/\s+/gu,'\x20')[_0x399da2(0x161)]();return _0x2f53e1['length']<=0x10?_0x2f53e1:_0x2f53e1[_0x399da2(0x18a)](0x0,0x10)+'…';}function _0x48af(){const _0x4a5586=['round','add','declared','slideOrder','replace','area','opacity','2276211FjmpSe','get','elements','top\x20','runtime','text','right','text-overlaps-text','pages','box','758994EozBxi','filter','text\x20\x22','pageWidth','\x20by\x20','pageId','signal','layout:','width','text-escapes-container','trim','UnitLayoutLintError','roundRect','push','\x20\x20opacity\x20','unit-layout-lint','1554vkrsRn','right\x20','has','text-off-page','5BJtbGo','ink','slide','elementId','map','sort','84556EPqGKJ','unitType','join','height','startsWith','bottom','content','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20','\x22\x20runs\x20off\x20the\x20page\x20(','warning','findIndex','length','1024262mPmeic','min','formulaReferenceUnits','INVALID_RENDER_RESULT','2432SQnWsE','Render\x20result\x20contains\x20unrequested\x20Slide\x20pages','rect','zIndex','Slide\x20unitData.id\x20is\x20required','string','12012102VwfFeX','\x22\x20escapes\x20',',\x20page\x20','slice','code',');\x20ink\x20','INVALID_INPUT','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20','pages\x20must\x20not\x20be\x20empty','fingerprint','left\x20','elementType','shapeType','type','isInteger','pageHeight','page','max','none','rule','4220936ZxPDCY','fill','visible','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20','color','set','captureSlideLayout','\x20overlaps\x20\x22','top','unitData','left'];_0x48af=function(){return _0x4a5586;};return _0x48af();}function y(_0x640070){const _0x5083c=_0x4037ef;return{'left':_(_0x640070['left']),'top':_(_0x640070[_0x5083c(0x1a3)]),'width':_(_0x640070[_0x5083c(0x15f)]),'height':_(_0x640070[_0x5083c(0x174)])};}function b(_0x20aea8){const _0x53ab31=_0x4037ef;let _0x33ab42=_0x20aea8[_0x53ab31(0x1b2)];return{'id':_0x20aea8['elementId'],'content':_0x33ab42[_0x53ab31(0x177)],'ink':y(_0x33ab42[_0x53ab31(0x16c)]),..._0x33ab42[_0x53ab31(0x19f)]===void 0x0?{}:{'color':_0x33ab42[_0x53ab31(0x19f)]},..._0x33ab42[_0x53ab31(0x1ac)]===void 0x0?{}:{'opacity':_0x33ab42['opacity']}};}function x(_0x4f3d61){const _0x522e61=_0x4037ef;return _0x4f3d61['color']===void 0x0&&_0x4f3d61[_0x522e61(0x1ac)]===void 0x0?'':''+(_0x4f3d61['color']===void 0x0?'':'\x20\x20'+_0x4f3d61[_0x522e61(0x19f)])+(_0x4f3d61[_0x522e61(0x1ac)]===void 0x0?'':_0x522e61(0x165)+_0x4f3d61['opacity']);}function S(_0x1d061c){const _0x1732f9=_0x4037ef;return{'id':_0x1d061c[_0x1732f9(0x16e)],'type':_0x1d061c[_0x1732f9(0x193)]===void 0x0?_0x1d061c['elementType']:_0x1d061c[_0x1732f9(0x192)]+':'+_0x1d061c[_0x1732f9(0x193)],..._0x1d061c[_0x1732f9(0x19c)]===void 0x0?{}:{'fill':_0x1d061c['fill']},'box':y(_0x1d061c[_0x1732f9(0x1a8)])};}function C(_0x139055){const _0x125e11=_0x4037ef;if(_0x139055===void 0x0)return'no\x20fill';let _0x3298e0=_0x139055[_0x125e11(0x1ac)]===void 0x0||_0x139055['opacity']===0x1?'':'\x20@'+_0x139055[_0x125e11(0x1ac)];return((_0x139055[_0x125e11(0x194)]??'?')+'\x20'+(_0x139055[_0x125e11(0x19f)]??'')+_0x3298e0)['trim']();}function w(_0x39c893){const _0x1ca126=_0x4037ef;return'('+_0x39c893['left']+','+_0x39c893[_0x1ca126(0x1a3)]+'\x20'+_0x39c893['width']+'×'+_0x39c893[_0x1ca126(0x174)]+')';}function _0x8b3d(_0xdc88d4,_0x288875){_0xdc88d4=_0xdc88d4-0x158;const _0x48af68=_0x48af();let _0x8b3d6=_0x48af68[_0xdc88d4];return _0x8b3d6;}function T(_0x1cd1f6){const _0x2711df=_0x4037ef;let _0x15b026=_0x1cd1f6[_0x2711df(0x19c)];return!(_0x15b026===void 0x0||_0x15b026[_0x2711df(0x194)]===_0x2711df(0x199)||_0x15b026[_0x2711df(0x1ac)]!==void 0x0&&_0x15b026[_0x2711df(0x1ac)]<o||_0x1cd1f6[_0x2711df(0x193)]===void 0x0||!s['has'](_0x1cd1f6['shapeType'])||_0x1cd1f6[_0x2711df(0x19d)]===!0x1);}function E(_0x4e1f48,_0x4ab562,_0x45223e){const _0x636423=_0x4037ef;let _0xcb77e2=m(_0x4e1f48['text'][_0x636423(0x16c)]),_0x5130c9;for(let _0xd67824 of _0x4ab562){if(_0xd67824[_0x636423(0x184)]>=_0x4e1f48['zIndex']||!T(_0xd67824))continue;let _0x59bfc3=m(_0xd67824['declared']),_0xccae15=h(_0x59bfc3);if(_0xccae15>=0.5*_0x45223e[_0x636423(0x15a)]*_0x45223e[_0x636423(0x196)])continue;let _0x392b55=_0xcb77e2[_0x636423(0x1a3)]>=_0x59bfc3[_0x636423(0x1a3)]-n&&_0xcb77e2['bottom']<=_0x59bfc3['bottom']+n,_0x21e857=_0xcb77e2[_0x636423(0x1a5)]>=_0x59bfc3[_0x636423(0x1a5)]-n&&_0xcb77e2['left']<=_0x59bfc3['right']+n&&_0xcb77e2[_0x636423(0x1a3)]>=_0x59bfc3['top']-n,_0x10e002=h(g(_0xcb77e2,_0x59bfc3))/Math[_0x636423(0x198)](h(_0xcb77e2),0x1);!_0x392b55||!_0x21e857||_0x10e002<0.35||(_0x5130c9===void 0x0||_0xccae15<_0x5130c9[_0x636423(0x1ab)])&&(_0x5130c9={'element':_0xd67824,'area':_0xccae15});}return _0x5130c9?.['element'];}function D(_0x4d3927){const _0x4f658a=_0x4037ef;let _0x3fa086=[_0x4d3927['left']===void 0x0?'':_0x4f658a(0x191)+_0x4d3927['left']+'px',_0x4d3927['top']===void 0x0?'':_0x4f658a(0x1b0)+_0x4d3927[_0x4f658a(0x1a3)]+'px',_0x4d3927['right']===void 0x0?'':_0x4f658a(0x168)+_0x4d3927[_0x4f658a(0x1b3)]+'px',_0x4d3927[_0x4f658a(0x176)]===void 0x0?'':'bottom\x20'+_0x4d3927[_0x4f658a(0x176)]+'px'][_0x4f658a(0x158)](_0x350f7d=>_0x350f7d!=='');return _0x3fa086[_0x4f658a(0x17c)]===0x0?'-':_0x3fa086[_0x4f658a(0x173)](',\x20');}function O(_0x15c5a7){const _0x3de663=_0x4037ef;if(typeof _0x15c5a7!=_0x3de663(0x186)||_0x15c5a7[_0x3de663(0x161)]()==='')throw new e(_0x3de663(0x18d),_0x3de663(0x185));return _0x15c5a7;}export{e as UnitLayoutLintError,l as createUnitLayoutLint,t as isUnitLayoutLintError};
|
|
1
|
+
const _0x191bdf=_0x4cb0;(function(_0x3370e1,_0x5bf934){const _0x371602=_0x4cb0,_0x2f0d84=_0x3370e1();while(!![]){try{const _0x29364c=-parseInt(_0x371602(0x194))/0x1*(parseInt(_0x371602(0x13e))/0x2)+parseInt(_0x371602(0x1ab))/0x3*(parseInt(_0x371602(0x1eb))/0x4)+parseInt(_0x371602(0x1f1))/0x5*(-parseInt(_0x371602(0x13c))/0x6)+-parseInt(_0x371602(0x148))/0x7*(parseInt(_0x371602(0x18c))/0x8)+-parseInt(_0x371602(0x149))/0x9+parseInt(_0x371602(0x159))/0xa*(-parseInt(_0x371602(0x14d))/0xb)+-parseInt(_0x371602(0x154))/0xc*(-parseInt(_0x371602(0x144))/0xd);if(_0x29364c===_0x5bf934)break;else _0x2f0d84['push'](_0x2f0d84['shift']());}catch(_0x4118af){_0x2f0d84['push'](_0x2f0d84['shift']());}}}(_0x44db,0xd99cf));import{createHash as _0x294883}from'node:crypto';var t=class extends Error{['code'];constructor(_0xd48637,_0x18bc60,_0x26260d){const _0x35eb70=_0x4cb0;super(_0x18bc60,_0x26260d),this[_0x35eb70(0x1e1)]=_0x35eb70(0x140),this[_0x35eb70(0x1e4)]=_0xd48637;}};function n(_0xfcc5fe){return _0xfcc5fe instanceof t;}async function r(_0x5888e8,_0x2b25f2){const _0x5be19b=_0x4cb0;if(typeof _0x5888e8['unitData']['id']!='string'||_0x5888e8['unitData']['id'][_0x5be19b(0x1e5)]()==='')throw new t(_0x5be19b(0x17f),_0x5be19b(0x1ea));let _0x4e250b=_0x5888e8[_0x5be19b(0x186)]??_0x5be19b(0x195);if(_0x4e250b!==_0x5be19b(0x15a)&&_0x4e250b!==_0x5be19b(0x1f9)&&_0x4e250b!=='both')throw new t(_0x5be19b(0x17f),'Board\x20mode\x20must\x20be\x20model,\x20rendered,\x20or\x20both');if(_0x5888e8['layoutPlan']!==void 0x0&&(_0x4e250b===_0x5be19b(0x15a)||_0x5888e8[_0x5be19b(0x189)]||_0x5888e8[_0x5be19b(0x14a)]||_0x5888e8['textPlanElementIds']!==void 0x0))throw new t(_0x5be19b(0x17f),_0x5be19b(0x17b));if(_0x5888e8[_0x5be19b(0x189)]===!0x0&&_0x4e250b==='model')throw new t(_0x5be19b(0x17f),'Label\x20plans\x20require\x20rendered\x20Board\x20analysis');if(_0x5888e8[_0x5be19b(0x14a)]===!0x0&&_0x4e250b==='model')throw new t(_0x5be19b(0x17f),_0x5be19b(0x1aa));if(_0x5888e8['textPlanElementIds']!==void 0x0&&_0x4e250b==='model')throw new t(_0x5be19b(0x17f),'Text\x20plans\x20require\x20rendered\x20Board\x20analysis');let _0x34c63d=_0x5888e8['maximumAutomaticLabelDistance'];if(_0x34c63d!==void 0x0&&!l(_0x34c63d))throw new t(_0x5be19b(0x17f),_0x5be19b(0x1b9));if(_0x34c63d!==void 0x0&&_0x4e250b===_0x5be19b(0x15a))throw new t(_0x5be19b(0x17f),_0x5be19b(0x16c));let _0x485f95=_0x5888e8[_0x5be19b(0x1da)][_0x5be19b(0x127)];if(!Array[_0x5be19b(0x158)](_0x485f95)||_0x485f95[_0x5be19b(0x19b)]===0x0||new Set(_0x485f95)[_0x5be19b(0x13f)]!==_0x485f95[_0x5be19b(0x19b)])throw new t(_0x5be19b(0x17f),_0x5be19b(0x193));if(_0x5888e8[_0x5be19b(0x17e)]?.[_0x5be19b(0x19b)]===0x0)throw new t(_0x5be19b(0x17f),'pages\x20must\x20not\x20be\x20empty');let _0x3ce50a=[...new Set((_0x5888e8[_0x5be19b(0x17e)]??_0x485f95)[_0x5be19b(0x1f2)](_0x21dccc=>{const _0x2dc105=_0x5be19b;let _0x3da968=typeof _0x21dccc==_0x2dc105(0x172)?_0x21dccc-0x1:_0x485f95[_0x2dc105(0x18b)](_0x21dccc),_0x39e72e=_0x485f95[_0x3da968];if(!Number[_0x2dc105(0x1c1)](_0x3da968)||_0x3da968<0x0||_0x39e72e===void 0x0||!_0x5888e8[_0x2dc105(0x1da)][_0x2dc105(0x17e)][_0x39e72e])throw new t(_0x2dc105(0x17f),'Board\x20page\x20selector\x20is\x20invalid:\x20'+String(_0x21dccc));return _0x39e72e;}))]['map'](_0x11dd14=>({'page':_0x485f95['indexOf'](_0x11dd14)+0x1,'pageId':_0x11dd14})),_0x35e37b=_0x5888e8['textPlanElementIds'];if(_0x35e37b!==void 0x0&&(!Array[_0x5be19b(0x158)](_0x35e37b)||_0x35e37b[_0x5be19b(0x1fb)](_0x4e521e=>typeof _0x4e521e!=_0x5be19b(0x12a)||_0x4e521e[_0x5be19b(0x1e5)]()==='')||new Set(_0x35e37b)[_0x5be19b(0x13f)]!==_0x35e37b[_0x5be19b(0x19b)]||_0x35e37b['some'](_0x5d609d=>!_0x3ce50a[_0x5be19b(0x1fb)](({pageId:_0x24b538})=>_0x5888e8[_0x5be19b(0x1da)][_0x5be19b(0x17e)][_0x24b538]?.[_0x5be19b(0x146)][_0x5d609d]?.[_0x5be19b(0x1d7)]===_0x5be19b(0x1bd)))))throw new t(_0x5be19b(0x17f),_0x5be19b(0x1af));let _0x4ae16c=_0x5888e8[_0x5be19b(0x1df)];if(_0x4ae16c!==void 0x0&&(!Number['isFinite'](_0x4ae16c)||_0x4ae16c<0x1||_0x4ae16c>0x2||!_0x35e37b?.['length']))throw new t('INVALID_INPUT','textPlanMaximumWidthGrowth\x20requires\x20selected\x20shape\x20IDs\x20and\x20a\x20finite\x20number\x20from\x201\x20to\x202');let _0x438492=structuredClone({'unitType':_0x5888e8[_0x5be19b(0x1fa)],'unitData':_0x5888e8[_0x5be19b(0x1da)],..._0x5888e8[_0x5be19b(0x168)]===void 0x0?{}:{'formulaReferenceUnits':_0x5888e8[_0x5be19b(0x168)]},..._0x5888e8[_0x5be19b(0x123)]===void 0x0?{}:{'embeddedUnits':_0x5888e8[_0x5be19b(0x123)]},'pages':_0x3ce50a[_0x5be19b(0x1f2)](({pageId:_0x4dfa5a})=>_0x4dfa5a),'focusPadding':0x30,..._0x34c63d===void 0x0?{}:{'maximumAutomaticLabelDistance':_0x34c63d},..._0x5888e8[_0x5be19b(0x139)]===void 0x0?{}:{'layoutPlan':_0x5888e8['layoutPlan']},..._0x5888e8[_0x5be19b(0x189)]===!0x0?{'includeLabelPlan':!0x0}:{},..._0x5888e8[_0x5be19b(0x14a)]===!0x0?{'includePortPlan':!0x0}:{},..._0x35e37b===void 0x0?{}:{'textPlanElementIds':_0x35e37b},..._0x4ae16c===void 0x0?{}:{'textPlanMaximumWidthGrowth':_0x4ae16c}}),_0x5b58b8=_0x294883(_0x5be19b(0x16a))[_0x5be19b(0x135)](JSON['stringify'](_0x438492))[_0x5be19b(0x14f)](_0x5be19b(0x1d6)),_0x2cb861=_0x4e250b===_0x5be19b(0x195)?['model','rendered']:[_0x4e250b],_0x31628e=[],_0x39fd4d=_0x3ce50a[_0x5be19b(0x1f2)](_0x2c1ffd=>({..._0x2c1ffd})),_0x18f1dc=[];for(let _0x474754 of _0x2cb861){_0x5888e8['signal']?.[_0x5be19b(0x138)]();let _0x5095ba=_0x474754===_0x5be19b(0x15a)?_0x2b25f2[_0x5be19b(0x1ec)]?.[_0x5be19b(0x160)][_0x5be19b(0x14e)](_0x2b25f2[_0x5be19b(0x1ec)]):_0x2b25f2[_0x5be19b(0x150)]!==void 0x0&&'captureBoardLayout'in _0x2b25f2[_0x5be19b(0x150)]?_0x2b25f2[_0x5be19b(0x150)][_0x5be19b(0x1b2)][_0x5be19b(0x14e)](_0x2b25f2['runtime']):void 0x0;if(_0x5095ba===void 0x0){for(let {pageId:_0x1ced7a}of _0x3ce50a)_0x31628e[_0x5be19b(0x152)]({'pageId':_0x1ced7a,'source':_0x474754,'reason':_0x5be19b(0x145)});continue;}let _0x54819d=structuredClone(_0x438492);_0x474754===_0x5be19b(0x15a)&&(delete _0x54819d[_0x5be19b(0x14a)],delete _0x54819d[_0x5be19b(0x139)],delete _0x54819d[_0x5be19b(0x1bc)],delete _0x54819d[_0x5be19b(0x1fe)],delete _0x54819d[_0x5be19b(0x1df)]);let _0x1e0d2f=await _0x5095ba({..._0x54819d,..._0x5888e8[_0x5be19b(0x157)]===void 0x0?{}:{'signal':_0x5888e8['signal']}});_0x5888e8[_0x5be19b(0x157)]?.[_0x5be19b(0x138)](),i(_0x1e0d2f,_0x3ce50a[_0x5be19b(0x1f2)](({pageId:_0x3a12ad})=>_0x3a12ad),_0x474754);for(let _0x2654c9 of _0x39fd4d){let _0x3900f8=_0x1e0d2f[_0x5be19b(0x17e)][_0x5be19b(0x147)](({pageId:_0x2a2a78})=>_0x2a2a78===_0x2654c9['pageId']),_0x577574=_0x3900f8?.[_0x5be19b(0x1e9)];if(_0x577574===void 0x0){_0x31628e[_0x5be19b(0x152)]({'pageId':_0x2654c9[_0x5be19b(0x1e0)],'source':_0x474754,'reason':_0x5be19b(0x133)});continue;}if(_0x2654c9[_0x474754]=_0x577574,_0x474754===_0x5be19b(0x1f9)&&_0x34c63d!==void 0x0&&!d(_0x577574,_0x34c63d,_0x438492['unitData'][_0x5be19b(0x17e)][_0x2654c9['pageId']][_0x5be19b(0x146)])&&_0x31628e['push']({'pageId':_0x2654c9[_0x5be19b(0x1e0)],'source':_0x474754,'reason':'automatic-label-distance-unavailable'}),_0x474754===_0x5be19b(0x1f9)&&_0x438492[_0x5be19b(0x139)]!==void 0x0){let _0x32fb2c=_0x3900f8?.['plan'];if(_0x32fb2c===void 0x0)_0x31628e[_0x5be19b(0x152)]({'pageId':_0x2654c9[_0x5be19b(0x1e0)],'source':_0x474754,'reason':_0x5be19b(0x15b)});else{if(!a(_0x32fb2c)||_0x32fb2c[_0x5be19b(0x165)]!==_0x5888e8[_0x5be19b(0x1da)]['id']||_0x32fb2c[_0x5be19b(0x1e0)]!==_0x2654c9[_0x5be19b(0x1e0)]||_0x32fb2c[_0x5be19b(0x1f0)]!==_0x5be19b(0x13b)&&_0x32fb2c[_0x5be19b(0x1f0)]!==_0x5be19b(0x180)||!Array[_0x5be19b(0x158)](_0x32fb2c[_0x5be19b(0x1f7)])||!Array[_0x5be19b(0x158)](_0x32fb2c[_0x5be19b(0x202)])||!Array[_0x5be19b(0x158)](_0x32fb2c['diagnostics']))throw new t('INVALID_RENDER_RESULT','Layout\x20plan\x20has\x20an\x20unexpected\x20Unit,\x20page,\x20status\x20or\x20payload');_0x2654c9['plan']=_0x32fb2c,_0x32fb2c[_0x5be19b(0x1f0)]==='incomplete'&&_0x31628e['push']({'pageId':_0x2654c9[_0x5be19b(0x1e0)],'source':_0x474754,'reason':_0x5be19b(0x174)});}}if(_0x474754===_0x5be19b(0x1f9)&&_0x5888e8[_0x5be19b(0x189)]===!0x0){if(_0x3900f8?.[_0x5be19b(0x1b5)]===void 0x0)_0x31628e['push']({'pageId':_0x2654c9[_0x5be19b(0x1e0)],'source':_0x474754,'reason':_0x5be19b(0x15c)});else{if(_0x3900f8['labelPlan']['unitId']!==_0x5888e8[_0x5be19b(0x1da)]['id']||_0x3900f8['labelPlan']['pageId']!==_0x2654c9[_0x5be19b(0x1e0)])throw new t(_0x5be19b(0x1b4),_0x5be19b(0x1bb));_0x2654c9[_0x5be19b(0x1b5)]=_0x3900f8[_0x5be19b(0x1b5)];}}if(_0x474754===_0x5be19b(0x1f9)&&_0x5888e8['includePortPlan']===!0x0){if(_0x3900f8?.['portPlan']===void 0x0)_0x31628e['push']({'pageId':_0x2654c9['pageId'],'source':_0x474754,'reason':_0x5be19b(0x1ff)});else{if(_0x3900f8[_0x5be19b(0x1c9)][_0x5be19b(0x165)]!==_0x5888e8[_0x5be19b(0x1da)]['id']||_0x3900f8[_0x5be19b(0x1c9)][_0x5be19b(0x1e0)]!==_0x2654c9[_0x5be19b(0x1e0)]||_0x3900f8[_0x5be19b(0x1c9)][_0x5be19b(0x1f0)]!==_0x5be19b(0x13b)&&_0x3900f8[_0x5be19b(0x1c9)][_0x5be19b(0x1f0)]!==_0x5be19b(0x180))throw new t(_0x5be19b(0x1b4),'Port\x20plan\x20has\x20an\x20unexpected\x20Unit,\x20page\x20or\x20status');_0x2654c9[_0x5be19b(0x1c9)]=_0x3900f8[_0x5be19b(0x1c9)],_0x3900f8['portPlan']['status']===_0x5be19b(0x180)&&_0x31628e['push']({'pageId':_0x2654c9['pageId'],'source':_0x474754,'reason':_0x5be19b(0x1ba)});}}_0x474754===_0x5be19b(0x1f9)&&_0x438492[_0x5be19b(0x1fe)]!==void 0x0&&(_0x3900f8?.['textPlan']===void 0x0?_0x31628e[_0x5be19b(0x152)]({'pageId':_0x2654c9['pageId'],'source':_0x474754,'reason':_0x5be19b(0x1b8)}):(f(_0x3900f8[_0x5be19b(0x162)],_0x5888e8[_0x5be19b(0x1da)]['id'],_0x2654c9[_0x5be19b(0x1e0)],_0x438492[_0x5be19b(0x1fe)],_0x438492[_0x5be19b(0x1da)][_0x5be19b(0x17e)][_0x2654c9['pageId']][_0x5be19b(0x146)],_0x438492[_0x5be19b(0x1df)]),_0x2654c9[_0x5be19b(0x162)]=_0x3900f8[_0x5be19b(0x162)],_0x3900f8[_0x5be19b(0x162)][_0x5be19b(0x1f0)]===_0x5be19b(0x180)&&_0x31628e['push']({'pageId':_0x2654c9[_0x5be19b(0x1e0)],'source':_0x474754,'reason':_0x5be19b(0x15f)})));for(let _0x52033c of _0x577574[_0x5be19b(0x17d)])_0x18f1dc[_0x5be19b(0x152)]({..._0x52033c,'page':_0x2654c9[_0x5be19b(0x14b)],'pageId':_0x2654c9[_0x5be19b(0x1e0)],'source':_0x474754,'fingerprint':_0x474754+':'+_0x2654c9[_0x5be19b(0x1e0)]+':'+_0x52033c[_0x5be19b(0x19a)]+':'+_0x52033c['id']});}}for(let _0x454f27 of _0x39fd4d){let _0x396936=_0x4e250b===_0x5be19b(0x15a)?'model':'rendered',_0x53380f=_0x454f27[_0x396936];(_0x53380f?.['summary'][_0x5be19b(0x1cb)]||_0x53380f?.[_0x5be19b(0x128)][_0x5be19b(0x1fb)](_0x1aded7=>!_0x1aded7[_0x5be19b(0x19e)]))&&_0x31628e[_0x5be19b(0x152)]({'pageId':_0x454f27[_0x5be19b(0x1e0)],'source':_0x396936,'reason':_0x5be19b(0x14c)}),(_0x53380f?.[_0x5be19b(0x17d)][_0x5be19b(0x1fb)](_0x4347ca=>_0x4347ca[_0x5be19b(0x19a)]===_0x5be19b(0x16b))||Object[_0x5be19b(0x141)](_0x53380f?.[_0x5be19b(0x1ad)]??{})['some'](_0x271550=>Object[_0x5be19b(0x141)](_0x271550)[_0x5be19b(0x1fb)](_0x1676e4=>_0x1676e4['status']===_0x5be19b(0x143))))&&_0x31628e[_0x5be19b(0x152)]({'pageId':_0x454f27[_0x5be19b(0x1e0)],'source':_0x396936,'reason':_0x5be19b(0x125)}),_0x53380f?.[_0x5be19b(0x17d)][_0x5be19b(0x1fb)](_0x5f104b=>_0x5f104b[_0x5be19b(0x19a)]===_0x5be19b(0x1fc))&&_0x31628e['push']({'pageId':_0x454f27[_0x5be19b(0x1e0)],'source':_0x396936,'reason':_0x5be19b(0x1a3)});}return{'kind':_0x5be19b(0x132),'unitId':_0x5888e8[_0x5be19b(0x1da)]['id'],'unitType':_0x5be19b(0x203),'mode':_0x4e250b,'snapshotHash':_0x5b58b8,'status':_0x31628e[_0x5be19b(0x19b)]>0x0?_0x5be19b(0x180):_0x18f1dc[_0x5be19b(0x19b)]>0x0?_0x5be19b(0x19c):_0x5be19b(0x1e3),'coverage':{'pages':_0x3ce50a,'sources':_0x2cb861,'complete':_0x31628e[_0x5be19b(0x19b)]===0x0,'incomplete':_0x31628e,'limitations':_0x4e250b===_0x5be19b(0x15a)?[_0x5be19b(0x1db)]:_0x34c63d===void 0x0?[]:[_0x5be19b(0x142)]},'analyses':_0x39fd4d,'findings':_0x18f1dc};}function i(_0x239eda,_0x3402cd,_0x588a14){const _0x4575d8=_0x4cb0;let _0x4b8a5b=new Set();for(let _0x21b74d of _0x239eda[_0x4575d8(0x17e)]){if(!_0x3402cd[_0x4575d8(0x1c6)](_0x21b74d[_0x4575d8(0x1e0)])||_0x4b8a5b['has'](_0x21b74d[_0x4575d8(0x1e0)])||_0x21b74d[_0x4575d8(0x1e9)][_0x4575d8(0x18f)]!==_0x588a14)throw new t('INVALID_RENDER_RESULT','Board\x20capture\x20contains\x20an\x20unexpected\x20page,\x20duplicate\x20page,\x20or\x20source');_0x4b8a5b[_0x4575d8(0x1d3)](_0x21b74d['pageId']);let {errorCount:_0x293e70,warningCount:_0x2cb189,unresolvedConnectorCount:_0x188258}=_0x21b74d['analysis']['summary'];if([_0x293e70,_0x2cb189,_0x188258][_0x4575d8(0x1fb)](_0x29a732=>!Number[_0x4575d8(0x200)](_0x29a732)||_0x29a732<0x0))throw new t(_0x4575d8(0x1b4),_0x4575d8(0x1a7));if(_0x293e70!==_0x21b74d[_0x4575d8(0x1e9)][_0x4575d8(0x17d)][_0x4575d8(0x1d8)](({severity:_0x38e243})=>_0x38e243===_0x4575d8(0x1ca))[_0x4575d8(0x19b)]||_0x2cb189!==_0x21b74d['analysis'][_0x4575d8(0x17d)]['filter'](({severity:_0x26f597})=>_0x26f597==='warning')[_0x4575d8(0x19b)])throw new t('INVALID_RENDER_RESULT',_0x4575d8(0x16e));if(_0x21b74d['analysis'][_0x4575d8(0x1ad)]!==void 0x0&&!s(_0x21b74d[_0x4575d8(0x1e9)][_0x4575d8(0x1ad)]))throw new t('INVALID_RENDER_RESULT','Board\x20capture\x20contains\x20invalid\x20connector\x20label\x20measurements');if(_0x21b74d['analysis'][_0x4575d8(0x1b7)]!==void 0x0&&(!a(_0x21b74d[_0x4575d8(0x1e9)][_0x4575d8(0x1b7)])||!l(_0x21b74d[_0x4575d8(0x1e9)]['labelDistanceInspection'][_0x4575d8(0x1bc)])||_0x21b74d[_0x4575d8(0x1e9)][_0x4575d8(0x1b7)]['metric']!==_0x4575d8(0x185)))throw new t(_0x4575d8(0x1b4),_0x4575d8(0x1ae));for(let _0x263688 of _0x21b74d['analysis'][_0x4575d8(0x17d)]){if(_0x263688[_0x4575d8(0x124)]!==void 0x0&&(!a(_0x263688['labelDistance'])||!l(_0x263688[_0x4575d8(0x124)][_0x4575d8(0x164)])||!l(_0x263688[_0x4575d8(0x124)][_0x4575d8(0x1be)])))throw new t(_0x4575d8(0x1b4),_0x4575d8(0x192));if(_0x263688['tableRange']!==void 0x0){let _0x35ebb8=_0x263688['tableRange'];if(!_0x35ebb8||![_0x35ebb8[_0x4575d8(0x1c3)],_0x35ebb8[_0x4575d8(0x13a)],_0x35ebb8['startColumn'],_0x35ebb8[_0x4575d8(0x166)]][_0x4575d8(0x1c8)](_0x4d64ad=>Number[_0x4575d8(0x1c1)](_0x4d64ad)&&_0x4d64ad>=0x0)||_0x35ebb8['startRow']>_0x35ebb8[_0x4575d8(0x13a)]||_0x35ebb8[_0x4575d8(0x176)]>_0x35ebb8['endColumn'])throw new t('INVALID_RENDER_RESULT',_0x4575d8(0x1ef));}if(_0x263688[_0x4575d8(0x179)]!==void 0x0&&(!c(_0x263688[_0x4575d8(0x179)]?.[_0x4575d8(0x187)],!0x1)||!c(_0x263688[_0x4575d8(0x179)]?.['contentSize'],!0x0)))throw new t('INVALID_RENDER_RESULT',_0x4575d8(0x190));}}}function a(_0x36cc25){const _0x57364d=_0x4cb0;if(!_0x36cc25||typeof _0x36cc25!=_0x57364d(0x1a0)||Array['isArray'](_0x36cc25))return!0x1;let _0x2d2d9a=Object[_0x57364d(0x175)](_0x36cc25);return _0x2d2d9a===Object[_0x57364d(0x19d)]||_0x2d2d9a===null;}function o(_0x7f914f){const _0xa57a7a=_0x4cb0;return a(_0x7f914f)&&c(_0x7f914f,!0x0)&&[_0x7f914f[_0xa57a7a(0x1d1)],_0x7f914f['top']][_0xa57a7a(0x1c8)](_0xf65591=>typeof _0xf65591==_0xa57a7a(0x172)&&Number[_0xa57a7a(0x15e)](_0xf65591));}function s(_0xa31fd4){const _0x32f24b=_0x4cb0;if(!a(_0xa31fd4))return!0x1;for(let [_0x4d7be3,_0x52b1ff]of Object[_0x32f24b(0x1c7)](_0xa31fd4)){if(_0x4d7be3[_0x32f24b(0x1e5)]()===''||!a(_0x52b1ff))return!0x1;for(let [_0x283364,_0x98a206]of Object[_0x32f24b(0x1c7)](_0x52b1ff)){if(_0x283364[_0x32f24b(0x1e5)]()===''||!a(_0x98a206))return!0x1;if(_0x98a206[_0x32f24b(0x1f0)]===_0x32f24b(0x143)){if(Reflect[_0x32f24b(0x16d)](_0x98a206)[_0x32f24b(0x19b)]!==0x1||!Object[_0x32f24b(0x19d)]['hasOwnProperty'][_0x32f24b(0x1a4)](_0x98a206,_0x32f24b(0x1f0)))return!0x1;continue;}if(_0x98a206['status']!==_0x32f24b(0x13b)||_0x98a206[_0x32f24b(0x126)]!==void 0x0&&!u(_0x98a206[_0x32f24b(0x126)])||!o(_0x98a206['rect'])||!o(_0x98a206[_0x32f24b(0x153)])||typeof _0x98a206['angleRadians']!=_0x32f24b(0x172)||!Number[_0x32f24b(0x15e)](_0x98a206['angleRadians'])||!a(_0x98a206['outerSize'])||!c(_0x98a206[_0x32f24b(0x15d)],!0x0)||!a(_0x98a206['requiredSize'])||!c(_0x98a206['requiredSize'],!0x0)||![_0x98a206[_0x32f24b(0x1c2)],_0x98a206[_0x32f24b(0x18a)],_0x98a206[_0x32f24b(0x167)]][_0x32f24b(0x1c8)](_0x1fe530=>typeof _0x1fe530=='boolean'))return!0x1;}}return!0x0;}function _0x4cb0(_0x26ee8e,_0x15e0f0){_0x26ee8e=_0x26ee8e-0x123;const _0x44db37=_0x44db();let _0x4cb02a=_0x44db37[_0x26ee8e];return _0x4cb02a;}function c(_0x5db698,_0xe2ad34){const _0x17a8a0=_0x4cb0;if(!_0x5db698||typeof _0x5db698!=_0x17a8a0(0x1a0))return!0x1;let _0x1f0d57=_0x5db698;return[_0x1f0d57['width'],_0x1f0d57['height']]['every'](_0x116f9a=>typeof _0x116f9a=='number'&&Number[_0x17a8a0(0x15e)](_0x116f9a)&&(_0xe2ad34?_0x116f9a>=0x0:_0x116f9a>0x0));}function l(_0x2caa16){const _0x75834=_0x4cb0;return typeof _0x2caa16==_0x75834(0x172)&&Number[_0x75834(0x15e)](_0x2caa16)&&_0x2caa16>=0x0;}function u(_0x46eb12){const _0x238bbc=_0x4cb0;return a(_0x46eb12)?_0x46eb12['status']===_0x238bbc(0x13b)?l(_0x46eb12['distance']):_0x46eb12[_0x238bbc(0x1f0)]===_0x238bbc(0x1f5)?typeof _0x46eb12['reason']=='string'&&['empty',_0x238bbc(0x1c4),_0x238bbc(0x1ac)]['includes'](_0x46eb12[_0x238bbc(0x196)]):_0x46eb12[_0x238bbc(0x1f0)]===_0x238bbc(0x143)&&Reflect[_0x238bbc(0x16d)](_0x46eb12)[_0x238bbc(0x19b)]===0x1:!0x1;}function d(_0x5a1774,_0x1c2879,_0x3b8cd2){const _0x3b9ab4=_0x4cb0;let _0x408ba9=_0x5a1774['labelDistanceInspection'];if(_0x408ba9===void 0x0)return!0x1;if(_0x408ba9['maximumAutomaticLabelDistance']!==_0x1c2879)throw new t('INVALID_RENDER_RESULT',_0x3b9ab4(0x1dc));let _0xb5ee7e=_0x5a1774[_0x3b9ab4(0x1ad)];if(_0xb5ee7e===void 0x0)return!0x1;let _0x2bdd9b=!0x0;for(let _0x446f42 of _0x5a1774['routes']){let _0x28022e=_0x3b8cd2[_0x446f42[_0x3b9ab4(0x130)]];if(!(!_0x28022e||!(_0x3b9ab4(0x1d5)in _0x28022e))){for(let _0x6ccdbf of _0x28022e[_0x3b9ab4(0x1d5)]['labels']??[])Object[_0x3b9ab4(0x1ed)](_0xb5ee7e[_0x446f42[_0x3b9ab4(0x130)]]??{},_0x6ccdbf['id'])||(_0x2bdd9b=!0x1);}}for(let [_0x5e645e,_0x3a0dfd]of Object['entries'](_0xb5ee7e))for(let [_0x4b8d66,_0x1bd240]of Object[_0x3b9ab4(0x1c7)](_0x3a0dfd)){if(_0x1bd240[_0x3b9ab4(0x1f0)]==='unresolved'||_0x1bd240[_0x3b9ab4(0x126)]===void 0x0){_0x2bdd9b=!0x1;continue;}let _0x116c00=_0x1bd240['automaticLabelDistance'];if(_0x116c00[_0x3b9ab4(0x1f0)]===_0x3b9ab4(0x143)&&(_0x2bdd9b=!0x1),_0x116c00['status']===_0x3b9ab4(0x1f5)&&_0x116c00[_0x3b9ab4(0x196)]===_0x3b9ab4(0x1c2)!==_0x1bd240[_0x3b9ab4(0x1c2)]||_0x116c00[_0x3b9ab4(0x1f0)]===_0x3b9ab4(0x13b)&&_0x1bd240[_0x3b9ab4(0x1c2)])throw new t(_0x3b9ab4(0x1b4),_0x3b9ab4(0x17a));if(_0x116c00[_0x3b9ab4(0x1f0)]===_0x3b9ab4(0x13b)&&_0x116c00[_0x3b9ab4(0x163)]>_0x1c2879+0.001&&!_0x5a1774[_0x3b9ab4(0x17d)][_0x3b9ab4(0x1fb)](_0x13a427=>_0x13a427[_0x3b9ab4(0x19a)]===_0x3b9ab4(0x1a6)&&_0x13a427[_0x3b9ab4(0x1cd)]['includes'](_0x5e645e)&&_0x13a427[_0x3b9ab4(0x19f)]?.[_0x3b9ab4(0x1c6)](_0x4b8d66)))throw new t(_0x3b9ab4(0x1b4),_0x3b9ab4(0x134));}for(let _0x534119 of _0x5a1774[_0x3b9ab4(0x17d)]){if(_0x534119[_0x3b9ab4(0x19a)]!==_0x3b9ab4(0x1a6)&&_0x534119['rule']!==_0x3b9ab4(0x1dd))continue;let _0x4da561=_0x534119[_0x3b9ab4(0x1cd)][0x0],_0x55431a=_0x534119[_0x3b9ab4(0x19f)]?.[0x0],_0x4c7d42=_0x4da561&&_0x55431a?_0xb5ee7e[_0x4da561]?.[_0x55431a]:void 0x0,_0x1b7fc3=_0x4c7d42?.[_0x3b9ab4(0x1f0)]==='ready'?_0x4c7d42['automaticLabelDistance']:void 0x0,_0x3eb102=_0x534119[_0x3b9ab4(0x19a)]===_0x3b9ab4(0x1a6)?_0x1b7fc3?.[_0x3b9ab4(0x1f0)]===_0x3b9ab4(0x13b)&&_0x1b7fc3[_0x3b9ab4(0x163)]>_0x1c2879+0.001&&_0x534119[_0x3b9ab4(0x1d4)]===_0x3b9ab4(0x1ca)&&_0x534119[_0x3b9ab4(0x124)]?.[_0x3b9ab4(0x164)]===_0x1b7fc3[_0x3b9ab4(0x163)]&&_0x534119[_0x3b9ab4(0x124)]?.[_0x3b9ab4(0x1be)]===_0x1c2879:_0x1b7fc3?.[_0x3b9ab4(0x1f0)]==='unresolved'&&_0x534119['severity']===_0x3b9ab4(0x1a2)&&_0x534119[_0x3b9ab4(0x124)]===void 0x0;if(_0x534119[_0x3b9ab4(0x1cd)]['length']!==0x1||_0x534119['labelIds']?.[_0x3b9ab4(0x19b)]!==0x1||!_0x3eb102)throw new t(_0x3b9ab4(0x1b4),_0x3b9ab4(0x17c));}return _0x2bdd9b;}function f(_0xb3baf7,_0x40f4c4,_0x51d07b,_0x18117d,_0x31a064,_0xfcef3b){const _0x1bb227=_0x4cb0;let _0x3a299f=()=>{const _0xcd0aa7=_0x4cb0;throw new t(_0xcd0aa7(0x1b4),_0xcd0aa7(0x12d));};(!a(_0xb3baf7)||_0xb3baf7[_0x1bb227(0x165)]!==_0x40f4c4||_0xb3baf7[_0x1bb227(0x1e0)]!==_0x51d07b||_0xb3baf7[_0x1bb227(0x1f0)]!==_0x1bb227(0x13b)&&_0xb3baf7[_0x1bb227(0x1f0)]!==_0x1bb227(0x180)||!Array['isArray'](_0xb3baf7[_0x1bb227(0x202)])||!Array['isArray'](_0xb3baf7[_0x1bb227(0x1f7)]))&&_0x3a299f();let _0x440b8a=new Set(_0x18117d),_0x4c881b=new Set();for(let _0x4ceb4e of _0xb3baf7['patches']){(!a(_0x4ceb4e)||typeof _0x4ceb4e[_0x1bb227(0x1f4)]!=_0x1bb227(0x12a)||!_0x440b8a[_0x1bb227(0x1e7)](_0x4ceb4e[_0x1bb227(0x1f4)])||_0x4c881b[_0x1bb227(0x1e7)](_0x4ceb4e['elementId'])||_0x31a064[_0x4ceb4e[_0x1bb227(0x1f4)]]?.[_0x1bb227(0x1d7)]!==_0x1bb227(0x1bd)||Object[_0x1bb227(0x12e)](_0x4ceb4e)[_0x1bb227(0x1fb)](_0x2a7405=>_0x2a7405!==_0x1bb227(0x1f4)&&_0x2a7405!==_0x1bb227(0x12c))||!a(_0x4ceb4e[_0x1bb227(0x12c)]))&&_0x3a299f();let _0x256e86=_0x4ceb4e[_0x1bb227(0x12c)],_0x168a19=_0x31a064[_0x4ceb4e['elementId']][_0x1bb227(0x12c)];(Object[_0x1bb227(0x12e)](_0x256e86)[_0x1bb227(0x1fb)](_0x58767a=>_0x58767a!==_0x1bb227(0x155)&&_0x58767a!=='height')||typeof _0x256e86['width']!='number'||!Number[_0x1bb227(0x15e)](_0x256e86['width'])||_0x256e86[_0x1bb227(0x155)]<=0x0||_0x256e86[_0x1bb227(0x155)]<(_0x168a19[_0x1bb227(0x155)]??0x0)||_0xfcef3b!==void 0x0&&_0x256e86[_0x1bb227(0x155)]>(_0x168a19[_0x1bb227(0x155)]??0x0)*_0xfcef3b||typeof _0x256e86['height']!=_0x1bb227(0x172)||!Number[_0x1bb227(0x15e)](_0x256e86[_0x1bb227(0x131)])||_0x256e86['height']<=0x0||_0x256e86[_0x1bb227(0x131)]<(_0x168a19[_0x1bb227(0x131)]??0x0))&&_0x3a299f(),_0x4c881b[_0x1bb227(0x1d3)](_0x4ceb4e[_0x1bb227(0x1f4)]);}}var p=0x2,m=0x6,h=0.02,g=0.15,_=0.5,v=new Set([_0x191bdf(0x151),'roundRect']),y=[_0x191bdf(0x137),_0x191bdf(0x173),_0x191bdf(0x1a5)];function _0x44db(){const _0x5311c4=['textPlanElementIds\x20must\x20select\x20unique\x20non-empty\x20shape\x20IDs\x20on\x20the\x20requested\x20pages','top\x20','\x20=\x20','captureBoardLayout','related','INVALID_RENDER_RESULT','labelPlan','right','labelDistanceInspection','text-plan-unavailable','maximumAutomaticLabelDistance\x20must\x20be\x20a\x20finite\x20non-negative\x20number','port-plan-incomplete','Label\x20plan\x20targets\x20an\x20unexpected\x20Unit\x20or\x20page','maximumAutomaticLabelDistance','shape','maximum','text\x20\x22','Slide\x20layout\x20runtime\x20is\x20required','isInteger','empty','startRow','authored-placement','content','includes','entries','every','portPlan','error','unresolvedConnectorCount','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20','connectorIds','\x22\x20runs\x20off\x20the\x20page\x20(','box',');\x20ink\x20','left',',\x20page\x20','add','severity','connectorData','hex','type','filter','fill','unitData','Model\x20analysis\x20does\x20not\x20establish\x20final\x20font\x20metrics\x20or\x20automatic\x20rendered\x20routes.','Label-distance\x20threshold\x20was\x20not\x20echoed','connector-label-distance-unresolved','none','textPlanMaximumWidthGrowth','pageId','name','min','clean','code','trim','bottom\x20','has','join','analysis','Board\x20unitData.id\x20is\x20required','8sdYSOX','modelRuntime','hasOwn','Slide\x20has\x20no\x20pages\x20to\x20lint','Board\x20capture\x20contains\x20an\x20invalid\x20table\x20cell\x20range','status','50RrgXKB','map','sort','elementId','excluded','pageHeight','preconditions','left\x20','rendered','unitType','some','element-text-layout-unresolved','zIndex','textPlanElementIds','port-plan-unavailable','isSafeInteger','replace','patches','board','embeddedUnits','labelDistance','unresolved-label','automaticLabelDistance','pageOrder','routes','get','string','pageWidth','transform','Text\x20plan\x20does\x20not\x20match\x20its\x20requested\x20Unit,\x20page\x20or\x20shape-size\x20selection','keys','color','connectorId','height','unit-layout-lint','analysis-missing','Missing\x20native\x20label-distance\x20finding','update','top','text-off-page','throwIfAborted','layoutPlan','endRow','ready','933126tMMXgt','Slide\x20page\x20selector\x20is\x20invalid:\x20','2iWrbKO','size','UnitLayoutLintError','values','Automatic\x20label\x20distance\x20uses\x20the\x20native\x20sampled,\x20marker-trimmed\x20stroke\x20centerline\x20before\x20dash\x20gaps\x20and\x20label\x20clipping;\x20it\x20is\x20not\x20raster-ink\x20distance.','unresolved','247btjyln','runtime-unavailable','elements','find','77bWgPez','12388311FFcAOQ','includePortPlan','page','unresolved-route','11MegMEV','bind','digest','runtime','rect','push','bounds','3539748JzcHup','width','layout:','signal','isArray','1033460RkIbRQ','model','layout-plan-unavailable','label-plan-unavailable','outerSize','isFinite','text-plan-incomplete','captureBoardModelLayout','localeCompare','textPlan','distance','measured','unitId','endColumn','endpointConstrained','formulaReferenceUnits','startsWith','sha256','connector-label-layout-unresolved','Label\x20distance\x20requires\x20rendered\x20Board\x20analysis','ownKeys','Board\x20capture\x20issue\x20counts\x20do\x20not\x20match\x20its\x20summary','round','shapeType','opacity','number','text-escapes-container','layout-plan-incomplete','getPrototypeOf','startColumn','elementType','text','textLayout','Contradictory\x20empty-label\x20distance','A\x20layout\x20plan\x20requires\x20rendered\x20Board\x20analysis\x20and\x20one\x20planning\x20request','Contradictory\x20native\x20label-distance\x20finding','issues','pages','INVALID_INPUT','incomplete','Unit\x20layout\x20lint\x20supports\x20Slide\x20and\x20Board\x20only','ink','Slide\x20unitData.id\x20is\x20required','declared','rendered-stroke-polyline-v1','mode','availableSize','fingerprint','includeLabelPlan','overflow','indexOf','115048XRWRIZ','max','slide','source','Board\x20capture\x20contains\x20invalid\x20text\x20measurements','element','Invalid\x20label-distance\x20evidence','Board\x20pageOrder\x20must\x20contain\x20unique\x20page\x20IDs','1639460nyxgiO','both','reason','\x22\x20escapes\x20','visible','area','rule','length','findings','prototype','resolved','labelIds','object','bottom','warning','unresolved-element-text','call','text-overlaps-text','connector-label-distance-exceeded','Board\x20capture\x20contains\x20invalid\x20summary\x20counts','slice','captureSlideLayout','Port\x20plans\x20require\x20rendered\x20Board\x20analysis','179142qvzsBR','endpoint-role','connectorLabelLayouts','Invalid\x20label-distance\x20receipt'];_0x44db=function(){return _0x5311c4;};return _0x44db();}function b(_0x2e772d){return{async 'lint'(_0x30f31e){const _0x1a8e7a=_0x4cb0;if(_0x30f31e['unitType']===_0x1a8e7a(0x203))return await r(_0x30f31e,_0x2e772d);if(_0x30f31e['unitType']!==_0x1a8e7a(0x18e))throw new t(_0x1a8e7a(0x17f),_0x1a8e7a(0x181));if(_0x1a8e7a(0x1bc)in _0x30f31e&&_0x30f31e['maximumAutomaticLabelDistance']!==void 0x0)throw new t(_0x1a8e7a(0x17f),'Label\x20distance\x20is\x20only\x20supported\x20for\x20Board');let _0x1732ab=z(_0x30f31e[_0x1a8e7a(0x1da)]['id']),_0x3d12c0=x(_0x30f31e[_0x1a8e7a(0x1da)]['slideOrder']??[],_0x30f31e[_0x1a8e7a(0x17e)]);if(_0x2e772d[_0x1a8e7a(0x150)]===void 0x0||!(_0x1a8e7a(0x1a9)in _0x2e772d['runtime']))throw new t(_0x1a8e7a(0x17f),_0x1a8e7a(0x1c0));let _0x5dd8e5=await _0x2e772d[_0x1a8e7a(0x150)]['captureSlideLayout']({'unitType':_0x1a8e7a(0x18e),'unitData':_0x30f31e[_0x1a8e7a(0x1da)],..._0x30f31e[_0x1a8e7a(0x168)]===void 0x0?{}:{'formulaReferenceUnits':_0x30f31e[_0x1a8e7a(0x168)]},'pages':_0x3d12c0['map'](({page:_0x4f99d5})=>_0x4f99d5),..._0x30f31e[_0x1a8e7a(0x157)]===void 0x0?{}:{'signal':_0x30f31e[_0x1a8e7a(0x157)]}});return S(_0x5dd8e5,_0x3d12c0),{'kind':_0x1a8e7a(0x132),'unitId':_0x1732ab,'unitType':_0x1a8e7a(0x18e),'coverage':{'pages':_0x3d12c0,'rules':y},'findings':C(_0x5dd8e5)};}};}function x(_0x147d9a,_0x363736){const _0x4ea193=_0x191bdf;if(_0x147d9a[_0x4ea193(0x19b)]===0x0)throw new t(_0x4ea193(0x17f),_0x4ea193(0x1ee));if(_0x363736!==void 0x0&&_0x363736[_0x4ea193(0x19b)]===0x0)throw new t('INVALID_INPUT','pages\x20must\x20not\x20be\x20empty');let _0x24e30b=_0x363736??_0x147d9a['map']((_0x2a2174,_0xe5e93f)=>_0xe5e93f+0x1),_0x130325=new Set(),_0x13813b=[];for(let _0x18d645 of _0x24e30b){let _0x54bc95=typeof _0x18d645=='number'?_0x18d645:_0x147d9a['findIndex'](_0x199cb0=>_0x199cb0===_0x18d645)+0x1;if(!Number['isInteger'](_0x54bc95)||_0x54bc95<0x1||_0x54bc95>_0x147d9a[_0x4ea193(0x19b)])throw new t('INVALID_INPUT',_0x4ea193(0x13d)+String(_0x18d645));let _0x8b7804=_0x147d9a[_0x54bc95-0x1];_0x130325[_0x4ea193(0x1e7)](_0x8b7804)||(_0x130325['add'](_0x8b7804),_0x13813b['push']({'page':_0x54bc95,'pageId':_0x8b7804}));}return _0x13813b;}function S(_0x2cef39,_0x8b727a){const _0x4ac797=_0x191bdf;let _0x52b3b0=new Map();for(let _0x6114ce of _0x2cef39[_0x4ac797(0x17e)]){let _0x4e2af7=_0x52b3b0['get'](_0x6114ce[_0x4ac797(0x1e0)])??[];_0x4e2af7[_0x4ac797(0x152)](_0x6114ce),_0x52b3b0['set'](_0x6114ce[_0x4ac797(0x1e0)],_0x4e2af7);}for(let _0x340ad1 of _0x8b727a){let _0x2e78e7=_0x52b3b0[_0x4ac797(0x129)](_0x340ad1[_0x4ac797(0x1e0)])??[];if(_0x2e78e7['length']!==0x1||_0x2e78e7[0x0]?.[_0x4ac797(0x14b)]!==_0x340ad1[_0x4ac797(0x14b)])throw new t(_0x4ac797(0x1b4),'Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20'+_0x340ad1['pageId']);let _0x4f4990=_0x2e78e7[0x0][_0x4ac797(0x146)][_0x4ac797(0x1f2)](({elementId:_0x50eb0a})=>_0x50eb0a);if(new Set(_0x4f4990)[_0x4ac797(0x13f)]!==_0x4f4990[_0x4ac797(0x19b)])throw new t(_0x4ac797(0x1b4),'Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20'+_0x340ad1[_0x4ac797(0x1e0)]);}if(_0x2cef39[_0x4ac797(0x17e)][_0x4ac797(0x19b)]!==_0x8b727a[_0x4ac797(0x19b)])throw new t(_0x4ac797(0x1b4),'Render\x20result\x20contains\x20unrequested\x20Slide\x20pages');}function C(_0x580adb){const _0x2aa6d2=_0x191bdf;let _0x24d0ef=[];for(let _0x40d37a of _0x580adb['pages']){let _0x38cea1=_0x40d37a['elements'][_0x2aa6d2(0x1d8)](_0xb8a3a2=>!_0xb8a3a2[_0x2aa6d2(0x1f4)][_0x2aa6d2(0x169)](_0x2aa6d2(0x156))),_0x826942=_0x38cea1['filter'](_0x2a3483=>_0x2a3483[_0x2aa6d2(0x178)]!==void 0x0&&_0x2a3483['text'][_0x2aa6d2(0x1c5)][_0x2aa6d2(0x1e5)]()!=='');for(let _0x5a475f of _0x826942){let _0x514a97=T(_0x5a475f['text'][_0x2aa6d2(0x182)]),_0x811410={..._0x514a97[_0x2aa6d2(0x1d1)]<-0x2?{'left':O(-_0x514a97[_0x2aa6d2(0x1d1)])}:{},..._0x514a97[_0x2aa6d2(0x136)]<-0x2?{'top':O(-_0x514a97[_0x2aa6d2(0x136)])}:{},..._0x514a97[_0x2aa6d2(0x1b6)]>_0x40d37a[_0x2aa6d2(0x12b)]+p?{'right':O(_0x514a97[_0x2aa6d2(0x1b6)]-_0x40d37a[_0x2aa6d2(0x12b)])}:{},..._0x514a97['bottom']>_0x40d37a[_0x2aa6d2(0x1f6)]+p?{'bottom':O(_0x514a97[_0x2aa6d2(0x1a1)]-_0x40d37a[_0x2aa6d2(0x1f6)])}:{}},_0x4f6e69=R(_0x811410);if(_0x4f6e69!=='-'){let _0x4a7aef=j(_0x5a475f),_0x4e1078=A({'left':0x0,'top':0x0,'width':_0x40d37a[_0x2aa6d2(0x12b)],'height':_0x40d37a['pageHeight']});_0x24d0ef[_0x2aa6d2(0x152)](w({'page':_0x40d37a[_0x2aa6d2(0x14b)],'pageId':_0x40d37a[_0x2aa6d2(0x1e0)],'rule':_0x2aa6d2(0x137),'id':_0x5a475f[_0x2aa6d2(0x1f4)],'text':_0x4a7aef,'pageBox':_0x4e1078,'overflow':_0x811410,'detail':'text\x20\x22'+k(_0x4a7aef[_0x2aa6d2(0x1c5)])+_0x2aa6d2(0x1ce)+_0x4f6e69+');\x20ink\x20'+F(_0x4a7aef[_0x2aa6d2(0x182)])+_0x2aa6d2(0x1d2)+F(_0x4e1078)}));}}for(let _0x4677f5 of _0x826942){let _0x102070=L(_0x4677f5,_0x38cea1,_0x40d37a);if(_0x102070===void 0x0)continue;let _0x371b2c=T(_0x4677f5[_0x2aa6d2(0x178)][_0x2aa6d2(0x182)]),_0x26df68=T(_0x102070['declared']),_0x19a0c5=Math[_0x2aa6d2(0x18d)](m,h*(_0x26df68[_0x2aa6d2(0x1b6)]-_0x26df68[_0x2aa6d2(0x1d1)])),_0x5dc95d={..._0x26df68['left']-_0x371b2c['left']>_0x19a0c5?{'left':O(_0x26df68['left']-_0x371b2c[_0x2aa6d2(0x1d1)])}:{},..._0x371b2c[_0x2aa6d2(0x1b6)]-_0x26df68['right']>_0x19a0c5?{'right':O(_0x371b2c[_0x2aa6d2(0x1b6)]-_0x26df68['right'])}:{},..._0x371b2c[_0x2aa6d2(0x1a1)]-_0x26df68[_0x2aa6d2(0x1a1)]>_0x19a0c5?{'bottom':O(_0x371b2c[_0x2aa6d2(0x1a1)]-_0x26df68[_0x2aa6d2(0x1a1)])}:{}},_0x2c34c3=R(_0x5dc95d);if(_0x2c34c3!=='-'){let _0x5763b0=j(_0x4677f5),_0x2b03f2=N(_0x102070);_0x24d0ef[_0x2aa6d2(0x152)](w({'page':_0x40d37a[_0x2aa6d2(0x14b)],'pageId':_0x40d37a[_0x2aa6d2(0x1e0)],'rule':_0x2aa6d2(0x173),'id':_0x4677f5['elementId'],'related':_0x102070[_0x2aa6d2(0x1f4)],'text':_0x5763b0,'container':_0x2b03f2,'overflow':_0x5dc95d,'detail':_0x2aa6d2(0x1bf)+k(_0x5763b0[_0x2aa6d2(0x1c5)])+_0x2aa6d2(0x197)+_0x2b03f2['id']+'\x20('+_0x2c34c3+_0x2aa6d2(0x1d0)+F(_0x5763b0[_0x2aa6d2(0x182)])+',\x20'+_0x2b03f2['id']+_0x2aa6d2(0x1b1)+_0x2b03f2['type']+'\x20'+P(_0x2b03f2[_0x2aa6d2(0x1d9)])+'\x20'+F(_0x2b03f2[_0x2aa6d2(0x1cf)])}));}}for(let _0x20d78f=0x0;_0x20d78f<_0x826942[_0x2aa6d2(0x19b)];_0x20d78f+=0x1)for(let _0x1588b2=_0x20d78f+0x1;_0x1588b2<_0x826942[_0x2aa6d2(0x19b)];_0x1588b2+=0x1){let _0x257ca7=_0x826942[_0x20d78f],_0x117cb3=_0x826942[_0x1588b2],_0x99938a=T(_0x257ca7[_0x2aa6d2(0x178)][_0x2aa6d2(0x182)]),_0x4948ec=T(_0x117cb3['text'][_0x2aa6d2(0x182)]),_0x44fd63=E(D(_0x99938a,_0x4948ec));if(_0x44fd63<=0x1)continue;let _0x22f214=_0x44fd63/Math[_0x2aa6d2(0x18d)](0x1,Math[_0x2aa6d2(0x1e2)](E(_0x99938a),E(_0x4948ec)));if(_0x22f214<=g)continue;let _0x322894=j(_0x257ca7),_0xfa04a5=j(_0x117cb3);_0x24d0ef['push'](w({'page':_0x40d37a[_0x2aa6d2(0x14b)],'pageId':_0x40d37a['pageId'],'rule':_0x2aa6d2(0x1a5),'id':_0x257ca7[_0x2aa6d2(0x1f4)],'related':_0x117cb3['elementId'],'text':_0x322894,'other':_0xfa04a5,'overlapRatio':Math[_0x2aa6d2(0x16f)](_0x22f214*0x64)/0x64,'detail':_0x2aa6d2(0x1bf)+k(_0x322894['content'])+'\x22'+M(_0x322894)+'\x20overlaps\x20\x22'+k(_0xfa04a5[_0x2aa6d2(0x1c5)])+'\x22'+M(_0xfa04a5)+'\x20by\x20'+Math[_0x2aa6d2(0x16f)](_0x22f214*0x64)+_0x2aa6d2(0x1cc)+F(_0x322894[_0x2aa6d2(0x182)])+',\x20'+F(_0xfa04a5['ink'])}));}}return _0x24d0ef[_0x2aa6d2(0x1f3)]((_0xcc125,_0x1bb7fc)=>_0xcc125['fingerprint'][_0x2aa6d2(0x161)](_0x1bb7fc[_0x2aa6d2(0x188)]));}function w(_0x5e0087){const _0x30bf45=_0x191bdf;return{..._0x5e0087,'fingerprint':[_0x5e0087[_0x30bf45(0x19a)],_0x5e0087[_0x30bf45(0x1e0)],_0x5e0087['id'],_0x5e0087[_0x30bf45(0x1b3)]??''][_0x30bf45(0x1e8)](':'),'severity':_0x30bf45(0x1a2)};}function T(_0x5934c5){const _0x4685de=_0x191bdf;return{'left':_0x5934c5[_0x4685de(0x1d1)],'top':_0x5934c5[_0x4685de(0x136)],'right':_0x5934c5[_0x4685de(0x1d1)]+_0x5934c5[_0x4685de(0x155)],'bottom':_0x5934c5[_0x4685de(0x136)]+_0x5934c5['height']};}function E(_0xc3d1c0){const _0x1bd755=_0x191bdf;return Math[_0x1bd755(0x18d)](0x0,_0xc3d1c0[_0x1bd755(0x1b6)]-_0xc3d1c0[_0x1bd755(0x1d1)])*Math[_0x1bd755(0x18d)](0x0,_0xc3d1c0['bottom']-_0xc3d1c0[_0x1bd755(0x136)]);}function D(_0x543114,_0x4d242a){const _0x14edfd=_0x191bdf;return{'left':Math[_0x14edfd(0x18d)](_0x543114[_0x14edfd(0x1d1)],_0x4d242a[_0x14edfd(0x1d1)]),'top':Math[_0x14edfd(0x18d)](_0x543114['top'],_0x4d242a['top']),'right':Math[_0x14edfd(0x1e2)](_0x543114[_0x14edfd(0x1b6)],_0x4d242a[_0x14edfd(0x1b6)]),'bottom':Math[_0x14edfd(0x1e2)](_0x543114[_0x14edfd(0x1a1)],_0x4d242a['bottom'])};}function O(_0x3bcd3a){return Math['round'](_0x3bcd3a);}function k(_0x4a121e){const _0x51c81c=_0x191bdf;let _0x5b6f70=_0x4a121e[_0x51c81c(0x201)](/\s+/gu,'\x20')[_0x51c81c(0x1e5)]();return _0x5b6f70[_0x51c81c(0x19b)]<=0x10?_0x5b6f70:_0x5b6f70[_0x51c81c(0x1a8)](0x0,0x10)+'…';}function A(_0x43675b){const _0x4ee0b5=_0x191bdf;return{'left':O(_0x43675b[_0x4ee0b5(0x1d1)]),'top':O(_0x43675b[_0x4ee0b5(0x136)]),'width':O(_0x43675b[_0x4ee0b5(0x155)]),'height':O(_0x43675b['height'])};}function j(_0x2ea76f){const _0x22cae9=_0x191bdf;let _0x3d720c=_0x2ea76f[_0x22cae9(0x178)];return{'id':_0x2ea76f[_0x22cae9(0x1f4)],'content':_0x3d720c[_0x22cae9(0x1c5)],'ink':A(_0x3d720c['ink']),..._0x3d720c[_0x22cae9(0x12f)]===void 0x0?{}:{'color':_0x3d720c[_0x22cae9(0x12f)]},..._0x3d720c['opacity']===void 0x0?{}:{'opacity':_0x3d720c[_0x22cae9(0x171)]}};}function M(_0x27fcbf){const _0x5eee40=_0x191bdf;return _0x27fcbf[_0x5eee40(0x12f)]===void 0x0&&_0x27fcbf[_0x5eee40(0x171)]===void 0x0?'':''+(_0x27fcbf['color']===void 0x0?'':'\x20\x20'+_0x27fcbf['color'])+(_0x27fcbf[_0x5eee40(0x171)]===void 0x0?'':'\x20\x20opacity\x20'+_0x27fcbf[_0x5eee40(0x171)]);}function N(_0x4e3a13){const _0x2a7a96=_0x191bdf;return{'id':_0x4e3a13[_0x2a7a96(0x1f4)],'type':_0x4e3a13['shapeType']===void 0x0?_0x4e3a13[_0x2a7a96(0x177)]:_0x4e3a13[_0x2a7a96(0x177)]+':'+_0x4e3a13[_0x2a7a96(0x170)],..._0x4e3a13['fill']===void 0x0?{}:{'fill':_0x4e3a13[_0x2a7a96(0x1d9)]},'box':A(_0x4e3a13[_0x2a7a96(0x184)])};}function P(_0xf631d0){const _0x1797da=_0x191bdf;if(_0xf631d0===void 0x0)return'no\x20fill';let _0x22cd6d=_0xf631d0[_0x1797da(0x171)]===void 0x0||_0xf631d0[_0x1797da(0x171)]===0x1?'':'\x20@'+_0xf631d0['opacity'];return((_0xf631d0[_0x1797da(0x1d7)]??'?')+'\x20'+(_0xf631d0['color']??'')+_0x22cd6d)[_0x1797da(0x1e5)]();}function F(_0x223fe7){const _0x25ee53=_0x191bdf;return'('+_0x223fe7['left']+','+_0x223fe7[_0x25ee53(0x136)]+'\x20'+_0x223fe7[_0x25ee53(0x155)]+'×'+_0x223fe7['height']+')';}function I(_0x2550d0){const _0x2e718a=_0x191bdf;let _0x720701=_0x2550d0['fill'];return!(_0x720701===void 0x0||_0x720701[_0x2e718a(0x1d7)]===_0x2e718a(0x1de)||_0x720701[_0x2e718a(0x171)]!==void 0x0&&_0x720701[_0x2e718a(0x171)]<_||_0x2550d0[_0x2e718a(0x170)]===void 0x0||!v[_0x2e718a(0x1e7)](_0x2550d0[_0x2e718a(0x170)])||_0x2550d0[_0x2e718a(0x198)]===!0x1);}function L(_0x598e76,_0x43863c,_0x1dc8b4){const _0x13dd93=_0x191bdf;let _0x1dc163=T(_0x598e76[_0x13dd93(0x178)][_0x13dd93(0x182)]),_0x68ad57;for(let _0x44f89a of _0x43863c){if(_0x44f89a[_0x13dd93(0x1fd)]>=_0x598e76['zIndex']||!I(_0x44f89a))continue;let _0x5e92c2=T(_0x44f89a[_0x13dd93(0x184)]),_0x1f48aa=E(_0x5e92c2);if(_0x1f48aa>=0.5*_0x1dc8b4[_0x13dd93(0x12b)]*_0x1dc8b4[_0x13dd93(0x1f6)])continue;let _0x224bb8=_0x1dc163['top']>=_0x5e92c2[_0x13dd93(0x136)]-p&&_0x1dc163[_0x13dd93(0x1a1)]<=_0x5e92c2[_0x13dd93(0x1a1)]+p,_0x175a80=_0x1dc163['left']>=_0x5e92c2[_0x13dd93(0x1d1)]-p&&_0x1dc163[_0x13dd93(0x1d1)]<=_0x5e92c2['right']+p&&_0x1dc163[_0x13dd93(0x136)]>=_0x5e92c2[_0x13dd93(0x136)]-p,_0x2ea702=E(D(_0x1dc163,_0x5e92c2))/Math['max'](E(_0x1dc163),0x1);!_0x224bb8||!_0x175a80||_0x2ea702<0.35||(_0x68ad57===void 0x0||_0x1f48aa<_0x68ad57[_0x13dd93(0x199)])&&(_0x68ad57={'element':_0x44f89a,'area':_0x1f48aa});}return _0x68ad57?.[_0x13dd93(0x191)];}function R(_0x3d07a0){const _0x177ee8=_0x191bdf;let _0x82ae10=[_0x3d07a0[_0x177ee8(0x1d1)]===void 0x0?'':_0x177ee8(0x1f8)+_0x3d07a0[_0x177ee8(0x1d1)]+'px',_0x3d07a0[_0x177ee8(0x136)]===void 0x0?'':_0x177ee8(0x1b0)+_0x3d07a0['top']+'px',_0x3d07a0[_0x177ee8(0x1b6)]===void 0x0?'':'right\x20'+_0x3d07a0[_0x177ee8(0x1b6)]+'px',_0x3d07a0['bottom']===void 0x0?'':_0x177ee8(0x1e6)+_0x3d07a0[_0x177ee8(0x1a1)]+'px'][_0x177ee8(0x1d8)](_0x4854ed=>_0x4854ed!=='');return _0x82ae10[_0x177ee8(0x19b)]===0x0?'-':_0x82ae10[_0x177ee8(0x1e8)](',\x20');}function z(_0x4137c3){const _0x4ba233=_0x191bdf;if(typeof _0x4137c3!=_0x4ba233(0x12a)||_0x4137c3[_0x4ba233(0x1e5)]()==='')throw new t('INVALID_INPUT',_0x4ba233(0x183));return _0x4137c3;}export{t as UnitLayoutLintError,b as createUnitLayoutLint,n as isUnitLayoutLintError};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univer-cli/unit-layout-lint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.2",
|
|
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
|
-
"@univer-cli/univer-render-runtime": "1.
|
|
21
|
+
"@univer-cli/univer-render-runtime": "1.5.2"
|
|
22
22
|
}
|
|
23
23
|
}
|