oatschema 0.0.1 → 0.1.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 (56) hide show
  1. package/AUTHORS +4 -0
  2. package/CHANGELOG.md +17 -0
  3. package/README.md +113 -13
  4. package/THIRD-PARTY-NOTICES +28 -0
  5. package/dist/ajv.d.ts +21 -0
  6. package/dist/ajv.js +28 -0
  7. package/dist/compiled/0.8.0/audio-transcription.js +4 -0
  8. package/dist/compiled/0.8.0/classification.js +4 -0
  9. package/dist/compiled/0.8.0/document-extraction.js +4 -0
  10. package/dist/compiled/0.8.0/embedding.js +4 -0
  11. package/dist/compiled/0.8.0/entity-extraction.js +4 -0
  12. package/dist/compiled/0.8.0/generic.js +4 -0
  13. package/dist/compiled/0.8.0/geolocation.js +4 -0
  14. package/dist/compiled/0.8.0/llm-output.js +4 -0
  15. package/dist/compiled/0.8.0/object-detection.js +4 -0
  16. package/dist/compiled/0.8.0/ranking.js +4 -0
  17. package/dist/compiled/0.8.0/regression.js +4 -0
  18. package/dist/compiled/0.8.0/temporal-segmentation.js +4 -0
  19. package/dist/compiled/index.js +30 -0
  20. package/dist/errors.d.ts +27 -0
  21. package/dist/errors.js +63 -0
  22. package/dist/formats.d.ts +13 -0
  23. package/dist/formats.js +106 -0
  24. package/dist/index.d.ts +6 -45
  25. package/dist/index.js +10 -56
  26. package/dist/names.d.ts +33 -0
  27. package/dist/names.js +33 -0
  28. package/dist/validate/audio-transcription.d.ts +27 -0
  29. package/dist/validate/audio-transcription.js +14 -0
  30. package/dist/validate/classification.d.ts +27 -0
  31. package/dist/validate/classification.js +14 -0
  32. package/dist/validate/document-extraction.d.ts +27 -0
  33. package/dist/validate/document-extraction.js +14 -0
  34. package/dist/validate/embedding.d.ts +27 -0
  35. package/dist/validate/embedding.js +14 -0
  36. package/dist/validate/entity-extraction.d.ts +27 -0
  37. package/dist/validate/entity-extraction.js +14 -0
  38. package/dist/validate/generic.d.ts +27 -0
  39. package/dist/validate/generic.js +14 -0
  40. package/dist/validate/geolocation.d.ts +27 -0
  41. package/dist/validate/geolocation.js +14 -0
  42. package/dist/validate/llm-output.d.ts +27 -0
  43. package/dist/validate/llm-output.js +14 -0
  44. package/dist/validate/object-detection.d.ts +27 -0
  45. package/dist/validate/object-detection.js +14 -0
  46. package/dist/validate/ranking.d.ts +27 -0
  47. package/dist/validate/ranking.js +14 -0
  48. package/dist/validate/regression.d.ts +27 -0
  49. package/dist/validate/regression.js +14 -0
  50. package/dist/validate/temporal-segmentation.d.ts +27 -0
  51. package/dist/validate/temporal-segmentation.js +14 -0
  52. package/dist/validate.d.ts +40 -0
  53. package/dist/validate.js +59 -0
  54. package/dist/validation.d.ts +74 -0
  55. package/dist/validation.js +328 -0
  56. package/package.json +24 -6
package/AUTHORS ADDED
@@ -0,0 +1,4 @@
1
+ The OATS Authors are the copyright holders of OATS. This file lists them.
2
+ Individuals and organisations may add themselves when they contribute.
3
+
4
+ Dorsal Hub LTD
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  This package uses its own semantic version. `SCHEMA_VERSION` gives the default OATS schema version of each release.
4
4
 
5
+ ## 0.1.0 (2026-10-30)
6
+
7
+ Validation, with precompiled validators.
8
+
9
+ - `oatschema/validate`: `validate`, `isValid`, `iterErrors` and `getValidator`, for a schema name, an optional schema version and `{ checkFormats }`. `validate` throws a `ValidationError` for the first error, and `iterErrors` yields every error. Validators are cached.
10
+ - `oatschema/validate/<name>`: `getValidator` for one schema, so a page loads only that schema's validator.
11
+ - The validators are compiled ahead of time, generate no code at run time and import nothing outside the package, so they run under a strict Content Security Policy (`script-src 'self'`) and in a browser without a bundler. The package still has no runtime dependencies.
12
+ - `ValidationError` has `message`, `reason`, `path`, `keyword`, `schemaPath`, `schemaName` and `schemaVersion`. It shows values from the record as `…`, and its size is bounded whatever the record holds: `reason` is at most 1,000 characters and each path string at most 100.
13
+ - Failures inside `anyOf`, `oneOf` and `if`/`then` are reported as oatschema-py reports them: one error for a failed `anyOf` or `oneOf`, and the `then` error without a separate `if` error.
14
+ - Verdicts match oatschema-py on every example in the OATS 0.8.0 release, with format checks on and off. One known difference: integers above 2^53, which `JSON.parse` rounds, can make a `uniqueItems` list fail.
15
+ - `date-time` follows RFC 3339 strictly, and `uri` accepts any absolute RFC 3986 URI. Both match the format checks oatschema-py uses.
16
+ - `oatschema/ajv`: `addOatsKeywords(ajv)` and `addOatsFormats(ajv)`, for people who validate with their own Ajv.
17
+ - `SchemaVersion`, a union of the bundled versions, and `isSchemaVersion(value)`. Every `version` parameter now takes a `SchemaVersion`, and `availableVersions()` returns `SchemaVersion[]`. **Breaking for TypeScript callers** that pass a `string`; narrow it with `isSchemaVersion` first. JavaScript callers are unaffected.
18
+ - `UnknownSchemaError` and `SchemaLookupError` keep their names. Their messages shorten a long requested name or version.
19
+ - The package now ships `AUTHORS`, and `THIRD-PARTY-NOTICES` with Ajv's MIT licence, which covers the generated validator code.
20
+ - Published from GitHub Actions with npm trusted publishing and provenance.
21
+
5
22
  ## 0.0.1 (2026-10-18)
6
23
 
7
24
  First release. Schema access only; validation is planned for 0.1.0.
