@gramps-connect/story 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/editor.js +34 -6
  2. package/dist/editor.js.map +2 -2
  3. package/dist/embed.js +41 -41
  4. package/dist/index.js.map +1 -1
  5. package/dist/map-edit.js.map +1 -1
  6. package/dist/player.js +32 -5
  7. package/dist/player.js.map +2 -2
  8. package/dist/types/editor/DateField.d.ts +3 -3
  9. package/dist/types/editor/MapEditor.d.ts +5 -4
  10. package/dist/types/editor/PhotosField.d.ts +2 -2
  11. package/dist/types/editor/PlaceField.d.ts +4 -4
  12. package/dist/types/editor/PlaceMap.d.ts +2 -2
  13. package/dist/types/editor/PlaceMapDialog.d.ts +4 -4
  14. package/dist/types/editor/StoryEditor.d.ts +7 -7
  15. package/dist/types/editor/index.d.ts +14 -14
  16. package/dist/types/editor/model.d.ts +1 -1
  17. package/dist/types/editor/placeShapes.d.ts +2 -2
  18. package/dist/types/editor/strings.d.ts +1 -1
  19. package/dist/types/editor/translations/de.d.ts +2 -2
  20. package/dist/types/editor/translations/es.d.ts +2 -2
  21. package/dist/types/editor/translations/fr.d.ts +2 -2
  22. package/dist/types/editor/translations/index.d.ts +2 -2
  23. package/dist/types/editor/translations/nl.d.ts +2 -2
  24. package/dist/types/index.d.ts +5 -5
  25. package/dist/types/mapEdit/index.d.ts +3 -3
  26. package/dist/types/mapEdit/mapFile.d.ts +1 -1
  27. package/dist/types/player/MapBackground.d.ts +3 -3
  28. package/dist/types/player/MapModeControl.d.ts +2 -2
  29. package/dist/types/player/StoryPlayer.d.ts +4 -4
  30. package/dist/types/player/TimelineStrip.d.ts +1 -1
  31. package/dist/types/player/dates.d.ts +1 -1
  32. package/dist/types/player/geo.d.ts +1 -1
  33. package/dist/types/player/index.d.ts +10 -10
  34. package/dist/types/version.d.ts +1 -1
  35. package/dist/types/zip.d.ts +3 -3
  36. package/package.json +2 -2
  37. package/src/editor/DateField.tsx +5 -5
  38. package/src/editor/MapEditor.tsx +10 -8
  39. package/src/editor/PhotosField.tsx +2 -2
  40. package/src/editor/PlaceField.tsx +6 -6
  41. package/src/editor/PlaceMap.tsx +5 -5
  42. package/src/editor/PlaceMapDialog.tsx +11 -11
  43. package/src/editor/StoryEditor.tsx +18 -18
  44. package/src/editor/index.ts +14 -14
  45. package/src/editor/mapEditorStrings.ts +1 -1
  46. package/src/editor/model.ts +2 -2
  47. package/src/editor/placeShapes.ts +3 -3
  48. package/src/editor/strings.ts +1 -1
  49. package/src/editor/translations/de.ts +2 -2
  50. package/src/editor/translations/es.ts +2 -2
  51. package/src/editor/translations/fr.ts +2 -2
  52. package/src/editor/translations/index.ts +6 -6
  53. package/src/editor/translations/nl.ts +2 -2
  54. package/src/embed/index.tsx +2 -2
  55. package/src/index.ts +5 -5
  56. package/src/mapEdit/index.ts +3 -3
  57. package/src/mapEdit/mapFile.ts +1 -1
  58. package/src/player/MapBackground.tsx +5 -5
  59. package/src/player/MapModeControl.tsx +2 -2
  60. package/src/player/StoryPlayer.tsx +50 -13
  61. package/src/player/TimelineStrip.tsx +2 -2
  62. package/src/player/dates.ts +1 -1
  63. package/src/player/geo.ts +1 -1
  64. package/src/player/index.ts +10 -10
  65. package/src/validate.ts +2 -2
  66. package/src/version.ts +1 -1
  67. package/src/zip.ts +3 -3
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts", "../spec/1.0/story.schema.json", "../src/generated/schemaValidator.js", "../src/validate.ts", "../src/zip.ts", "../src/image.ts"],
4
- "sourcesContent": ["// Format identity and versioning (spec/1.0/README.md section 2), and the\n// chain of upgraders that lets this package keep opening every older major\n// version of the format.\nimport type { StoryDoc } from \"./types\";\n\nexport const FORMAT_ID = \"gramps-connect-story\";\n\n/** The version this package writes. */\nexport const FORMAT_VERSION = \"1.0\";\n\nexport const CURRENT_MAJOR = 1;\n\n/** Upgraders, keyed by the major version they upgrade *from*: UPGRADERS[1]\n * turns a 1.x document into a 2.0 one, and so on. Never remove one -- each\n * is the only thing that keeps old files opening -- and give each a fixture\n * from its source version under examples/. Empty while 1 is the only major.\n * Each receives a document that already passed its own version's checks. */\nconst UPGRADERS: Record<number, (doc: Record<string, unknown>) => Record<string, unknown>> = {};\n\n/** Every major version upgradeStory() can open. */\nexport const SUPPORTED_FORMAT_MAJORS: readonly number[] = Object.freeze(\n Array.from({ length: CURRENT_MAJOR }, (_, i) => i + 1).filter(\n (major) => major === CURRENT_MAJOR || UPGRADERS[major] !== undefined,\n ),\n);\n\nexport type StoryErrorCode =\n | \"not-a-zip\"\n | \"no-story-json\"\n | \"bad-json\"\n | \"not-a-story\"\n | \"bad-version\"\n | \"newer-version\"\n | \"too-large\"\n | \"invalid\";\n\nexport class StoryFormatError extends Error {\n readonly code: StoryErrorCode;\n constructor(code: StoryErrorCode, message: string) {\n super(message);\n this.name = \"StoryFormatError\";\n this.code = code;\n }\n}\n\nexport interface ParsedVersion {\n major: number;\n minor: number;\n}\n\nexport function parseVersion(version: unknown): ParsedVersion | null {\n if (typeof version !== \"string\") return null;\n const match = /^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$/.exec(version);\n if (!match) return null;\n return { major: Number(match[1]), minor: Number(match[2]) };\n}\n\n/** Checks `raw` is a story at all and brings it up to CURRENT_MAJOR.\n * Doesn't validate the result -- see validate.ts -- only what it needs to\n * pick upgraders: `format` and `version`. Throws StoryFormatError. */\nexport function upgradeStory(raw: unknown): StoryDoc {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n throw new StoryFormatError(\"not-a-story\", \"story.json is not a JSON object.\");\n }\n let doc = raw as Record<string, unknown>;\n if (doc.format !== FORMAT_ID) {\n throw new StoryFormatError(\"not-a-story\", `story.json's \"format\" is not \"${FORMAT_ID}\".`);\n }\n const parsed = parseVersion(doc.version);\n if (!parsed || parsed.major < 1) {\n throw new StoryFormatError(\"bad-version\", `story.json's \"version\" (${JSON.stringify(doc.version)}) is not a valid MAJOR.MINOR version.`);\n }\n if (parsed.major > CURRENT_MAJOR) {\n throw new StoryFormatError(\n \"newer-version\",\n `This story uses format version ${doc.version}, which is newer than this viewer supports (up to ${CURRENT_MAJOR}.x). A newer viewer is needed to open it.`,\n );\n }\n for (let major = parsed.major; major < CURRENT_MAJOR; major++) {\n const upgrade = UPGRADERS[major];\n if (!upgrade) {\n throw new StoryFormatError(\"bad-version\", `No upgrade path from format version ${major}.x.`);\n }\n doc = upgrade(doc);\n }\n return doc as unknown as StoryDoc;\n}\n", "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\",\n \"title\": \"Gramps Connect Story, format 1.0\",\n \"description\": \"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).\",\n \"type\": \"object\",\n \"required\": [\"format\", \"version\", \"title\", \"slides\", \"media\"],\n \"properties\": {\n \"$schema\": { \"type\": \"string\" },\n \"format\": { \"const\": \"gramps-connect-story\" },\n \"version\": {\n \"description\": \"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.\",\n \"type\": \"string\",\n \"pattern\": \"^1\\\\.(0|[1-9][0-9]*)$\"\n },\n \"title\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"language\": {\n \"description\": \"BCP 47 language tag of the story's text, e.g. \\\"en\\\", \\\"de-CH\\\".\",\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"\n },\n \"created\": {\n \"description\": \"When the file was written, as an RFC 3339 date-time.\",\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"\n },\n \"generator\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"version\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" }\n }\n },\n \"authors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"url\": { \"type\": \"string\" }\n }\n }\n },\n \"license\": {\n \"description\": \"License of the story's content (text and media), as an SPDX identifier or free text.\",\n \"type\": \"string\"\n },\n \"presentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"basemap\": { \"enum\": [\"standard\", \"historical\", \"auto\", \"none\"] }\n }\n },\n \"slides\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"$ref\": \"#/$defs/slide\" }\n },\n \"media\": {\n \"description\": \"Every media file in the story, keyed by an id that slides and overlays refer to.\",\n \"type\": \"object\",\n \"propertyNames\": { \"$ref\": \"#/$defs/id\" },\n \"additionalProperties\": { \"$ref\": \"#/$defs/mediaItem\" }\n },\n \"extensions\": {\n \"description\": \"Producer-specific data, keyed by namespace. Viewers ignore it.\",\n \"type\": \"object\",\n \"additionalProperties\": { \"type\": \"object\" }\n }\n },\n \"$defs\": {\n \"id\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z0-9_-]{1,64}$\"\n },\n \"storyDate\": {\n \"type\": \"object\",\n \"required\": [\"text\"],\n \"properties\": {\n \"text\": {\n \"description\": \"The date as it should be shown, in the story's language.\",\n \"type\": \"string\",\n \"pattern\": \"\\\\S\"\n },\n \"edtf\": {\n \"description\": \"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\n \"type\": \"string\",\n \"pattern\": \"\\\\S\"\n },\n \"sortYear\": {\n \"description\": \"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\n \"type\": \"integer\"\n }\n }\n },\n \"slide\": {\n \"type\": \"object\",\n \"required\": [\"id\"],\n \"properties\": {\n \"id\": { \"$ref\": \"#/$defs/id\" },\n \"title\": { \"type\": \"string\" },\n \"text\": {\n \"description\": \"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\n \"type\": \"string\"\n },\n \"date\": { \"$ref\": \"#/$defs/storyDate\" },\n \"place\": { \"$ref\": \"#/$defs/place\" },\n \"media\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/slideMedia\" }\n },\n \"people\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"role\": { \"type\": \"string\" }\n }\n }\n }\n }\n },\n \"slideMedia\": {\n \"type\": \"object\",\n \"required\": [\"ref\"],\n \"properties\": {\n \"ref\": { \"$ref\": \"#/$defs/id\" },\n \"caption\": { \"type\": \"string\" },\n \"credit\": { \"type\": \"string\" }\n }\n },\n \"place\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"lat\": { \"type\": \"number\", \"minimum\": -90, \"maximum\": 90 },\n \"lon\": { \"type\": \"number\", \"minimum\": -180, \"maximum\": 180 },\n \"geometry\": {\n \"description\": \"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\n \"type\": \"object\",\n \"required\": [\"type\"],\n \"properties\": { \"type\": { \"type\": \"string\" } },\n \"additionalProperties\": true\n },\n \"overlays\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/overlay\" }\n }\n },\n \"dependentRequired\": {\n \"lat\": [\"lon\"],\n \"lon\": [\"lat\"]\n }\n },\n \"lonLat\": {\n \"type\": \"array\",\n \"prefixItems\": [\n { \"type\": \"number\", \"minimum\": -180, \"maximum\": 180 },\n { \"type\": \"number\", \"minimum\": -90, \"maximum\": 90 }\n ],\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"overlay\": {\n \"type\": \"object\",\n \"required\": [\"media\", \"corners\"],\n \"properties\": {\n \"media\": { \"$ref\": \"#/$defs/id\" },\n \"corners\": {\n \"description\": \"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/lonLat\" },\n \"minItems\": 4,\n \"maxItems\": 4\n },\n \"opacity\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"order\": {\n \"description\": \"Stacking order among a slide's overlays; lower is drawn first.\",\n \"type\": \"integer\"\n },\n \"date\": { \"$ref\": \"#/$defs/storyDate\" }\n }\n },\n \"mediaItem\": {\n \"type\": \"object\",\n \"required\": [\"src\", \"mime\"],\n \"properties\": {\n \"src\": {\n \"description\": \"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\n \"type\": \"string\",\n \"pattern\": \"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"\n },\n \"mime\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z]+/[A-Za-z0-9.+-]+$\"\n },\n \"width\": { \"type\": \"integer\", \"minimum\": 1 },\n \"height\": { \"type\": \"integer\", \"minimum\": 1 },\n \"alt\": { \"type\": \"string\" }\n }\n }\n }\n}\n", "// GENERATED by scripts/generate-validator.mjs from spec/1.0/story.schema.json -- do not edit.\n// @ts-nocheck\n\"use strict\";export const validate = validate20;export default validate20;const schema31 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\",\"title\":\"Gramps Connect Story, format 1.0\",\"description\":\"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).\",\"type\":\"object\",\"required\":[\"format\",\"version\",\"title\",\"slides\",\"media\"],\"properties\":{\"$schema\":{\"type\":\"string\"},\"format\":{\"const\":\"gramps-connect-story\"},\"version\":{\"description\":\"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.\",\"type\":\"string\",\"pattern\":\"^1\\\\.(0|[1-9][0-9]*)$\"},\"title\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"language\":{\"description\":\"BCP 47 language tag of the story's text, e.g. \\\"en\\\", \\\"de-CH\\\".\",\"type\":\"string\",\"pattern\":\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"},\"created\":{\"description\":\"When the file was written, as an RFC 3339 date-time.\",\"type\":\"string\",\"pattern\":\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"},\"generator\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"version\":{\"type\":\"string\"},\"url\":{\"type\":\"string\"}}},\"authors\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"url\":{\"type\":\"string\"}}}},\"license\":{\"description\":\"License of the story's content (text and media), as an SPDX identifier or free text.\",\"type\":\"string\"},\"presentation\":{\"type\":\"object\",\"properties\":{\"basemap\":{\"enum\":[\"standard\",\"historical\",\"auto\",\"none\"]}}},\"slides\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/$defs/slide\"}},\"media\":{\"description\":\"Every media file in the story, keyed by an id that slides and overlays refer to.\",\"type\":\"object\",\"propertyNames\":{\"$ref\":\"#/$defs/id\"},\"additionalProperties\":{\"$ref\":\"#/$defs/mediaItem\"}},\"extensions\":{\"description\":\"Producer-specific data, keyed by namespace. Viewers ignore it.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}}},\"$defs\":{\"id\":{\"type\":\"string\",\"pattern\":\"^[A-Za-z0-9_-]{1,64}$\"},\"storyDate\":{\"type\":\"object\",\"required\":[\"text\"],\"properties\":{\"text\":{\"description\":\"The date as it should be shown, in the story's language.\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"edtf\":{\"description\":\"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"sortYear\":{\"description\":\"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\"type\":\"integer\"}}},\"slide\":{\"type\":\"object\",\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/$defs/id\"},\"title\":{\"type\":\"string\"},\"text\":{\"description\":\"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\"type\":\"string\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"},\"place\":{\"$ref\":\"#/$defs/place\"},\"media\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/slideMedia\"}},\"people\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"role\":{\"type\":\"string\"}}}}}},\"slideMedia\":{\"type\":\"object\",\"required\":[\"ref\"],\"properties\":{\"ref\":{\"$ref\":\"#/$defs/id\"},\"caption\":{\"type\":\"string\"},\"credit\":{\"type\":\"string\"}}},\"place\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"lat\":{\"type\":\"number\",\"minimum\":-90,\"maximum\":90},\"lon\":{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},\"geometry\":{\"description\":\"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\"}},\"additionalProperties\":true},\"overlays\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/overlay\"}}},\"dependentRequired\":{\"lat\":[\"lon\"],\"lon\":[\"lat\"]}},\"lonLat\":{\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},{\"type\":\"number\",\"minimum\":-90,\"maximum\":90}],\"minItems\":2,\"maxItems\":2},\"overlay\":{\"type\":\"object\",\"required\":[\"media\",\"corners\"],\"properties\":{\"media\":{\"$ref\":\"#/$defs/id\"},\"corners\":{\"description\":\"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/lonLat\"},\"minItems\":4,\"maxItems\":4},\"opacity\":{\"type\":\"number\",\"minimum\":0,\"maximum\":1},\"order\":{\"description\":\"Stacking order among a slide's overlays; lower is drawn first.\",\"type\":\"integer\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"}}},\"mediaItem\":{\"type\":\"object\",\"required\":[\"src\",\"mime\"],\"properties\":{\"src\":{\"description\":\"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\"type\":\"string\",\"pattern\":\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},\"mime\":{\"type\":\"string\",\"pattern\":\"^[a-z]+/[A-Za-z0-9.+-]+$\"},\"width\":{\"type\":\"integer\",\"minimum\":1},\"height\":{\"type\":\"integer\",\"minimum\":1},\"alt\":{\"type\":\"string\"}}}}};const schema33 = {\"type\":\"string\",\"pattern\":\"^[A-Za-z0-9_-]{1,64}$\"};const schema43 = {\"type\":\"object\",\"required\":[\"src\",\"mime\"],\"properties\":{\"src\":{\"description\":\"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\"type\":\"string\",\"pattern\":\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},\"mime\":{\"type\":\"string\",\"pattern\":\"^[a-z]+/[A-Za-z0-9.+-]+$\"},\"width\":{\"type\":\"integer\",\"minimum\":1},\"height\":{\"type\":\"integer\",\"minimum\":1},\"alt\":{\"type\":\"string\"}}};const pattern4 = new RegExp(\"^1\\\\.(0|[1-9][0-9]*)$\", \"u\");const pattern5 = new RegExp(\"\\\\S\", \"u\");const pattern6 = new RegExp(\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\", \"u\");const pattern7 = new RegExp(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\", \"u\");const pattern10 = new RegExp(\"^[A-Za-z0-9_-]{1,64}$\", \"u\");const pattern19 = new RegExp(\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\", \"u\");const pattern20 = new RegExp(\"^[a-z]+/[A-Za-z0-9.+-]+$\", \"u\");const schema32 = {\"type\":\"object\",\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/$defs/id\"},\"title\":{\"type\":\"string\"},\"text\":{\"description\":\"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\"type\":\"string\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"},\"place\":{\"$ref\":\"#/$defs/place\"},\"media\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/slideMedia\"}},\"people\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"role\":{\"type\":\"string\"}}}}}};const schema34 = {\"type\":\"object\",\"required\":[\"text\"],\"properties\":{\"text\":{\"description\":\"The date as it should be shown, in the story's language.\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"edtf\":{\"description\":\"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"sortYear\":{\"description\":\"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\"type\":\"integer\"}}};const schema35 = {\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"lat\":{\"type\":\"number\",\"minimum\":-90,\"maximum\":90},\"lon\":{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},\"geometry\":{\"description\":\"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\"}},\"additionalProperties\":true},\"overlays\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/overlay\"}}},\"dependentRequired\":{\"lat\":[\"lon\"],\"lon\":[\"lat\"]}};const schema36 = {\"type\":\"object\",\"required\":[\"media\",\"corners\"],\"properties\":{\"media\":{\"$ref\":\"#/$defs/id\"},\"corners\":{\"description\":\"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/lonLat\"},\"minItems\":4,\"maxItems\":4},\"opacity\":{\"type\":\"number\",\"minimum\":0,\"maximum\":1},\"order\":{\"description\":\"Stacking order among a slide's overlays; lower is drawn first.\",\"type\":\"integer\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"}}};const schema38 = {\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},{\"type\":\"number\",\"minimum\":-90,\"maximum\":90}],\"minItems\":2,\"maxItems\":2};function validate23(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate23.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.media === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"media\"},message:\"must have required property '\"+\"media\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.corners === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"corners\"},message:\"must have required property '\"+\"corners\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.media !== undefined){let data0 = data.media;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err2 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.corners !== undefined){let data1 = data.corners;if(Array.isArray(data1)){if(data1.length > 4){const err4 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/maxItems\",keyword:\"maxItems\",params:{limit: 4},message:\"must NOT have more than 4 items\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data1.length < 4){const err5 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/minItems\",keyword:\"minItems\",params:{limit: 4},message:\"must NOT have fewer than 4 items\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];if(Array.isArray(data2)){if(data2.length > 2){const err6 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/maxItems\",keyword:\"maxItems\",params:{limit: 2},message:\"must NOT have more than 2 items\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data2.length < 2){const err7 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/minItems\",keyword:\"minItems\",params:{limit: 2},message:\"must NOT have fewer than 2 items\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}const len1 = data2.length;if(len1 > 0){let data3 = data2[0];if((typeof data3 == \"number\") && (isFinite(data3))){if(data3 > 180 || isNaN(data3)){const err8 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 180},message:\"must be <= 180\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data3 < -180 || isNaN(data3)){const err9 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -180},message:\"must be >= -180\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(len1 > 1){let data4 = data2[1];if((typeof data4 == \"number\") && (isFinite(data4))){if(data4 > 90 || isNaN(data4)){const err11 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 90},message:\"must be <= 90\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data4 < -90 || isNaN(data4)){const err12 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -90},message:\"must be >= -90\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.opacity !== undefined){let data5 = data.opacity;if((typeof data5 == \"number\") && (isFinite(data5))){if(data5 > 1 || isNaN(data5)){const err16 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 1},message:\"must be <= 1\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data5 < 0 || isNaN(data5)){const err17 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.order !== undefined){let data6 = data.order;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err19 = {instancePath:instancePath+\"/order\",schemaPath:\"#/properties/order/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.date !== undefined){let data7 = data.date;if(data7 && typeof data7 == \"object\" && !Array.isArray(data7)){if(data7.text === undefined){const err20 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data7.text !== undefined){let data8 = data7.text;if(typeof data8 === \"string\"){if(!pattern5.test(data8)){const err21 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data7.edtf !== undefined){let data9 = data7.edtf;if(typeof data9 === \"string\"){if(!pattern5.test(data9)){const err23 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data7.sortYear !== undefined){let data10 = data7.sortYear;if(!(((typeof data10 == \"number\") && (!(data10 % 1) && !isNaN(data10))) && (isFinite(data10)))){const err25 = {instancePath:instancePath+\"/date/sortYear\",schemaPath:\"#/$defs/storyDate/properties/sortYear/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}else {const err27 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}validate23.errors = vErrors;return errors === 0;}validate23.evaluated = {\"props\":{\"media\":true,\"corners\":true,\"opacity\":true,\"order\":true,\"date\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate22(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.name !== undefined){if(typeof data.name !== \"string\"){const err0 = {instancePath:instancePath+\"/name\",schemaPath:\"#/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.lat !== undefined){let data1 = data.lat;if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 > 90 || isNaN(data1)){const err1 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 90},message:\"must be <= 90\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data1 < -90 || isNaN(data1)){const err2 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -90},message:\"must be >= -90\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.lon !== undefined){let data2 = data.lon;if((typeof data2 == \"number\") && (isFinite(data2))){if(data2 > 180 || isNaN(data2)){const err4 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 180},message:\"must be <= 180\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data2 < -180 || isNaN(data2)){const err5 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -180},message:\"must be >= -180\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.geometry !== undefined){let data3 = data.geometry;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){if(data3.type === undefined){const err7 = {instancePath:instancePath+\"/geometry\",schemaPath:\"#/properties/geometry/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data3.type !== undefined){if(typeof data3.type !== \"string\"){const err8 = {instancePath:instancePath+\"/geometry/type\",schemaPath:\"#/properties/geometry/properties/type/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath:instancePath+\"/geometry\",schemaPath:\"#/properties/geometry/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.overlays !== undefined){let data5 = data.overlays;if(Array.isArray(data5)){const len0 = data5.length;for(let i0=0; i0<len0; i0++){if(!(validate23(data5[i0], {instancePath:instancePath+\"/overlays/\" + i0,parentData:data5,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate23.errors : vErrors.concat(validate23.errors);errors = vErrors.length;}}}else {const err10 = {instancePath:instancePath+\"/overlays\",schemaPath:\"#/properties/overlays/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.lat !== undefined){if(data.lon === undefined){const err11 = {instancePath,schemaPath:\"#/dependentRequired\",keyword:\"dependentRequired\",params:{property: \"lat\",\n missingProperty: \"lon\",\n depsCount: 1,\n deps: \"lon\"},message:\"must have property lon when property lat is present\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.lon !== undefined){if(data.lat === undefined){const err12 = {instancePath,schemaPath:\"#/dependentRequired\",keyword:\"dependentRequired\",params:{property: \"lon\",\n missingProperty: \"lat\",\n depsCount: 1,\n deps: \"lat\"},message:\"must have property lat when property lon is present\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {\"props\":{\"name\":true,\"lat\":true,\"lon\":true,\"geometry\":true,\"overlays\":true},\"dynamicProps\":false,\"dynamicItems\":false};const schema40 = {\"type\":\"object\",\"required\":[\"ref\"],\"properties\":{\"ref\":{\"$ref\":\"#/$defs/id\"},\"caption\":{\"type\":\"string\"},\"credit\":{\"type\":\"string\"}}};function validate26(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate26.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.ref === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"ref\"},message:\"must have required property '\"+\"ref\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref !== undefined){let data0 = data.ref;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err1 = {instancePath:instancePath+\"/ref\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath:instancePath+\"/ref\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.caption !== undefined){if(typeof data.caption !== \"string\"){const err3 = {instancePath:instancePath+\"/caption\",schemaPath:\"#/properties/caption/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.credit !== undefined){if(typeof data.credit !== \"string\"){const err4 = {instancePath:instancePath+\"/credit\",schemaPath:\"#/properties/credit/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate26.errors = vErrors;return errors === 0;}validate26.evaluated = {\"props\":{\"ref\":true,\"caption\":true,\"credit\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate21(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err1 = {instancePath:instancePath+\"/id\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath:instancePath+\"/id\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.title !== undefined){if(typeof data.title !== \"string\"){const err3 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.text !== undefined){if(typeof data.text !== \"string\"){const err4 = {instancePath:instancePath+\"/text\",schemaPath:\"#/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.date !== undefined){let data3 = data.date;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){if(data3.text === undefined){const err5 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data3.text !== undefined){let data4 = data3.text;if(typeof data4 === \"string\"){if(!pattern5.test(data4)){const err6 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data3.edtf !== undefined){let data5 = data3.edtf;if(typeof data5 === \"string\"){if(!pattern5.test(data5)){const err8 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data3.sortYear !== undefined){let data6 = data3.sortYear;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err10 = {instancePath:instancePath+\"/date/sortYear\",schemaPath:\"#/$defs/storyDate/properties/sortYear/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.place !== undefined){if(!(validate22(data.place, {instancePath:instancePath+\"/place\",parentData:data,parentDataProperty:\"place\",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data.media !== undefined){let data8 = data.media;if(Array.isArray(data8)){const len0 = data8.length;for(let i0=0; i0<len0; i0++){if(!(validate26(data8[i0], {instancePath:instancePath+\"/media/\" + i0,parentData:data8,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}}}else {const err12 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.people !== undefined){let data10 = data.people;if(Array.isArray(data10)){const len1 = data10.length;for(let i1=0; i1<len1; i1++){let data11 = data10[i1];if(data11 && typeof data11 == \"object\" && !Array.isArray(data11)){if(data11.name === undefined){const err13 = {instancePath:instancePath+\"/people/\" + i1,schemaPath:\"#/properties/people/items/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data11.name !== undefined){let data12 = data11.name;if(typeof data12 === \"string\"){if(!pattern5.test(data12)){const err14 = {instancePath:instancePath+\"/people/\" + i1+\"/name\",schemaPath:\"#/properties/people/items/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+\"/people/\" + i1+\"/name\",schemaPath:\"#/properties/people/items/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data11.role !== undefined){if(typeof data11.role !== \"string\"){const err16 = {instancePath:instancePath+\"/people/\" + i1+\"/role\",schemaPath:\"#/properties/people/items/properties/role/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath:instancePath+\"/people/\" + i1,schemaPath:\"#/properties/people/items/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+\"/people\",schemaPath:\"#/properties/people/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}}else {const err19 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate21.errors = vErrors;return errors === 0;}validate21.evaluated = {\"props\":{\"id\":true,\"title\":true,\"text\":true,\"date\":true,\"place\":true,\"media\":true,\"people\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate20(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.format === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"format\"},message:\"must have required property '\"+\"format\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"version\"},message:\"must have required property '\"+\"version\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.title === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.slides === undefined){const err3 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"slides\"},message:\"must have required property '\"+\"slides\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.media === undefined){const err4 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"media\"},message:\"must have required property '\"+\"media\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.$schema !== undefined){if(typeof data.$schema !== \"string\"){const err5 = {instancePath:instancePath+\"/$schema\",schemaPath:\"#/properties/%24schema/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.format !== undefined){if(\"gramps-connect-story\" !== data.format){const err6 = {instancePath:instancePath+\"/format\",schemaPath:\"#/properties/format/const\",keyword:\"const\",params:{allowedValue: \"gramps-connect-story\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.version !== undefined){let data2 = data.version;if(typeof data2 === \"string\"){if(!pattern4.test(data2)){const err7 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/pattern\",keyword:\"pattern\",params:{pattern: \"^1\\\\.(0|[1-9][0-9]*)$\"},message:\"must match pattern \\\"\"+\"^1\\\\.(0|[1-9][0-9]*)$\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.title !== undefined){let data3 = data.title;if(typeof data3 === \"string\"){if(!pattern5.test(data3)){const err9 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.language !== undefined){let data4 = data.language;if(typeof data4 === \"string\"){if(!pattern6.test(data4)){const err11 = {instancePath:instancePath+\"/language\",schemaPath:\"#/properties/language/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"+\"\\\"\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+\"/language\",schemaPath:\"#/properties/language/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.created !== undefined){let data5 = data.created;if(typeof data5 === \"string\"){if(!pattern7.test(data5)){const err13 = {instancePath:instancePath+\"/created\",schemaPath:\"#/properties/created/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"},message:\"must match pattern \\\"\"+\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"+\"\\\"\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+\"/created\",schemaPath:\"#/properties/created/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.generator !== undefined){let data6 = data.generator;if(data6 && typeof data6 == \"object\" && !Array.isArray(data6)){if(data6.name === undefined){const err15 = {instancePath:instancePath+\"/generator\",schemaPath:\"#/properties/generator/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data6.name !== undefined){let data7 = data6.name;if(typeof data7 === \"string\"){if(!pattern5.test(data7)){const err16 = {instancePath:instancePath+\"/generator/name\",schemaPath:\"#/properties/generator/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+\"/generator/name\",schemaPath:\"#/properties/generator/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data6.version !== undefined){if(typeof data6.version !== \"string\"){const err18 = {instancePath:instancePath+\"/generator/version\",schemaPath:\"#/properties/generator/properties/version/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data6.url !== undefined){if(typeof data6.url !== \"string\"){const err19 = {instancePath:instancePath+\"/generator/url\",schemaPath:\"#/properties/generator/properties/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}else {const err20 = {instancePath:instancePath+\"/generator\",schemaPath:\"#/properties/generator/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.authors !== undefined){let data10 = data.authors;if(Array.isArray(data10)){const len0 = data10.length;for(let i0=0; i0<len0; i0++){let data11 = data10[i0];if(data11 && typeof data11 == \"object\" && !Array.isArray(data11)){if(data11.name === undefined){const err21 = {instancePath:instancePath+\"/authors/\" + i0,schemaPath:\"#/properties/authors/items/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data11.name !== undefined){let data12 = data11.name;if(typeof data12 === \"string\"){if(!pattern5.test(data12)){const err22 = {instancePath:instancePath+\"/authors/\" + i0+\"/name\",schemaPath:\"#/properties/authors/items/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+\"/authors/\" + i0+\"/name\",schemaPath:\"#/properties/authors/items/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data11.url !== undefined){if(typeof data11.url !== \"string\"){const err24 = {instancePath:instancePath+\"/authors/\" + i0+\"/url\",schemaPath:\"#/properties/authors/items/properties/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+\"/authors/\" + i0,schemaPath:\"#/properties/authors/items/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+\"/authors\",schemaPath:\"#/properties/authors/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.license !== undefined){if(typeof data.license !== \"string\"){const err27 = {instancePath:instancePath+\"/license\",schemaPath:\"#/properties/license/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data.presentation !== undefined){let data15 = data.presentation;if(data15 && typeof data15 == \"object\" && !Array.isArray(data15)){if(data15.basemap !== undefined){let data16 = data15.basemap;if(!((((data16 === \"standard\") || (data16 === \"historical\")) || (data16 === \"auto\")) || (data16 === \"none\"))){const err28 = {instancePath:instancePath+\"/presentation/basemap\",schemaPath:\"#/properties/presentation/properties/basemap/enum\",keyword:\"enum\",params:{allowedValues: schema31.properties.presentation.properties.basemap.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}}else {const err29 = {instancePath:instancePath+\"/presentation\",schemaPath:\"#/properties/presentation/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.slides !== undefined){let data17 = data.slides;if(Array.isArray(data17)){if(data17.length < 1){const err30 = {instancePath:instancePath+\"/slides\",schemaPath:\"#/properties/slides/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}const len1 = data17.length;for(let i1=0; i1<len1; i1++){if(!(validate21(data17[i1], {instancePath:instancePath+\"/slides/\" + i1,parentData:data17,parentDataProperty:i1,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}}}else {const err31 = {instancePath:instancePath+\"/slides\",schemaPath:\"#/properties/slides/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.media !== undefined){let data19 = data.media;if(data19 && typeof data19 == \"object\" && !Array.isArray(data19)){for(const key0 in data19){const _errs38 = errors;if(typeof key0 === \"string\"){if(!pattern10.test(key0)){const err32 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\",propertyName:key0};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\",propertyName:key0};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}var valid8 = _errs38 === errors;if(!valid8){const err34 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/propertyNames\",keyword:\"propertyNames\",params:{propertyName: key0},message:\"property name must be valid\"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}for(const key1 in data19){let data20 = data19[key1];if(data20 && typeof data20 == \"object\" && !Array.isArray(data20)){if(data20.src === undefined){const err35 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/required\",keyword:\"required\",params:{missingProperty: \"src\"},message:\"must have required property '\"+\"src\"+\"'\"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data20.mime === undefined){const err36 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/required\",keyword:\"required\",params:{missingProperty: \"mime\"},message:\"must have required property '\"+\"mime\"+\"'\"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data20.src !== undefined){let data21 = data20.src;if(typeof data21 === \"string\"){if(!pattern19.test(data21)){const err37 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/src\",schemaPath:\"#/$defs/mediaItem/properties/src/pattern\",keyword:\"pattern\",params:{pattern: \"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},message:\"must match pattern \\\"\"+\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}else {const err38 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/src\",schemaPath:\"#/$defs/mediaItem/properties/src/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data20.mime !== undefined){let data22 = data20.mime;if(typeof data22 === \"string\"){if(!pattern20.test(data22)){const err39 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/mime\",schemaPath:\"#/$defs/mediaItem/properties/mime/pattern\",keyword:\"pattern\",params:{pattern: \"^[a-z]+/[A-Za-z0-9.+-]+$\"},message:\"must match pattern \\\"\"+\"^[a-z]+/[A-Za-z0-9.+-]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/mime\",schemaPath:\"#/$defs/mediaItem/properties/mime/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.width !== undefined){let data23 = data20.width;if(!(((typeof data23 == \"number\") && (!(data23 % 1) && !isNaN(data23))) && (isFinite(data23)))){const err41 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/width\",schemaPath:\"#/$defs/mediaItem/properties/width/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if((typeof data23 == \"number\") && (isFinite(data23))){if(data23 < 1 || isNaN(data23)){const err42 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/width\",schemaPath:\"#/$defs/mediaItem/properties/width/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}}if(data20.height !== undefined){let data24 = data20.height;if(!(((typeof data24 == \"number\") && (!(data24 % 1) && !isNaN(data24))) && (isFinite(data24)))){const err43 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/height\",schemaPath:\"#/$defs/mediaItem/properties/height/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}if((typeof data24 == \"number\") && (isFinite(data24))){if(data24 < 1 || isNaN(data24)){const err44 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/height\",schemaPath:\"#/$defs/mediaItem/properties/height/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}if(data20.alt !== undefined){if(typeof data20.alt !== \"string\"){const err45 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/alt\",schemaPath:\"#/$defs/mediaItem/properties/alt/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}}else {const err46 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}}else {const err47 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data.extensions !== undefined){let data26 = data.extensions;if(data26 && typeof data26 == \"object\" && !Array.isArray(data26)){for(const key2 in data26){let data27 = data26[key2];if(!(data27 && typeof data27 == \"object\" && !Array.isArray(data27))){const err48 = {instancePath:instancePath+\"/extensions/\" + key2.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/properties/extensions/additionalProperties/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+\"/extensions\",schemaPath:\"#/properties/extensions/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}}else {const err50 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {\"props\":{\"$schema\":true,\"format\":true,\"version\":true,\"title\":true,\"language\":true,\"created\":true,\"generator\":true,\"authors\":true,\"license\":true,\"presentation\":true,\"slides\":true,\"media\":true,\"extensions\":true},\"dynamicProps\":false,\"dynamicItems\":false};\n", "// Everything that makes a story.json valid: the JSON Schema (compiled ahead\n// of time into generated/schemaValidator.js -- see\n// scripts/generate-validator.mjs for why) plus the cross-references the\n// schema can't express (spec/1.0/README.md section 8).\nimport schema from \"../spec/1.0/story.schema.json\" with { type: \"json\" };\nimport { validate as schemaValidate } from \"./generated/schemaValidator.js\";\nimport { CURRENT_MAJOR, parseVersion } from \"./version\";\nimport type { StoryDoc } from \"./types\";\n\n/** Minor version of the schema bundled here: unknown fields in a file of\n * this minor version or older are probably typos, not newer features. */\nconst SCHEMA_MINOR = 0;\n\nexport interface StoryIssue {\n /** JSON Pointer into story.json (\"\" for the root), e.g. \"/slides/2/media/0/ref\". */\n path: string;\n message: string;\n}\n\nexport interface ValidationResult {\n valid: boolean;\n errors: StoryIssue[];\n /** Not wrong, but probably not intended: unknown fields in a file that\n * claims a version this package fully knows, media nothing uses. */\n warnings: StoryIssue[];\n}\n\n/** Checks a story document. `files`, when given, is the set of paths in the\n * zip (relative to its story root), so every media `src` can be checked\n * too; without it only story.json itself is checked. */\nexport function validate(doc: unknown, files?: { has(path: string): boolean }): ValidationResult {\n const errors: StoryIssue[] = [];\n const warnings: StoryIssue[] = [];\n\n if (!schemaValidate(doc)) {\n for (const err of schemaValidate.errors ?? []) {\n errors.push({ path: err.instancePath, message: describeSchemaError(err) });\n }\n // Cross-reference checks below assume the basic shape is right.\n return { valid: false, errors, warnings };\n }\n const story = doc as StoryDoc;\n\n const slideIds = new Set<string>();\n const usedMedia = new Set<string>();\n const checkRef = (key: string, path: string) => {\n usedMedia.add(key);\n if (!Object.prototype.hasOwnProperty.call(story.media, key)) {\n errors.push({ path, message: `refers to media \"${key}\", which isn't in \"media\".` });\n }\n };\n story.slides.forEach((slide, i) => {\n if (slideIds.has(slide.id)) {\n errors.push({ path: `/slides/${i}/id`, message: `duplicate slide id \"${slide.id}\".` });\n }\n slideIds.add(slide.id);\n slide.media?.forEach((m, j) => checkRef(m.ref, `/slides/${i}/media/${j}/ref`));\n slide.place?.overlays?.forEach((o, j) => checkRef(o.media, `/slides/${i}/place/overlays/${j}/media`));\n });\n\n for (const [key, item] of Object.entries(story.media)) {\n const path = `/media/${escapePointer(key)}`;\n if (files && !files.has(item.src)) {\n errors.push({ path: `${path}/src`, message: `file \"${item.src}\" is not in the zip.` });\n }\n if (!usedMedia.has(key)) {\n warnings.push({ path, message: `media \"${key}\" isn't used by any slide or overlay.` });\n }\n }\n\n const version = parseVersion(story.version);\n if (version && version.major === CURRENT_MAJOR && version.minor <= SCHEMA_MINOR) {\n findUnknownFields(story, schema as unknown as SchemaNode, \"\", warnings);\n }\n\n return { valid: errors.length === 0, errors, warnings };\n}\n\ninterface AjvError {\n instancePath: string;\n keyword: string;\n params: Record<string, unknown>;\n message?: string;\n}\n\nfunction describeSchemaError(err: AjvError): string {\n if (err.keyword === \"pattern\" && err.params.pattern === \"\\\\S\") return \"must not be empty.\";\n if (err.keyword === \"required\") return `is missing required field \"${String(err.params.missingProperty)}\".`;\n if (err.keyword === \"const\") return `must be ${JSON.stringify(err.params.allowedValue)}.`;\n if (err.keyword === \"enum\") return `must be one of ${(err.params.allowedValues as unknown[]).map((v) => JSON.stringify(v)).join(\", \")}.`;\n return `${err.message ?? \"is invalid\"}.`;\n}\n\nfunction escapePointer(key: string): string {\n return key.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\n\ntype SchemaNode = {\n $ref?: string;\n properties?: Record<string, SchemaNode>;\n additionalProperties?: SchemaNode | boolean;\n items?: SchemaNode;\n prefixItems?: SchemaNode[];\n};\n\nfunction resolveRef(node: SchemaNode, root: Record<string, unknown>): SchemaNode {\n if (!node.$ref) return node;\n const name = node.$ref.replace(/^#\\/\\$defs\\//, \"\");\n return (root.$defs as Record<string, SchemaNode>)[name];\n}\n\n/** Walks the document alongside the schema, warning about any key an\n * object's schema doesn't name. An object whose schema says\n * `additionalProperties: true` (GeoJSON) or gives a schema for extra keys\n * (`media`, `extensions`) is open, not a typo trap. */\nfunction findUnknownFields(value: unknown, node: SchemaNode, path: string, warnings: StoryIssue[], root = schema as unknown as Record<string, unknown>) {\n node = resolveRef(node, root);\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n const itemNode = node.prefixItems?.[i] ?? node.items;\n if (itemNode) findUnknownFields(item, itemNode, `${path}/${i}`, warnings, root);\n });\n return;\n }\n if (typeof value !== \"object\" || value === null) return;\n for (const [key, child] of Object.entries(value)) {\n const childPath = `${path}/${escapePointer(key)}`;\n const known = node.properties?.[key];\n if (known) {\n findUnknownFields(child, known, childPath, warnings, root);\n } else if (typeof node.additionalProperties === \"object\") {\n findUnknownFields(child, node.additionalProperties, childPath, warnings, root);\n } else if (node.properties && node.additionalProperties !== true) {\n warnings.push({ path: childPath, message: `unknown field \"${key}\" (ignored).` });\n }\n }\n}\n", "// Reading and writing the .story.zip container (spec/1.0/README.md\n// sections 1 and 5). A zip handed to readStoryZip() may come from anyone,\n// so reading caps how much it will inflate before looking at any of it.\nimport { unzip, zip, type AsyncZippable, type UnzipFileInfo } from \"fflate\";\nimport { FORMAT_ID, FORMAT_VERSION, StoryFormatError, upgradeStory } from \"./version\";\nimport { validate, type StoryIssue } from \"./validate\";\nimport type { MediaItem, StoryDoc } from \"./types\";\n\nexport interface StoryPackage {\n doc: StoryDoc;\n /** Every file under the story root, keyed by its path relative to that\n * root -- the same paths media `src` values use. */\n files: Map<string, Uint8Array>;\n warnings: StoryIssue[];\n}\n\nexport interface ReadLimits {\n /** Total uncompressed bytes. Default 512 MiB. */\n maxTotalBytes?: number;\n /** Number of entries. Default 10,000. */\n maxFiles?: number;\n}\n\nconst STORY_JSON = \"story.json\";\n\ntype Input = Blob | ArrayBuffer | Uint8Array;\n\nasync function toBytes(input: Input): Promise<Uint8Array> {\n if (input instanceof Uint8Array) return input;\n if (input instanceof ArrayBuffer) return new Uint8Array(input);\n return new Uint8Array(await input.arrayBuffer());\n}\n\nfunction isIgnoredEntry(name: string): boolean {\n return name.endsWith(\"/\") || name.startsWith(\"__MACOSX/\");\n}\n\n/** Opens a .story.zip: finds story.json (at the root, or inside a single\n * top-level folder), upgrades it to the current major version, and\n * validates it against the files actually present. Throws\n * StoryFormatError for anything that isn't a valid story; non-fatal\n * findings come back as `warnings`. */\nexport async function readStoryZip(input: Input, limits: ReadLimits = {}): Promise<StoryPackage> {\n const maxTotal = limits.maxTotalBytes ?? 512 * 1024 * 1024;\n const maxFiles = limits.maxFiles ?? 10_000;\n const bytes = await toBytes(input);\n\n let total = 0;\n let count = 0;\n let overLimit = false;\n const entries = await new Promise<Record<string, Uint8Array>>((resolve, reject) => {\n unzip(bytes, {\n // Runs on the central directory's declared sizes, before inflating.\n filter(file: UnzipFileInfo) {\n if (isIgnoredEntry(file.name)) return false;\n count += 1;\n total += file.originalSize;\n if (count > maxFiles || total > maxTotal) overLimit = true;\n return !overLimit;\n },\n }, (err, data) => (err ? reject(err) : resolve(data)));\n }).catch((err: unknown) => {\n throw new StoryFormatError(\"not-a-zip\", `Not a readable zip file (${err instanceof Error ? err.message : String(err)}).`);\n });\n if (overLimit) {\n throw new StoryFormatError(\"too-large\", \"This zip is too large to open as a story.\");\n }\n\n const prefix = findStoryRoot(Object.keys(entries));\n const files = new Map<string, Uint8Array>();\n for (const [name, data] of Object.entries(entries)) {\n if (name.startsWith(prefix)) files.set(name.slice(prefix.length), data);\n }\n\n let raw: unknown;\n try {\n raw = JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(files.get(STORY_JSON)!));\n } catch (err) {\n throw new StoryFormatError(\"bad-json\", `story.json is not valid JSON (${err instanceof Error ? err.message : String(err)}).`);\n }\n const doc = upgradeStory(raw);\n const result = validate(doc, files);\n if (!result.valid) {\n throw new StoryValidationError(result.errors);\n }\n return { doc, files, warnings: result.warnings };\n}\n\n/** The `invalid` StoryFormatError, carrying every issue found. */\nexport class StoryValidationError extends StoryFormatError {\n readonly issues: StoryIssue[];\n constructor(issues: StoryIssue[]) {\n super(\"invalid\", `story.json is invalid: ${issues.slice(0, 5).map((i) => `${i.path || \"/\"} ${i.message}`).join(\"; \")}${issues.length > 5 ? ` (and ${issues.length - 5} more)` : \"\"}`);\n this.issues = issues;\n }\n}\n\nfunction findStoryRoot(names: string[]): string {\n if (names.includes(STORY_JSON)) return \"\";\n const nested = names.filter((n) => /^[^/]+\\/story\\.json$/.test(n));\n if (nested.length === 1) return nested[0].slice(0, -STORY_JSON.length);\n throw new StoryFormatError(\n \"no-story-json\",\n nested.length > 1\n ? \"This zip holds more than one story.json; a story zip has exactly one.\"\n : \"This zip has no story.json, so it isn't a story.\",\n );\n}\n\n/** The Blob for one media key, typed with its declared mime -- ready for\n * URL.createObjectURL(). Undefined for an unknown key or a missing file. */\nexport function mediaBlob(pkg: StoryPackage, key: string): Blob | undefined {\n const item: MediaItem | undefined = Object.prototype.hasOwnProperty.call(pkg.doc.media, key) ? pkg.doc.media[key] : undefined;\n const data = item && pkg.files.get(item.src);\n return data ? new Blob([data as Uint8Array<ArrayBuffer>], { type: item.mime }) : undefined;\n}\n\n/** Already-compressed formats are stored rather than deflated again. */\nfunction isCompressedMime(mime: string | undefined): boolean {\n return !!mime && (/^(image|video|audio)\\//.test(mime) && mime !== \"image/svg+xml\" && mime !== \"image/bmp\");\n}\n\n/** Builds a .story.zip from a document and its media files (keyed by the\n * same paths as the media `src` values). Fills in `format`/`version` when\n * absent, validates, and throws StoryValidationError rather than writing\n * an invalid story. */\nexport async function writeStoryZip(\n doc: Omit<StoryDoc, \"format\" | \"version\"> & Partial<Pick<StoryDoc, \"format\" | \"version\">>,\n files: Map<string, Uint8Array | Blob>,\n): Promise<Uint8Array> {\n const full: StoryDoc = { format: FORMAT_ID, version: FORMAT_VERSION, ...doc } as StoryDoc;\n const result = validate(full, files);\n if (!result.valid) throw new StoryValidationError(result.errors);\n\n const mimeBySrc = new Map(Object.values(full.media).map((m) => [m.src, m.mime]));\n const entries: AsyncZippable = {\n [STORY_JSON]: [new TextEncoder().encode(JSON.stringify(full, null, 2)), { level: 6 }],\n };\n for (const [path, data] of files) {\n if (path === STORY_JSON) continue;\n const bytes = data instanceof Uint8Array ? data : new Uint8Array(await data.arrayBuffer());\n entries[path] = [bytes, { level: isCompressedMime(mimeBySrc.get(path)) ? 0 : 6 }];\n }\n return new Promise((resolve, reject) => {\n zip(entries, (err, out) => (err ? reject(err) : resolve(out)));\n });\n}\n", "// Re-encodes an image for presentation (spec/1.0/README.md section 5):\n// scaled to fit a long-edge limit and written through a canvas, which also\n// drops every bit of EXIF/GPS metadata the original carried. Browser-only\n// (createImageBitmap + OffscreenCanvas); the sizing and format decisions are\n// split out as plain functions so they can be tested anywhere.\n\nexport type ImagePurpose = \"photo\" | \"overlay\";\n\nexport interface OptimizeOptions {\n /** \"photo\" (default): slide pictures, 1600px, WebP. \"overlay\": map\n * overlays, 2048px, PNG when they have transparency. */\n purpose?: ImagePurpose;\n /** Overrides the purpose's long-edge limit. Never scales up. */\n maxEdge?: number;\n /** Lossy quality, 0-1. Default 0.82. */\n quality?: number;\n}\n\nexport interface OptimizedImage {\n blob: Blob;\n mime: \"image/webp\" | \"image/jpeg\" | \"image/png\";\n /** File extension without the dot, matching `mime`. */\n ext: \"webp\" | \"jpg\" | \"png\";\n width: number;\n height: number;\n}\n\nexport const DEFAULT_MAX_EDGE: Record<ImagePurpose, number> = { photo: 1600, overlay: 2048 };\n\n/** Scales (width, height) down to fit within maxEdge on the longer side,\n * keeping the aspect ratio; never scales up. */\nexport function fitWithin(width: number, height: number, maxEdge: number): { width: number; height: number } {\n const longEdge = Math.max(width, height);\n if (longEdge <= maxEdge) return { width, height };\n const scale = maxEdge / longEdge;\n return { width: Math.max(1, Math.round(width * scale)), height: Math.max(1, Math.round(height * scale)) };\n}\n\n/** Which encodings to try, best first. An overlay with transparency must\n * keep its alpha channel, and lossless PNG keeps hard map edges clean;\n * everything else goes lossy. JPEG is the fallback for a browser that\n * can't encode WebP (convertToBlob silently returns PNG then). */\nexport function encodingCandidates(purpose: ImagePurpose, hasAlpha: boolean): OptimizedImage[\"mime\"][] {\n if (hasAlpha) return purpose === \"overlay\" ? [\"image/png\"] : [\"image/webp\", \"image/png\"];\n return [\"image/webp\", \"image/jpeg\"];\n}\n\nconst EXT: Record<OptimizedImage[\"mime\"], OptimizedImage[\"ext\"]> = {\n \"image/webp\": \"webp\",\n \"image/jpeg\": \"jpg\",\n \"image/png\": \"png\",\n};\n\n/** Any pixel not fully opaque. Checked on the already-scaled canvas, so the\n * cost is bounded by maxEdge, not by the original's size. */\nfunction canvasHasAlpha(ctx: OffscreenCanvasRenderingContext2D, width: number, height: number): boolean {\n const data = ctx.getImageData(0, 0, width, height).data;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] < 255) return true;\n }\n return false;\n}\n\nexport async function optimizeImage(input: Blob, options: OptimizeOptions = {}): Promise<OptimizedImage> {\n const purpose = options.purpose ?? \"photo\";\n const maxEdge = options.maxEdge ?? DEFAULT_MAX_EDGE[purpose];\n const quality = options.quality ?? 0.82;\n\n // imageOrientation \"from-image\" applies the EXIF rotation before the\n // metadata is lost, so a sideways phone photo stays upright.\n const bitmap = await createImageBitmap(input, { imageOrientation: \"from-image\" });\n try {\n const { width, height } = fitWithin(bitmap.width, bitmap.height, maxEdge);\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) throw new Error(\"No 2D canvas context available.\");\n ctx.imageSmoothingQuality = \"high\";\n ctx.drawImage(bitmap, 0, 0, width, height);\n const hasAlpha = canvasHasAlpha(ctx, width, height);\n\n for (const mime of encodingCandidates(purpose, hasAlpha)) {\n const blob = await canvas.convertToBlob({ type: mime, quality });\n if (blob.type === mime) return { blob, mime, ext: EXT[mime], width, height };\n }\n // Every browser can encode PNG; it's convertToBlob's own fallback.\n const blob = await canvas.convertToBlob({ type: \"image/png\" });\n return { blob, mime: \"image/png\", ext: \"png\", width, height };\n } finally {\n bitmap.close();\n }\n}\n"],
4
+ "sourcesContent": ["// Format identity and versioning (spec/1.0/README.md section 2), and the\n// chain of upgraders that lets this package keep opening every older major\n// version of the format.\nimport type { StoryDoc } from \"./types.js\";\n\nexport const FORMAT_ID = \"gramps-connect-story\";\n\n/** The version this package writes. */\nexport const FORMAT_VERSION = \"1.0\";\n\nexport const CURRENT_MAJOR = 1;\n\n/** Upgraders, keyed by the major version they upgrade *from*: UPGRADERS[1]\n * turns a 1.x document into a 2.0 one, and so on. Never remove one -- each\n * is the only thing that keeps old files opening -- and give each a fixture\n * from its source version under examples/. Empty while 1 is the only major.\n * Each receives a document that already passed its own version's checks. */\nconst UPGRADERS: Record<number, (doc: Record<string, unknown>) => Record<string, unknown>> = {};\n\n/** Every major version upgradeStory() can open. */\nexport const SUPPORTED_FORMAT_MAJORS: readonly number[] = Object.freeze(\n Array.from({ length: CURRENT_MAJOR }, (_, i) => i + 1).filter(\n (major) => major === CURRENT_MAJOR || UPGRADERS[major] !== undefined,\n ),\n);\n\nexport type StoryErrorCode =\n | \"not-a-zip\"\n | \"no-story-json\"\n | \"bad-json\"\n | \"not-a-story\"\n | \"bad-version\"\n | \"newer-version\"\n | \"too-large\"\n | \"invalid\";\n\nexport class StoryFormatError extends Error {\n readonly code: StoryErrorCode;\n constructor(code: StoryErrorCode, message: string) {\n super(message);\n this.name = \"StoryFormatError\";\n this.code = code;\n }\n}\n\nexport interface ParsedVersion {\n major: number;\n minor: number;\n}\n\nexport function parseVersion(version: unknown): ParsedVersion | null {\n if (typeof version !== \"string\") return null;\n const match = /^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$/.exec(version);\n if (!match) return null;\n return { major: Number(match[1]), minor: Number(match[2]) };\n}\n\n/** Checks `raw` is a story at all and brings it up to CURRENT_MAJOR.\n * Doesn't validate the result -- see validate.ts -- only what it needs to\n * pick upgraders: `format` and `version`. Throws StoryFormatError. */\nexport function upgradeStory(raw: unknown): StoryDoc {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n throw new StoryFormatError(\"not-a-story\", \"story.json is not a JSON object.\");\n }\n let doc = raw as Record<string, unknown>;\n if (doc.format !== FORMAT_ID) {\n throw new StoryFormatError(\"not-a-story\", `story.json's \"format\" is not \"${FORMAT_ID}\".`);\n }\n const parsed = parseVersion(doc.version);\n if (!parsed || parsed.major < 1) {\n throw new StoryFormatError(\"bad-version\", `story.json's \"version\" (${JSON.stringify(doc.version)}) is not a valid MAJOR.MINOR version.`);\n }\n if (parsed.major > CURRENT_MAJOR) {\n throw new StoryFormatError(\n \"newer-version\",\n `This story uses format version ${doc.version}, which is newer than this viewer supports (up to ${CURRENT_MAJOR}.x). A newer viewer is needed to open it.`,\n );\n }\n for (let major = parsed.major; major < CURRENT_MAJOR; major++) {\n const upgrade = UPGRADERS[major];\n if (!upgrade) {\n throw new StoryFormatError(\"bad-version\", `No upgrade path from format version ${major}.x.`);\n }\n doc = upgrade(doc);\n }\n return doc as unknown as StoryDoc;\n}\n", "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\",\n \"title\": \"Gramps Connect Story, format 1.0\",\n \"description\": \"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).\",\n \"type\": \"object\",\n \"required\": [\"format\", \"version\", \"title\", \"slides\", \"media\"],\n \"properties\": {\n \"$schema\": { \"type\": \"string\" },\n \"format\": { \"const\": \"gramps-connect-story\" },\n \"version\": {\n \"description\": \"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.\",\n \"type\": \"string\",\n \"pattern\": \"^1\\\\.(0|[1-9][0-9]*)$\"\n },\n \"title\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"language\": {\n \"description\": \"BCP 47 language tag of the story's text, e.g. \\\"en\\\", \\\"de-CH\\\".\",\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"\n },\n \"created\": {\n \"description\": \"When the file was written, as an RFC 3339 date-time.\",\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"\n },\n \"generator\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"version\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" }\n }\n },\n \"authors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"url\": { \"type\": \"string\" }\n }\n }\n },\n \"license\": {\n \"description\": \"License of the story's content (text and media), as an SPDX identifier or free text.\",\n \"type\": \"string\"\n },\n \"presentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"basemap\": { \"enum\": [\"standard\", \"historical\", \"auto\", \"none\"] }\n }\n },\n \"slides\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"$ref\": \"#/$defs/slide\" }\n },\n \"media\": {\n \"description\": \"Every media file in the story, keyed by an id that slides and overlays refer to.\",\n \"type\": \"object\",\n \"propertyNames\": { \"$ref\": \"#/$defs/id\" },\n \"additionalProperties\": { \"$ref\": \"#/$defs/mediaItem\" }\n },\n \"extensions\": {\n \"description\": \"Producer-specific data, keyed by namespace. Viewers ignore it.\",\n \"type\": \"object\",\n \"additionalProperties\": { \"type\": \"object\" }\n }\n },\n \"$defs\": {\n \"id\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z0-9_-]{1,64}$\"\n },\n \"storyDate\": {\n \"type\": \"object\",\n \"required\": [\"text\"],\n \"properties\": {\n \"text\": {\n \"description\": \"The date as it should be shown, in the story's language.\",\n \"type\": \"string\",\n \"pattern\": \"\\\\S\"\n },\n \"edtf\": {\n \"description\": \"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\n \"type\": \"string\",\n \"pattern\": \"\\\\S\"\n },\n \"sortYear\": {\n \"description\": \"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\n \"type\": \"integer\"\n }\n }\n },\n \"slide\": {\n \"type\": \"object\",\n \"required\": [\"id\"],\n \"properties\": {\n \"id\": { \"$ref\": \"#/$defs/id\" },\n \"title\": { \"type\": \"string\" },\n \"text\": {\n \"description\": \"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\n \"type\": \"string\"\n },\n \"date\": { \"$ref\": \"#/$defs/storyDate\" },\n \"place\": { \"$ref\": \"#/$defs/place\" },\n \"media\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/slideMedia\" }\n },\n \"people\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"role\": { \"type\": \"string\" }\n }\n }\n }\n }\n },\n \"slideMedia\": {\n \"type\": \"object\",\n \"required\": [\"ref\"],\n \"properties\": {\n \"ref\": { \"$ref\": \"#/$defs/id\" },\n \"caption\": { \"type\": \"string\" },\n \"credit\": { \"type\": \"string\" }\n }\n },\n \"place\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"lat\": { \"type\": \"number\", \"minimum\": -90, \"maximum\": 90 },\n \"lon\": { \"type\": \"number\", \"minimum\": -180, \"maximum\": 180 },\n \"geometry\": {\n \"description\": \"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\n \"type\": \"object\",\n \"required\": [\"type\"],\n \"properties\": { \"type\": { \"type\": \"string\" } },\n \"additionalProperties\": true\n },\n \"overlays\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/overlay\" }\n }\n },\n \"dependentRequired\": {\n \"lat\": [\"lon\"],\n \"lon\": [\"lat\"]\n }\n },\n \"lonLat\": {\n \"type\": \"array\",\n \"prefixItems\": [\n { \"type\": \"number\", \"minimum\": -180, \"maximum\": 180 },\n { \"type\": \"number\", \"minimum\": -90, \"maximum\": 90 }\n ],\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"overlay\": {\n \"type\": \"object\",\n \"required\": [\"media\", \"corners\"],\n \"properties\": {\n \"media\": { \"$ref\": \"#/$defs/id\" },\n \"corners\": {\n \"description\": \"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/lonLat\" },\n \"minItems\": 4,\n \"maxItems\": 4\n },\n \"opacity\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"order\": {\n \"description\": \"Stacking order among a slide's overlays; lower is drawn first.\",\n \"type\": \"integer\"\n },\n \"date\": { \"$ref\": \"#/$defs/storyDate\" }\n }\n },\n \"mediaItem\": {\n \"type\": \"object\",\n \"required\": [\"src\", \"mime\"],\n \"properties\": {\n \"src\": {\n \"description\": \"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\n \"type\": \"string\",\n \"pattern\": \"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"\n },\n \"mime\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z]+/[A-Za-z0-9.+-]+$\"\n },\n \"width\": { \"type\": \"integer\", \"minimum\": 1 },\n \"height\": { \"type\": \"integer\", \"minimum\": 1 },\n \"alt\": { \"type\": \"string\" }\n }\n }\n }\n}\n", "// GENERATED by scripts/generate-validator.mjs from spec/1.0/story.schema.json -- do not edit.\n// @ts-nocheck\n\"use strict\";export const validate = validate20;export default validate20;const schema31 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\",\"title\":\"Gramps Connect Story, format 1.0\",\"description\":\"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).\",\"type\":\"object\",\"required\":[\"format\",\"version\",\"title\",\"slides\",\"media\"],\"properties\":{\"$schema\":{\"type\":\"string\"},\"format\":{\"const\":\"gramps-connect-story\"},\"version\":{\"description\":\"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.\",\"type\":\"string\",\"pattern\":\"^1\\\\.(0|[1-9][0-9]*)$\"},\"title\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"language\":{\"description\":\"BCP 47 language tag of the story's text, e.g. \\\"en\\\", \\\"de-CH\\\".\",\"type\":\"string\",\"pattern\":\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"},\"created\":{\"description\":\"When the file was written, as an RFC 3339 date-time.\",\"type\":\"string\",\"pattern\":\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"},\"generator\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"version\":{\"type\":\"string\"},\"url\":{\"type\":\"string\"}}},\"authors\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"url\":{\"type\":\"string\"}}}},\"license\":{\"description\":\"License of the story's content (text and media), as an SPDX identifier or free text.\",\"type\":\"string\"},\"presentation\":{\"type\":\"object\",\"properties\":{\"basemap\":{\"enum\":[\"standard\",\"historical\",\"auto\",\"none\"]}}},\"slides\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/$defs/slide\"}},\"media\":{\"description\":\"Every media file in the story, keyed by an id that slides and overlays refer to.\",\"type\":\"object\",\"propertyNames\":{\"$ref\":\"#/$defs/id\"},\"additionalProperties\":{\"$ref\":\"#/$defs/mediaItem\"}},\"extensions\":{\"description\":\"Producer-specific data, keyed by namespace. Viewers ignore it.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}}},\"$defs\":{\"id\":{\"type\":\"string\",\"pattern\":\"^[A-Za-z0-9_-]{1,64}$\"},\"storyDate\":{\"type\":\"object\",\"required\":[\"text\"],\"properties\":{\"text\":{\"description\":\"The date as it should be shown, in the story's language.\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"edtf\":{\"description\":\"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"sortYear\":{\"description\":\"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\"type\":\"integer\"}}},\"slide\":{\"type\":\"object\",\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/$defs/id\"},\"title\":{\"type\":\"string\"},\"text\":{\"description\":\"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\"type\":\"string\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"},\"place\":{\"$ref\":\"#/$defs/place\"},\"media\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/slideMedia\"}},\"people\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"role\":{\"type\":\"string\"}}}}}},\"slideMedia\":{\"type\":\"object\",\"required\":[\"ref\"],\"properties\":{\"ref\":{\"$ref\":\"#/$defs/id\"},\"caption\":{\"type\":\"string\"},\"credit\":{\"type\":\"string\"}}},\"place\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"lat\":{\"type\":\"number\",\"minimum\":-90,\"maximum\":90},\"lon\":{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},\"geometry\":{\"description\":\"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\"}},\"additionalProperties\":true},\"overlays\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/overlay\"}}},\"dependentRequired\":{\"lat\":[\"lon\"],\"lon\":[\"lat\"]}},\"lonLat\":{\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},{\"type\":\"number\",\"minimum\":-90,\"maximum\":90}],\"minItems\":2,\"maxItems\":2},\"overlay\":{\"type\":\"object\",\"required\":[\"media\",\"corners\"],\"properties\":{\"media\":{\"$ref\":\"#/$defs/id\"},\"corners\":{\"description\":\"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/lonLat\"},\"minItems\":4,\"maxItems\":4},\"opacity\":{\"type\":\"number\",\"minimum\":0,\"maximum\":1},\"order\":{\"description\":\"Stacking order among a slide's overlays; lower is drawn first.\",\"type\":\"integer\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"}}},\"mediaItem\":{\"type\":\"object\",\"required\":[\"src\",\"mime\"],\"properties\":{\"src\":{\"description\":\"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\"type\":\"string\",\"pattern\":\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},\"mime\":{\"type\":\"string\",\"pattern\":\"^[a-z]+/[A-Za-z0-9.+-]+$\"},\"width\":{\"type\":\"integer\",\"minimum\":1},\"height\":{\"type\":\"integer\",\"minimum\":1},\"alt\":{\"type\":\"string\"}}}}};const schema33 = {\"type\":\"string\",\"pattern\":\"^[A-Za-z0-9_-]{1,64}$\"};const schema43 = {\"type\":\"object\",\"required\":[\"src\",\"mime\"],\"properties\":{\"src\":{\"description\":\"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\"type\":\"string\",\"pattern\":\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},\"mime\":{\"type\":\"string\",\"pattern\":\"^[a-z]+/[A-Za-z0-9.+-]+$\"},\"width\":{\"type\":\"integer\",\"minimum\":1},\"height\":{\"type\":\"integer\",\"minimum\":1},\"alt\":{\"type\":\"string\"}}};const pattern4 = new RegExp(\"^1\\\\.(0|[1-9][0-9]*)$\", \"u\");const pattern5 = new RegExp(\"\\\\S\", \"u\");const pattern6 = new RegExp(\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\", \"u\");const pattern7 = new RegExp(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\", \"u\");const pattern10 = new RegExp(\"^[A-Za-z0-9_-]{1,64}$\", \"u\");const pattern19 = new RegExp(\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\", \"u\");const pattern20 = new RegExp(\"^[a-z]+/[A-Za-z0-9.+-]+$\", \"u\");const schema32 = {\"type\":\"object\",\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/$defs/id\"},\"title\":{\"type\":\"string\"},\"text\":{\"description\":\"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\"type\":\"string\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"},\"place\":{\"$ref\":\"#/$defs/place\"},\"media\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/slideMedia\"}},\"people\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"role\":{\"type\":\"string\"}}}}}};const schema34 = {\"type\":\"object\",\"required\":[\"text\"],\"properties\":{\"text\":{\"description\":\"The date as it should be shown, in the story's language.\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"edtf\":{\"description\":\"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"sortYear\":{\"description\":\"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\"type\":\"integer\"}}};const schema35 = {\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"lat\":{\"type\":\"number\",\"minimum\":-90,\"maximum\":90},\"lon\":{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},\"geometry\":{\"description\":\"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\"}},\"additionalProperties\":true},\"overlays\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/overlay\"}}},\"dependentRequired\":{\"lat\":[\"lon\"],\"lon\":[\"lat\"]}};const schema36 = {\"type\":\"object\",\"required\":[\"media\",\"corners\"],\"properties\":{\"media\":{\"$ref\":\"#/$defs/id\"},\"corners\":{\"description\":\"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/lonLat\"},\"minItems\":4,\"maxItems\":4},\"opacity\":{\"type\":\"number\",\"minimum\":0,\"maximum\":1},\"order\":{\"description\":\"Stacking order among a slide's overlays; lower is drawn first.\",\"type\":\"integer\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"}}};const schema38 = {\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},{\"type\":\"number\",\"minimum\":-90,\"maximum\":90}],\"minItems\":2,\"maxItems\":2};function validate23(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate23.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.media === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"media\"},message:\"must have required property '\"+\"media\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.corners === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"corners\"},message:\"must have required property '\"+\"corners\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.media !== undefined){let data0 = data.media;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err2 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.corners !== undefined){let data1 = data.corners;if(Array.isArray(data1)){if(data1.length > 4){const err4 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/maxItems\",keyword:\"maxItems\",params:{limit: 4},message:\"must NOT have more than 4 items\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data1.length < 4){const err5 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/minItems\",keyword:\"minItems\",params:{limit: 4},message:\"must NOT have fewer than 4 items\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];if(Array.isArray(data2)){if(data2.length > 2){const err6 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/maxItems\",keyword:\"maxItems\",params:{limit: 2},message:\"must NOT have more than 2 items\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data2.length < 2){const err7 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/minItems\",keyword:\"minItems\",params:{limit: 2},message:\"must NOT have fewer than 2 items\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}const len1 = data2.length;if(len1 > 0){let data3 = data2[0];if((typeof data3 == \"number\") && (isFinite(data3))){if(data3 > 180 || isNaN(data3)){const err8 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 180},message:\"must be <= 180\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data3 < -180 || isNaN(data3)){const err9 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -180},message:\"must be >= -180\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(len1 > 1){let data4 = data2[1];if((typeof data4 == \"number\") && (isFinite(data4))){if(data4 > 90 || isNaN(data4)){const err11 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 90},message:\"must be <= 90\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data4 < -90 || isNaN(data4)){const err12 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -90},message:\"must be >= -90\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.opacity !== undefined){let data5 = data.opacity;if((typeof data5 == \"number\") && (isFinite(data5))){if(data5 > 1 || isNaN(data5)){const err16 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 1},message:\"must be <= 1\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data5 < 0 || isNaN(data5)){const err17 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.order !== undefined){let data6 = data.order;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err19 = {instancePath:instancePath+\"/order\",schemaPath:\"#/properties/order/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.date !== undefined){let data7 = data.date;if(data7 && typeof data7 == \"object\" && !Array.isArray(data7)){if(data7.text === undefined){const err20 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data7.text !== undefined){let data8 = data7.text;if(typeof data8 === \"string\"){if(!pattern5.test(data8)){const err21 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data7.edtf !== undefined){let data9 = data7.edtf;if(typeof data9 === \"string\"){if(!pattern5.test(data9)){const err23 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data7.sortYear !== undefined){let data10 = data7.sortYear;if(!(((typeof data10 == \"number\") && (!(data10 % 1) && !isNaN(data10))) && (isFinite(data10)))){const err25 = {instancePath:instancePath+\"/date/sortYear\",schemaPath:\"#/$defs/storyDate/properties/sortYear/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}else {const err27 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}validate23.errors = vErrors;return errors === 0;}validate23.evaluated = {\"props\":{\"media\":true,\"corners\":true,\"opacity\":true,\"order\":true,\"date\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate22(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.name !== undefined){if(typeof data.name !== \"string\"){const err0 = {instancePath:instancePath+\"/name\",schemaPath:\"#/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.lat !== undefined){let data1 = data.lat;if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 > 90 || isNaN(data1)){const err1 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 90},message:\"must be <= 90\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data1 < -90 || isNaN(data1)){const err2 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -90},message:\"must be >= -90\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.lon !== undefined){let data2 = data.lon;if((typeof data2 == \"number\") && (isFinite(data2))){if(data2 > 180 || isNaN(data2)){const err4 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 180},message:\"must be <= 180\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data2 < -180 || isNaN(data2)){const err5 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -180},message:\"must be >= -180\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.geometry !== undefined){let data3 = data.geometry;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){if(data3.type === undefined){const err7 = {instancePath:instancePath+\"/geometry\",schemaPath:\"#/properties/geometry/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data3.type !== undefined){if(typeof data3.type !== \"string\"){const err8 = {instancePath:instancePath+\"/geometry/type\",schemaPath:\"#/properties/geometry/properties/type/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath:instancePath+\"/geometry\",schemaPath:\"#/properties/geometry/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.overlays !== undefined){let data5 = data.overlays;if(Array.isArray(data5)){const len0 = data5.length;for(let i0=0; i0<len0; i0++){if(!(validate23(data5[i0], {instancePath:instancePath+\"/overlays/\" + i0,parentData:data5,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate23.errors : vErrors.concat(validate23.errors);errors = vErrors.length;}}}else {const err10 = {instancePath:instancePath+\"/overlays\",schemaPath:\"#/properties/overlays/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.lat !== undefined){if(data.lon === undefined){const err11 = {instancePath,schemaPath:\"#/dependentRequired\",keyword:\"dependentRequired\",params:{property: \"lat\",\n missingProperty: \"lon\",\n depsCount: 1,\n deps: \"lon\"},message:\"must have property lon when property lat is present\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.lon !== undefined){if(data.lat === undefined){const err12 = {instancePath,schemaPath:\"#/dependentRequired\",keyword:\"dependentRequired\",params:{property: \"lon\",\n missingProperty: \"lat\",\n depsCount: 1,\n deps: \"lat\"},message:\"must have property lat when property lon is present\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {\"props\":{\"name\":true,\"lat\":true,\"lon\":true,\"geometry\":true,\"overlays\":true},\"dynamicProps\":false,\"dynamicItems\":false};const schema40 = {\"type\":\"object\",\"required\":[\"ref\"],\"properties\":{\"ref\":{\"$ref\":\"#/$defs/id\"},\"caption\":{\"type\":\"string\"},\"credit\":{\"type\":\"string\"}}};function validate26(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate26.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.ref === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"ref\"},message:\"must have required property '\"+\"ref\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref !== undefined){let data0 = data.ref;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err1 = {instancePath:instancePath+\"/ref\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath:instancePath+\"/ref\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.caption !== undefined){if(typeof data.caption !== \"string\"){const err3 = {instancePath:instancePath+\"/caption\",schemaPath:\"#/properties/caption/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.credit !== undefined){if(typeof data.credit !== \"string\"){const err4 = {instancePath:instancePath+\"/credit\",schemaPath:\"#/properties/credit/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate26.errors = vErrors;return errors === 0;}validate26.evaluated = {\"props\":{\"ref\":true,\"caption\":true,\"credit\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate21(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err1 = {instancePath:instancePath+\"/id\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath:instancePath+\"/id\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.title !== undefined){if(typeof data.title !== \"string\"){const err3 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.text !== undefined){if(typeof data.text !== \"string\"){const err4 = {instancePath:instancePath+\"/text\",schemaPath:\"#/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.date !== undefined){let data3 = data.date;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){if(data3.text === undefined){const err5 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data3.text !== undefined){let data4 = data3.text;if(typeof data4 === \"string\"){if(!pattern5.test(data4)){const err6 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data3.edtf !== undefined){let data5 = data3.edtf;if(typeof data5 === \"string\"){if(!pattern5.test(data5)){const err8 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data3.sortYear !== undefined){let data6 = data3.sortYear;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err10 = {instancePath:instancePath+\"/date/sortYear\",schemaPath:\"#/$defs/storyDate/properties/sortYear/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.place !== undefined){if(!(validate22(data.place, {instancePath:instancePath+\"/place\",parentData:data,parentDataProperty:\"place\",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data.media !== undefined){let data8 = data.media;if(Array.isArray(data8)){const len0 = data8.length;for(let i0=0; i0<len0; i0++){if(!(validate26(data8[i0], {instancePath:instancePath+\"/media/\" + i0,parentData:data8,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}}}else {const err12 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.people !== undefined){let data10 = data.people;if(Array.isArray(data10)){const len1 = data10.length;for(let i1=0; i1<len1; i1++){let data11 = data10[i1];if(data11 && typeof data11 == \"object\" && !Array.isArray(data11)){if(data11.name === undefined){const err13 = {instancePath:instancePath+\"/people/\" + i1,schemaPath:\"#/properties/people/items/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data11.name !== undefined){let data12 = data11.name;if(typeof data12 === \"string\"){if(!pattern5.test(data12)){const err14 = {instancePath:instancePath+\"/people/\" + i1+\"/name\",schemaPath:\"#/properties/people/items/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+\"/people/\" + i1+\"/name\",schemaPath:\"#/properties/people/items/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data11.role !== undefined){if(typeof data11.role !== \"string\"){const err16 = {instancePath:instancePath+\"/people/\" + i1+\"/role\",schemaPath:\"#/properties/people/items/properties/role/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath:instancePath+\"/people/\" + i1,schemaPath:\"#/properties/people/items/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+\"/people\",schemaPath:\"#/properties/people/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}}else {const err19 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate21.errors = vErrors;return errors === 0;}validate21.evaluated = {\"props\":{\"id\":true,\"title\":true,\"text\":true,\"date\":true,\"place\":true,\"media\":true,\"people\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate20(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.format === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"format\"},message:\"must have required property '\"+\"format\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"version\"},message:\"must have required property '\"+\"version\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.title === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.slides === undefined){const err3 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"slides\"},message:\"must have required property '\"+\"slides\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.media === undefined){const err4 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"media\"},message:\"must have required property '\"+\"media\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.$schema !== undefined){if(typeof data.$schema !== \"string\"){const err5 = {instancePath:instancePath+\"/$schema\",schemaPath:\"#/properties/%24schema/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.format !== undefined){if(\"gramps-connect-story\" !== data.format){const err6 = {instancePath:instancePath+\"/format\",schemaPath:\"#/properties/format/const\",keyword:\"const\",params:{allowedValue: \"gramps-connect-story\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.version !== undefined){let data2 = data.version;if(typeof data2 === \"string\"){if(!pattern4.test(data2)){const err7 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/pattern\",keyword:\"pattern\",params:{pattern: \"^1\\\\.(0|[1-9][0-9]*)$\"},message:\"must match pattern \\\"\"+\"^1\\\\.(0|[1-9][0-9]*)$\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.title !== undefined){let data3 = data.title;if(typeof data3 === \"string\"){if(!pattern5.test(data3)){const err9 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.language !== undefined){let data4 = data.language;if(typeof data4 === \"string\"){if(!pattern6.test(data4)){const err11 = {instancePath:instancePath+\"/language\",schemaPath:\"#/properties/language/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"+\"\\\"\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+\"/language\",schemaPath:\"#/properties/language/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.created !== undefined){let data5 = data.created;if(typeof data5 === \"string\"){if(!pattern7.test(data5)){const err13 = {instancePath:instancePath+\"/created\",schemaPath:\"#/properties/created/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"},message:\"must match pattern \\\"\"+\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"+\"\\\"\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+\"/created\",schemaPath:\"#/properties/created/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.generator !== undefined){let data6 = data.generator;if(data6 && typeof data6 == \"object\" && !Array.isArray(data6)){if(data6.name === undefined){const err15 = {instancePath:instancePath+\"/generator\",schemaPath:\"#/properties/generator/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data6.name !== undefined){let data7 = data6.name;if(typeof data7 === \"string\"){if(!pattern5.test(data7)){const err16 = {instancePath:instancePath+\"/generator/name\",schemaPath:\"#/properties/generator/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+\"/generator/name\",schemaPath:\"#/properties/generator/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data6.version !== undefined){if(typeof data6.version !== \"string\"){const err18 = {instancePath:instancePath+\"/generator/version\",schemaPath:\"#/properties/generator/properties/version/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data6.url !== undefined){if(typeof data6.url !== \"string\"){const err19 = {instancePath:instancePath+\"/generator/url\",schemaPath:\"#/properties/generator/properties/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}else {const err20 = {instancePath:instancePath+\"/generator\",schemaPath:\"#/properties/generator/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.authors !== undefined){let data10 = data.authors;if(Array.isArray(data10)){const len0 = data10.length;for(let i0=0; i0<len0; i0++){let data11 = data10[i0];if(data11 && typeof data11 == \"object\" && !Array.isArray(data11)){if(data11.name === undefined){const err21 = {instancePath:instancePath+\"/authors/\" + i0,schemaPath:\"#/properties/authors/items/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data11.name !== undefined){let data12 = data11.name;if(typeof data12 === \"string\"){if(!pattern5.test(data12)){const err22 = {instancePath:instancePath+\"/authors/\" + i0+\"/name\",schemaPath:\"#/properties/authors/items/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+\"/authors/\" + i0+\"/name\",schemaPath:\"#/properties/authors/items/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data11.url !== undefined){if(typeof data11.url !== \"string\"){const err24 = {instancePath:instancePath+\"/authors/\" + i0+\"/url\",schemaPath:\"#/properties/authors/items/properties/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+\"/authors/\" + i0,schemaPath:\"#/properties/authors/items/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+\"/authors\",schemaPath:\"#/properties/authors/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.license !== undefined){if(typeof data.license !== \"string\"){const err27 = {instancePath:instancePath+\"/license\",schemaPath:\"#/properties/license/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data.presentation !== undefined){let data15 = data.presentation;if(data15 && typeof data15 == \"object\" && !Array.isArray(data15)){if(data15.basemap !== undefined){let data16 = data15.basemap;if(!((((data16 === \"standard\") || (data16 === \"historical\")) || (data16 === \"auto\")) || (data16 === \"none\"))){const err28 = {instancePath:instancePath+\"/presentation/basemap\",schemaPath:\"#/properties/presentation/properties/basemap/enum\",keyword:\"enum\",params:{allowedValues: schema31.properties.presentation.properties.basemap.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}}else {const err29 = {instancePath:instancePath+\"/presentation\",schemaPath:\"#/properties/presentation/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.slides !== undefined){let data17 = data.slides;if(Array.isArray(data17)){if(data17.length < 1){const err30 = {instancePath:instancePath+\"/slides\",schemaPath:\"#/properties/slides/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}const len1 = data17.length;for(let i1=0; i1<len1; i1++){if(!(validate21(data17[i1], {instancePath:instancePath+\"/slides/\" + i1,parentData:data17,parentDataProperty:i1,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}}}else {const err31 = {instancePath:instancePath+\"/slides\",schemaPath:\"#/properties/slides/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.media !== undefined){let data19 = data.media;if(data19 && typeof data19 == \"object\" && !Array.isArray(data19)){for(const key0 in data19){const _errs38 = errors;if(typeof key0 === \"string\"){if(!pattern10.test(key0)){const err32 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\",propertyName:key0};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\",propertyName:key0};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}var valid8 = _errs38 === errors;if(!valid8){const err34 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/propertyNames\",keyword:\"propertyNames\",params:{propertyName: key0},message:\"property name must be valid\"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}for(const key1 in data19){let data20 = data19[key1];if(data20 && typeof data20 == \"object\" && !Array.isArray(data20)){if(data20.src === undefined){const err35 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/required\",keyword:\"required\",params:{missingProperty: \"src\"},message:\"must have required property '\"+\"src\"+\"'\"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data20.mime === undefined){const err36 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/required\",keyword:\"required\",params:{missingProperty: \"mime\"},message:\"must have required property '\"+\"mime\"+\"'\"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data20.src !== undefined){let data21 = data20.src;if(typeof data21 === \"string\"){if(!pattern19.test(data21)){const err37 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/src\",schemaPath:\"#/$defs/mediaItem/properties/src/pattern\",keyword:\"pattern\",params:{pattern: \"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},message:\"must match pattern \\\"\"+\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}else {const err38 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/src\",schemaPath:\"#/$defs/mediaItem/properties/src/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data20.mime !== undefined){let data22 = data20.mime;if(typeof data22 === \"string\"){if(!pattern20.test(data22)){const err39 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/mime\",schemaPath:\"#/$defs/mediaItem/properties/mime/pattern\",keyword:\"pattern\",params:{pattern: \"^[a-z]+/[A-Za-z0-9.+-]+$\"},message:\"must match pattern \\\"\"+\"^[a-z]+/[A-Za-z0-9.+-]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/mime\",schemaPath:\"#/$defs/mediaItem/properties/mime/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.width !== undefined){let data23 = data20.width;if(!(((typeof data23 == \"number\") && (!(data23 % 1) && !isNaN(data23))) && (isFinite(data23)))){const err41 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/width\",schemaPath:\"#/$defs/mediaItem/properties/width/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if((typeof data23 == \"number\") && (isFinite(data23))){if(data23 < 1 || isNaN(data23)){const err42 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/width\",schemaPath:\"#/$defs/mediaItem/properties/width/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}}if(data20.height !== undefined){let data24 = data20.height;if(!(((typeof data24 == \"number\") && (!(data24 % 1) && !isNaN(data24))) && (isFinite(data24)))){const err43 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/height\",schemaPath:\"#/$defs/mediaItem/properties/height/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}if((typeof data24 == \"number\") && (isFinite(data24))){if(data24 < 1 || isNaN(data24)){const err44 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/height\",schemaPath:\"#/$defs/mediaItem/properties/height/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}if(data20.alt !== undefined){if(typeof data20.alt !== \"string\"){const err45 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/alt\",schemaPath:\"#/$defs/mediaItem/properties/alt/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}}else {const err46 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}}else {const err47 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data.extensions !== undefined){let data26 = data.extensions;if(data26 && typeof data26 == \"object\" && !Array.isArray(data26)){for(const key2 in data26){let data27 = data26[key2];if(!(data27 && typeof data27 == \"object\" && !Array.isArray(data27))){const err48 = {instancePath:instancePath+\"/extensions/\" + key2.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/properties/extensions/additionalProperties/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+\"/extensions\",schemaPath:\"#/properties/extensions/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}}else {const err50 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {\"props\":{\"$schema\":true,\"format\":true,\"version\":true,\"title\":true,\"language\":true,\"created\":true,\"generator\":true,\"authors\":true,\"license\":true,\"presentation\":true,\"slides\":true,\"media\":true,\"extensions\":true},\"dynamicProps\":false,\"dynamicItems\":false};\n", "// Everything that makes a story.json valid: the JSON Schema (compiled ahead\n// of time into generated/schemaValidator.js -- see\n// scripts/generate-validator.mjs for why) plus the cross-references the\n// schema can't express (spec/1.0/README.md section 8).\nimport schema from \"../spec/1.0/story.schema.json\" with { type: \"json\" };\nimport { validate as schemaValidate } from \"./generated/schemaValidator.js\";\nimport { CURRENT_MAJOR, parseVersion } from \"./version.js\";\nimport type { StoryDoc } from \"./types.js\";\n\n/** Minor version of the schema bundled here: unknown fields in a file of\n * this minor version or older are probably typos, not newer features. */\nconst SCHEMA_MINOR = 0;\n\nexport interface StoryIssue {\n /** JSON Pointer into story.json (\"\" for the root), e.g. \"/slides/2/media/0/ref\". */\n path: string;\n message: string;\n}\n\nexport interface ValidationResult {\n valid: boolean;\n errors: StoryIssue[];\n /** Not wrong, but probably not intended: unknown fields in a file that\n * claims a version this package fully knows, media nothing uses. */\n warnings: StoryIssue[];\n}\n\n/** Checks a story document. `files`, when given, is the set of paths in the\n * zip (relative to its story root), so every media `src` can be checked\n * too; without it only story.json itself is checked. */\nexport function validate(doc: unknown, files?: { has(path: string): boolean }): ValidationResult {\n const errors: StoryIssue[] = [];\n const warnings: StoryIssue[] = [];\n\n if (!schemaValidate(doc)) {\n for (const err of schemaValidate.errors ?? []) {\n errors.push({ path: err.instancePath, message: describeSchemaError(err) });\n }\n // Cross-reference checks below assume the basic shape is right.\n return { valid: false, errors, warnings };\n }\n const story = doc as StoryDoc;\n\n const slideIds = new Set<string>();\n const usedMedia = new Set<string>();\n const checkRef = (key: string, path: string) => {\n usedMedia.add(key);\n if (!Object.prototype.hasOwnProperty.call(story.media, key)) {\n errors.push({ path, message: `refers to media \"${key}\", which isn't in \"media\".` });\n }\n };\n story.slides.forEach((slide, i) => {\n if (slideIds.has(slide.id)) {\n errors.push({ path: `/slides/${i}/id`, message: `duplicate slide id \"${slide.id}\".` });\n }\n slideIds.add(slide.id);\n slide.media?.forEach((m, j) => checkRef(m.ref, `/slides/${i}/media/${j}/ref`));\n slide.place?.overlays?.forEach((o, j) => checkRef(o.media, `/slides/${i}/place/overlays/${j}/media`));\n });\n\n for (const [key, item] of Object.entries(story.media)) {\n const path = `/media/${escapePointer(key)}`;\n if (files && !files.has(item.src)) {\n errors.push({ path: `${path}/src`, message: `file \"${item.src}\" is not in the zip.` });\n }\n if (!usedMedia.has(key)) {\n warnings.push({ path, message: `media \"${key}\" isn't used by any slide or overlay.` });\n }\n }\n\n const version = parseVersion(story.version);\n if (version && version.major === CURRENT_MAJOR && version.minor <= SCHEMA_MINOR) {\n findUnknownFields(story, schema as unknown as SchemaNode, \"\", warnings);\n }\n\n return { valid: errors.length === 0, errors, warnings };\n}\n\ninterface AjvError {\n instancePath: string;\n keyword: string;\n params: Record<string, unknown>;\n message?: string;\n}\n\nfunction describeSchemaError(err: AjvError): string {\n if (err.keyword === \"pattern\" && err.params.pattern === \"\\\\S\") return \"must not be empty.\";\n if (err.keyword === \"required\") return `is missing required field \"${String(err.params.missingProperty)}\".`;\n if (err.keyword === \"const\") return `must be ${JSON.stringify(err.params.allowedValue)}.`;\n if (err.keyword === \"enum\") return `must be one of ${(err.params.allowedValues as unknown[]).map((v) => JSON.stringify(v)).join(\", \")}.`;\n return `${err.message ?? \"is invalid\"}.`;\n}\n\nfunction escapePointer(key: string): string {\n return key.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\n\ntype SchemaNode = {\n $ref?: string;\n properties?: Record<string, SchemaNode>;\n additionalProperties?: SchemaNode | boolean;\n items?: SchemaNode;\n prefixItems?: SchemaNode[];\n};\n\nfunction resolveRef(node: SchemaNode, root: Record<string, unknown>): SchemaNode {\n if (!node.$ref) return node;\n const name = node.$ref.replace(/^#\\/\\$defs\\//, \"\");\n return (root.$defs as Record<string, SchemaNode>)[name];\n}\n\n/** Walks the document alongside the schema, warning about any key an\n * object's schema doesn't name. An object whose schema says\n * `additionalProperties: true` (GeoJSON) or gives a schema for extra keys\n * (`media`, `extensions`) is open, not a typo trap. */\nfunction findUnknownFields(value: unknown, node: SchemaNode, path: string, warnings: StoryIssue[], root = schema as unknown as Record<string, unknown>) {\n node = resolveRef(node, root);\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n const itemNode = node.prefixItems?.[i] ?? node.items;\n if (itemNode) findUnknownFields(item, itemNode, `${path}/${i}`, warnings, root);\n });\n return;\n }\n if (typeof value !== \"object\" || value === null) return;\n for (const [key, child] of Object.entries(value)) {\n const childPath = `${path}/${escapePointer(key)}`;\n const known = node.properties?.[key];\n if (known) {\n findUnknownFields(child, known, childPath, warnings, root);\n } else if (typeof node.additionalProperties === \"object\") {\n findUnknownFields(child, node.additionalProperties, childPath, warnings, root);\n } else if (node.properties && node.additionalProperties !== true) {\n warnings.push({ path: childPath, message: `unknown field \"${key}\" (ignored).` });\n }\n }\n}\n", "// Reading and writing the .story.zip container (spec/1.0/README.md\n// sections 1 and 5). A zip handed to readStoryZip() may come from anyone,\n// so reading caps how much it will inflate before looking at any of it.\nimport { unzip, zip, type AsyncZippable, type UnzipFileInfo } from \"fflate\";\nimport { FORMAT_ID, FORMAT_VERSION, StoryFormatError, upgradeStory } from \"./version.js\";\nimport { validate, type StoryIssue } from \"./validate.js\";\nimport type { MediaItem, StoryDoc } from \"./types.js\";\n\nexport interface StoryPackage {\n doc: StoryDoc;\n /** Every file under the story root, keyed by its path relative to that\n * root -- the same paths media `src` values use. */\n files: Map<string, Uint8Array>;\n warnings: StoryIssue[];\n}\n\nexport interface ReadLimits {\n /** Total uncompressed bytes. Default 512 MiB. */\n maxTotalBytes?: number;\n /** Number of entries. Default 10,000. */\n maxFiles?: number;\n}\n\nconst STORY_JSON = \"story.json\";\n\ntype Input = Blob | ArrayBuffer | Uint8Array;\n\nasync function toBytes(input: Input): Promise<Uint8Array> {\n if (input instanceof Uint8Array) return input;\n if (input instanceof ArrayBuffer) return new Uint8Array(input);\n return new Uint8Array(await input.arrayBuffer());\n}\n\nfunction isIgnoredEntry(name: string): boolean {\n return name.endsWith(\"/\") || name.startsWith(\"__MACOSX/\");\n}\n\n/** Opens a .story.zip: finds story.json (at the root, or inside a single\n * top-level folder), upgrades it to the current major version, and\n * validates it against the files actually present. Throws\n * StoryFormatError for anything that isn't a valid story; non-fatal\n * findings come back as `warnings`. */\nexport async function readStoryZip(input: Input, limits: ReadLimits = {}): Promise<StoryPackage> {\n const maxTotal = limits.maxTotalBytes ?? 512 * 1024 * 1024;\n const maxFiles = limits.maxFiles ?? 10_000;\n const bytes = await toBytes(input);\n\n let total = 0;\n let count = 0;\n let overLimit = false;\n const entries = await new Promise<Record<string, Uint8Array>>((resolve, reject) => {\n unzip(bytes, {\n // Runs on the central directory's declared sizes, before inflating.\n filter(file: UnzipFileInfo) {\n if (isIgnoredEntry(file.name)) return false;\n count += 1;\n total += file.originalSize;\n if (count > maxFiles || total > maxTotal) overLimit = true;\n return !overLimit;\n },\n }, (err, data) => (err ? reject(err) : resolve(data)));\n }).catch((err: unknown) => {\n throw new StoryFormatError(\"not-a-zip\", `Not a readable zip file (${err instanceof Error ? err.message : String(err)}).`);\n });\n if (overLimit) {\n throw new StoryFormatError(\"too-large\", \"This zip is too large to open as a story.\");\n }\n\n const prefix = findStoryRoot(Object.keys(entries));\n const files = new Map<string, Uint8Array>();\n for (const [name, data] of Object.entries(entries)) {\n if (name.startsWith(prefix)) files.set(name.slice(prefix.length), data);\n }\n\n let raw: unknown;\n try {\n raw = JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(files.get(STORY_JSON)!));\n } catch (err) {\n throw new StoryFormatError(\"bad-json\", `story.json is not valid JSON (${err instanceof Error ? err.message : String(err)}).`);\n }\n const doc = upgradeStory(raw);\n const result = validate(doc, files);\n if (!result.valid) {\n throw new StoryValidationError(result.errors);\n }\n return { doc, files, warnings: result.warnings };\n}\n\n/** The `invalid` StoryFormatError, carrying every issue found. */\nexport class StoryValidationError extends StoryFormatError {\n readonly issues: StoryIssue[];\n constructor(issues: StoryIssue[]) {\n super(\"invalid\", `story.json is invalid: ${issues.slice(0, 5).map((i) => `${i.path || \"/\"} ${i.message}`).join(\"; \")}${issues.length > 5 ? ` (and ${issues.length - 5} more)` : \"\"}`);\n this.issues = issues;\n }\n}\n\nfunction findStoryRoot(names: string[]): string {\n if (names.includes(STORY_JSON)) return \"\";\n const nested = names.filter((n) => /^[^/]+\\/story\\.json$/.test(n));\n if (nested.length === 1) return nested[0].slice(0, -STORY_JSON.length);\n throw new StoryFormatError(\n \"no-story-json\",\n nested.length > 1\n ? \"This zip holds more than one story.json; a story zip has exactly one.\"\n : \"This zip has no story.json, so it isn't a story.\",\n );\n}\n\n/** The Blob for one media key, typed with its declared mime -- ready for\n * URL.createObjectURL(). Undefined for an unknown key or a missing file. */\nexport function mediaBlob(pkg: StoryPackage, key: string): Blob | undefined {\n const item: MediaItem | undefined = Object.prototype.hasOwnProperty.call(pkg.doc.media, key) ? pkg.doc.media[key] : undefined;\n const data = item && pkg.files.get(item.src);\n return data ? new Blob([data as Uint8Array<ArrayBuffer>], { type: item.mime }) : undefined;\n}\n\n/** Already-compressed formats are stored rather than deflated again. */\nfunction isCompressedMime(mime: string | undefined): boolean {\n return !!mime && (/^(image|video|audio)\\//.test(mime) && mime !== \"image/svg+xml\" && mime !== \"image/bmp\");\n}\n\n/** Builds a .story.zip from a document and its media files (keyed by the\n * same paths as the media `src` values). Fills in `format`/`version` when\n * absent, validates, and throws StoryValidationError rather than writing\n * an invalid story. */\nexport async function writeStoryZip(\n doc: Omit<StoryDoc, \"format\" | \"version\"> & Partial<Pick<StoryDoc, \"format\" | \"version\">>,\n files: Map<string, Uint8Array | Blob>,\n): Promise<Uint8Array> {\n const full: StoryDoc = { format: FORMAT_ID, version: FORMAT_VERSION, ...doc } as StoryDoc;\n const result = validate(full, files);\n if (!result.valid) throw new StoryValidationError(result.errors);\n\n const mimeBySrc = new Map(Object.values(full.media).map((m) => [m.src, m.mime]));\n const entries: AsyncZippable = {\n [STORY_JSON]: [new TextEncoder().encode(JSON.stringify(full, null, 2)), { level: 6 }],\n };\n for (const [path, data] of files) {\n if (path === STORY_JSON) continue;\n const bytes = data instanceof Uint8Array ? data : new Uint8Array(await data.arrayBuffer());\n entries[path] = [bytes, { level: isCompressedMime(mimeBySrc.get(path)) ? 0 : 6 }];\n }\n return new Promise((resolve, reject) => {\n zip(entries, (err, out) => (err ? reject(err) : resolve(out)));\n });\n}\n", "// Re-encodes an image for presentation (spec/1.0/README.md section 5):\n// scaled to fit a long-edge limit and written through a canvas, which also\n// drops every bit of EXIF/GPS metadata the original carried. Browser-only\n// (createImageBitmap + OffscreenCanvas); the sizing and format decisions are\n// split out as plain functions so they can be tested anywhere.\n\nexport type ImagePurpose = \"photo\" | \"overlay\";\n\nexport interface OptimizeOptions {\n /** \"photo\" (default): slide pictures, 1600px, WebP. \"overlay\": map\n * overlays, 2048px, PNG when they have transparency. */\n purpose?: ImagePurpose;\n /** Overrides the purpose's long-edge limit. Never scales up. */\n maxEdge?: number;\n /** Lossy quality, 0-1. Default 0.82. */\n quality?: number;\n}\n\nexport interface OptimizedImage {\n blob: Blob;\n mime: \"image/webp\" | \"image/jpeg\" | \"image/png\";\n /** File extension without the dot, matching `mime`. */\n ext: \"webp\" | \"jpg\" | \"png\";\n width: number;\n height: number;\n}\n\nexport const DEFAULT_MAX_EDGE: Record<ImagePurpose, number> = { photo: 1600, overlay: 2048 };\n\n/** Scales (width, height) down to fit within maxEdge on the longer side,\n * keeping the aspect ratio; never scales up. */\nexport function fitWithin(width: number, height: number, maxEdge: number): { width: number; height: number } {\n const longEdge = Math.max(width, height);\n if (longEdge <= maxEdge) return { width, height };\n const scale = maxEdge / longEdge;\n return { width: Math.max(1, Math.round(width * scale)), height: Math.max(1, Math.round(height * scale)) };\n}\n\n/** Which encodings to try, best first. An overlay with transparency must\n * keep its alpha channel, and lossless PNG keeps hard map edges clean;\n * everything else goes lossy. JPEG is the fallback for a browser that\n * can't encode WebP (convertToBlob silently returns PNG then). */\nexport function encodingCandidates(purpose: ImagePurpose, hasAlpha: boolean): OptimizedImage[\"mime\"][] {\n if (hasAlpha) return purpose === \"overlay\" ? [\"image/png\"] : [\"image/webp\", \"image/png\"];\n return [\"image/webp\", \"image/jpeg\"];\n}\n\nconst EXT: Record<OptimizedImage[\"mime\"], OptimizedImage[\"ext\"]> = {\n \"image/webp\": \"webp\",\n \"image/jpeg\": \"jpg\",\n \"image/png\": \"png\",\n};\n\n/** Any pixel not fully opaque. Checked on the already-scaled canvas, so the\n * cost is bounded by maxEdge, not by the original's size. */\nfunction canvasHasAlpha(ctx: OffscreenCanvasRenderingContext2D, width: number, height: number): boolean {\n const data = ctx.getImageData(0, 0, width, height).data;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] < 255) return true;\n }\n return false;\n}\n\nexport async function optimizeImage(input: Blob, options: OptimizeOptions = {}): Promise<OptimizedImage> {\n const purpose = options.purpose ?? \"photo\";\n const maxEdge = options.maxEdge ?? DEFAULT_MAX_EDGE[purpose];\n const quality = options.quality ?? 0.82;\n\n // imageOrientation \"from-image\" applies the EXIF rotation before the\n // metadata is lost, so a sideways phone photo stays upright.\n const bitmap = await createImageBitmap(input, { imageOrientation: \"from-image\" });\n try {\n const { width, height } = fitWithin(bitmap.width, bitmap.height, maxEdge);\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) throw new Error(\"No 2D canvas context available.\");\n ctx.imageSmoothingQuality = \"high\";\n ctx.drawImage(bitmap, 0, 0, width, height);\n const hasAlpha = canvasHasAlpha(ctx, width, height);\n\n for (const mime of encodingCandidates(purpose, hasAlpha)) {\n const blob = await canvas.convertToBlob({ type: mime, quality });\n if (blob.type === mime) return { blob, mime, ext: EXT[mime], width, height };\n }\n // Every browser can encode PNG; it's convertToBlob's own fallback.\n const blob = await canvas.convertToBlob({ type: \"image/png\" });\n return { blob, mime: \"image/png\", ext: \"png\", width, height };\n } finally {\n bitmap.close();\n }\n}\n"],
5
5
  "mappings": ";AAKO,IAAM,YAAY;AAGlB,IAAM,iBAAiB;AAEvB,IAAM,gBAAgB;AAO7B,IAAM,YAAuF,CAAC;AAGvF,IAAM,0BAA6C,OAAO;AAAA,EAC/D,MAAM,KAAK,EAAE,QAAQ,cAAc,GAAG,CAAC,GAAG,MAAM,IAAI,CAAC,EAAE;AAAA,IACrD,CAAC,UAAU,UAAU,iBAAiB,UAAU,KAAK,MAAM;AAAA,EAC7D;AACF;AAYO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAE1C,YAAY,MAAsB,S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