package/README.md CHANGED
@@ -4,13 +4,15 @@
4
4
  [![CI](https://github.com/oatschema/oatschema-js/actions/workflows/ci.yml/badge.svg)](https://github.com/oatschema/oatschema-js/actions/workflows/ci.yml)
5
5
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/oatschema/oatschema-js/blob/main/LICENSE)
6
6
 
7
- The [OATS](https://oatschema.org) (Open Annotation Task Schemas) JSON schemas for JavaScript and TypeScript.
7
+ The [OATS](https://oatschema.org) (Open Annotation Task Schemas) JSON schemas and validators for JavaScript and TypeScript.
8
8
 
9
9
  OATS is a collection of strict, versioned JSON Schema 2020-12 schemas, defining and validating the structured outputs of machine learning models, workflow steps and annotation. Models, pipelines and people write the same JSON for each task, so a classification, a transcription or a set of detected objects has one shape, whatever produced it. This package bundles the schemas so you can validate those records anywhere. (OATS is unrelated to the W3C Web Annotation data model, formerly Open Annotation.)
10
10
 
11
11
  - **No dependencies, no I/O.** The schemas are embedded in the module, so the package works the same in Node.js 22+, browsers, Deno, Bun and any bundler.
12
+ - **Validation built in.** Validators are compiled ahead of time, so they generate no code at run time. They work under a strict Content Security Policy (`script-src 'self'`) and in a browser page without a bundler, and a page can load the validator for one schema only.
13
+ - **Same verdicts as Python.** On every example in the OATS release, the validators agree with [oatschema-py](https://github.com/oatschema/oatschema-py), with format checks on and off.
12
14
  - **Exactly as released.** Each schema is byte-identical to its [oatschema/oats](https://github.com/oatschema/oats) release.
13
- - **Typed.** ESM with TypeScript types. Schema names are a union type, so typos fail at compile time.
15
+ - **Typed.** ESM with TypeScript types. Schema names and versions are union types, so typos fail at compile time.
14
16
 
15
17
  ## Quick start
16
18
 
@@ -20,10 +22,15 @@ npm install oatschema
20
22
 
21
23
  ```ts
22
24
  import { getSchema, SCHEMA_VERSION } from "oatschema";
25
+ import { validate, isValid } from "oatschema/validate";
23
26
 
24
27
  const schema = getSchema("classification"); // a fresh plain object, safe to modify
25
28
  schema.$id; // "https://oatschema.org/0.8.0/classification"
26
29
  SCHEMA_VERSION; // "0.8.0", used when you don't pass a version
30
+
31
+ isValid({ labels: [{ label: "cat", score: 0.92 }] }, "classification"); // true
32
+ validate({ labels: [{ label: "cat", score: 1.5 }] }, "classification");
33
+ // throws ValidationError: classification 0.8.0 at /labels/0/score: … is greater than the maximum of 1
27
34
  ```
28
35
 
29
36
  ## Schemas
@@ -47,29 +54,106 @@ Browse every schema, its fields and the changelog at [oatschema.org](https://oat
47
54
 
48
55
  ## Validating records
49
56
 
50
- `getSchema` returns a plain object for any JSON Schema 2020-12 validator. With [Ajv](https://ajv.js.org):
57
+ `oatschema/validate` checks a record (a JSON value, such as the result of `JSON.parse`) against a bundled schema:
58
+
59
+ ```ts
60
+ import { getValidator, isValid, iterErrors, validate, ValidationError } from "oatschema/validate";
61
+
62
+ const record = JSON.parse(text);
63
+ if (!isValid(record, "classification")) {
64
+ for (const error of iterErrors(record, "classification")) {
65
+ console.log(error.path, error.keyword, error.reason); // ["labels", 0, "score"] "maximum" "… is greater than the maximum of 1"
66
+ }
67
+ }
68
+
69
+ try {
70
+ validate(record, "classification", "0.8.0");
71
+ } catch (error) {
72
+ if (error instanceof ValidationError) {
73
+ console.log(error.message); // classification 0.8.0 at /labels/0/score: … is greater than the maximum of 1
74
+ }
75
+ }
76
+
77
+ const validator = getValidator("classification"); // cached, so get it once and reuse it
78
+ validator.isValid(record);
79
+ ```
80
+
81
+ - `validate` throws a `ValidationError` for the first error. `iterErrors` yields every error, and `isValid` returns a boolean.
82
+ - Formats (`date-time` and `uri`) are checked unless you pass `{ checkFormats: false }`, as in `isValid(record, "classification", undefined, { checkFormats: false })`.
83
+ - Pass the schema version a record was written for. A version read from a record is a `string`; narrow it with `isSchemaVersion(version)` first.
84
+
85
+ **Errors never quote the record.** A `ValidationError` shows each value from the record as `…` and quotes only property names, so a multi-megabyte value can't end up in a log. `reason` is at most 1,000 characters, each string in `path` at most 100, and `message` adds the schema, version and location. It has:
86
+
87
+ | Property | Holds |
88
+ | :--- | :--- |
89
+ | `message` | `classification 0.8.0 at /labels/0/score: … is greater than the maximum of 1` |
90
+ | `reason` | `… is greater than the maximum of 1` |
91
+ | `path` | `["labels", 0, "score"]`: where in the record, with array indices as numbers |
92
+ | `keyword` | `"maximum"`: the JSON Schema keyword that rejected the value |
93
+ | `schemaPath` | `["properties", "labels", "items", "properties", "score", "maximum"]`: where in the schema |
94
+ | `schemaName`, `schemaVersion` | The schema it was checked against |
95
+
96
+ ### One schema only
97
+
98
+ `oatschema/validate` loads the validators for every schema (about 56 KB gzipped). A page that checks one schema can load just that one, plus about 7 KB of shared code:
51
99
 
52
100
  ```ts
53
- import Ajv2020 from "ajv/dist/2020.js";
54
- import addFormats from "ajv-formats";
101
+ import { getValidator } from "oatschema/validate/document-extraction";
102
+
103
+ const validator = getValidator(); // or getValidator("0.8.0", { checkFormats: false })
104
+ validator.validate(record);
105
+ ```
106
+
107
+ ### In a browser, without a bundler
108
+
109
+ Every module in `dist/` imports only other files in `dist/` by relative path, and nothing evaluates code from strings. Serve the package's `dist/` directory from your own origin and import the file you need:
110
+
111
+ ```html
112
+ <script type="module">
113
+ import { getValidator } from "/static/oatschema/dist/validate/classification.js";
114
+ getValidator().isValid({ labels: [{ label: "cat" }] });
115
+ </script>
116
+ ```
117
+
118
+ ### Same verdicts as oatschema-py
119
+
120
+ The validators are compiled from the schemas with [Ajv](https://ajv.js.org), but no Ajv code or type is part of the API. The repository's `conformance/` directory holds every example from each bundled OATS release, with its expected verdict, plus format edge cases checked against the jsonschema-rs version oatschema-py uses. The tests check every case here, and a script checks the same cases against oatschema-py. They agree on all of them, with format checks on and off.
121
+
122
+ `date-time` follows RFC 3339 strictly (a `T` separator, an offset with a colon, real dates, and leap seconds only at 23:59:60 UTC), and `uri` accepts any absolute RFC 3986 URI, including `x:`. Both match jsonschema-rs on every case in `conformance/formats.json`.
123
+
124
+ Known differences from oatschema-py:
125
+
126
+ - **One changes a verdict:** JavaScript numbers hold integers exactly only up to 2^53. `JSON.parse` rounds larger ones, so two different large integers in a `uniqueItems` list (such as `embedding`'s sparse `indices` or `document-extraction`'s page lists) can become equal and fail here while oatschema-py accepts them. Keep such integers below 9007199254740992.
127
+
128
+ These don't change a verdict:
129
+
130
+ - Property names in messages are shortened to 100 characters. oatschema-py quotes them in full, within its 1,000-character limit.
131
+ - When a record has several errors, the two packages may list them in a different order, so `validate` can report a different one of them.
132
+ - Records must be JSON values. Values JSON can't hold, such as `undefined`, `NaN`, functions, class instances and cyclic objects, give no particular result.
133
+
134
+ ### With your own Ajv
135
+
136
+ If you already compile schemas with Ajv, `oatschema/ajv` registers the two OATS keywords and the same `date-time` and `uri` checks:
137
+
138
+ ```ts
139
+ import { Ajv2020 } from "ajv/dist/2020.js";
55
140
  import { getSchema } from "oatschema";
141
+ import { addOatsFormats, addOatsKeywords } from "oatschema/ajv";
56
142
 
57
143
  const ajv = new Ajv2020({ allErrors: true, strictTypes: false, strictTuples: false, strictRequired: false });
58
- ajv.addKeyword({ keyword: "x-license", schemaType: "object" });
59
- ajv.addKeyword({ keyword: "x-version", schemaType: "string" });
60
- addFormats(ajv);
61
-
62
- const validate = ajv.compile(getSchema("classification"));
63
- validate({ labels: [{ label: "cat", score: 0.92 }] }); // true
64
- validate({ labels: [{ label: "cat", score: 1.5 }] }); // false: /labels/0/score must be <= 1
144
+ addOatsFormats(addOatsKeywords(ajv));
145
+ const check = ajv.compile(getSchema("classification"));
65
146
  ```
66
147
 
67
148
  - `x-license` and `x-version` are the only non-standard keywords in OATS. Registering them keeps Ajv's strict mode on for everything else.
68
149
  - The three relaxed options switch off Ajv's style checks, which reject some valid 2020-12 patterns that OATS uses, such as `required` inside an `if`.
69
150
  - Compile each schema once per Ajv instance and reuse the function. Compiling a second copy with the same `$id` throws; fetch the first with `ajv.getSchema(schema.$id)`.
151
+ - Ajv's own error objects can carry property names from the record at any length. `oatschema/validate` bounds its errors; with your own Ajv, that's up to you.
70
152
 
71
153
  ## API
72
154
 
155
+ From `oatschema`:
156
+
73
157
  | Export | Description |
74
158
  | :--- | :--- |
75
159
  | `getSchema(name, version?)` | The schema as a new object on every call |
@@ -77,11 +161,25 @@ validate({ labels: [{ label: "cat", score: 1.5 }] }); // false: /labels/0/score
77
161
  | `availableVersions()` | Every bundled schema version, oldest first |
78
162
  | `SCHEMA_VERSION` | The default schema version, the newest bundled |
79
163
  | `SCHEMA_NAMES`, `SchemaName` | The schema names, as an array and a union type |
164
+ | `SchemaVersion`, `isSchemaVersion(value)` | The bundled versions as a union type, and a guard that narrows a string to it |
80
165
  | `UnknownSchemaError` | Thrown for a name that exists in no bundled version |
81
166
  | `SchemaLookupError` | Thrown for a version that isn't bundled, or that lacks the schema |
82
167
 
168
+ From `oatschema/validate`:
169
+
170
+ | Export | Description |
171
+ | :--- | :--- |
172
+ | `validate(record, name, version?, options?)` | Throws a `ValidationError` for the first error |
173
+ | `isValid(record, name, version?, options?)` | Whether the record conforms |
174
+ | `iterErrors(record, name, version?, options?)` | An iterator over every error |
175
+ | `getValidator(name, version?, options?)` | A cached `Validator` with `validate`, `isValid` and `iterErrors` methods |
176
+ | `ValidationError` | A record that doesn't conform |
177
+
178
+ `oatschema/validate` also re-exports `UnknownSchemaError` and `SchemaLookupError`, and the types `Validator`, `ValidateOptions` and `ValidationErrorDetails`. `oatschema/validate/<name>` exports `getValidator(version?, options?)` for that schema, `ValidationError`, `SchemaLookupError` and the same types. `oatschema/ajv` exports `addOatsKeywords(ajv)` and `addOatsFormats(ajv)`.
179
+
83
180
  - `version` must be exact: `"0.8.0"`, never `"0.8"` or `"latest"`.
84
- - Both errors carry the requested `schemaName`, and `SchemaLookupError` also carries `schemaVersion`.
181
+ - `options` is `{ checkFormats?: boolean }`. Any other key, or a `checkFormats` that isn't a boolean, throws a `TypeError`.
182
+ - `UnknownSchemaError` and `SchemaLookupError` carry the requested `schemaName`, and `SchemaLookupError` also carries `schemaVersion`.
85
183
 
86
184
  ## Versions
87
185
 
@@ -100,3 +198,5 @@ Schema changes belong in [oatschema/oats](https://github.com/oatschema/oats). Fo
100
198
  ## License
101
199
 
102
200
  Apache-2.0. Copyright [The OATS Authors](https://github.com/oatschema/oatschema-js/blob/main/AUTHORS).
201
+
202
+ The precompiled validators in `dist/compiled/` are generated by Ajv, which is MIT-licensed; its licence is in `THIRD-PARTY-NOTICES`.
@@ -0,0 +1,28 @@
1
+ oatschema includes code generated by Ajv, the JSON Schema validator
2
+ (https://ajv.js.org), in the precompiled validators under dist/compiled/.
3
+ The generated code was produced with ajv 8.20.0, which is licensed as follows.
4
+
5
+ --------------------------------------------------------------------------------
6
+
7
+ The MIT License (MIT)
8
+
9
+ Copyright (c) 2015-2021 Evgeny Poberezkin
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
package/dist/ajv.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ /** The part of an Ajv instance that {@link addOatsKeywords} uses. */
2
+ export interface KeywordTarget {
3
+ addKeyword(definition: {
4
+ keyword: string;
5
+ schemaType: "object" | "string";
6
+ }): unknown;
7
+ }
8
+ /** The part of an Ajv instance that {@link addOatsFormats} uses. */
9
+ export interface FormatTarget {
10
+ addFormat(name: string, format: (value: string) => boolean): unknown;
11
+ }
12
+ /**
13
+ * Register the two non-standard OATS keywords, `x-license` (an object) and `x-version` (a string), so that Ajv's
14
+ * strict mode accepts the schemas. Returns `ajv`.
15
+ */
16
+ export declare function addOatsKeywords<T extends KeywordTarget>(ajv: T): T;
17
+ /**
18
+ * Register the `date-time` and `uri` formats with the same checks as `oatschema/validate`, which are stricter than
19
+ * `ajv-formats` for `date-time` (RFC 3339 only) and accept every RFC 3986 URI. Returns `ajv`.
20
+ */
21
+ export declare function addOatsFormats<T extends FormatTarget>(ajv: T): T;
package/dist/ajv.js ADDED
@@ -0,0 +1,28 @@
1
+ // SPDX-FileCopyrightText: 2026 The OATS Authors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * Helpers for validating OATS records with your own Ajv instance.
5
+ *
6
+ * `oatschema/validate` needs no Ajv. Use these only if you already compile schemas with Ajv yourself.
7
+ *
8
+ * @module
9
+ */
10
+ import { isDateTime, isUri } from "./formats.js";
11
+ /**
12
+ * Register the two non-standard OATS keywords, `x-license` (an object) and `x-version` (a string), so that Ajv's
13
+ * strict mode accepts the schemas. Returns `ajv`.
14
+ */
15
+ export function addOatsKeywords(ajv) {
16
+ ajv.addKeyword({ keyword: "x-license", schemaType: "object" });
17
+ ajv.addKeyword({ keyword: "x-version", schemaType: "string" });
18
+ return ajv;
19
+ }
20
+ /**
21
+ * Register the `date-time` and `uri` formats with the same checks as `oatschema/validate`, which are stricter than
22
+ * `ajv-formats` for `date-time` (RFC 3339 only) and accept every RFC 3986 URI. Returns `ajv`.
23
+ */
24
+ export function addOatsFormats(ajv) {
25
+ ajv.addFormat("date-time", isDateTime);
26
+ ajv.addFormat("uri", isUri);
27
+ return ajv;
28
+ }
@@ -0,0 +1,4 @@
1
+ // SPDX-FileCopyrightText: 2026 The OATS Authors
2
+ // SPDX-FileCopyrightText: 2015-2021 Evgeny Poberezkin
3
+ // SPDX-License-Identifier: Apache-2.0 AND MIT
4
+ import{ucs2length as T}from"../../formats.js";const D=P;var M=P;const c=Object.prototype.hasOwnProperty,d=T,v=new RegExp("^[a-z]{3}$","u");function P(l,{instancePath:i="",parentData:F,parentDataProperty:S,rootData:E=l,dynamicAnchors:$={}}={}){let e=null,t=0;const x=P.evaluated;x.dynamicProps&&(x.props=void 0),x.dynamicItems&&(x.items=void 0);const w=t;let b=!1;const L=t;if(l&&typeof l=="object"&&!Array.isArray(l)&&(l.text===void 0||!c.call(l,"text"))){const p={instancePath:i,schemaPath:"#/anyOf/0/required",keyword:"required",params:{missingProperty:"text"}};e===null?e=[p]:e.push(p),t++}var _=L===t;b=b||_;const O=t;if(l&&typeof l=="object"&&!Array.isArray(l)&&(l.segments===void 0||!c.call(l,"segments"))){const p={instancePath:i,schemaPath:"#/anyOf/1/required",keyword:"required",params:{missingProperty:"segments"}};e===null?e=[p]:e.push(p),t++}var _=O===t;if(b=b||_,b)t=w,e!==null&&(w?e.length=w:e=null);else{const p={instancePath:i,schemaPath:"#/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:t-w})};e===null?e=[p]:e.push(p),t++}if(l&&typeof l=="object"&&!Array.isArray(l)){for(const p of Object.keys(l))if(!(p==="track_id"||p==="producer"||p==="language"||p==="duration"||p==="score_explanation"||p==="text"||p==="segments"||p==="attributes")){const a={instancePath:i,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p}};e===null?e=[a]:e.push(a),t++}if(l.track_id!==void 0&&c.call(l,"track_id")){let p=l.track_id;if(typeof p=="string"){if(d(p)>128){const a={instancePath:i+"/track_id",schemaPath:"#/properties/track_id/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/track_id",schemaPath:"#/properties/track_id/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),t++}}if(l.producer!==void 0&&c.call(l,"producer")){let p=l.producer;if(typeof p=="string"){if(d(p)>1024){const a={instancePath:i+"/producer",schemaPath:"#/properties/producer/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/producer",schemaPath:"#/properties/producer/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),t++}}if(l.language!==void 0&&c.call(l,"language")){let p=l.language;if(typeof p=="string"){if(d(p)>3){const a={instancePath:i+"/language",schemaPath:"#/properties/language/maxLength",keyword:"maxLength",params:{limit:3}};e===null?e=[a]:e.push(a),t++}if(!v.test(p)){const a={instancePath:i+"/language",schemaPath:"#/properties/language/pattern",keyword:"pattern",params:{pattern:"^[a-z]{3}$"}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/language",schemaPath:"#/properties/language/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),t++}}if(l.duration!==void 0&&c.call(l,"duration")){let p=l.duration;if(typeof p=="number"&&isFinite(p)){if(p<0||isNaN(p)){const a={instancePath:i+"/duration",schemaPath:"#/properties/duration/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/duration",schemaPath:"#/properties/duration/type",keyword:"type",params:{type:"number"}};e===null?e=[a]:e.push(a),t++}}if(l.score_explanation!==void 0&&c.call(l,"score_explanation")){let p=l.score_explanation;if(typeof p=="string"){if(d(p)>256){const a={instancePath:i+"/score_explanation",schemaPath:"#/properties/score_explanation/maxLength",keyword:"maxLength",params:{limit:256}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/score_explanation",schemaPath:"#/properties/score_explanation/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),t++}}if(l.text!==void 0&&c.call(l,"text")){let p=l.text;if(typeof p=="string"){if(d(p)>524288){const a={instancePath:i+"/text",schemaPath:"#/properties/text/maxLength",keyword:"maxLength",params:{limit:524288}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),t++}}if(l.segments!==void 0&&c.call(l,"segments")){let p=l.segments;if(Array.isArray(p)){if(p.length>1e5){const n={instancePath:i+"/segments",schemaPath:"#/properties/segments/maxItems",keyword:"maxItems",params:{limit:1e5}};e===null?e=[n]:e.push(n),t++}if(p.length<1){const n={instancePath:i+"/segments",schemaPath:"#/properties/segments/minItems",keyword:"minItems",params:{limit:1}};e===null?e=[n]:e.push(n),t++}const a=p.length;for(let n=0;n<a;n++){let o=p[n];if(o&&typeof o=="object"&&!Array.isArray(o)){if(o.text===void 0||!c.call(o,"text")){const r={instancePath:i+"/segments/"+n,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty:"text"}};e===null?e=[r]:e.push(r),t++}if(o.start_time===void 0||!c.call(o,"start_time")){const r={instancePath:i+"/segments/"+n,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty:"start_time"}};e===null?e=[r]:e.push(r),t++}if(o.end_time===void 0||!c.call(o,"end_time")){const r={instancePath:i+"/segments/"+n,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty:"end_time"}};e===null?e=[r]:e.push(r),t++}for(const r of Object.keys(o))if(!(r==="text"||r==="start_time"||r==="end_time"||r==="language"||r==="speaker"||r==="events"||r==="score"||r==="attributes")){const s={instancePath:i+"/segments/"+n,schemaPath:"#/properties/segments/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r}};e===null?e=[s]:e.push(s),t++}if(o.text!==void 0&&c.call(o,"text")){let r=o.text;if(typeof r=="string"){if(d(r)>4096){const s={instancePath:i+"/segments/"+n+"/text",schemaPath:"#/properties/segments/items/properties/text/maxLength",keyword:"maxLength",params:{limit:4096}};e===null?e=[s]:e.push(s),t++}}else{const s={instancePath:i+"/segments/"+n+"/text",schemaPath:"#/properties/segments/items/properties/text/type",keyword:"type",params:{type:"string"}};e===null?e=[s]:e.push(s),t++}}if(o.start_time!==void 0&&c.call(o,"start_time")){let r=o.start_time;if(typeof r=="number"&&isFinite(r)){if(r<0||isNaN(r)){const s={instancePath:i+"/segments/"+n+"/start_time",schemaPath:"#/properties/segments/items/properties/start_time/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[s]:e.push(s),t++}}else{const s={instancePath:i+"/segments/"+n+"/start_time",schemaPath:"#/properties/segments/items/properties/start_time/type",keyword:"type",params:{type:"number"}};e===null?e=[s]:e.push(s),t++}}if(o.end_time!==void 0&&c.call(o,"end_time")){let r=o.end_time;if(typeof r=="number"&&isFinite(r)){if(r<0||isNaN(r)){const s={instancePath:i+"/segments/"+n+"/end_time",schemaPath:"#/properties/segments/items/properties/end_time/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[s]:e.push(s),t++}}else{const s={instancePath:i+"/segments/"+n+"/end_time",schemaPath:"#/properties/segments/items/properties/end_time/type",keyword:"type",params:{type:"number"}};e===null?e=[s]:e.push(s),t++}}if(o.language!==void 0&&c.call(o,"language")){let r=o.language;if(typeof r=="string"){if(d(r)>3){const s={instancePath:i+"/segments/"+n+"/language",schemaPath:"#/properties/segments/items/properties/language/maxLength",keyword:"maxLength",params:{limit:3}};e===null?e=[s]:e.push(s),t++}if(!v.test(r)){const s={instancePath:i+"/segments/"+n+"/language",schemaPath:"#/properties/segments/items/properties/language/pattern",keyword:"pattern",params:{pattern:"^[a-z]{3}$"}};e===null?e=[s]:e.push(s),t++}}else{const s={instancePath:i+"/segments/"+n+"/language",schemaPath:"#/properties/segments/items/properties/language/type",keyword:"type",params:{type:"string"}};e===null?e=[s]:e.push(s),t++}}if(o.speaker!==void 0&&c.call(o,"speaker")){let r=o.speaker;if(r&&typeof r=="object"&&!Array.isArray(r)){if(r.id===void 0||!c.call(r,"id")){const s={instancePath:i+"/segments/"+n+"/speaker",schemaPath:"#/properties/segments/items/properties/speaker/required",keyword:"required",params:{missingProperty:"id"}};e===null?e=[s]:e.push(s),t++}for(const s of Object.keys(r))if(!(s==="id"||s==="name"||s==="score")){const m={instancePath:i+"/segments/"+n+"/speaker",schemaPath:"#/properties/segments/items/properties/speaker/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s}};e===null?e=[m]:e.push(m),t++}if(r.id!==void 0&&c.call(r,"id")){let s=r.id;if(typeof s=="string"){if(d(s)>128){const m={instancePath:i+"/segments/"+n+"/speaker/id",schemaPath:"#/properties/segments/items/properties/speaker/properties/id/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[m]:e.push(m),t++}}else{const m={instancePath:i+"/segments/"+n+"/speaker/id",schemaPath:"#/properties/segments/items/properties/speaker/properties/id/type",keyword:"type",params:{type:"string"}};e===null?e=[m]:e.push(m),t++}}if(r.name!==void 0&&c.call(r,"name")){let s=r.name;if(typeof s=="string"){if(d(s)>128){const m={instancePath:i+"/segments/"+n+"/speaker/name",schemaPath:"#/properties/segments/items/properties/speaker/properties/name/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[m]:e.push(m),t++}}else{const m={instancePath:i+"/segments/"+n+"/speaker/name",schemaPath:"#/properties/segments/items/properties/speaker/properties/name/type",keyword:"type",params:{type:"string"}};e===null?e=[m]:e.push(m),t++}}if(r.score!==void 0&&c.call(r,"score")){let s=r.score;if(typeof s=="number"&&isFinite(s)){if(s>1||isNaN(s)){const m={instancePath:i+"/segments/"+n+"/speaker/score",schemaPath:"#/properties/segments/items/properties/speaker/properties/score/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[m]:e.push(m),t++}if(s<0||isNaN(s)){const m={instancePath:i+"/segments/"+n+"/speaker/score",schemaPath:"#/properties/segments/items/properties/speaker/properties/score/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[m]:e.push(m),t++}}else{const m={instancePath:i+"/segments/"+n+"/speaker/score",schemaPath:"#/properties/segments/items/properties/speaker/properties/score/type",keyword:"type",params:{type:"number"}};e===null?e=[m]:e.push(m),t++}}}else{const s={instancePath:i+"/segments/"+n+"/speaker",schemaPath:"#/properties/segments/items/properties/speaker/type",keyword:"type",params:{type:"object"}};e===null?e=[s]:e.push(s),t++}}if(o.events!==void 0&&c.call(o,"events")){let r=o.events;if(Array.isArray(r)){if(r.length>64){const m={instancePath:i+"/segments/"+n+"/events",schemaPath:"#/properties/segments/items/properties/events/maxItems",keyword:"maxItems",params:{limit:64}};e===null?e=[m]:e.push(m),t++}const s=r.length;for(let m=0;m<s;m++){let f=r[m];if(typeof f=="string"){if(d(f)>128){const h={instancePath:i+"/segments/"+n+"/events/"+m,schemaPath:"#/properties/segments/items/properties/events/items/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[h]:e.push(h),t++}}else{const h={instancePath:i+"/segments/"+n+"/events/"+m,schemaPath:"#/properties/segments/items/properties/events/items/type",keyword:"type",params:{type:"string"}};e===null?e=[h]:e.push(h),t++}}}else{const s={instancePath:i+"/segments/"+n+"/events",schemaPath:"#/properties/segments/items/properties/events/type",keyword:"type",params:{type:"array"}};e===null?e=[s]:e.push(s),t++}}if(o.score!==void 0&&c.call(o,"score")){let r=o.score;if(typeof r=="number"&&isFinite(r)){if(r>1||isNaN(r)){const s={instancePath:i+"/segments/"+n+"/score",schemaPath:"#/properties/segments/items/properties/score/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[s]:e.push(s),t++}if(r<0||isNaN(r)){const s={instancePath:i+"/segments/"+n+"/score",schemaPath:"#/properties/segments/items/properties/score/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[s]:e.push(s),t++}}else{const s={instancePath:i+"/segments/"+n+"/score",schemaPath:"#/properties/segments/items/properties/score/type",keyword:"type",params:{type:"number"}};e===null?e=[s]:e.push(s),t++}}if(o.attributes!==void 0&&c.call(o,"attributes")){let r=o.attributes;if(r&&typeof r=="object"&&!Array.isArray(r)){if(Object.keys(r).length>16){const s={instancePath:i+"/segments/"+n+"/attributes",schemaPath:"#/properties/segments/items/properties/attributes/maxProperties",keyword:"maxProperties",params:{limit:16}};e===null?e=[s]:e.push(s),t++}for(const s of Object.keys(r)){const m=t;if(typeof s=="string"&&d(s)>128){const f={instancePath:i+"/segments/"+n+"/attributes",schemaPath:"#/properties/segments/items/properties/attributes/propertyNames/maxLength",keyword:"maxLength",params:{limit:128},propertyName:s};e===null?e=[f]:e.push(f),t++}var j=m===t;if(!j){const f={instancePath:i+"/segments/"+n+"/attributes",schemaPath:"#/properties/segments/items/properties/attributes/propertyNames",keyword:"propertyNames",params:{propertyName:s}};e===null?e=[f]:e.push(f),t++}}for(const s of Object.keys(r)){let m=r[s];const f=t;let h=!1;const u=t;if(typeof m=="string"){if(d(m)>1024){const y={instancePath:i+"/segments/"+n+"/attributes/"+s.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/segments/items/properties/attributes/additionalProperties/anyOf/0/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[y]:e.push(y),t++}}else{const y={instancePath:i+"/segments/"+n+"/attributes/"+s.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/segments/items/properties/attributes/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"}};e===null?e=[y]:e.push(y),t++}var g=u===t;h=h||g;const A=t;if(!(typeof m=="number"&&isFinite(m))){const y={instancePath:i+"/segments/"+n+"/attributes/"+s.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/segments/items/properties/attributes/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"number"}};e===null?e=[y]:e.push(y),t++}var g=A===t;h=h||g;const q=t;if(typeof m!="boolean"){const y={instancePath:i+"/segments/"+n+"/attributes/"+s.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/segments/items/properties/attributes/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"boolean"}};e===null?e=[y]:e.push(y),t++}var g=q===t;h=h||g;const I=t;if(m!==null){const y={instancePath:i+"/segments/"+n+"/attributes/"+s.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/segments/items/properties/attributes/additionalProperties/anyOf/3/type",keyword:"type",params:{type:"null"}};e===null?e=[y]:e.push(y),t++}var g=I===t;if(h=h||g,h)t=f,e!==null&&(f?e.length=f:e=null);else{const y={instancePath:i+"/segments/"+n+"/attributes/"+s.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/segments/items/properties/attributes/additionalProperties/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:t-f})};e===null?e=[y]:e.push(y),t++}}}else{const s={instancePath:i+"/segments/"+n+"/attributes",schemaPath:"#/properties/segments/items/properties/attributes/type",keyword:"type",params:{type:"object"}};e===null?e=[s]:e.push(s),t++}}}else{const r={instancePath:i+"/segments/"+n,schemaPath:"#/properties/segments/items/type",keyword:"type",params:{type:"object"}};e===null?e=[r]:e.push(r),t++}}}else{const a={instancePath:i+"/segments",schemaPath:"#/properties/segments/type",keyword:"type",params:{type:"array"}};e===null?e=[a]:e.push(a),t++}}if(l.attributes!==void 0&&c.call(l,"attributes")){let p=l.attributes;if(p&&typeof p=="object"&&!Array.isArray(p)){if(Object.keys(p).length>16){const a={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/maxProperties",keyword:"maxProperties",params:{limit:16}};e===null?e=[a]:e.push(a),t++}for(const a of Object.keys(p)){const n=t;if(typeof a=="string"&&d(a)>128){const o={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/propertyNames/maxLength",keyword:"maxLength",params:{limit:128},propertyName:a};e===null?e=[o]:e.push(o),t++}var N=n===t;if(!N){const o={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/propertyNames",keyword:"propertyNames",params:{propertyName:a}};e===null?e=[o]:e.push(o),t++}}for(const a of Object.keys(p)){let n=p[a];const o=t;let r=!1;const s=t;if(typeof n=="string"){if(d(n)>1024){const u={instancePath:i+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/0/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[u]:e.push(u),t++}}else{const u={instancePath:i+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"}};e===null?e=[u]:e.push(u),t++}var k=s===t;r=r||k;const m=t;if(!(typeof n=="number"&&isFinite(n))){const u={instancePath:i+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"number"}};e===null?e=[u]:e.push(u),t++}var k=m===t;r=r||k;const f=t;if(typeof n!="boolean"){const u={instancePath:i+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"boolean"}};e===null?e=[u]:e.push(u),t++}var k=f===t;r=r||k;const h=t;if(n!==null){const u={instancePath:i+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/3/type",keyword:"type",params:{type:"null"}};e===null?e=[u]:e.push(u),t++}var k=h===t;if(r=r||k,r)t=o,e!==null&&(o?e.length=o:e=null);else{const u={instancePath:i+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:t-o})};e===null?e=[u]:e.push(u),t++}}}else{const a={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/type",keyword:"type",params:{type:"object"}};e===null?e=[a]:e.push(a),t++}}}else{const p={instancePath:i,schemaPath:"#/type",keyword:"type",params:{type:"object"}};e===null?e=[p]:e.push(p),t++}return P.errors=e,t===0}P.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};export{M as default,D as validate};
@@ -0,0 +1,4 @@
1
+ // SPDX-FileCopyrightText: 2026 The OATS Authors
2
+ // SPDX-FileCopyrightText: 2015-2021 Evgeny Poberezkin
3
+ // SPDX-License-Identifier: Apache-2.0 AND MIT
4
+ import{FORMATS as x,ucs2length as j}from"../../formats.js";const S=P;var C=P;const y=Object.prototype.hasOwnProperty,b=j,A=x.uri,N=x["date-time"];function P(n,{instancePath:i="",parentData:I,parentDataProperty:q,rootData:T=n,dynamicAnchors:F={}}={}){let e=null,t=0;const k=P.evaluated;if(k.dynamicProps&&(k.props=void 0),k.dynamicItems&&(k.items=void 0),n&&typeof n=="object"&&!Array.isArray(n)){if(n.labels===void 0||!y.call(n,"labels")){const l={instancePath:i,schemaPath:"#/required",keyword:"required",params:{missingProperty:"labels"}};e===null?e=[l]:e.push(l),t++}for(const l of Object.keys(n))if(!(l==="target"||l==="producer"||l==="score_explanation"||l==="vocabulary"||l==="vocabulary_url"||l==="labels"||l==="attributes")){const r={instancePath:i,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:l}};e===null?e=[r]:e.push(r),t++}if(n.target!==void 0&&y.call(n,"target")){let l=n.target;if(typeof l=="string"){if(b(l)>256){const r={instancePath:i+"/target",schemaPath:"#/properties/target/maxLength",keyword:"maxLength",params:{limit:256}};e===null?e=[r]:e.push(r),t++}}else{const r={instancePath:i+"/target",schemaPath:"#/properties/target/type",keyword:"type",params:{type:"string"}};e===null?e=[r]:e.push(r),t++}}if(n.producer!==void 0&&y.call(n,"producer")){let l=n.producer;if(typeof l=="string"){if(b(l)>1024){const r={instancePath:i+"/producer",schemaPath:"#/properties/producer/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[r]:e.push(r),t++}}else{const r={instancePath:i+"/producer",schemaPath:"#/properties/producer/type",keyword:"type",params:{type:"string"}};e===null?e=[r]:e.push(r),t++}}if(n.score_explanation!==void 0&&y.call(n,"score_explanation")){let l=n.score_explanation;if(typeof l=="string"){if(b(l)>256){const r={instancePath:i+"/score_explanation",schemaPath:"#/properties/score_explanation/maxLength",keyword:"maxLength",params:{limit:256}};e===null?e=[r]:e.push(r),t++}}else{const r={instancePath:i+"/score_explanation",schemaPath:"#/properties/score_explanation/type",keyword:"type",params:{type:"string"}};e===null?e=[r]:e.push(r),t++}}if(n.vocabulary!==void 0&&y.call(n,"vocabulary")){let l=n.vocabulary;if(Array.isArray(l)){if(l.length>100){const s={instancePath:i+"/vocabulary",schemaPath:"#/properties/vocabulary/maxItems",keyword:"maxItems",params:{limit:100}};e===null?e=[s]:e.push(s),t++}const r=l.length;for(let s=0;s<r;s++){let a=l[s];if(typeof a=="string"){if(b(a)>128){const m={instancePath:i+"/vocabulary/"+s,schemaPath:"#/properties/vocabulary/items/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[m]:e.push(m),t++}}else{const m={instancePath:i+"/vocabulary/"+s,schemaPath:"#/properties/vocabulary/items/type",keyword:"type",params:{type:"string"}};e===null?e=[m]:e.push(m),t++}}let o=l.length,p;if(o>1){const s={};for(;o--;){let a=l[o];if(typeof a=="string"){if(typeof s[a]=="number"){p=s[a];const m={instancePath:i+"/vocabulary",schemaPath:"#/properties/vocabulary/uniqueItems",keyword:"uniqueItems",params:{i:o,j:p}};e===null?e=[m]:e.push(m),t++;break}s[a]=o}}}}else{const r={instancePath:i+"/vocabulary",schemaPath:"#/properties/vocabulary/type",keyword:"type",params:{type:"array"}};e===null?e=[r]:e.push(r),t++}}if(n.vocabulary_url!==void 0&&y.call(n,"vocabulary_url")){let l=n.vocabulary_url;if(typeof l=="string"){if(b(l)>2048){const r={instancePath:i+"/vocabulary_url",schemaPath:"#/properties/vocabulary_url/maxLength",keyword:"maxLength",params:{limit:2048}};e===null?e=[r]:e.push(r),t++}if(!A(l)){const r={instancePath:i+"/vocabulary_url",schemaPath:"#/properties/vocabulary_url/format",keyword:"format",params:{format:"uri"}};e===null?e=[r]:e.push(r),t++}}else{const r={instancePath:i+"/vocabulary_url",schemaPath:"#/properties/vocabulary_url/type",keyword:"type",params:{type:"string"}};e===null?e=[r]:e.push(r),t++}}if(n.labels!==void 0&&y.call(n,"labels")){let l=n.labels;if(Array.isArray(l)){if(l.length>1e4){const o={instancePath:i+"/labels",schemaPath:"#/properties/labels/maxItems",keyword:"maxItems",params:{limit:1e4}};e===null?e=[o]:e.push(o),t++}if(l.length<0){const o={instancePath:i+"/labels",schemaPath:"#/properties/labels/minItems",keyword:"minItems",params:{limit:0}};e===null?e=[o]:e.push(o),t++}const r=l.length;for(let o=0;o<r;o++){let p=l[o];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.label===void 0||!y.call(p,"label")){const s={instancePath:i+"/labels/"+o,schemaPath:"#/properties/labels/items/required",keyword:"required",params:{missingProperty:"label"}};e===null?e=[s]:e.push(s),t++}for(const s of Object.keys(p))if(!(s==="label"||s==="score"||s==="timestamp"||s==="attributes")){const a={instancePath:i+"/labels/"+o,schemaPath:"#/properties/labels/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s}};e===null?e=[a]:e.push(a),t++}if(p.label!==void 0&&y.call(p,"label")){let s=p.label;if(typeof s=="string"){if(b(s)>128){const a={instancePath:i+"/labels/"+o+"/label",schemaPath:"#/properties/labels/items/properties/label/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/labels/"+o+"/label",schemaPath:"#/properties/labels/items/properties/label/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),t++}}if(p.score!==void 0&&y.call(p,"score")){let s=p.score;if(typeof s=="number"&&isFinite(s)){if(s>1||isNaN(s)){const a={instancePath:i+"/labels/"+o+"/score",schemaPath:"#/properties/labels/items/properties/score/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[a]:e.push(a),t++}if(s<-1||isNaN(s)){const a={instancePath:i+"/labels/"+o+"/score",schemaPath:"#/properties/labels/items/properties/score/minimum",keyword:"minimum",params:{comparison:">=",limit:-1}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/labels/"+o+"/score",schemaPath:"#/properties/labels/items/properties/score/type",keyword:"type",params:{type:"number"}};e===null?e=[a]:e.push(a),t++}}if(p.timestamp!==void 0&&y.call(p,"timestamp")){let s=p.timestamp;if(typeof s=="string"){if(b(s)>128){const a={instancePath:i+"/labels/"+o+"/timestamp",schemaPath:"#/properties/labels/items/properties/timestamp/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[a]:e.push(a),t++}if(!N(s)){const a={instancePath:i+"/labels/"+o+"/timestamp",schemaPath:"#/properties/labels/items/properties/timestamp/format",keyword:"format",params:{format:"date-time"}};e===null?e=[a]:e.push(a),t++}}else{const a={instancePath:i+"/labels/"+o+"/timestamp",schemaPath:"#/properties/labels/items/properties/timestamp/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),t++}}if(p.attributes!==void 0&&y.call(p,"attributes")){let s=p.attributes;if(s&&typeof s=="object"&&!Array.isArray(s)){if(Object.keys(s).length>16){const a={instancePath:i+"/labels/"+o+"/attributes",schemaPath:"#/properties/labels/items/properties/attributes/maxProperties",keyword:"maxProperties",params:{limit:16}};e===null?e=[a]:e.push(a),t++}for(const a of Object.keys(s)){const m=t;if(typeof a=="string"&&b(a)>128){const h={instancePath:i+"/labels/"+o+"/attributes",schemaPath:"#/properties/labels/items/properties/attributes/propertyNames/maxLength",keyword:"maxLength",params:{limit:128},propertyName:a};e===null?e=[h]:e.push(h),t++}var w=m===t;if(!w){const h={instancePath:i+"/labels/"+o+"/attributes",schemaPath:"#/properties/labels/items/properties/attributes/propertyNames",keyword:"propertyNames",params:{propertyName:a}};e===null?e=[h]:e.push(h),t++}}for(const a of Object.keys(s)){let m=s[a];const h=t;let f=!1;const c=t;if(typeof m=="string"){if(b(m)>1024){const u={instancePath:i+"/labels/"+o+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/labels/items/properties/attributes/additionalProperties/anyOf/0/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[u]:e.push(u),t++}}else{const u={instancePath:i+"/labels/"+o+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/labels/items/properties/attributes/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"}};e===null?e=[u]:e.push(u),t++}var d=c===t;f=f||d;const L=t;if(!(typeof m=="number"&&isFinite(m))){const u={instancePath:i+"/labels/"+o+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/labels/items/properties/attributes/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"number"}};e===null?e=[u]:e.push(u),t++}var d=L===t;f=f||d;const _=t;if(typeof m!="boolean"){const u={instancePath:i+"/labels/"+o+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/labels/items/properties/attributes/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"boolean"}};e===null?e=[u]:e.push(u),t++}var d=_===t;f=f||d;const O=t;if(m!==null){const u={instancePath:i+"/labels/"+o+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/labels/items/properties/attributes/additionalProperties/anyOf/3/type",keyword:"type",params:{type:"null"}};e===null?e=[u]:e.push(u),t++}var d=O===t;if(f=f||d,f)t=h,e!==null&&(h?e.length=h:e=null);else{const u={instancePath:i+"/labels/"+o+"/attributes/"+a.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/labels/items/properties/attributes/additionalProperties/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:t-h})};e===null?e=[u]:e.push(u),t++}}}else{const a={instancePath:i+"/labels/"+o+"/attributes",schemaPath:"#/properties/labels/items/properties/attributes/type",keyword:"type",params:{type:"object"}};e===null?e=[a]:e.push(a),t++}}}else{const s={instancePath:i+"/labels/"+o,schemaPath:"#/properties/labels/items/type",keyword:"type",params:{type:"object"}};e===null?e=[s]:e.push(s),t++}}}else{const r={instancePath:i+"/labels",schemaPath:"#/properties/labels/type",keyword:"type",params:{type:"array"}};e===null?e=[r]:e.push(r),t++}}if(n.attributes!==void 0&&y.call(n,"attributes")){let l=n.attributes;if(l&&typeof l=="object"&&!Array.isArray(l)){if(Object.keys(l).length>16){const r={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/maxProperties",keyword:"maxProperties",params:{limit:16}};e===null?e=[r]:e.push(r),t++}for(const r of Object.keys(l)){const o=t;if(typeof r=="string"&&b(r)>128){const p={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/propertyNames/maxLength",keyword:"maxLength",params:{limit:128},propertyName:r};e===null?e=[p]:e.push(p),t++}var v=o===t;if(!v){const p={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/propertyNames",keyword:"propertyNames",params:{propertyName:r}};e===null?e=[p]:e.push(p),t++}}for(const r of Object.keys(l)){let o=l[r];const p=t;let s=!1;const a=t;if(typeof o=="string"){if(b(o)>1024){const c={instancePath:i+"/attributes/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/0/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[c]:e.push(c),t++}}else{const c={instancePath:i+"/attributes/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"}};e===null?e=[c]:e.push(c),t++}var g=a===t;s=s||g;const m=t;if(!(typeof o=="number"&&isFinite(o))){const c={instancePath:i+"/attributes/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"number"}};e===null?e=[c]:e.push(c),t++}var g=m===t;s=s||g;const h=t;if(typeof o!="boolean"){const c={instancePath:i+"/attributes/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"boolean"}};e===null?e=[c]:e.push(c),t++}var g=h===t;s=s||g;const f=t;if(o!==null){const c={instancePath:i+"/attributes/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/3/type",keyword:"type",params:{type:"null"}};e===null?e=[c]:e.push(c),t++}var g=f===t;if(s=s||g,s)t=p,e!==null&&(p?e.length=p:e=null);else{const c={instancePath:i+"/attributes/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:t-p})};e===null?e=[c]:e.push(c),t++}}}else{const r={instancePath:i+"/attributes",schemaPath:"#/properties/attributes/type",keyword:"type",params:{type:"object"}};e===null?e=[r]:e.push(r),t++}}}else{const l={instancePath:i,schemaPath:"#/type",keyword:"type",params:{type:"object"}};e===null?e=[l]:e.push(l),t++}return P.errors=e,t===0}P.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};export{C as default,S as validate};
@@ -0,0 +1,4 @@
1
+ // SPDX-FileCopyrightText: 2026 The OATS Authors
2
+ // SPDX-FileCopyrightText: 2015-2021 Evgeny Poberezkin
3
+ // SPDX-License-Identifier: Apache-2.0 AND MIT
4
+ import{ucs2length as ue}from"../../formats.js";const ke=z;var xe=z;const C={"x-license":{id:"Apache-2.0",notice:"Copyright 2025-2026 The OATS Authors",url:"https://github.com/oatschema/oats/blob/main/LICENSE"},$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://oatschema.org/0.8.0/document-extraction",title:"Document Extraction","x-version":"0.8.0",description:"Represent the layout and content of a document, including text blocks, geometric coordinates, and page structure.",type:"object",properties:{extraction_type:{type:"string",description:"Optionally indicate the extraction type.",enum:["text","lines","boxes","polygons","mixed"]},producer:{type:"string",description:"The creator (model, tool or author) of this extraction.",maxLength:1024},unit:{type:"string",description:"The unit for all coordinate values: 'px' for pixels, 'pt' for typographic points, 'normalized' for values from 0.0 to 1.0, and 'per_mille' for values from 0 to 1000. Required whenever geometric data is present.",enum:["px","pt","normalized","per_mille"]},page_width:{description:"The width of the page(s), in the record's unit if 'px' or 'pt', otherwise in any unit shared with page_height. Can be a single number for uniform documents, or an array of objects mapping specific widths to page numbers.",oneOf:[{type:"number",title:"Uniform Width",exclusiveMinimum:0},{type:"array",title:"Variable Widths",minItems:1,maxItems:1e4,items:{type:"object",description:"A width shared by one or more pages.",properties:{value:{type:"number",description:"The width of these pages.",exclusiveMinimum:0},pages:{type:"array",description:"The page numbers (1-indexed) that share this width.",minItems:1,maxItems:1e5,uniqueItems:!0,items:{type:"integer",minimum:1}}},required:["value","pages"],additionalProperties:!1}}]},page_height:{description:"The height of the page(s), in the record's unit if 'px' or 'pt', otherwise in any unit shared with page_width. Can be a single number for uniform documents, or an array of objects mapping specific heights to page numbers.",oneOf:[{type:"number",title:"Uniform Height",exclusiveMinimum:0},{type:"array",title:"Variable Heights",minItems:1,maxItems:1e4,items:{type:"object",description:"A height shared by one or more pages.",properties:{value:{type:"number",description:"The height of these pages.",exclusiveMinimum:0},pages:{type:"array",description:"The page numbers (1-indexed) that share this height.",minItems:1,maxItems:1e5,uniqueItems:!0,items:{type:"integer",minimum:1}}},required:["value","pages"],additionalProperties:!1}}]},score_explanation:{type:"string",description:"Defines the meaning of the 'score' field.",maxLength:256},blocks:{type:"array",description:"An array of text blocks extracted from the document.",maxItems:1e5,items:{type:"object",description:"A single extracted block of text or geometry.",properties:{block_type:{type:"string",description:"Defines the nature of this specific block (text, line, box, polygon, or multi_polygon).",enum:["text","line","box","polygon","multi_polygon"]},id:{type:"string",description:"A unique identifier (e.g., UUID4) for this block, useful for referencing.",maxLength:128},text:{type:"string",description:"The text content of the block. Required for text and line block types.",maxLength:4096},line_number:{type:"integer",description:"The line number of the block within its page, if applicable.",minimum:1},page_number:{type:"integer",description:"The page number (1-indexed) where this block is located.",minimum:1},score:{type:"number",description:"The confidence score for this block's detection and transcription, ranging from 0.0 (uncertain) to 1.0 (certain).",minimum:0,maximum:1},box:{type:"object",description:"A rectangular bounding box defined by its top-left corner (x, y) and its dimensions.",properties:{x:{type:"number",description:"The x-coordinate of the top-left corner.",minimum:0},y:{type:"number",description:"The y-coordinate of the top-left corner.",minimum:0},width:{type:"number",description:"The width of the box.",minimum:0},height:{type:"number",description:"The height of the box.",minimum:0}},required:["x","y","width","height"],additionalProperties:!1},polygon:{type:"array",description:"An ordered list of vertices defining a non-rectangular boundary.",minItems:3,maxItems:1e3,items:{type:"object",description:"A single vertex, measured from the top-left corner of the page or image.",properties:{x:{type:"number",description:"The x-coordinate of the vertex.",minimum:0},y:{type:"number",description:"The y-coordinate of the vertex.",minimum:0}},required:["x","y"],additionalProperties:!1}},multi_polygon:{type:"array",description:"A list of polygons, for a single region that is occluded or fragmented into multiple visible parts.",minItems:1,maxItems:100,items:{type:"array",description:"An ordered list of vertices defining a non-rectangular boundary.",minItems:3,maxItems:1e3,items:{type:"object",description:"A single vertex, measured from the top-left corner of the page or image.",properties:{x:{type:"number",description:"The x-coordinate of the vertex.",minimum:0},y:{type:"number",description:"The y-coordinate of the vertex.",minimum:0}},required:["x","y"],additionalProperties:!1}}},attributes:{type:"object",description:"Arbitrary metadata relevant to this block.",maxProperties:16,propertyNames:{maxLength:128},additionalProperties:{anyOf:[{type:"string",maxLength:1024},{type:"number"},{type:"boolean"},{type:"null"}]}}},required:["block_type"],allOf:[{if:{properties:{block_type:{enum:["text","line"]}}},then:{required:["text"]}},{if:{properties:{block_type:{const:"box"}}},then:{required:["box"]}},{if:{properties:{block_type:{const:"polygon"}}},then:{required:["polygon"]}},{if:{properties:{block_type:{const:"multi_polygon"}}},then:{required:["multi_polygon"]}},{if:{properties:{block_type:{const:"line"}}},then:{anyOf:[{required:["box"]},{required:["polygon"]},{required:["multi_polygon"]}]}}],additionalProperties:!1}},attributes:{type:"object",description:"Arbitrary metadata relevant to this extraction.",maxProperties:16,propertyNames:{maxLength:128},additionalProperties:{anyOf:[{type:"string",maxLength:1024},{type:"number"},{type:"boolean"},{type:"null"}]}}},required:["blocks"],allOf:[{if:{properties:{blocks:{contains:{anyOf:[{required:["box"]},{required:["polygon"]},{required:["multi_polygon"]}]}}},required:["blocks"]},then:{required:["unit"]}},{if:{properties:{unit:{const:"normalized"}},required:["unit"]},then:{properties:{blocks:{items:{properties:{box:{properties:{x:{maximum:1},y:{maximum:1},width:{maximum:1},height:{maximum:1}}},polygon:{items:{properties:{x:{maximum:1},y:{maximum:1}}}},multi_polygon:{items:{items:{properties:{x:{maximum:1},y:{maximum:1}}}}}}}}}}},{if:{properties:{unit:{const:"per_mille"}},required:["unit"]},then:{properties:{blocks:{items:{properties:{box:{properties:{x:{maximum:1e3},y:{maximum:1e3},width:{maximum:1e3},height:{maximum:1e3}}},polygon:{items:{properties:{x:{maximum:1e3},y:{maximum:1e3}}}},multi_polygon:{items:{items:{properties:{x:{maximum:1e3},y:{maximum:1e3}}}}}}}}}}}],additionalProperties:!1},m=Object.prototype.hasOwnProperty,L=ue;function z(h,{instancePath:t="",parentData:fe,parentDataProperty:ye,rootData:he=h,dynamicAnchors:de={}}={}){let e=null,i=0;const S=z.evaluated;S.dynamicProps&&(S.props=void 0),S.dynamicItems&&(S.items=void 0);const R=i;let re=!0;const le=i;if(h&&typeof h=="object"&&!Array.isArray(h)){let u;if((h.blocks===void 0||!m.call(h,"blocks"))&&(u="blocks")){const y={};e===null?e=[y]:e.push(y),i++}else if(h.blocks!==void 0&&m.call(h,"blocks")){let y=h.blocks;if(Array.isArray(y)){const o=i,s=y.length;for(let k=0;k<s;k++){let g=y[k];const f=i,p=i;let c=!1;const a=i;if(g&&typeof g=="object"&&!Array.isArray(g)){let P;if((g.box===void 0||!m.call(g,"box"))&&(P="box")){const d={};e===null?e=[d]:e.push(d),i++}}var E=a===i;c=c||E;const b=i;if(g&&typeof g=="object"&&!Array.isArray(g)){let P;if((g.polygon===void 0||!m.call(g,"polygon"))&&(P="polygon")){const d={};e===null?e=[d]:e.push(d),i++}}var E=b===i;c=c||E;const _=i;if(g&&typeof g=="object"&&!Array.isArray(g)){let P;if((g.multi_polygon===void 0||!m.call(g,"multi_polygon"))&&(P="multi_polygon")){const d={};e===null?e=[d]:e.push(d),i++}}var E=_===i;if(c=c||E,c)i=p,e!==null&&(p?e.length=p:e=null);else{const P={};e===null?e=[P]:e.push(P),i++}var se=f===i;if(se)break}if(se)i=o,e!==null&&(o?e.length=o:e=null);else{const k={};e===null?e=[k]:e.push(k),i++}}}}var H=le===i;if(i=R,e!==null&&(R?e.length=R:e=null),H){const u=i;if(h&&typeof h=="object"&&!Array.isArray(h)&&(h.unit===void 0||!m.call(h,"unit"))){const o={instancePath:t,schemaPath:"#/allOf/0/then/required",keyword:"required",params:{missingProperty:"unit"}};e===null?e=[o]:e.push(o),i++}var H=u===i;re=H}if(!re){const u={instancePath:t,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[u]:e.push(u),i++}const W=i;let $=!0;const pe=i;if(h&&typeof h=="object"&&!Array.isArray(h)){let u;if((h.unit===void 0||!m.call(h,"unit"))&&(u="unit")){const y={};e===null?e=[y]:e.push(y),i++}else if(h.unit!==void 0&&m.call(h,"unit")&&h.unit!=="normalized"){const y={};e===null?e=[y]:e.push(y),i++}}var B=pe===i;if(i=W,e!==null&&(W?e.length=W:e=null),B){const u=i;if(h&&typeof h=="object"&&!Array.isArray(h)&&h.blocks!==void 0&&m.call(h,"blocks")){let o=h.blocks;if(Array.isArray(o)){const s=o.length;for(let k=0;k<s;k++){let g=o[k];if(g&&typeof g=="object"&&!Array.isArray(g)){if(g.box!==void 0&&m.call(g,"box")){let f=g.box;if(f&&typeof f=="object"&&!Array.isArray(f)){if(f.x!==void 0&&m.call(f,"x")){let p=f.x;if(typeof p=="number"&&isFinite(p)&&(p>1||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/x",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/box/properties/x/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[c]:e.push(c),i++}}if(f.y!==void 0&&m.call(f,"y")){let p=f.y;if(typeof p=="number"&&isFinite(p)&&(p>1||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/y",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/box/properties/y/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[c]:e.push(c),i++}}if(f.width!==void 0&&m.call(f,"width")){let p=f.width;if(typeof p=="number"&&isFinite(p)&&(p>1||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/width",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/box/properties/width/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[c]:e.push(c),i++}}if(f.height!==void 0&&m.call(f,"height")){let p=f.height;if(typeof p=="number"&&isFinite(p)&&(p>1||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/height",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/box/properties/height/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[c]:e.push(c),i++}}}}if(g.polygon!==void 0&&m.call(g,"polygon")){let f=g.polygon;if(Array.isArray(f)){const p=f.length;for(let c=0;c<p;c++){let a=f[c];if(a&&typeof a=="object"&&!Array.isArray(a)){if(a.x!==void 0&&m.call(a,"x")){let b=a.x;if(typeof b=="number"&&isFinite(b)&&(b>1||isNaN(b))){const _={instancePath:t+"/blocks/"+k+"/polygon/"+c+"/x",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/polygon/items/properties/x/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[_]:e.push(_),i++}}if(a.y!==void 0&&m.call(a,"y")){let b=a.y;if(typeof b=="number"&&isFinite(b)&&(b>1||isNaN(b))){const _={instancePath:t+"/blocks/"+k+"/polygon/"+c+"/y",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/polygon/items/properties/y/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[_]:e.push(_),i++}}}}}}if(g.multi_polygon!==void 0&&m.call(g,"multi_polygon")){let f=g.multi_polygon;if(Array.isArray(f)){const p=f.length;for(let c=0;c<p;c++){let a=f[c];if(Array.isArray(a)){const b=a.length;for(let _=0;_<b;_++){let P=a[_];if(P&&typeof P=="object"&&!Array.isArray(P)){if(P.x!==void 0&&m.call(P,"x")){let d=P.x;if(typeof d=="number"&&isFinite(d)&&(d>1||isNaN(d))){const x={instancePath:t+"/blocks/"+k+"/multi_polygon/"+c+"/"+_+"/x",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/multi_polygon/items/items/properties/x/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[x]:e.push(x),i++}}if(P.y!==void 0&&m.call(P,"y")){let d=P.y;if(typeof d=="number"&&isFinite(d)&&(d>1||isNaN(d))){const x={instancePath:t+"/blocks/"+k+"/multi_polygon/"+c+"/"+_+"/y",schemaPath:"#/allOf/1/then/properties/blocks/items/properties/multi_polygon/items/items/properties/y/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[x]:e.push(x),i++}}}}}}}}}}}}var B=u===i;if($=B,$){var F={};F.blocks=!0,F.unit=!0}}if(!$){const u={instancePath:t,schemaPath:"#/allOf/1/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[u]:e.push(u),i++}F!==!0&&(F=F||{},F.blocks=!0);const G=i;let J=!0;const ae=i;if(h&&typeof h=="object"&&!Array.isArray(h)){let u;if((h.unit===void 0||!m.call(h,"unit"))&&(u="unit")){const y={};e===null?e=[y]:e.push(y),i++}else if(h.unit!==void 0&&m.call(h,"unit")&&h.unit!=="per_mille"){const y={};e===null?e=[y]:e.push(y),i++}}var Q=ae===i;if(i=G,e!==null&&(G?e.length=G:e=null),Q){const u=i;if(h&&typeof h=="object"&&!Array.isArray(h)&&h.blocks!==void 0&&m.call(h,"blocks")){let o=h.blocks;if(Array.isArray(o)){const s=o.length;for(let k=0;k<s;k++){let g=o[k];if(g&&typeof g=="object"&&!Array.isArray(g)){if(g.box!==void 0&&m.call(g,"box")){let f=g.box;if(f&&typeof f=="object"&&!Array.isArray(f)){if(f.x!==void 0&&m.call(f,"x")){let p=f.x;if(typeof p=="number"&&isFinite(p)&&(p>1e3||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/x",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/box/properties/x/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[c]:e.push(c),i++}}if(f.y!==void 0&&m.call(f,"y")){let p=f.y;if(typeof p=="number"&&isFinite(p)&&(p>1e3||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/y",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/box/properties/y/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[c]:e.push(c),i++}}if(f.width!==void 0&&m.call(f,"width")){let p=f.width;if(typeof p=="number"&&isFinite(p)&&(p>1e3||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/width",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/box/properties/width/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[c]:e.push(c),i++}}if(f.height!==void 0&&m.call(f,"height")){let p=f.height;if(typeof p=="number"&&isFinite(p)&&(p>1e3||isNaN(p))){const c={instancePath:t+"/blocks/"+k+"/box/height",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/box/properties/height/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[c]:e.push(c),i++}}}}if(g.polygon!==void 0&&m.call(g,"polygon")){let f=g.polygon;if(Array.isArray(f)){const p=f.length;for(let c=0;c<p;c++){let a=f[c];if(a&&typeof a=="object"&&!Array.isArray(a)){if(a.x!==void 0&&m.call(a,"x")){let b=a.x;if(typeof b=="number"&&isFinite(b)&&(b>1e3||isNaN(b))){const _={instancePath:t+"/blocks/"+k+"/polygon/"+c+"/x",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/polygon/items/properties/x/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[_]:e.push(_),i++}}if(a.y!==void 0&&m.call(a,"y")){let b=a.y;if(typeof b=="number"&&isFinite(b)&&(b>1e3||isNaN(b))){const _={instancePath:t+"/blocks/"+k+"/polygon/"+c+"/y",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/polygon/items/properties/y/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[_]:e.push(_),i++}}}}}}if(g.multi_polygon!==void 0&&m.call(g,"multi_polygon")){let f=g.multi_polygon;if(Array.isArray(f)){const p=f.length;for(let c=0;c<p;c++){let a=f[c];if(Array.isArray(a)){const b=a.length;for(let _=0;_<b;_++){let P=a[_];if(P&&typeof P=="object"&&!Array.isArray(P)){if(P.x!==void 0&&m.call(P,"x")){let d=P.x;if(typeof d=="number"&&isFinite(d)&&(d>1e3||isNaN(d))){const x={instancePath:t+"/blocks/"+k+"/multi_polygon/"+c+"/"+_+"/x",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/multi_polygon/items/items/properties/x/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[x]:e.push(x),i++}}if(P.y!==void 0&&m.call(P,"y")){let d=P.y;if(typeof d=="number"&&isFinite(d)&&(d>1e3||isNaN(d))){const x={instancePath:t+"/blocks/"+k+"/multi_polygon/"+c+"/"+_+"/y",schemaPath:"#/allOf/2/then/properties/blocks/items/properties/multi_polygon/items/items/properties/y/maximum",keyword:"maximum",params:{comparison:"<=",limit:1e3}};e===null?e=[x]:e.push(x),i++}}}}}}}}}}}}var Q=u===i;if(J=Q,J){var K={};K.blocks=!0,K.unit=!0}}if(!J){const u={instancePath:t,schemaPath:"#/allOf/2/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[u]:e.push(u),i++}if(F!==!0&&K!==void 0&&(K===!0?F=!0:(F=F||{},Object.assign(F,K))),h&&typeof h=="object"&&!Array.isArray(h)){if(h.blocks===void 0||!m.call(h,"blocks")){const u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"blocks"}};e===null?e=[u]:e.push(u),i++}for(const u of Object.keys(h))if(!(u==="extraction_type"||u==="producer"||u==="unit"||u==="page_width"||u==="page_height"||u==="score_explanation"||u==="blocks"||u==="attributes")){const y={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:u}};e===null?e=[y]:e.push(y),i++}if(h.extraction_type!==void 0&&m.call(h,"extraction_type")){let u=h.extraction_type;if(typeof u!="string"){const y={instancePath:t+"/extraction_type",schemaPath:"#/properties/extraction_type/type",keyword:"type",params:{type:"string"}};e===null?e=[y]:e.push(y),i++}if(!(u==="text"||u==="lines"||u==="boxes"||u==="polygons"||u==="mixed")){const y={instancePath:t+"/extraction_type",schemaPath:"#/properties/extraction_type/enum",keyword:"enum",params:{allowedValues:C.properties.extraction_type.enum}};e===null?e=[y]:e.push(y),i++}}if(h.producer!==void 0&&m.call(h,"producer")){let u=h.producer;if(typeof u=="string"){if(L(u)>1024){const y={instancePath:t+"/producer",schemaPath:"#/properties/producer/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[y]:e.push(y),i++}}else{const y={instancePath:t+"/producer",schemaPath:"#/properties/producer/type",keyword:"type",params:{type:"string"}};e===null?e=[y]:e.push(y),i++}}if(h.unit!==void 0&&m.call(h,"unit")){let u=h.unit;if(typeof u!="string"){const y={instancePath:t+"/unit",schemaPath:"#/properties/unit/type",keyword:"type",params:{type:"string"}};e===null?e=[y]:e.push(y),i++}if(!(u==="px"||u==="pt"||u==="normalized"||u==="per_mille")){const y={instancePath:t+"/unit",schemaPath:"#/properties/unit/enum",keyword:"enum",params:{allowedValues:C.properties.unit.enum}};e===null?e=[y]:e.push(y),i++}}if(h.page_width!==void 0&&m.call(h,"page_width")){let u=h.page_width;const y=i;let o=!1,s=null;const k=i;if(typeof u=="number"&&isFinite(u)){if(u<=0||isNaN(u)){const f={instancePath:t+"/page_width",schemaPath:"#/properties/page_width/oneOf/0/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0}};e===null?e=[f]:e.push(f),i++}}else{const f={instancePath:t+"/page_width",schemaPath:"#/properties/page_width/oneOf/0/type",keyword:"type",params:{type:"number"}};e===null?e=[f]:e.push(f),i++}var U=k===i;U&&(o=!0,s=0);const g=i;if(Array.isArray(u)){if(u.length>1e4){const p={instancePath:t+"/page_width",schemaPath:"#/properties/page_width/oneOf/1/maxItems",keyword:"maxItems",params:{limit:1e4}};e===null?e=[p]:e.push(p),i++}if(u.length<1){const p={instancePath:t+"/page_width",schemaPath:"#/properties/page_width/oneOf/1/minItems",keyword:"minItems",params:{limit:1}};e===null?e=[p]:e.push(p),i++}const f=u.length;for(let p=0;p<f;p++){let c=u[p];if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.value===void 0||!m.call(c,"value")){const a={instancePath:t+"/page_width/"+p,schemaPath:"#/properties/page_width/oneOf/1/items/required",keyword:"required",params:{missingProperty:"value"}};e===null?e=[a]:e.push(a),i++}if(c.pages===void 0||!m.call(c,"pages")){const a={instancePath:t+"/page_width/"+p,schemaPath:"#/properties/page_width/oneOf/1/items/required",keyword:"required",params:{missingProperty:"pages"}};e===null?e=[a]:e.push(a),i++}for(const a of Object.keys(c))if(!(a==="value"||a==="pages")){const b={instancePath:t+"/page_width/"+p,schemaPath:"#/properties/page_width/oneOf/1/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a}};e===null?e=[b]:e.push(b),i++}if(c.value!==void 0&&m.call(c,"value")){let a=c.value;if(typeof a=="number"&&isFinite(a)){if(a<=0||isNaN(a)){const b={instancePath:t+"/page_width/"+p+"/value",schemaPath:"#/properties/page_width/oneOf/1/items/properties/value/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0}};e===null?e=[b]:e.push(b),i++}}else{const b={instancePath:t+"/page_width/"+p+"/value",schemaPath:"#/properties/page_width/oneOf/1/items/properties/value/type",keyword:"type",params:{type:"number"}};e===null?e=[b]:e.push(b),i++}}if(c.pages!==void 0&&m.call(c,"pages")){let a=c.pages;if(Array.isArray(a)){if(a.length>1e5){const d={instancePath:t+"/page_width/"+p+"/pages",schemaPath:"#/properties/page_width/oneOf/1/items/properties/pages/maxItems",keyword:"maxItems",params:{limit:1e5}};e===null?e=[d]:e.push(d),i++}if(a.length<1){const d={instancePath:t+"/page_width/"+p+"/pages",schemaPath:"#/properties/page_width/oneOf/1/items/properties/pages/minItems",keyword:"minItems",params:{limit:1}};e===null?e=[d]:e.push(d),i++}const b=a.length;for(let d=0;d<b;d++){let x=a[d];if(!(typeof x=="number"&&!(x%1)&&!isNaN(x)&&isFinite(x))){const N={instancePath:t+"/page_width/"+p+"/pages/"+d,schemaPath:"#/properties/page_width/oneOf/1/items/properties/pages/items/type",keyword:"type",params:{type:"integer"}};e===null?e=[N]:e.push(N),i++}if(typeof x=="number"&&isFinite(x)&&(x<1||isNaN(x))){const N={instancePath:t+"/page_width/"+p+"/pages/"+d,schemaPath:"#/properties/page_width/oneOf/1/items/properties/pages/items/minimum",keyword:"minimum",params:{comparison:">=",limit:1}};e===null?e=[N]:e.push(N),i++}}let _=a.length,P;if(_>1){const d={};for(;_--;){let x=a[_];if(typeof x=="number"&&!(x%1)&&!isNaN(x)&&isFinite(x)){if(typeof d[x]=="number"){P=d[x];const N={instancePath:t+"/page_width/"+p+"/pages",schemaPath:"#/properties/page_width/oneOf/1/items/properties/pages/uniqueItems",keyword:"uniqueItems",params:{i:_,j:P}};e===null?e=[N]:e.push(N),i++;break}d[x]=_}}}}else{const b={instancePath:t+"/page_width/"+p+"/pages",schemaPath:"#/properties/page_width/oneOf/1/items/properties/pages/type",keyword:"type",params:{type:"array"}};e===null?e=[b]:e.push(b),i++}}}else{const a={instancePath:t+"/page_width/"+p,schemaPath:"#/properties/page_width/oneOf/1/items/type",keyword:"type",params:{type:"object"}};e===null?e=[a]:e.push(a),i++}}}else{const f={instancePath:t+"/page_width",schemaPath:"#/properties/page_width/oneOf/1/type",keyword:"type",params:{type:"array"}};e===null?e=[f]:e.push(f),i++}var U=g===i;if(U&&o?(o=!1,s=[s,1]):U&&(o=!0,s=1),o)i=y,e!==null&&(y?e.length=y:e=null);else{const f={instancePath:t+"/page_width",schemaPath:"#/properties/page_width/oneOf",keyword:"oneOf",params:Object.assign({passingSchemas:s},{branchErrors:i-y})};e===null?e=[f]:e.push(f),i++}}if(h.page_height!==void 0&&m.call(h,"page_height")){let u=h.page_height;const y=i;let o=!1,s=null;const k=i;if(typeof u=="number"&&isFinite(u)){if(u<=0||isNaN(u)){const f={instancePath:t+"/page_height",schemaPath:"#/properties/page_height/oneOf/0/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0}};e===null?e=[f]:e.push(f),i++}}else{const f={instancePath:t+"/page_height",schemaPath:"#/properties/page_height/oneOf/0/type",keyword:"type",params:{type:"number"}};e===null?e=[f]:e.push(f),i++}var V=k===i;V&&(o=!0,s=0);const g=i;if(Array.isArray(u)){if(u.length>1e4){const p={instancePath:t+"/page_height",schemaPath:"#/properties/page_height/oneOf/1/maxItems",keyword:"maxItems",params:{limit:1e4}};e===null?e=[p]:e.push(p),i++}if(u.length<1){const p={instancePath:t+"/page_height",schemaPath:"#/properties/page_height/oneOf/1/minItems",keyword:"minItems",params:{limit:1}};e===null?e=[p]:e.push(p),i++}const f=u.length;for(let p=0;p<f;p++){let c=u[p];if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.value===void 0||!m.call(c,"value")){const a={instancePath:t+"/page_height/"+p,schemaPath:"#/properties/page_height/oneOf/1/items/required",keyword:"required",params:{missingProperty:"value"}};e===null?e=[a]:e.push(a),i++}if(c.pages===void 0||!m.call(c,"pages")){const a={instancePath:t+"/page_height/"+p,schemaPath:"#/properties/page_height/oneOf/1/items/required",keyword:"required",params:{missingProperty:"pages"}};e===null?e=[a]:e.push(a),i++}for(const a of Object.keys(c))if(!(a==="value"||a==="pages")){const b={instancePath:t+"/page_height/"+p,schemaPath:"#/properties/page_height/oneOf/1/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a}};e===null?e=[b]:e.push(b),i++}if(c.value!==void 0&&m.call(c,"value")){let a=c.value;if(typeof a=="number"&&isFinite(a)){if(a<=0||isNaN(a)){const b={instancePath:t+"/page_height/"+p+"/value",schemaPath:"#/properties/page_height/oneOf/1/items/properties/value/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0}};e===null?e=[b]:e.push(b),i++}}else{const b={instancePath:t+"/page_height/"+p+"/value",schemaPath:"#/properties/page_height/oneOf/1/items/properties/value/type",keyword:"type",params:{type:"number"}};e===null?e=[b]:e.push(b),i++}}if(c.pages!==void 0&&m.call(c,"pages")){let a=c.pages;if(Array.isArray(a)){if(a.length>1e5){const d={instancePath:t+"/page_height/"+p+"/pages",schemaPath:"#/properties/page_height/oneOf/1/items/properties/pages/maxItems",keyword:"maxItems",params:{limit:1e5}};e===null?e=[d]:e.push(d),i++}if(a.length<1){const d={instancePath:t+"/page_height/"+p+"/pages",schemaPath:"#/properties/page_height/oneOf/1/items/properties/pages/minItems",keyword:"minItems",params:{limit:1}};e===null?e=[d]:e.push(d),i++}const b=a.length;for(let d=0;d<b;d++){let x=a[d];if(!(typeof x=="number"&&!(x%1)&&!isNaN(x)&&isFinite(x))){const N={instancePath:t+"/page_height/"+p+"/pages/"+d,schemaPath:"#/properties/page_height/oneOf/1/items/properties/pages/items/type",keyword:"type",params:{type:"integer"}};e===null?e=[N]:e.push(N),i++}if(typeof x=="number"&&isFinite(x)&&(x<1||isNaN(x))){const N={instancePath:t+"/page_height/"+p+"/pages/"+d,schemaPath:"#/properties/page_height/oneOf/1/items/properties/pages/items/minimum",keyword:"minimum",params:{comparison:">=",limit:1}};e===null?e=[N]:e.push(N),i++}}let _=a.length,P;if(_>1){const d={};for(;_--;){let x=a[_];if(typeof x=="number"&&!(x%1)&&!isNaN(x)&&isFinite(x)){if(typeof d[x]=="number"){P=d[x];const N={instancePath:t+"/page_height/"+p+"/pages",schemaPath:"#/properties/page_height/oneOf/1/items/properties/pages/uniqueItems",keyword:"uniqueItems",params:{i:_,j:P}};e===null?e=[N]:e.push(N),i++;break}d[x]=_}}}}else{const b={instancePath:t+"/page_height/"+p+"/pages",schemaPath:"#/properties/page_height/oneOf/1/items/properties/pages/type",keyword:"type",params:{type:"array"}};e===null?e=[b]:e.push(b),i++}}}else{const a={instancePath:t+"/page_height/"+p,schemaPath:"#/properties/page_height/oneOf/1/items/type",keyword:"type",params:{type:"object"}};e===null?e=[a]:e.push(a),i++}}}else{const f={instancePath:t+"/page_height",schemaPath:"#/properties/page_height/oneOf/1/type",keyword:"type",params:{type:"array"}};e===null?e=[f]:e.push(f),i++}var V=g===i;if(V&&o?(o=!1,s=[s,1]):V&&(o=!0,s=1),o)i=y,e!==null&&(y?e.length=y:e=null);else{const f={instancePath:t+"/page_height",schemaPath:"#/properties/page_height/oneOf",keyword:"oneOf",params:Object.assign({passingSchemas:s},{branchErrors:i-y})};e===null?e=[f]:e.push(f),i++}}if(h.score_explanation!==void 0&&m.call(h,"score_explanation")){let u=h.score_explanation;if(typeof u=="string"){if(L(u)>256){const y={instancePath:t+"/score_explanation",schemaPath:"#/properties/score_explanation/maxLength",keyword:"maxLength",params:{limit:256}};e===null?e=[y]:e.push(y),i++}}else{const y={instancePath:t+"/score_explanation",schemaPath:"#/properties/score_explanation/type",keyword:"type",params:{type:"string"}};e===null?e=[y]:e.push(y),i++}}if(h.blocks!==void 0&&m.call(h,"blocks")){let u=h.blocks;if(Array.isArray(u)){if(u.length>1e5){const o={instancePath:t+"/blocks",schemaPath:"#/properties/blocks/maxItems",keyword:"maxItems",params:{limit:1e5}};e===null?e=[o]:e.push(o),i++}const y=u.length;for(let o=0;o<y;o++){let s=u[o];const k=i;let g=!0;const f=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&s.block_type!==void 0&&m.call(s,"block_type")){let r=s.block_type;if(!(r==="text"||r==="line")){const l={};e===null?e=[l]:e.push(l),i++}}var X=f===i;if(i=k,e!==null&&(k?e.length=k:e=null),X){const r=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&(s.text===void 0||!m.call(s,"text"))){const n={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/0/then/required",keyword:"required",params:{missingProperty:"text"}};e===null?e=[n]:e.push(n),i++}var X=r===i;g=X}if(!g){const r={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/0/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[r]:e.push(r),i++}const p=i;let c=!0;const a=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&s.block_type!==void 0&&m.call(s,"block_type")&&s.block_type!=="box"){const r={};e===null?e=[r]:e.push(r),i++}var Y=a===i;if(i=p,e!==null&&(p?e.length=p:e=null),Y){const r=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&(s.box===void 0||!m.call(s,"box"))){const n={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/1/then/required",keyword:"required",params:{missingProperty:"box"}};e===null?e=[n]:e.push(n),i++}var Y=r===i;c=Y}if(!c){const r={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/1/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[r]:e.push(r),i++}const b=i;let _=!0;const P=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&s.block_type!==void 0&&m.call(s,"block_type")&&s.block_type!=="polygon"){const r={};e===null?e=[r]:e.push(r),i++}var Z=P===i;if(i=b,e!==null&&(b?e.length=b:e=null),Z){const r=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&(s.polygon===void 0||!m.call(s,"polygon"))){const n={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/2/then/required",keyword:"required",params:{missingProperty:"polygon"}};e===null?e=[n]:e.push(n),i++}var Z=r===i;_=Z}if(!_){const r={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/2/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[r]:e.push(r),i++}const d=i;let x=!0;const N=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&s.block_type!==void 0&&m.call(s,"block_type")&&s.block_type!=="multi_polygon"){const r={};e===null?e=[r]:e.push(r),i++}var ee=N===i;if(i=d,e!==null&&(d?e.length=d:e=null),ee){const r=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&(s.multi_polygon===void 0||!m.call(s,"multi_polygon"))){const n={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/3/then/required",keyword:"required",params:{missingProperty:"multi_polygon"}};e===null?e=[n]:e.push(n),i++}var ee=r===i;x=ee}if(!x){const r={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/3/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[r]:e.push(r),i++}const te=i;let oe=!0;const ce=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&s.block_type!==void 0&&m.call(s,"block_type")&&s.block_type!=="line"){const r={};e===null?e=[r]:e.push(r),i++}var ie=ce===i;if(i=te,e!==null&&(te?e.length=te:e=null),ie){const r=i,l=i;let n=!1;const v=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&(s.box===void 0||!m.call(s,"box"))){const O={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/4/then/anyOf/0/required",keyword:"required",params:{missingProperty:"box"}};e===null?e=[O]:e.push(O),i++}var D=v===i;n=n||D;const w=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&(s.polygon===void 0||!m.call(s,"polygon"))){const O={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/4/then/anyOf/1/required",keyword:"required",params:{missingProperty:"polygon"}};e===null?e=[O]:e.push(O),i++}var D=w===i;n=n||D;const A=i;if(s&&typeof s=="object"&&!Array.isArray(s)&&(s.multi_polygon===void 0||!m.call(s,"multi_polygon"))){const O={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/4/then/anyOf/2/required",keyword:"required",params:{missingProperty:"multi_polygon"}};e===null?e=[O]:e.push(O),i++}var D=A===i;if(n=n||D,n)i=l,e!==null&&(l?e.length=l:e=null);else{const O={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/4/then/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:i-l})};e===null?e=[O]:e.push(O),i++}var ie=r===i;oe=ie}if(!oe){const r={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/allOf/4/if",keyword:"if",params:{failingKeyword:"then"}};e===null?e=[r]:e.push(r),i++}if(s&&typeof s=="object"&&!Array.isArray(s)){if(s.block_type===void 0||!m.call(s,"block_type")){const r={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/required",keyword:"required",params:{missingProperty:"block_type"}};e===null?e=[r]:e.push(r),i++}for(const r of Object.keys(s))if(!m.call(C.properties.blocks.items.properties,r)){const l={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r}};e===null?e=[l]:e.push(l),i++}if(s.block_type!==void 0&&m.call(s,"block_type")){let r=s.block_type;if(typeof r!="string"){const l={instancePath:t+"/blocks/"+o+"/block_type",schemaPath:"#/properties/blocks/items/properties/block_type/type",keyword:"type",params:{type:"string"}};e===null?e=[l]:e.push(l),i++}if(!(r==="text"||r==="line"||r==="box"||r==="polygon"||r==="multi_polygon")){const l={instancePath:t+"/blocks/"+o+"/block_type",schemaPath:"#/properties/blocks/items/properties/block_type/enum",keyword:"enum",params:{allowedValues:C.properties.blocks.items.properties.block_type.enum}};e===null?e=[l]:e.push(l),i++}}if(s.id!==void 0&&m.call(s,"id")){let r=s.id;if(typeof r=="string"){if(L(r)>128){const l={instancePath:t+"/blocks/"+o+"/id",schemaPath:"#/properties/blocks/items/properties/id/maxLength",keyword:"maxLength",params:{limit:128}};e===null?e=[l]:e.push(l),i++}}else{const l={instancePath:t+"/blocks/"+o+"/id",schemaPath:"#/properties/blocks/items/properties/id/type",keyword:"type",params:{type:"string"}};e===null?e=[l]:e.push(l),i++}}if(s.text!==void 0&&m.call(s,"text")){let r=s.text;if(typeof r=="string"){if(L(r)>4096){const l={instancePath:t+"/blocks/"+o+"/text",schemaPath:"#/properties/blocks/items/properties/text/maxLength",keyword:"maxLength",params:{limit:4096}};e===null?e=[l]:e.push(l),i++}}else{const l={instancePath:t+"/blocks/"+o+"/text",schemaPath:"#/properties/blocks/items/properties/text/type",keyword:"type",params:{type:"string"}};e===null?e=[l]:e.push(l),i++}}if(s.line_number!==void 0&&m.call(s,"line_number")){let r=s.line_number;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){const l={instancePath:t+"/blocks/"+o+"/line_number",schemaPath:"#/properties/blocks/items/properties/line_number/type",keyword:"type",params:{type:"integer"}};e===null?e=[l]:e.push(l),i++}if(typeof r=="number"&&isFinite(r)&&(r<1||isNaN(r))){const l={instancePath:t+"/blocks/"+o+"/line_number",schemaPath:"#/properties/blocks/items/properties/line_number/minimum",keyword:"minimum",params:{comparison:">=",limit:1}};e===null?e=[l]:e.push(l),i++}}if(s.page_number!==void 0&&m.call(s,"page_number")){let r=s.page_number;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){const l={instancePath:t+"/blocks/"+o+"/page_number",schemaPath:"#/properties/blocks/items/properties/page_number/type",keyword:"type",params:{type:"integer"}};e===null?e=[l]:e.push(l),i++}if(typeof r=="number"&&isFinite(r)&&(r<1||isNaN(r))){const l={instancePath:t+"/blocks/"+o+"/page_number",schemaPath:"#/properties/blocks/items/properties/page_number/minimum",keyword:"minimum",params:{comparison:">=",limit:1}};e===null?e=[l]:e.push(l),i++}}if(s.score!==void 0&&m.call(s,"score")){let r=s.score;if(typeof r=="number"&&isFinite(r)){if(r>1||isNaN(r)){const l={instancePath:t+"/blocks/"+o+"/score",schemaPath:"#/properties/blocks/items/properties/score/maximum",keyword:"maximum",params:{comparison:"<=",limit:1}};e===null?e=[l]:e.push(l),i++}if(r<0||isNaN(r)){const l={instancePath:t+"/blocks/"+o+"/score",schemaPath:"#/properties/blocks/items/properties/score/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[l]:e.push(l),i++}}else{const l={instancePath:t+"/blocks/"+o+"/score",schemaPath:"#/properties/blocks/items/properties/score/type",keyword:"type",params:{type:"number"}};e===null?e=[l]:e.push(l),i++}}if(s.box!==void 0&&m.call(s,"box")){let r=s.box;if(r&&typeof r=="object"&&!Array.isArray(r)){if(r.x===void 0||!m.call(r,"x")){const l={instancePath:t+"/blocks/"+o+"/box",schemaPath:"#/properties/blocks/items/properties/box/required",keyword:"required",params:{missingProperty:"x"}};e===null?e=[l]:e.push(l),i++}if(r.y===void 0||!m.call(r,"y")){const l={instancePath:t+"/blocks/"+o+"/box",schemaPath:"#/properties/blocks/items/properties/box/required",keyword:"required",params:{missingProperty:"y"}};e===null?e=[l]:e.push(l),i++}if(r.width===void 0||!m.call(r,"width")){const l={instancePath:t+"/blocks/"+o+"/box",schemaPath:"#/properties/blocks/items/properties/box/required",keyword:"required",params:{missingProperty:"width"}};e===null?e=[l]:e.push(l),i++}if(r.height===void 0||!m.call(r,"height")){const l={instancePath:t+"/blocks/"+o+"/box",schemaPath:"#/properties/blocks/items/properties/box/required",keyword:"required",params:{missingProperty:"height"}};e===null?e=[l]:e.push(l),i++}for(const l of Object.keys(r))if(!(l==="x"||l==="y"||l==="width"||l==="height")){const n={instancePath:t+"/blocks/"+o+"/box",schemaPath:"#/properties/blocks/items/properties/box/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:l}};e===null?e=[n]:e.push(n),i++}if(r.x!==void 0&&m.call(r,"x")){let l=r.x;if(typeof l=="number"&&isFinite(l)){if(l<0||isNaN(l)){const n={instancePath:t+"/blocks/"+o+"/box/x",schemaPath:"#/properties/blocks/items/properties/box/properties/x/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[n]:e.push(n),i++}}else{const n={instancePath:t+"/blocks/"+o+"/box/x",schemaPath:"#/properties/blocks/items/properties/box/properties/x/type",keyword:"type",params:{type:"number"}};e===null?e=[n]:e.push(n),i++}}if(r.y!==void 0&&m.call(r,"y")){let l=r.y;if(typeof l=="number"&&isFinite(l)){if(l<0||isNaN(l)){const n={instancePath:t+"/blocks/"+o+"/box/y",schemaPath:"#/properties/blocks/items/properties/box/properties/y/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[n]:e.push(n),i++}}else{const n={instancePath:t+"/blocks/"+o+"/box/y",schemaPath:"#/properties/blocks/items/properties/box/properties/y/type",keyword:"type",params:{type:"number"}};e===null?e=[n]:e.push(n),i++}}if(r.width!==void 0&&m.call(r,"width")){let l=r.width;if(typeof l=="number"&&isFinite(l)){if(l<0||isNaN(l)){const n={instancePath:t+"/blocks/"+o+"/box/width",schemaPath:"#/properties/blocks/items/properties/box/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[n]:e.push(n),i++}}else{const n={instancePath:t+"/blocks/"+o+"/box/width",schemaPath:"#/properties/blocks/items/properties/box/properties/width/type",keyword:"type",params:{type:"number"}};e===null?e=[n]:e.push(n),i++}}if(r.height!==void 0&&m.call(r,"height")){let l=r.height;if(typeof l=="number"&&isFinite(l)){if(l<0||isNaN(l)){const n={instancePath:t+"/blocks/"+o+"/box/height",schemaPath:"#/properties/blocks/items/properties/box/properties/height/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[n]:e.push(n),i++}}else{const n={instancePath:t+"/blocks/"+o+"/box/height",schemaPath:"#/properties/blocks/items/properties/box/properties/height/type",keyword:"type",params:{type:"number"}};e===null?e=[n]:e.push(n),i++}}}else{const l={instancePath:t+"/blocks/"+o+"/box",schemaPath:"#/properties/blocks/items/properties/box/type",keyword:"type",params:{type:"object"}};e===null?e=[l]:e.push(l),i++}}if(s.polygon!==void 0&&m.call(s,"polygon")){let r=s.polygon;if(Array.isArray(r)){if(r.length>1e3){const n={instancePath:t+"/blocks/"+o+"/polygon",schemaPath:"#/properties/blocks/items/properties/polygon/maxItems",keyword:"maxItems",params:{limit:1e3}};e===null?e=[n]:e.push(n),i++}if(r.length<3){const n={instancePath:t+"/blocks/"+o+"/polygon",schemaPath:"#/properties/blocks/items/properties/polygon/minItems",keyword:"minItems",params:{limit:3}};e===null?e=[n]:e.push(n),i++}const l=r.length;for(let n=0;n<l;n++){let v=r[n];if(v&&typeof v=="object"&&!Array.isArray(v)){if(v.x===void 0||!m.call(v,"x")){const w={instancePath:t+"/blocks/"+o+"/polygon/"+n,schemaPath:"#/properties/blocks/items/properties/polygon/items/required",keyword:"required",params:{missingProperty:"x"}};e===null?e=[w]:e.push(w),i++}if(v.y===void 0||!m.call(v,"y")){const w={instancePath:t+"/blocks/"+o+"/polygon/"+n,schemaPath:"#/properties/blocks/items/properties/polygon/items/required",keyword:"required",params:{missingProperty:"y"}};e===null?e=[w]:e.push(w),i++}for(const w of Object.keys(v))if(!(w==="x"||w==="y")){const A={instancePath:t+"/blocks/"+o+"/polygon/"+n,schemaPath:"#/properties/blocks/items/properties/polygon/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:w}};e===null?e=[A]:e.push(A),i++}if(v.x!==void 0&&m.call(v,"x")){let w=v.x;if(typeof w=="number"&&isFinite(w)){if(w<0||isNaN(w)){const A={instancePath:t+"/blocks/"+o+"/polygon/"+n+"/x",schemaPath:"#/properties/blocks/items/properties/polygon/items/properties/x/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[A]:e.push(A),i++}}else{const A={instancePath:t+"/blocks/"+o+"/polygon/"+n+"/x",schemaPath:"#/properties/blocks/items/properties/polygon/items/properties/x/type",keyword:"type",params:{type:"number"}};e===null?e=[A]:e.push(A),i++}}if(v.y!==void 0&&m.call(v,"y")){let w=v.y;if(typeof w=="number"&&isFinite(w)){if(w<0||isNaN(w)){const A={instancePath:t+"/blocks/"+o+"/polygon/"+n+"/y",schemaPath:"#/properties/blocks/items/properties/polygon/items/properties/y/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[A]:e.push(A),i++}}else{const A={instancePath:t+"/blocks/"+o+"/polygon/"+n+"/y",schemaPath:"#/properties/blocks/items/properties/polygon/items/properties/y/type",keyword:"type",params:{type:"number"}};e===null?e=[A]:e.push(A),i++}}}else{const w={instancePath:t+"/blocks/"+o+"/polygon/"+n,schemaPath:"#/properties/blocks/items/properties/polygon/items/type",keyword:"type",params:{type:"object"}};e===null?e=[w]:e.push(w),i++}}}else{const l={instancePath:t+"/blocks/"+o+"/polygon",schemaPath:"#/properties/blocks/items/properties/polygon/type",keyword:"type",params:{type:"array"}};e===null?e=[l]:e.push(l),i++}}if(s.multi_polygon!==void 0&&m.call(s,"multi_polygon")){let r=s.multi_polygon;if(Array.isArray(r)){if(r.length>100){const n={instancePath:t+"/blocks/"+o+"/multi_polygon",schemaPath:"#/properties/blocks/items/properties/multi_polygon/maxItems",keyword:"maxItems",params:{limit:100}};e===null?e=[n]:e.push(n),i++}if(r.length<1){const n={instancePath:t+"/blocks/"+o+"/multi_polygon",schemaPath:"#/properties/blocks/items/properties/multi_polygon/minItems",keyword:"minItems",params:{limit:1}};e===null?e=[n]:e.push(n),i++}const l=r.length;for(let n=0;n<l;n++){let v=r[n];if(Array.isArray(v)){if(v.length>1e3){const A={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n,schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/maxItems",keyword:"maxItems",params:{limit:1e3}};e===null?e=[A]:e.push(A),i++}if(v.length<3){const A={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n,schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/minItems",keyword:"minItems",params:{limit:3}};e===null?e=[A]:e.push(A),i++}const w=v.length;for(let A=0;A<w;A++){let q=v[A];if(q&&typeof q=="object"&&!Array.isArray(q)){if(q.x===void 0||!m.call(q,"x")){const O={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A,schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/required",keyword:"required",params:{missingProperty:"x"}};e===null?e=[O]:e.push(O),i++}if(q.y===void 0||!m.call(q,"y")){const O={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A,schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/required",keyword:"required",params:{missingProperty:"y"}};e===null?e=[O]:e.push(O),i++}for(const O of Object.keys(q))if(!(O==="x"||O==="y")){const I={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A,schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:O}};e===null?e=[I]:e.push(I),i++}if(q.x!==void 0&&m.call(q,"x")){let O=q.x;if(typeof O=="number"&&isFinite(O)){if(O<0||isNaN(O)){const I={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A+"/x",schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/properties/x/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[I]:e.push(I),i++}}else{const I={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A+"/x",schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/properties/x/type",keyword:"type",params:{type:"number"}};e===null?e=[I]:e.push(I),i++}}if(q.y!==void 0&&m.call(q,"y")){let O=q.y;if(typeof O=="number"&&isFinite(O)){if(O<0||isNaN(O)){const I={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A+"/y",schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/properties/y/minimum",keyword:"minimum",params:{comparison:">=",limit:0}};e===null?e=[I]:e.push(I),i++}}else{const I={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A+"/y",schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/properties/y/type",keyword:"type",params:{type:"number"}};e===null?e=[I]:e.push(I),i++}}}else{const O={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n+"/"+A,schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/items/type",keyword:"type",params:{type:"object"}};e===null?e=[O]:e.push(O),i++}}}else{const w={instancePath:t+"/blocks/"+o+"/multi_polygon/"+n,schemaPath:"#/properties/blocks/items/properties/multi_polygon/items/type",keyword:"type",params:{type:"array"}};e===null?e=[w]:e.push(w),i++}}}else{const l={instancePath:t+"/blocks/"+o+"/multi_polygon",schemaPath:"#/properties/blocks/items/properties/multi_polygon/type",keyword:"type",params:{type:"array"}};e===null?e=[l]:e.push(l),i++}}if(s.attributes!==void 0&&m.call(s,"attributes")){let r=s.attributes;if(r&&typeof r=="object"&&!Array.isArray(r)){if(Object.keys(r).length>16){const l={instancePath:t+"/blocks/"+o+"/attributes",schemaPath:"#/properties/blocks/items/properties/attributes/maxProperties",keyword:"maxProperties",params:{limit:16}};e===null?e=[l]:e.push(l),i++}for(const l of Object.keys(r)){const n=i;if(typeof l=="string"&&L(l)>128){const v={instancePath:t+"/blocks/"+o+"/attributes",schemaPath:"#/properties/blocks/items/properties/attributes/propertyNames/maxLength",keyword:"maxLength",params:{limit:128},propertyName:l};e===null?e=[v]:e.push(v),i++}var ne=n===i;if(!ne){const v={instancePath:t+"/blocks/"+o+"/attributes",schemaPath:"#/properties/blocks/items/properties/attributes/propertyNames",keyword:"propertyNames",params:{propertyName:l}};e===null?e=[v]:e.push(v),i++}}for(const l of Object.keys(r)){let n=r[l];const v=i;let w=!1;const A=i;if(typeof n=="string"){if(L(n)>1024){const j={instancePath:t+"/blocks/"+o+"/attributes/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/blocks/items/properties/attributes/additionalProperties/anyOf/0/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[j]:e.push(j),i++}}else{const j={instancePath:t+"/blocks/"+o+"/attributes/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/blocks/items/properties/attributes/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"}};e===null?e=[j]:e.push(j),i++}var T=A===i;w=w||T;const q=i;if(!(typeof n=="number"&&isFinite(n))){const j={instancePath:t+"/blocks/"+o+"/attributes/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/blocks/items/properties/attributes/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"number"}};e===null?e=[j]:e.push(j),i++}var T=q===i;w=w||T;const O=i;if(typeof n!="boolean"){const j={instancePath:t+"/blocks/"+o+"/attributes/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/blocks/items/properties/attributes/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"boolean"}};e===null?e=[j]:e.push(j),i++}var T=O===i;w=w||T;const I=i;if(n!==null){const j={instancePath:t+"/blocks/"+o+"/attributes/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/blocks/items/properties/attributes/additionalProperties/anyOf/3/type",keyword:"type",params:{type:"null"}};e===null?e=[j]:e.push(j),i++}var T=I===i;if(w=w||T,w)i=v,e!==null&&(v?e.length=v:e=null);else{const j={instancePath:t+"/blocks/"+o+"/attributes/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/blocks/items/properties/attributes/additionalProperties/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:i-v})};e===null?e=[j]:e.push(j),i++}}}else{const l={instancePath:t+"/blocks/"+o+"/attributes",schemaPath:"#/properties/blocks/items/properties/attributes/type",keyword:"type",params:{type:"object"}};e===null?e=[l]:e.push(l),i++}}}else{const r={instancePath:t+"/blocks/"+o,schemaPath:"#/properties/blocks/items/type",keyword:"type",params:{type:"object"}};e===null?e=[r]:e.push(r),i++}}}else{const y={instancePath:t+"/blocks",schemaPath:"#/properties/blocks/type",keyword:"type",params:{type:"array"}};e===null?e=[y]:e.push(y),i++}}if(h.attributes!==void 0&&m.call(h,"attributes")){let u=h.attributes;if(u&&typeof u=="object"&&!Array.isArray(u)){if(Object.keys(u).length>16){const y={instancePath:t+"/attributes",schemaPath:"#/properties/attributes/maxProperties",keyword:"maxProperties",params:{limit:16}};e===null?e=[y]:e.push(y),i++}for(const y of Object.keys(u)){const o=i;if(typeof y=="string"&&L(y)>128){const s={instancePath:t+"/attributes",schemaPath:"#/properties/attributes/propertyNames/maxLength",keyword:"maxLength",params:{limit:128},propertyName:y};e===null?e=[s]:e.push(s),i++}var me=o===i;if(!me){const s={instancePath:t+"/attributes",schemaPath:"#/properties/attributes/propertyNames",keyword:"propertyNames",params:{propertyName:y}};e===null?e=[s]:e.push(s),i++}}for(const y of Object.keys(u)){let o=u[y];const s=i;let k=!1;const g=i;if(typeof o=="string"){if(L(o)>1024){const a={instancePath:t+"/attributes/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/0/maxLength",keyword:"maxLength",params:{limit:1024}};e===null?e=[a]:e.push(a),i++}}else{const a={instancePath:t+"/attributes/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"}};e===null?e=[a]:e.push(a),i++}var M=g===i;k=k||M;const f=i;if(!(typeof o=="number"&&isFinite(o))){const a={instancePath:t+"/attributes/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"number"}};e===null?e=[a]:e.push(a),i++}var M=f===i;k=k||M;const p=i;if(typeof o!="boolean"){const a={instancePath:t+"/attributes/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"boolean"}};e===null?e=[a]:e.push(a),i++}var M=p===i;k=k||M;const c=i;if(o!==null){const a={instancePath:t+"/attributes/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf/3/type",keyword:"type",params:{type:"null"}};e===null?e=[a]:e.push(a),i++}var M=c===i;if(k=k||M,k)i=s,e!==null&&(s?e.length=s:e=null);else{const a={instancePath:t+"/attributes/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/attributes/additionalProperties/anyOf",keyword:"anyOf",params:Object.assign({},{branchErrors:i-s})};e===null?e=[a]:e.push(a),i++}}}else{const y={instancePath:t+"/attributes",schemaPath:"#/properties/attributes/type",keyword:"type",params:{type:"object"}};e===null?e=[y]:e.push(y),i++}}}else{const u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}};e===null?e=[u]:e.push(u),i++}return z.errors=e,i===0}z.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};export{xe as default,ke as validate};