{"version":3,"file":"js-yaml.mjs","names":[],"sources":["../src/tag.ts","../src/tag/scalar/str.ts","../src/tag/scalar/null_core.ts","../src/tag/scalar/null_json.ts","../src/tag/scalar/null_yaml11.ts","../src/tag/scalar/bool_core.ts","../src/tag/scalar/bool_json.ts","../src/tag/scalar/bool_yaml11.ts","../src/tag/scalar/int_core.ts","../src/tag/scalar/int_json.ts","../src/tag/scalar/int_yaml11.ts","../src/tag/scalar/float_core.ts","../src/tag/scalar/float_json.ts","../src/tag/scalar/float_yaml11.ts","../src/tag/scalar/merge.ts","../src/tag/scalar/binary.ts","../src/tag/scalar/timestamp.ts","../src/tag/sequence/seq.ts","../src/tag/sequence/omap.ts","../src/tag/sequence/pairs.ts","../src/common/object.ts","../src/tag/mapping/map.ts","../src/tag/mapping/set.ts","../src/schema.ts","../src/tag/mapping/real_map.ts","../src/tag/mapping/legacy_map.ts","../src/common/snippet.ts","../src/common/exception.ts","../src/parser/events.ts","../src/parser/parser_scalar.ts","../src/common/tagname.ts","../src/parser/constructor.ts","../src/parser/parser.ts","../src/load.ts","../src/ast/nodes.ts","../src/ast/from_js.ts","../src/ast/visit.ts","../src/ast/presenter.ts","../src/dump.ts","../src/ast/from_events.ts"],"sourcesContent":["const NOT_RESOLVED: unique symbol = Symbol('NOT_RESOLVED')\nconst MERGE_KEY: unique symbol = Symbol('MERGE_KEY')\n\ntype ScalarRepresent = (data: any) => string\ntype SequenceRepresent = (data: any) => ArrayLike<unknown>\ntype MappingRepresent = (data: any) => Map<unknown, unknown>\n\ntype IdentifyFn = (data: any) => boolean\ntype RepresentTagNameFn = (data: any) => string\n\ninterface ScalarTagDefinition<Result = unknown> {\n  tagName: string\n  nodeKind: 'scalar'\n  implicit: boolean\n  matchByTagPrefix: boolean\n  // Set of `source.charAt(0)` keys for which `resolve` may succeed (a superset of\n  // what it really matches). A key is either a single character or '' (empty\n  // source). `null` means \"no constraint, always try\". Used by the composer to\n  // dispatch implicit scalars by first character without running every resolver.\n  implicitFirstChars: readonly string[] | null\n  // `isExplicit` is true for an explicit tag (`!!tag`), false for implicit plain\n  // scalar resolution.\n  resolve: (source: string, isExplicit: boolean, tagName: string) => Result | typeof NOT_RESOLVED\n  identify: IdentifyFn | null\n  // A scalar's printed form is text, so `represent` always yields a string. The\n  // factory supplies a `String(data)` default when a tag omits it.\n  represent: ScalarRepresent\n  representTagName: RepresentTagNameFn | null\n}\n\ninterface SequenceTagDefinition<Carrier = unknown, Result = Carrier> {\n  tagName: string\n  nodeKind: 'sequence'\n  implicit: false\n  matchByTagPrefix: boolean\n  create: (tagName: string) => Carrier\n  addItem: (carrier: Carrier, item: unknown, index: number) => void | string\n  finalize: (carrier: Carrier) => Result\n  carrierIsResult: boolean\n  identify: IdentifyFn | null\n  represent: SequenceRepresent\n  representTagName: RepresentTagNameFn | null\n}\n\ninterface MappingTagDefinition<Carrier = unknown, Result = Carrier> {\n  tagName: string\n  nodeKind: 'mapping'\n  implicit: false\n  matchByTagPrefix: boolean\n  create: (tagName: string) => Carrier\n  // Writes a pair. Returns '' on success, a non-empty error message otherwise\n  // (key does not fit the representation, value rejected, ...). Always a string\n  // so the hot path never allocates an exception wrapper.\n  addPair: (carrier: Carrier, key: unknown, value: unknown) => string\n  // Read side, mirrors `Map` — defining a representation means defining how to\n  // read it back. `has` is the hot dedup probe (membership without fetching the\n  // value); `keys`/`get` are used only on the cold merge path (`<<`).\n  has: (carrier: Carrier, key: unknown) => boolean\n  keys: (result: Result) => Iterable<unknown>\n  get: (result: Result, key: unknown) => unknown\n  finalize: (carrier: Carrier) => Result\n  carrierIsResult: boolean\n  identify: IdentifyFn | null\n  represent: MappingRepresent\n  representTagName: RepresentTagNameFn | null\n}\n\ntype TagDefinition =\n  | ScalarTagDefinition<any>\n  | SequenceTagDefinition<any, any>\n  | MappingTagDefinition<any, any>\n\ninterface ScalarTagOptions<Result> {\n  implicit?: boolean\n  matchByTagPrefix?: boolean\n  implicitFirstChars?: readonly string[] | null\n  resolve: ScalarTagDefinition<Result>['resolve']\n  identify?: ScalarTagDefinition<Result>['identify']\n  represent?: ScalarTagDefinition<Result>['represent']\n  representTagName?: ScalarTagDefinition<Result>['representTagName']\n}\n\ntype RepresentOptions<Container, Canonical, Represent> =\n  | {\n      identify?: null\n      represent?: Represent\n      representTagName?: RepresentTagNameFn | null\n    }\n  | (Container extends Canonical\n      ? {\n          identify?: IdentifyFn | null\n          represent?: Represent\n          representTagName?: RepresentTagNameFn | null\n        }\n      : {\n          identify: IdentifyFn\n          represent: Represent\n          representTagName?: RepresentTagNameFn | null\n        })\n\ntype SequenceTagOptions<Carrier, Result = Carrier> = {\n  matchByTagPrefix?: boolean\n  create: SequenceTagDefinition<Carrier, Result>['create']\n  addItem: SequenceTagDefinition<Carrier, Result>['addItem']\n  finalize?: SequenceTagDefinition<Carrier, Result>['finalize']\n} & RepresentOptions<Result, ArrayLike<unknown>, SequenceRepresent>\n\ntype MappingTagOptions<Carrier, Result = Carrier> = {\n  matchByTagPrefix?: boolean\n  create: MappingTagDefinition<Carrier, Result>['create']\n  addPair: MappingTagDefinition<Carrier, Result>['addPair']\n  has: MappingTagDefinition<Carrier, Result>['has']\n  keys: MappingTagDefinition<Carrier, Result>['keys']\n  get: MappingTagDefinition<Carrier, Result>['get']\n  finalize?: MappingTagDefinition<Carrier, Result>['finalize']\n} & RepresentOptions<Result, Map<unknown, unknown>, MappingRepresent>\n\nfunction defineScalarTag<Result> (tagName: string, options: ScalarTagOptions<Result>): ScalarTagDefinition<Result> {\n  return {\n    tagName,\n    nodeKind: 'scalar',\n    implicit: options.implicit ?? false,\n    matchByTagPrefix: options.matchByTagPrefix ?? false,\n    implicitFirstChars: options.implicitFirstChars ?? null,\n    resolve: options.resolve,\n    identify: options.identify ?? null,\n    represent: options.represent ?? (data => String(data)),\n    representTagName: options.representTagName ?? null\n  }\n}\n\nfunction defineSequenceTag<Carrier, Result = Carrier> (tagName: string, options: SequenceTagOptions<Carrier, Result>): SequenceTagDefinition<Carrier, Result> {\n  const carrierIsResult = options.finalize === undefined\n\n  return {\n    tagName,\n    nodeKind: 'sequence',\n    implicit: false,\n    matchByTagPrefix: options.matchByTagPrefix ?? false,\n    create: options.create,\n    addItem: options.addItem,\n    finalize: options.finalize ?? (carrier => carrier as unknown as Result),\n    carrierIsResult,\n    identify: options.identify ?? null,\n    represent: options.represent ?? (data => data as ArrayLike<unknown>),\n    representTagName: options.representTagName ?? null\n  }\n}\n\nfunction defineMappingTag<Carrier, Result = Carrier> (tagName: string, options: MappingTagOptions<Carrier, Result>): MappingTagDefinition<Carrier, Result> {\n  const carrierIsResult = options.finalize === undefined\n\n  return {\n    tagName,\n    nodeKind: 'mapping',\n    implicit: false,\n    matchByTagPrefix: options.matchByTagPrefix ?? false,\n    create: options.create,\n    addPair: options.addPair,\n    has: options.has,\n    keys: options.keys,\n    get: options.get,\n    finalize: options.finalize ?? (carrier => carrier as unknown as Result),\n    carrierIsResult,\n    identify: options.identify ?? null,\n    represent: options.represent ?? (data => data as Map<unknown, unknown>),\n    representTagName: options.representTagName ?? null\n  }\n}\n\nexport {\n  NOT_RESOLVED,\n  MERGE_KEY,\n  defineScalarTag,\n  defineSequenceTag,\n  defineMappingTag,\n\n  type ScalarTagDefinition,\n  type SequenceTagDefinition,\n  type MappingTagDefinition,\n  type TagDefinition,\n  type ScalarTagOptions,\n  type SequenceTagOptions,\n  type MappingTagOptions,\n  type ScalarRepresent,\n  type SequenceRepresent,\n  type MappingRepresent\n}\n","import { defineScalarTag } from '../../tag.ts'\n\nconst strTag = defineScalarTag('tag:yaml.org,2002:str', {\n  resolve: (source) => source,\n  identify: (data) => typeof data === 'string'\n})\n\nexport { strTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst NULL_VALUES = ['', '~', 'null', 'Null', 'NULL']\n\nconst nullCoreTag = defineScalarTag('tag:yaml.org,2002:null', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: '' (empty), '~', 'null'/'Null'/'NULL'.\n  implicitFirstChars: ['', '~', 'n', 'N'],\n  resolve: (source) => {\n    if (NULL_VALUES.indexOf(source) !== -1) return null\n\n    return NOT_RESOLVED\n  },\n  identify: (object) => object === null,\n  represent: () => 'null'\n})\n\nexport { nullCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst nullJsonTag = defineScalarTag('tag:yaml.org,2002:null', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: null.\n  implicitFirstChars: ['n'],\n  resolve: (source, isExplicit) => {\n    if (source === 'null' || (isExplicit && source === '')) return null\n\n    return NOT_RESOLVED\n  },\n  identify: (object) => object === null,\n  represent: () => 'null'\n})\n\nexport { nullJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst NULL_VALUES = ['', '~', 'null', 'Null', 'NULL']\n\nconst nullYaml11Tag = defineScalarTag('tag:yaml.org,2002:null', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: '' (empty), '~', 'null'/'Null'/'NULL'.\n  implicitFirstChars: ['', '~', 'n', 'N'],\n  resolve: (source) => {\n    if (NULL_VALUES.indexOf(source) !== -1) return null\n\n    return NOT_RESOLVED\n  },\n  identify: (object) => object === null,\n  represent: () => 'null'\n})\n\nexport { nullYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true', 'True', 'TRUE']\nconst FALSE_VALUES = ['false', 'False', 'FALSE']\n\nconst boolCoreTag = defineScalarTag('tag:yaml.org,2002:bool', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: true/True/TRUE, false/False/FALSE.\n  implicitFirstChars: ['t', 'T', 'f', 'F'],\n  resolve: (source) => {\n    if (TRUE_VALUES.indexOf(source) !== -1) return true\n    if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n    return NOT_RESOLVED\n  },\n  identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n  represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true']\nconst FALSE_VALUES = ['false']\n\nconst boolJsonTag = defineScalarTag('tag:yaml.org,2002:bool', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: true, false.\n  implicitFirstChars: ['t', 'f'],\n  resolve: (source) => {\n    if (TRUE_VALUES.indexOf(source) !== -1) return true\n    if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n    return NOT_RESOLVED\n  },\n  identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n  represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst TRUE_VALUES = ['true', 'True', 'TRUE', 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON']\nconst FALSE_VALUES = ['false', 'False', 'FALSE', 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF']\n\nconst boolYaml11Tag = defineScalarTag('tag:yaml.org,2002:bool', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs.\n  implicitFirstChars: ['y', 'Y', 'n', 'N', 't', 'T', 'f', 'F', 'o', 'O'],\n  resolve: (source) => {\n    if (TRUE_VALUES.indexOf(source) !== -1) return true\n    if (FALSE_VALUES.indexOf(source) !== -1) return false\n\n    return NOT_RESOLVED\n  },\n  identify: (object) => Object.prototype.toString.call(object) === '[object Boolean]',\n  represent: (object) => object ? 'true' : 'false'\n})\n\nexport { boolYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 Core schema implicit resolution:\n// [-+]? [0-9]+ | 0o [0-7]+ | 0x [0-9a-fA-F]+\nconst YAML_INTEGER_IMPLICIT_PATTERN = new RegExp(\n  // 0o123\n  '^(?:0o[0-7]+' +\n  // 0x1A\n  '|0x[0-9a-fA-F]+' +\n  // 12345\n  '|[-+]?[0-9]+)$')\n\n// Explicit `!!int` validation is separate from Core implicit resolution.\nconst YAML_INTEGER_EXPLICIT_PATTERN = new RegExp(\n  // 0b1010\n  '^(?:[-+]?0b[0-1]+' +\n  // 0o123\n  '|[-+]?0o[0-7]+' +\n  // 0x1A\n  '|[-+]?0x[0-9a-fA-F]+' +\n  // 12345\n  '|[-+]?[0-9]+)$')\n\nfunction parseYamlInteger (source: string) {\n  let value = source\n  let sign = 1\n\n  if (value[0] === '-' || value[0] === '+') {\n    if (value[0] === '-') sign = -1\n    value = value.slice(1)\n  }\n\n  if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n  if (value.startsWith('0o')) return sign * parseInt(value.slice(2), 8)\n  if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n  return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string, isExplicit: boolean) {\n  if (isExplicit) {\n    if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n  } else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) {\n    return NOT_RESOLVED\n  }\n\n  const result = parseYamlInteger(source)\n  return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\nconst intCoreTag = defineScalarTag('tag:yaml.org,2002:int', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: optional sign + decimal digit.\n  implicitFirstChars: ['-', '+', ...'0123456789'],\n  resolve: resolveYamlInteger,\n  identify: (object) =>\n    // No ancient boxed numbers support\n    Number.isInteger(object) &&\n    // Negative zero => !!float\n    !Object.is(object, -0) &&\n    // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n    object.toString(10).indexOf('e') < 0,\n  represent: (object: number) => object.toString(10)\n})\n\nexport { intCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 JSON schema implicit resolution:\n// -? ( 0 | [1-9] [0-9]* )\nconst YAML_INTEGER_IMPLICIT_PATTERN = new RegExp(\n  '^-?(?:0|[1-9][0-9]*)$')\n\n// Explicit `!!int` validation is separate from JSON implicit resolution.\nconst YAML_INTEGER_EXPLICIT_PATTERN = new RegExp(\n  // 0b1010\n  '^(?:[-+]?0b[0-1]+' +\n  // 0o123\n  '|[-+]?0o[0-7]+' +\n  // 0x1A\n  '|[-+]?0x[0-9a-fA-F]+' +\n  // 12345\n  '|[-+]?[0-9]+)$')\n\nfunction parseYamlInteger (source: string) {\n  let value = source\n  let sign = 1\n\n  if (value[0] === '-' || value[0] === '+') {\n    if (value[0] === '-') sign = -1\n    value = value.slice(1)\n  }\n\n  if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n  if (value.startsWith('0o')) return sign * parseInt(value.slice(2), 8)\n  if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n  return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string, isExplicit: boolean) {\n  if (isExplicit) {\n    if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n  } else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) {\n    return NOT_RESOLVED\n  }\n\n  const result = parseYamlInteger(source)\n  return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\nconst intJsonTag = defineScalarTag('tag:yaml.org,2002:int', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: optional '-' or digit.\n  implicitFirstChars: ['-', ...'0123456789'],\n  resolve: resolveYamlInteger,\n  identify: (object) =>\n    // No ancient boxed numbers support\n    Number.isInteger(object) &&\n    // Negative zero => !!float\n    !Object.is(object, -0) &&\n    // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n    object.toString(10).indexOf('e') < 0,\n  represent: (object: number) => object.toString(10)\n})\n\nexport { intJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_INTEGER_PATTERN = new RegExp(\n  // 0b1010\n  '^(?:[-+]?0b[0-1_]+' +\n  // 0123\n  '|[-+]?0[0-7_]+' +\n  // 0x1A\n  '|[-+]?0x[0-9a-fA-F_]+' +\n  // 1:23\n  '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+' +\n  // 12345\n  '|[-+]?(?:0|[1-9][0-9_]*))$')\n\nfunction parseYamlInteger (source: string) {\n  let value = source.replace(/_/g, '')\n  let sign = 1\n\n  if (value[0] === '-' || value[0] === '+') {\n    if (value[0] === '-') sign = -1\n    value = value.slice(1)\n  }\n\n  if (value.startsWith('0b')) return sign * parseInt(value.slice(2), 2)\n  if (value.startsWith('0x')) return sign * parseInt(value.slice(2), 16)\n\n  if (value.includes(':')) {\n    let result = 0\n    for (const part of value.split(':')) result = result * 60 + Number(part)\n    return sign * result\n  }\n\n  if (value !== '0' && value[0] === '0') return sign * parseInt(value, 8)\n\n  return sign * parseInt(value, 10)\n}\n\nfunction resolveYamlInteger (source: string) {\n  if (!YAML_INTEGER_PATTERN.test(source)) return NOT_RESOLVED\n\n  const result = parseYamlInteger(source)\n  return Number.isFinite(result) ? result : NOT_RESOLVED\n}\n\nconst intYaml11Tag = defineScalarTag('tag:yaml.org,2002:int', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: optional sign + decimal digit.\n  implicitFirstChars: ['-', '+', ...'0123456789'],\n  resolve: resolveYamlInteger,\n  identify: (object) =>\n    // No ancient boxed numbers support\n    Number.isInteger(object) &&\n    // Negative zero => !!float\n    !Object.is(object, -0) &&\n    // Exponential form => !!float, round-trip for !!int 1e21 will be broken\n    object.toString(10).indexOf('e') < 0,\n  represent: (object: number) => object.toString(10)\n})\n\nexport { intYaml11Tag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n  // 2.5e4, 2.5 and integers\n  '^(?:[-+]?[0-9]+(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n  // .2e4, .2\n  '|[-+]?\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n  // .inf\n  '|[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n  '^(?:' +\n  // .inf\n  '[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string) {\n  if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED\n\n  let value = source.toLowerCase()\n  const sign = value[0] === '-' ? -1 : 1\n\n  if ('+-'.includes(value[0])) value = value.slice(1)\n\n  if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n  if (value === '.nan') return NaN\n\n  const result = sign * parseFloat(value)\n\n  if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result\n  return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n  if (isNaN(object)) return '.nan'\n  if (object === Number.POSITIVE_INFINITY) return '.inf'\n  if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n  if (Object.is(object, -0)) return '-0.0'\n\n  const result = object.toString(10)\n  return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\nconst floatCoreTag = defineScalarTag('tag:yaml.org,2002:float', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: optional sign, '.', or digit\n  // ('.inf'/'.nan' start with '.').\n  implicitFirstChars: ['-', '+', '.', ...'0123456789'],\n  resolve: resolveYamlFloat,\n  identify: (object) =>\n    // No ancient boxed numbers support\n    typeof object === 'number' &&\n    (\n      // We land here all numbers, not handled (declined) by !!int `.identify`\n      // The same condition as for !!int, but reversed.\n\n      // Filter out integers...\n      !Number.isInteger(object) ||\n      // but allow negative zero\n      Object.is(object, -0) ||\n      // and integers with exponential form\n      object.toString(10).indexOf('e') >= 0\n    ),\n  represent: representYamlFloat\n})\n\nexport { floatCoreTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\n// YAML 1.2 JSON schema implicit resolution:\n// -? ( 0 | [1-9] [0-9]* ) ( \\. [0-9]* )? ( [eE] [-+]? [0-9]+ )?\nconst YAML_FLOAT_IMPLICIT_PATTERN = new RegExp(\n  // 2.5e4, 2.5 and integers\n  '^-?(?:0|[1-9][0-9]*)(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$')\n\n// Explicit `!!float` validation is separate from JSON implicit resolution.\nconst YAML_FLOAT_EXPLICIT_PATTERN = new RegExp(\n  // 2.5e4, 2.5 and integers\n  '^(?:[-+]?[0-9]+(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n  // .2e4, .2\n  '|[-+]?\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n  // .inf\n  '|[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string, isExplicit: boolean) {\n  if (isExplicit) {\n    if (!YAML_FLOAT_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n\n    let value = source.toLowerCase()\n    const sign = value[0] === '-' ? -1 : 1\n\n    if ('+-'.includes(value[0])) value = value.slice(1)\n\n    if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n    if (value === '.nan') return NaN\n\n    const result = sign * parseFloat(value)\n    return Number.isFinite(result) ? result : NOT_RESOLVED\n  }\n\n  if (!YAML_FLOAT_IMPLICIT_PATTERN.test(source)) return NOT_RESOLVED\n\n  const result = Number(source)\n\n  if (Number.isFinite(result)) return result\n  return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n  if (isNaN(object)) return '.nan'\n  if (object === Number.POSITIVE_INFINITY) return '.inf'\n  if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n  if (Object.is(object, -0)) return '-0.0'\n\n  const result = object.toString(10)\n  return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\nconst floatJsonTag = defineScalarTag('tag:yaml.org,2002:float', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: optional '-' or digit.\n  implicitFirstChars: ['-', ...'0123456789'],\n  resolve: resolveYamlFloat,\n  identify: (object) =>\n    // No ancient boxed numbers support\n    typeof object === 'number' &&\n    (\n      // We land here all numbers, not handled (declined) by !!int `.identify`\n      // The same condition as for !!int, but reversed.\n\n      // Filter out integers...\n      !Number.isInteger(object) ||\n      // but allow negative zero\n      Object.is(object, -0) ||\n      // and integers with exponential form\n      object.toString(10).indexOf('e') >= 0\n    ),\n  represent: representYamlFloat\n})\n\nexport { floatJsonTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n  // 2.5e4, 2.5 and integers\n  '^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\\\.[0-9_]*)(?:[eE][-+][0-9]+)?' +\n  // 190:20:30.15\n  '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*' +\n  // .inf\n  '|[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n  '^(?:' +\n  // .inf\n  '[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (source: string) {\n  if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED\n\n  let value = source.toLowerCase().replace(/_/g, '')\n  const sign = value[0] === '-' ? -1 : 1\n\n  if ('+-'.includes(value[0])) value = value.slice(1)\n\n  if (value === '.inf') return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n  if (value === '.nan') return NaN\n\n  let result = 0\n\n  if (value.includes(':')) {\n    for (const part of value.split(':')) result = result * 60 + Number(part)\n    result *= sign\n  } else {\n    result = sign * parseFloat(value)\n  }\n\n  if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result\n  return NOT_RESOLVED\n}\n\nfunction representYamlFloat (object: number) {\n  if (isNaN(object)) return '.nan'\n  if (object === Number.POSITIVE_INFINITY) return '.inf'\n  if (object === Number.NEGATIVE_INFINITY) return '-.inf'\n  if (Object.is(object, -0)) return '-0.0'\n\n  const result = object.toString(10)\n  return /^[-+]?[0-9]+e/.test(result) ? result.replace('e', '.e') : result\n}\n\nconst floatYaml11Tag = defineScalarTag('tag:yaml.org,2002:float', {\n  implicit: true,\n  // Superset of source.charAt(0) over all matched inputs: optional sign, '.', or digit\n  // ('.inf'/'.nan' start with '.').\n  implicitFirstChars: ['-', '+', '.', ...'0123456789'],\n  resolve: resolveYamlFloat,\n  identify: (object) =>\n    // No ancient boxed numbers support\n    typeof object === 'number' &&\n    (\n      // We land here all numbers, not handled (declined) by !!int `.identify`\n      // The same condition as for !!int, but reversed.\n\n      // Filter out integers...\n      !Number.isInteger(object) ||\n      // but allow negative zero\n      Object.is(object, -0) ||\n      // and integers with exponential form\n      object.toString(10).indexOf('e') >= 0\n    ),\n  represent: representYamlFloat\n})\n\nexport { floatYaml11Tag }\n","import { defineScalarTag, MERGE_KEY, NOT_RESOLVED } from '../../tag.ts'\n\nconst mergeTag = defineScalarTag('tag:yaml.org,2002:merge', {\n  implicit: true,\n  // source.charAt(0) over matched implicit inputs: '<' ('<<').\n  implicitFirstChars: ['<'],\n  resolve: (source, isExplicit) => {\n    if (source === '<<' || (isExplicit && source === '')) return MERGE_KEY\n    return NOT_RESOLVED\n  }\n})\n\nexport { mergeTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst BASE64_PATTERN = /^[A-Za-z0-9+/]*={0,2}$/\n\nfunction resolveYamlBinary (source: string) {\n  // Strip allowed whitespace first, so validation stays a plain base64 check.\n  const input = source.replace(/\\s/g, '')\n  if (input.length % 4 !== 0 || !BASE64_PATTERN.test(input)) return NOT_RESOLVED\n\n  const binary = atob(input)\n  const result = new Uint8Array(binary.length)\n  for (let index = 0; index < binary.length; index++) {\n    result[index] = binary.charCodeAt(index)\n  }\n  return result\n}\n\nfunction representYamlBinary (object: Uint8Array) {\n  let binary = ''\n  for (let index = 0; index < object.length; index++) {\n    binary += String.fromCharCode(object[index])\n  }\n  return btoa(binary)\n}\n\nconst binaryTag = defineScalarTag('tag:yaml.org,2002:binary', {\n  resolve: resolveYamlBinary,\n  identify: (object) => Object.prototype.toString.call(object) === '[object Uint8Array]',\n  represent: representYamlBinary\n})\n\nexport { binaryTag }\n","import { defineScalarTag, NOT_RESOLVED } from '../../tag.ts'\n\nconst YAML_DATE_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$')\n\nconst YAML_TIMESTAMP_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])' +\n  '-([0-9][0-9]?)' +\n  '-([0-9][0-9]?)' +\n  '(?:[Tt]|[ \\\\t]+)' +\n  '([0-9][0-9]?)' +\n  ':([0-9][0-9])' +\n  ':([0-9][0-9])' +\n  '(?:\\\\.([0-9]*))?' +\n  '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' +\n  '(?::([0-9][0-9]))?))?$')\n\nfunction resolveYamlTimestamp (source: string) {\n  let match = YAML_DATE_REGEXP.exec(source)\n  if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(source)\n  if (match === null) return NOT_RESOLVED\n\n  const year = +(match[1])\n  const month = +(match[2]) - 1\n  const day = +(match[3])\n\n  // Date-only form (`YYYY-MM-DD`) has no time captures.\n  if (!match[4]) {\n    const date = new Date(Date.UTC(year, month, day))\n    // Reject dates that JS would normalize, e.g. 2023-02-29 -> 2023-03-01.\n    if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) {\n      return NOT_RESOLVED\n    }\n    return date\n  }\n\n  const hour = +(match[4])\n  const minute = +(match[5])\n  const second = +(match[6])\n  let fraction = 0\n\n  // Reject times that JS would normalize into the next minute/hour/day.\n  if (hour > 23 || minute > 59 || second > 59) return NOT_RESOLVED\n\n  if (match[7]) {\n    let value = match[7].slice(0, 3)\n    while (value.length < 3) value += '0'\n    fraction = +value\n  }\n\n  const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))\n\n  // Reject invalid calendar dates before applying timezone offset.\n  if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) {\n    return NOT_RESOLVED\n  }\n\n  if (match[9]) {\n    const offsetHour = +(match[10])\n    const offsetMinute = +(match[11] || 0)\n    // Reject timezone offsets that JS date arithmetic would otherwise accept.\n    if (offsetHour > 23 || offsetMinute > 59) return NOT_RESOLVED\n\n    const offset = (offsetHour * 60 + offsetMinute) * 60000\n    date.setTime(date.getTime() - (match[9] === '-' ? -offset : offset))\n  }\n\n  return date\n}\n\nconst timestampTag = defineScalarTag('tag:yaml.org,2002:timestamp', {\n  implicit: true,\n  // Both patterns start with a 4-digit year, so source.charAt(0) is always a digit.\n  implicitFirstChars: [...'0123456789'],\n  resolve: resolveYamlTimestamp,\n  identify: (object) => object instanceof Date,\n  represent: (object: Date) => object.toISOString()\n})\n\nexport { timestampTag }\n","import { defineSequenceTag } from '../../tag.ts'\n\nconst seqTag = defineSequenceTag('tag:yaml.org,2002:seq', {\n  create: () => [] as unknown[],\n  addItem: (container, item) => {\n    container.push(item)\n  },\n  identify: Array.isArray\n})\n\nexport { seqTag }\n","import { defineSequenceTag } from '../../tag.ts'\n\ntype OmapItem = Record<string, unknown>\n\nconst omapTag = defineSequenceTag('tag:yaml.org,2002:omap', {\n  create: () => [] as OmapItem[],\n  addItem: (container, item) => {\n    if (Object.prototype.toString.call(item) !== '[object Object]') {\n      return 'cannot resolve an ordered map item'\n    }\n\n    const object = item as OmapItem\n    const itemKeys = Object.keys(object)\n\n    if (itemKeys.length !== 1) return 'cannot resolve an ordered map item'\n    for (const existing of container) {\n      if (Object.prototype.hasOwnProperty.call(existing, itemKeys[0])) {\n        return 'cannot resolve an ordered map item'\n      }\n    }\n\n    container.push(object)\n    return ''\n  }\n})\n\nexport { omapTag }\n","import { defineSequenceTag } from '../../tag.ts'\n\ntype Pair = [unknown, unknown]\n\nconst pairsTag = defineSequenceTag('tag:yaml.org,2002:pairs', {\n  create: () => [] as Pair[],\n  addItem: (container, item) => {\n    if (item instanceof Map) {\n      if (item.size !== 1) return 'cannot resolve a pairs item'\n\n      container.push(item.entries().next().value!)\n      return ''\n    }\n\n    if (Object.prototype.toString.call(item) !== '[object Object]') {\n      return 'cannot resolve a pairs item'\n    }\n\n    const object = item as Record<string, unknown>\n    const keys = Object.keys(object)\n\n    if (keys.length !== 1) return 'cannot resolve a pairs item'\n\n    container.push([keys[0], object[keys[0]]] satisfies Pair)\n    return ''\n  }\n})\n\nexport { pairsTag }\n","function isPlainObject (data: unknown): boolean {\n  if (data === null || typeof data !== 'object' || Array.isArray(data)) return false\n  const prototype = Object.getPrototypeOf(data)\n  return prototype === null || prototype === Object.prototype\n}\n\n// Project `object` onto `keys`. Absent keys are skipped (so the result can be\n// safely spread over defaults without clobbering them with `undefined`), hence\n// the `Partial` return.\nfunction pick<T extends object, K extends keyof T> (object: T, keys: readonly K[]): Partial<Pick<T, K>> {\n  const result: Partial<Pick<T, K>> = {}\n  for (const key of keys) {\n    if (object[key] !== undefined) result[key] = object[key]\n  }\n  return result\n}\n\nexport {\n  isPlainObject,\n  pick\n}\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\ntype StringMapping = Record<string, unknown>\n\nconst mapTag = defineMappingTag('tag:yaml.org,2002:map', {\n  create: (): StringMapping => ({}),\n  identify: isPlainObject,\n  // Dump side: wrap the plain object into the canonical `Map` form the writer\n  // walks. Shallow — keys/values stay references to the originals.\n  represent: (o: StringMapping) => {\n    const map = new Map<string, unknown>()\n    for (const key of Object.keys(o)) map.set(key, o[key])\n    return map\n  },\n  addPair: (container, key, value) => {\n    if (key !== null && typeof key === 'object') {\n      return 'object-based map does not support complex keys'\n    }\n    const normalizedKey = String(key)\n    if (normalizedKey === '__proto__') {\n      // Define as an own data property so a literal `__proto__` key stays data\n      // and never invokes the prototype setter.\n      Object.defineProperty(container, normalizedKey, {\n        value, enumerable: true, configurable: true, writable: true\n      })\n    } else {\n      container[normalizedKey] = value\n    }\n    return ''\n  },\n  // hasOwn, not `in`: a plain object inherits `toString` and friends.\n  has: (container, key) => {\n    if (key !== null && typeof key === 'object') return false\n    return Object.prototype.hasOwnProperty.call(container, String(key))\n  },\n  keys: (container) => Object.keys(container),\n  get: (container, key) => container[String(key)]\n})\n\nexport { mapTag, isPlainObject, type StringMapping }\n","import { defineMappingTag } from '../../tag.ts'\n\nconst setTag = defineMappingTag('tag:yaml.org,2002:set', {\n  create: () => new Set<unknown>(),\n  identify: (data) => data instanceof Set,\n  represent: (data: Set<unknown>) => {\n    const map = new Map<unknown, null>()\n    for (const key of data) map.set(key, null)\n    return map\n  },\n  addPair: (container, key, value) => {\n    if (value !== null) return 'cannot resolve a set item'\n    container.add(key)\n    return ''\n  },\n  has: (container, key) => container.has(key),\n  keys: (container) => container.keys(),\n  get: () => null\n})\n\nexport { setTag }\n","import {\n  type MappingTagDefinition,\n  type ScalarTagDefinition,\n  type SequenceTagDefinition,\n  type TagDefinition\n} from './tag.ts'\nimport { strTag } from './tag/scalar/str.ts'\nimport { nullCoreTag } from './tag/scalar/null_core.ts'\nimport { nullJsonTag } from './tag/scalar/null_json.ts'\nimport { nullYaml11Tag } from './tag/scalar/null_yaml11.ts'\nimport { boolCoreTag } from './tag/scalar/bool_core.ts'\nimport { boolJsonTag } from './tag/scalar/bool_json.ts'\nimport { boolYaml11Tag } from './tag/scalar/bool_yaml11.ts'\nimport { intCoreTag } from './tag/scalar/int_core.ts'\nimport { intJsonTag } from './tag/scalar/int_json.ts'\nimport { intYaml11Tag } from './tag/scalar/int_yaml11.ts'\nimport { floatCoreTag } from './tag/scalar/float_core.ts'\nimport { floatJsonTag } from './tag/scalar/float_json.ts'\nimport { floatYaml11Tag } from './tag/scalar/float_yaml11.ts'\nimport { mergeTag } from './tag/scalar/merge.ts'\nimport { binaryTag } from './tag/scalar/binary.ts'\nimport { timestampTag } from './tag/scalar/timestamp.ts'\nimport { seqTag } from './tag/sequence/seq.ts'\nimport { omapTag } from './tag/sequence/omap.ts'\nimport { pairsTag } from './tag/sequence/pairs.ts'\nimport { mapTag } from './tag/mapping/map.ts'\nimport { setTag } from './tag/mapping/set.ts'\n\ninterface TagDefinitionMap {\n  scalar: Record<string, ScalarTagDefinition>\n  sequence: Record<string, SequenceTagDefinition>\n  mapping: Record<string, MappingTagDefinition>\n}\n\ninterface TagDefinitionListMap {\n  scalar: ScalarTagDefinition[]\n  sequence: SequenceTagDefinition[]\n  mapping: MappingTagDefinition[]\n}\n\nfunction createTagDefinitionMap (): TagDefinitionMap {\n  return {\n    scalar: {},\n    sequence: {},\n    mapping: {}\n  }\n}\n\nfunction createTagDefinitionListMap (): TagDefinitionListMap {\n  return {\n    scalar: [],\n    sequence: [],\n    mapping: []\n  }\n}\n\nfunction compileTags (tags: readonly TagDefinition[]) {\n  const result: TagDefinition[] = []\n\n  for (const tag of tags) {\n    let index = result.length\n\n    for (let previousIndex = 0; previousIndex < result.length; previousIndex++) {\n      const previous = result[previousIndex]\n\n      if (previous.nodeKind === tag.nodeKind &&\n          previous.tagName === tag.tagName &&\n          previous.matchByTagPrefix === tag.matchByTagPrefix) {\n        index = previousIndex\n        break\n      }\n    }\n\n    result[index] = tag\n  }\n\n  return result\n}\n\nclass Schema {\n  readonly tags: readonly TagDefinition[]\n  readonly implicitScalarTags: readonly ScalarTagDefinition[]\n  // Dispatch implicit scalar resolvers by `source.charAt(0)`. Each bucket holds the\n  // resolvers that may match that key, in schema order; a key absent from the map\n  // uses `implicitScalarAnyFirstChar` (resolvers that declared no first-char\n  // constraint, so they apply to any first character).\n  readonly implicitScalarByFirstChar: ReadonlyMap<string, readonly ScalarTagDefinition[]>\n  readonly implicitScalarAnyFirstChar: readonly ScalarTagDefinition[]\n  // The default scalar tag (`!!str`), resolved once so the composer's fallback for\n  // unresolved plain scalars avoids a keyed lookup per scalar.\n  readonly defaultScalarTag: ScalarTagDefinition\n  // The default container tags (`!!seq` / `!!map`), used by the dumper: when a\n  // value is identified by its default tag, the tag is implicit and not printed.\n  // Undefined if the schema does not define them (then such values can't be dumped).\n  readonly defaultSequenceTag: SequenceTagDefinition | undefined\n  readonly defaultMappingTag: MappingTagDefinition | undefined\n  readonly exact: TagDefinitionMap\n  readonly prefix: TagDefinitionListMap\n\n  constructor (tags: readonly TagDefinition[]) {\n    const compiledTags = compileTags(tags)\n    const implicitScalarTags: ScalarTagDefinition[] = []\n    const exact = createTagDefinitionMap()\n    const prefix = createTagDefinitionListMap()\n\n    for (const tag of compiledTags) {\n      if (tag.nodeKind === 'scalar' && tag.implicit) {\n        if (tag.matchByTagPrefix) {\n          throw new Error('Implicit scalar tags cannot match by tag prefix')\n        }\n\n        implicitScalarTags.push(tag)\n      }\n\n      switch (tag.nodeKind) {\n        case 'scalar':\n          if (tag.matchByTagPrefix) prefix.scalar.push(tag)\n          else exact.scalar[tag.tagName] = tag\n          break\n        case 'sequence':\n          if (tag.matchByTagPrefix) prefix.sequence.push(tag)\n          else exact.sequence[tag.tagName] = tag\n          break\n        case 'mapping':\n          if (tag.matchByTagPrefix) prefix.mapping.push(tag)\n          else exact.mapping[tag.tagName] = tag\n          break\n      }\n    }\n\n    const implicitScalarAnyFirstChar = implicitScalarTags.filter(tag => tag.implicitFirstChars === null)\n\n    const keys = new Set<string>()\n    for (const tag of implicitScalarTags) {\n      if (tag.implicitFirstChars !== null) {\n        for (const key of tag.implicitFirstChars) keys.add(key)\n      }\n    }\n\n    const implicitScalarByFirstChar = new Map<string, ScalarTagDefinition[]>()\n    for (const key of keys) {\n      implicitScalarByFirstChar.set(key, implicitScalarTags.filter(tag =>\n        tag.implicitFirstChars === null || tag.implicitFirstChars.indexOf(key) !== -1))\n    }\n\n    const defaultScalarTag = exact.scalar['tag:yaml.org,2002:str']\n    if (!defaultScalarTag) throw new Error('schema does not define the default scalar tag (tag:yaml.org,2002:str)')\n\n    this.tags = compiledTags\n    this.implicitScalarTags = implicitScalarTags\n    this.implicitScalarByFirstChar = implicitScalarByFirstChar\n    this.implicitScalarAnyFirstChar = implicitScalarAnyFirstChar\n    this.defaultScalarTag = defaultScalarTag\n    this.defaultSequenceTag = exact.sequence['tag:yaml.org,2002:seq']\n    this.defaultMappingTag = exact.mapping['tag:yaml.org,2002:map']\n    this.exact = exact\n    this.prefix = prefix\n  }\n\n  withTags (...tags: Array<TagDefinition | readonly TagDefinition[]>): Schema {\n    let flatTags: TagDefinition[] = []\n    for (const tag of tags) flatTags = flatTags.concat(tag)\n\n    return new Schema([...this.tags, ...flatTags])\n  }\n}\n\nconst FAILSAFE_SCHEMA = new Schema([\n  strTag,\n  seqTag,\n  mapTag\n])\n\nconst JSON_SCHEMA = new Schema([\n  ...FAILSAFE_SCHEMA.tags,\n  nullJsonTag,\n  boolJsonTag,\n  intJsonTag,\n  floatJsonTag\n])\n\nconst CORE_SCHEMA = new Schema([\n  ...FAILSAFE_SCHEMA.tags,\n  nullCoreTag,\n  boolCoreTag,\n  intCoreTag,\n  floatCoreTag\n])\n\nconst YAML11_SCHEMA = new Schema([\n  ...FAILSAFE_SCHEMA.tags,\n  nullYaml11Tag,\n  boolYaml11Tag,\n  intYaml11Tag,\n  floatYaml11Tag,\n  timestampTag,\n  mergeTag,\n  binaryTag,\n  omapTag,\n  pairsTag,\n  setTag\n])\n\nexport {\n  Schema,\n  FAILSAFE_SCHEMA,\n  JSON_SCHEMA,\n  CORE_SCHEMA,\n  YAML11_SCHEMA,\n\n  type TagDefinitionMap,\n  type TagDefinitionListMap\n}\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\ntype RealMapping = Map<unknown, unknown>\n\n// A mapping represented as a real `Map`: keys keep their constructed type,\n// nothing is stringified. Drop-in replacement for the default `!!map` tag\n// (same tag name) — `CORE_SCHEMA.withTags(realMapTag)`.\nconst realMapTag = defineMappingTag('tag:yaml.org,2002:map', {\n  create: () => new Map<unknown, unknown>(),\n  addPair: (container: RealMapping, key, value) => {\n    container.set(key, value)\n    return ''\n  },\n  has: (container: RealMapping, key) => container.has(key),\n  keys: (container: RealMapping) => container.keys(),\n  get: (container: RealMapping, key) => container.get(key),\n  // Dump side: handle both a real `Map` and a plain object, so this tag fully\n  // replaces the default map representation when dumping too.\n  identify: (data) => data instanceof Map || isPlainObject(data),\n  // Dump side: the canonical mapping form is a `Map`. A real `Map` passes\n  // through untouched (keys keep their type); a plain object is wrapped\n  // shallowly. Lossless — nothing is stringified.\n  represent: (data) => {\n    if (data instanceof Map) return data\n    const map = new Map<unknown, unknown>()\n    const obj = data as Record<string, unknown>\n    for (const key of Object.keys(obj)) map.set(key, obj[key])\n    return map\n  }\n})\n\nexport { realMapTag }\n","import { defineMappingTag } from '../../tag.ts'\nimport { isPlainObject } from '../../common/object.ts'\n\ntype StringMapping = Record<string, unknown>\n\n// Coerce a constructed key into the string identity a `{}` representation uses.\n// Returns null for a nested array key (an array element that is itself an\n// array), which would otherwise blow up exponentially when stringified via\n// aliases.\nfunction normalizeKey (key: unknown): string | null {\n  if (Array.isArray(key)) {\n    const array = Array.prototype.slice.call(key) as unknown[]\n\n    for (let index = 0; index < array.length; index++) {\n      if (Array.isArray(array[index])) return null\n\n      if (typeof array[index] === 'object' &&\n          Object.prototype.toString.call(array[index]) === '[object Object]') {\n        array[index] = '[object Object]'\n      }\n    }\n\n    return String(array)\n  }\n\n  if (typeof key === 'object' &&\n      Object.prototype.toString.call(key) === '[object Object]') {\n    return '[object Object]'\n  }\n\n  return String(key)\n}\n\nconst legacyMapTag = defineMappingTag('tag:yaml.org,2002:map', {\n  create: (): StringMapping => ({}),\n  identify: isPlainObject,\n  // Dump side: wrap the plain object into the canonical `Map` form the writer\n  // walks. Shallow — keys/values stay references to the originals.\n  represent: (o: StringMapping) => {\n    const map = new Map<string, unknown>()\n    for (const key of Object.keys(o)) map.set(key, o[key])\n    return map\n  },\n  addPair: (container, key, value) => {\n    const normalizedKey = normalizeKey(key)\n    if (normalizedKey === null) return 'nested arrays are not supported inside keys'\n    if (normalizedKey === '__proto__') {\n      // Define as an own data property so a literal `__proto__` key stays data\n      // and never invokes the prototype setter.\n      Object.defineProperty(container, normalizedKey, {\n        value, enumerable: true, configurable: true, writable: true\n      })\n    } else {\n      container[normalizedKey] = value\n    }\n    return ''\n  },\n  // hasOwn, not `in`: a plain object inherits `toString` and friends.\n  has: (container, key) => {\n    const normalizedKey = normalizeKey(key)\n    return normalizedKey !== null && Object.prototype.hasOwnProperty.call(container, normalizedKey)\n  },\n  keys: (container) => Object.keys(container),\n  get: (container, key) => container[String(key)]\n})\n\nexport { legacyMapTag, isPlainObject, type StringMapping }\n","export interface SnippetMark {\n  name?: string | null\n  buffer: string\n  position: number\n  line: number\n  column: number\n  snippet?: string | null\n}\n\ninterface SnippetOptions {\n  maxLength?: number\n  indent?: number\n  linesBefore?: number\n  linesAfter?: number\n}\n\nconst DEFAULT_SNIPPET_OPTIONS: Required<SnippetOptions> = {\n  maxLength: 79,\n  indent: 1,\n  linesBefore: 3,\n  linesAfter: 2\n}\n\n// get snippet for a single line, respecting maxLength\nfunction getLine (buffer: string, lineStart: number, lineEnd: number, position: number, maxLineLength: number) {\n  let head = ''\n  let tail = ''\n  const maxHalfLength = Math.floor(maxLineLength / 2) - 1\n\n  if (position - lineStart > maxHalfLength) {\n    head = ' ... '\n    lineStart = position - maxHalfLength + head.length\n  }\n\n  if (lineEnd - position > maxHalfLength) {\n    tail = ' ...'\n    lineEnd = position + maxHalfLength - tail.length\n  }\n\n  return {\n    str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n    pos: position - lineStart + head.length // relative position\n  }\n}\n\nfunction padStart (string: string, max: number) {\n  // max() protects from negativa value, to avoid exception.\n  return ' '.repeat(Math.max(max - string.length, 0)) + string\n}\n\nfunction makeSnippet (mark: SnippetMark, options?: SnippetOptions) {\n  if (!mark.buffer) return null\n\n  const opts = { ...DEFAULT_SNIPPET_OPTIONS, ...options }\n\n  const re = /\\r?\\n|\\r|\\0/g\n  const lineStarts = [0]\n  const lineEnds: number[] = []\n  let match: RegExpExecArray | null\n  let foundLineNo = -1\n\n  while ((match = re.exec(mark.buffer))) {\n    lineEnds.push(match.index)\n    lineStarts.push(match.index + match[0].length)\n\n    if (mark.position <= match.index && foundLineNo < 0) {\n      foundLineNo = lineStarts.length - 2\n    }\n  }\n\n  if (foundLineNo < 0) foundLineNo = lineStarts.length - 1\n\n  let result = ''\n  const lineNoLength = Math.min(mark.line + opts.linesAfter, lineEnds.length).toString().length\n  const maxLineLength = opts.maxLength - (opts.indent + lineNoLength + 3)\n\n  for (let i = 1; i <= opts.linesBefore; i++) {\n    if (foundLineNo - i < 0) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo - i],\n      lineEnds[foundLineNo - i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n      maxLineLength\n    )\n    result = `${' '.repeat(opts.indent)}${padStart((mark.line - i + 1).toString(), lineNoLength)} | ${line.str}\\n${result}`\n  }\n\n  const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)\n  result += `${' '.repeat(opts.indent)}${padStart((mark.line + 1).toString(), lineNoLength)} | ${line.str}\\n`\n  result += `${'-'.repeat(opts.indent + lineNoLength + 3 + line.pos)}^\\n`\n\n  for (let i = 1; i <= opts.linesAfter; i++) {\n    if (foundLineNo + i >= lineEnds.length) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo + i],\n      lineEnds[foundLineNo + i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n      maxLineLength\n    )\n    result += `${' '.repeat(opts.indent)}${padStart((mark.line + i + 1).toString(), lineNoLength)} | ${line.str}\\n`\n  }\n\n  return result.replace(/\\n$/, '')\n}\n\nexport default makeSnippet\n","import makeSnippet, { type SnippetMark } from './snippet.ts'\n\n// YAML error class. http://stackoverflow.com/questions/8458984\n//\nfunction formatError (exception: YAMLException, compact?: boolean) {\n  let where = ''\n\n  if (!exception.mark) return exception.reason\n\n  if (exception.mark.name) {\n    where += `in \"${exception.mark.name}\" `\n  }\n\n  where += `(${exception.mark.line + 1}:${exception.mark.column + 1})`\n\n  if (!compact && exception.mark.snippet) {\n    where += `\\n\\n${exception.mark.snippet}`\n  }\n\n  return `${exception.reason} ${where}`\n}\n\nclass YAMLException extends Error {\n  reason: string\n  mark?: SnippetMark\n\n  constructor (reason: string, mark?: SnippetMark) {\n    super()\n\n    this.name = 'YAMLException'\n    this.reason = reason\n    this.mark = mark\n    this.message = formatError(this, false)\n\n    // Guard for ancient browsers\n    if (Error.captureStackTrace) {\n      // Include stack trace in error object,\n      Error.captureStackTrace(this, this.constructor)\n    }\n  }\n\n  toString (compact?: boolean) {\n    return `${this.name}: ${formatError(this, compact)}`\n  }\n}\n\n// Build a YAMLException with a source snippet and throw it. `source` is the\n// raw input text (no parser sentinel); `position` is an offset into it.\nfunction throwErrorAt (source: string, position: number, message: string, filename = ''): never {\n  let line = 0\n  let lineStart = 0\n\n  for (let index = 0; index < position; index++) {\n    const ch = source.charCodeAt(index)\n\n    if (ch === 0x0A/* LF */) {\n      line++\n      lineStart = index + 1\n    } else if (ch === 0x0D/* CR */) {\n      line++\n      if (source.charCodeAt(index + 1) === 0x0A/* LF */) index++\n      lineStart = index + 1\n    }\n  }\n\n  const mark: SnippetMark = {\n    name: filename,\n    buffer: source,\n    position,\n    line,\n    column: position - lineStart\n  }\n\n  mark.snippet = makeSnippet(mark)\n  throw new YAMLException(message, mark)\n}\n\nexport { YAMLException, throwErrorAt }\n","const EVENT_DOCUMENT = 1\nconst EVENT_SEQUENCE = 2\nconst EVENT_MAPPING = 3\nconst EVENT_SCALAR = 4\nconst EVENT_ALIAS = 5\nconst EVENT_POP = 6\n\ntype EventType =\n  typeof EVENT_DOCUMENT | typeof EVENT_SEQUENCE | typeof EVENT_MAPPING |\n  typeof EVENT_SCALAR | typeof EVENT_ALIAS | typeof EVENT_POP\n\nconst SCALAR_STYLE_PLAIN = 1\nconst SCALAR_STYLE_SINGLE_QUOTED = 2\nconst SCALAR_STYLE_DOUBLE_QUOTED = 3\nconst SCALAR_STYLE_LITERAL_BLOCK = 4\nconst SCALAR_STYLE_FOLDED_BLOCK = 5\n\ntype ScalarStyle =\n  typeof SCALAR_STYLE_PLAIN | typeof SCALAR_STYLE_SINGLE_QUOTED |\n  typeof SCALAR_STYLE_DOUBLE_QUOTED | typeof SCALAR_STYLE_LITERAL_BLOCK |\n  typeof SCALAR_STYLE_FOLDED_BLOCK\n\nconst COLLECTION_STYLE_BLOCK = 1\nconst COLLECTION_STYLE_FLOW = 2\n\ntype CollectionStyle =\n  typeof COLLECTION_STYLE_BLOCK | typeof COLLECTION_STYLE_FLOW\n\nconst CHOMPING_CLIP = 1\nconst CHOMPING_STRIP = 2\nconst CHOMPING_KEEP = 3\n\ntype Chomping =\n  typeof CHOMPING_CLIP | typeof CHOMPING_STRIP | typeof CHOMPING_KEEP\n\ntype DocumentDirective =\n  { kind: 'yaml', version: string } |\n  { kind: 'tag', handle: string, prefix: string }\n\ntype TagHandlers = Record<string, string>\n\ninterface DocumentEvent {\n  type: typeof EVENT_DOCUMENT\n  explicitStart: boolean\n  explicitEnd: boolean\n  directives: DocumentDirective[]\n}\n\ninterface SequenceEvent {\n  type: typeof EVENT_SEQUENCE\n  start: number\n  anchorStart: number\n  anchorEnd: number\n  tagStart: number\n  tagEnd: number\n  style: CollectionStyle\n}\n\ninterface MappingEvent {\n  type: typeof EVENT_MAPPING\n  start: number\n  anchorStart: number\n  anchorEnd: number\n  tagStart: number\n  tagEnd: number\n  style: CollectionStyle\n}\n\ninterface ScalarEvent {\n  type: typeof EVENT_SCALAR\n  valueStart: number\n  valueEnd: number\n  anchorStart: number\n  anchorEnd: number\n  tagStart: number\n  tagEnd: number\n  style: ScalarStyle\n  chomping: Chomping\n  indent: number\n  fast: boolean\n}\n\ninterface AliasEvent {\n  type: typeof EVENT_ALIAS\n  anchorStart: number\n  anchorEnd: number\n}\n\ninterface PopEvent {\n  type: typeof EVENT_POP\n}\n\ntype Event =\n  DocumentEvent |\n  SequenceEvent |\n  MappingEvent |\n  ScalarEvent |\n  AliasEvent |\n  PopEvent\n\nexport {\n  EVENT_DOCUMENT,\n  EVENT_SEQUENCE,\n  EVENT_MAPPING,\n  EVENT_SCALAR,\n  EVENT_ALIAS,\n  EVENT_POP,\n\n  SCALAR_STYLE_PLAIN,\n  SCALAR_STYLE_SINGLE_QUOTED,\n  SCALAR_STYLE_DOUBLE_QUOTED,\n  SCALAR_STYLE_LITERAL_BLOCK,\n  SCALAR_STYLE_FOLDED_BLOCK,\n\n  COLLECTION_STYLE_BLOCK,\n  COLLECTION_STYLE_FLOW,\n\n  CHOMPING_CLIP,\n  CHOMPING_STRIP,\n  CHOMPING_KEEP,\n\n  type EventType,\n  type ScalarStyle,\n  type CollectionStyle,\n\n  type Chomping,\n  type DocumentDirective,\n  type TagHandlers,\n  type DocumentEvent,\n  type SequenceEvent,\n  type MappingEvent,\n  type ScalarEvent,\n  type AliasEvent,\n  type PopEvent,\n  type Event\n}\n","import {\n  SCALAR_STYLE_SINGLE_QUOTED,\n  SCALAR_STYLE_DOUBLE_QUOTED,\n  SCALAR_STYLE_LITERAL_BLOCK,\n  SCALAR_STYLE_FOLDED_BLOCK,\n  CHOMPING_STRIP,\n  CHOMPING_KEEP,\n  type ScalarEvent\n} from './events.ts'\n\nconst NO_RANGE = -1\n\n// --- character helpers (mirrors src/loader.ts, kept self-contained here) ---\n\nfunction simpleEscapeSequence (c: number) {\n  switch (c) {\n    case 0x30/* 0 */: return '\\x00'\n    case 0x61/* a */: return '\\x07'\n    case 0x62/* b */: return '\\x08'\n    case 0x74/* t */: return '\\x09'\n    case 0x09/* Tab */: return '\\x09'\n    case 0x6E/* n */: return '\\x0A'\n    case 0x76/* v */: return '\\x0B'\n    case 0x66/* f */: return '\\x0C'\n    case 0x72/* r */: return '\\x0D'\n    case 0x65/* e */: return '\\x1B'\n    case 0x20/* Space */: return ' '\n    case 0x22/* \" */: return '\\x22'\n    case 0x2F/* / */: return '/'\n    case 0x5C/* \\ */: return '\\x5C'\n    case 0x4E/* N */: return '\\x85'\n    case 0x5F/* _ */: return '\\xA0'\n    case 0x4C/* L */: return '\\u2028'\n    case 0x50/* P */: return '\\u2029'\n    default: return ''\n  }\n}\n\nconst simpleEscapeCheck = new Array(256)\nconst simpleEscapeMap = new Array(256)\nfor (let i = 0; i < 256; i++) {\n  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0\n  simpleEscapeMap[i] = simpleEscapeSequence(i)\n}\n\nfunction charFromCodepoint (c: number) {\n  if (c <= 0xFFFF) {\n    return String.fromCharCode(c)\n  }\n  return String.fromCharCode(\n    ((c - 0x010000) >> 10) + 0xD800,\n    ((c - 0x010000) & 0x03FF) + 0xDC00\n  )\n}\n\nfunction fromHexCode (c: number) {\n  if (c >= 0x30/* 0 */ && c <= 0x39/* 9 */) return c - 0x30\n  const lc = c | 0x20\n  // Double-quoted scalar ranges are validated by parser.ts before cooking.\n  return lc - 0x61 + 10\n}\n\nfunction escapedHexLen (c: number) {\n  if (c === 0x78/* x */) return 2\n  if (c === 0x75/* u */) return 4\n  // Double-quoted scalar ranges are validated by parser.ts before cooking.\n  return 8\n}\n\n// --- line folding helpers ---\n\n// Skip a run of line breaks plus the leading whitespace of the following\n// lines, returning the number of line breaks consumed and the new position.\nfunction skipFoldedBreaks (input: string, position: number, end: number) {\n  let breaks = 0\n\n  while (position < end) {\n    const ch = input.charCodeAt(position)\n\n    if (ch === 0x0A/* LF */) {\n      breaks++\n      position++\n    } else if (ch === 0x0D/* CR */) {\n      breaks++\n      position++\n      if (input.charCodeAt(position) === 0x0A/* LF */) position++\n    } else if (ch === 0x20/* Space */ || ch === 0x09/* Tab */) {\n      position++\n    } else {\n      break\n    }\n  }\n\n  return { position, breaks }\n}\n\n// Folding of line breaks between content chunks: a single break becomes a\n// space, several breaks become (count - 1) newlines.\nfunction foldedBreaks (count: number) {\n  if (count === 1) return ' '\n  // Called only after skipFoldedBreaks() consumed at least one line break.\n  return '\\n'.repeat(count - 1)\n}\n\n// --- per-style extractors ---\n\nfunction getPlainValue (input: string, start: number, end: number) {\n  let result = ''\n  let position = start\n  let captureStart = start\n  let captureEnd = start\n\n  while (position < end) {\n    const ch = input.charCodeAt(position)\n\n    if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n      result += input.slice(captureStart, captureEnd)\n      const fold = skipFoldedBreaks(input, position, end)\n      result += foldedBreaks(fold.breaks)\n      position = captureStart = captureEnd = fold.position\n    } else {\n      position++\n      if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n    }\n  }\n\n  return result + input.slice(captureStart, captureEnd)\n}\n\nfunction getSingleQuotedValue (input: string, start: number, end: number) {\n  let result = ''\n  let position = start\n  let captureStart = start\n  let captureEnd = start\n\n  while (position < end) {\n    const ch = input.charCodeAt(position)\n\n    if (ch === 0x27/* ' */) {\n      // Within the stored range every quote is part of an escaped '' pair.\n      result += input.slice(captureStart, position) + \"'\"\n      position += 2\n      captureStart = captureEnd = position\n    } else if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n      result += input.slice(captureStart, captureEnd)\n      const fold = skipFoldedBreaks(input, position, end)\n      result += foldedBreaks(fold.breaks)\n      position = captureStart = captureEnd = fold.position\n    } else {\n      position++\n      if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n    }\n  }\n\n  // Whitespace right before the closing quote is significant (it is only\n  // stripped when followed by a line break).\n  return result + input.slice(captureStart, end)\n}\n\nfunction getDoubleQuotedValue (input: string, start: number, end: number) {\n  let result = ''\n  let position = start\n  let captureStart = start\n  let captureEnd = start\n\n  while (position < end) {\n    const ch = input.charCodeAt(position)\n\n    if (ch === 0x5C/* \\ */) {\n      result += input.slice(captureStart, position)\n      position++\n      const escaped = input.charCodeAt(position)\n\n      if (escaped === 0x0A/* LF */ || escaped === 0x0D/* CR */) {\n        // Escaped line break: a line continuation that joins with nothing.\n        position = skipFoldedBreaks(input, position, end).position\n      } else if (escaped < 256 && simpleEscapeCheck[escaped]) {\n        result += simpleEscapeMap[escaped]\n        position++\n      } else {\n        // parser.ts has already rejected unknown escapes and invalid hex digits.\n        let hexLength = escapedHexLen(escaped)\n        let hexResult = 0\n\n        for (; hexLength > 0; hexLength--) {\n          position++\n          const digit = fromHexCode(input.charCodeAt(position))\n          hexResult = (hexResult << 4) + digit\n        }\n\n        result += charFromCodepoint(hexResult)\n        position++\n      }\n\n      captureStart = captureEnd = position\n    } else if (ch === 0x0A/* LF */ || ch === 0x0D/* CR */) {\n      result += input.slice(captureStart, captureEnd)\n      const fold = skipFoldedBreaks(input, position, end)\n      result += foldedBreaks(fold.breaks)\n      position = captureStart = captureEnd = fold.position\n    } else {\n      position++\n      if (ch !== 0x20/* Space */ && ch !== 0x09/* Tab */) captureEnd = position\n    }\n  }\n\n  return result + input.slice(captureStart, end)\n}\n\nfunction getBlockValue (\n  input: string,\n  start: number,\n  end: number,\n  indent: number,\n  chomping: number,\n  folded: boolean\n) {\n  const textIndent = indent < 0 ? 0 : indent\n  // The range starts at column 0 of the first line and includes every line\n  // break, including those of trailing blank lines.\n  const region = input.slice(start, end).replace(/\\r\\n?/g, '\\n')\n  // An empty range is a block with no lines at all (e.g. an empty `|+`) and\n  // must stay empty; a naive split would invent a phantom blank line. Otherwise\n  // a trailing line break leaves a trailing '' from split() that is not a real\n  // line (just the terminator of the last one), so drop it. Interior blank\n  // lines are kept.\n  const lines = region === ''\n    ? []\n    : (region.endsWith('\\n') ? region.slice(0, -1) : region).split('\\n')\n\n  let result = ''\n  let didReadContent = false\n  let emptyLines = 0\n  let atMoreIndented = false\n\n  for (const line of lines) {\n    // Whitespace beyond the content indentation is part of the content, so the\n    // indentation scan stops at textIndent. A line is empty only when nothing\n    // remains after the (capped) indentation.\n    // indent < 0 means no content line was detected (a wholly blank block), so\n    // every line is an empty line.\n    let column = 0\n    while (column < textIndent && line.charCodeAt(column) === 0x20/* Space */) column++\n\n    if (indent < 0 || column >= line.length) {\n      emptyLines++\n      continue\n    }\n\n    const content = line.slice(textIndent)\n    const first = content.charCodeAt(0)\n\n    if (folded) {\n      if (first === 0x20/* Space */ || first === 0x09/* Tab */) {\n        // More-indented lines are not folded.\n        atMoreIndented = true\n        result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n      } else if (atMoreIndented) {\n        atMoreIndented = false\n        result += '\\n'.repeat(emptyLines + 1)\n      } else if (emptyLines === 0) {\n        if (didReadContent) result += ' '\n      } else {\n        result += '\\n'.repeat(emptyLines)\n      }\n    } else {\n      result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n    }\n\n    result += content\n    didReadContent = true\n    emptyLines = 0\n  }\n\n  if (chomping === CHOMPING_KEEP) {\n    result += '\\n'.repeat(didReadContent ? 1 + emptyLines : emptyLines)\n  } else if (chomping !== CHOMPING_STRIP) {\n    if (didReadContent) result += '\\n'\n  }\n\n  return result\n}\n\nfunction getScalarValue (input: string, scalar: ScalarEvent): string {\n  if (scalar.valueStart === NO_RANGE) return ''\n\n  const { valueStart, valueEnd } = scalar\n\n  // Fast path: the parser marked this scalar as a verbatim slice of the input\n  // (single-line plain / quoted with no escapes or folded breaks), so the\n  // per-style char loop below would just reproduce the slice.\n  if (scalar.fast) return input.slice(valueStart, valueEnd)\n\n  switch (scalar.style) {\n    case SCALAR_STYLE_SINGLE_QUOTED:\n      return getSingleQuotedValue(input, valueStart, valueEnd)\n    case SCALAR_STYLE_DOUBLE_QUOTED:\n      return getDoubleQuotedValue(input, valueStart, valueEnd)\n    case SCALAR_STYLE_LITERAL_BLOCK:\n      return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, false)\n    case SCALAR_STYLE_FOLDED_BLOCK:\n      return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, true)\n    default:\n      return getPlainValue(input, valueStart, valueEnd)\n  }\n}\n\nexport {\n  getScalarValue\n}\n","const DEFAULT_TAG_HANDLERS: Readonly<Record<string, string>> = {\n  '!': '!',\n  '!!': 'tag:yaml.org,2002:'\n}\n\nfunction tagPercentEncode (source: string) {\n  return encodeURI(source).replace(/!/g, '%21')\n}\n\nfunction tagNameFull (rawTag: string, tagHandlers?: Readonly<Record<string, string>>) {\n  if (rawTag.startsWith('!<') && rawTag.endsWith('>')) {\n    return decodeURIComponent(rawTag.slice(2, -1))\n  }\n\n  const handleEnd = rawTag.indexOf('!', 1)\n  const handle = handleEnd === -1 ? '!' : rawTag.slice(0, handleEnd + 1)\n  const prefix = tagHandlers?.[handle] ?? DEFAULT_TAG_HANDLERS[handle] ?? handle\n\n  return decodeURIComponent(prefix) + decodeURIComponent(rawTag.slice(handle.length))\n}\n\nfunction tagNameShort (fullTag: string) {\n  let tag = fullTag\n\n  if (tag.charCodeAt(0) === 0x21) {\n    tag = tag.slice(1)\n    return `!${tagPercentEncode(tag)}`\n  }\n\n  if (tag.slice(0, 18) === 'tag:yaml.org,2002:') {\n    return `!!${tagPercentEncode(tag.slice(18))}`\n  }\n\n  return `!<${tagPercentEncode(tag)}>`\n}\n\nexport {\n  tagNameFull,\n  tagNameShort\n}\n","import {\n  EVENT_ALIAS,\n  EVENT_DOCUMENT,\n  EVENT_MAPPING,\n  EVENT_POP,\n  EVENT_SCALAR,\n  EVENT_SEQUENCE,\n  SCALAR_STYLE_PLAIN,\n  type Event,\n  type TagHandlers,\n  type MappingEvent,\n  type ScalarEvent,\n  type SequenceEvent\n} from './events.ts'\nimport { getScalarValue } from './parser_scalar.ts'\nimport { CORE_SCHEMA, type Schema } from '../schema.ts'\nimport {\n  MERGE_KEY,\n  NOT_RESOLVED,\n  type MappingTagDefinition,\n  type ScalarTagDefinition,\n  type SequenceTagDefinition\n} from '../tag.ts'\nimport { YAMLException, throwErrorAt } from '../common/exception.ts'\nimport { tagNameFull } from '../common/tagname.ts'\n\nconst NO_RANGE = -1\n\ninterface DocumentFrame {\n  kind: 'document'\n  position: number\n  value: unknown\n  hasValue: boolean\n}\n\ninterface SequenceFrame {\n  kind: 'sequence'\n  position: number\n  value: any\n  tag: SequenceTagDefinition<any, any>\n  anchor: Anchor | null\n  index: number\n  // True when this sequence is the source list of a `<<` merge (`<<: [...]`).\n  // Each element is validated as a mapping on arrival; the materialized list is\n  // then delivered to the target mapping, which folds the elements in.\n  merge: boolean\n}\n\ninterface MappingFrame {\n  kind: 'mapping'\n  position: number\n  value: any\n  tag: MappingTagDefinition<any, any>\n  anchor: Anchor | null\n  key: unknown\n  keyPosition: number\n  hasKey: boolean\n  // Keys brought in by a merge that an explicit pair is still allowed to\n  // override. Lazily allocated: stays null for mappings without `<<`.\n  overridable: Set<unknown> | null\n}\n\ntype Frame = DocumentFrame | SequenceFrame | MappingFrame\n\ntype AnyTag = ScalarTagDefinition | SequenceTagDefinition<any, any> | MappingTagDefinition<any, any>\n\ninterface ValueAndTag {\n  value: unknown\n  tag: AnyTag\n}\n\ninterface Anchor {\n  value: unknown\n  tag: AnyTag\n  isValueFinal: boolean\n}\n\ninterface ConstructorOptions {\n  source: string\n  filename?: string\n  schema?: Schema\n  json?: boolean\n  maxTotalMergeKeys?: number\n  maxAliases?: number\n}\n\n// `source` is input data, not config — so it has no default here.\nconst DEFAULT_CONSTRUCTOR_OPTIONS: Required<Omit<ConstructorOptions, 'source'>> = {\n  filename: '',\n  schema: CORE_SCHEMA,\n  json: false,\n  maxTotalMergeKeys: 10000,\n  maxAliases: -1\n}\n\ninterface ConstructorState extends Required<ConstructorOptions> {\n  events: Event[]\n  documents: unknown[]\n  eventIndex: number\n  position: number\n  frames: Frame[]\n  anchors: Map<string, Anchor>\n  tagHandlers: TagHandlers\n  totalMergeKeys: number\n  aliasCount: number\n}\n\nfunction eventPosition (event: Event) {\n  if ('tagStart' in event && event.tagStart !== NO_RANGE) return event.tagStart\n  if ('anchorStart' in event && event.anchorStart !== NO_RANGE) return event.anchorStart\n  if ('valueStart' in event && event.valueStart !== NO_RANGE) return event.valueStart\n  if ('start' in event) return event.start\n  return 0\n}\n\nfunction throwError (state: ConstructorState, message: string): never {\n  throwErrorAt(state.source, state.position, message, state.filename)\n}\n\nfunction finalizeCollection (\n  state: ConstructorState,\n  position: number,\n  tag: SequenceTagDefinition<any, any> | MappingTagDefinition<any, any>,\n  carrier: unknown\n) {\n  try {\n    return tag.finalize(carrier)\n  } catch (error) {\n    if (error instanceof YAMLException) throw error\n    throwErrorAt(\n      state.source,\n      position,\n      error instanceof Error ? error.message : String(error),\n      state.filename\n    )\n  }\n}\n\nfunction lookupTag<T extends ScalarTagDefinition | SequenceTagDefinition | MappingTagDefinition> (\n  exact: Record<string, T>,\n  prefix: readonly T[],\n  tagName: string\n): T | undefined {\n  const exactTag = exact[tagName]\n  if (exactTag) return exactTag\n\n  for (const tag of prefix) {\n    if (tagName.startsWith(tag.tagName)) return tag\n  }\n\n  return undefined\n}\n\nfunction findExplicitTag<T extends ScalarTagDefinition | SequenceTagDefinition | MappingTagDefinition> (\n  state: ConstructorState,\n  exact: Record<string, T>,\n  prefix: readonly T[],\n  tagName: string,\n  nodeKind: T['nodeKind']\n) {\n  const tag = lookupTag(exact, prefix, tagName)\n  if (tag) return tag\n\n  throwError(state, `unknown ${nodeKind} tag !<${tagName}>`)\n}\n\nfunction constructScalar (\n  state: ConstructorState,\n  event: ScalarEvent\n): ValueAndTag {\n  const source = getScalarValue(state.source, event)\n  const rawTag = event.tagStart === NO_RANGE\n    ? ''\n    : state.source.slice(event.tagStart, event.tagEnd)\n  const strTag = state.schema.defaultScalarTag\n\n  if (rawTag !== '') {\n    if (rawTag === '!') return { value: source, tag: strTag }\n\n    const tagName = tagNameFull(rawTag, state.tagHandlers)\n    const scalarTag = lookupTag(state.schema.exact.scalar, state.schema.prefix.scalar, tagName)\n\n    if (scalarTag) {\n      const result = scalarTag.resolve(source, true, tagName)\n\n      if (result === NOT_RESOLVED) {\n        throwError(state, `cannot resolve a node with !<${tagName}> explicit tag`)\n      }\n\n      return { value: result, tag: scalarTag }\n    }\n\n    // An empty node carrying a collection tag (e.g. `!!map`, `!!seq`) is emitted\n    // by the parser as a scalar event, since there is no collection syntax to key\n    // off. Resolve it here by the explicit tag's kind into an empty collection.\n    const collectionTagDef =\n      lookupTag(state.schema.exact.mapping, state.schema.prefix.mapping, tagName) ??\n      lookupTag(state.schema.exact.sequence, state.schema.prefix.sequence, tagName)\n\n    if (collectionTagDef) {\n      if (source !== '') {\n        throwError(state, `cannot resolve a node with !<${tagName}> explicit tag`)\n      }\n\n      const carrier = collectionTagDef.create(tagName)\n      const value = collectionTagDef.carrierIsResult\n        ? carrier\n        : finalizeCollection(state, state.position, collectionTagDef, carrier)\n      return { value, tag: collectionTagDef }\n    }\n\n    throwError(state, `unknown scalar tag !<${tagName}>`)\n  }\n\n  if (event.style === SCALAR_STYLE_PLAIN) {\n    // charAt(0) (not source[0]) yields '' for an empty source, which is the key\n    // the null tag declares; source[0] would be undefined and miss that bucket.\n    const candidates = state.schema.implicitScalarByFirstChar.get(source.charAt(0)) ??\n      state.schema.implicitScalarAnyFirstChar\n    for (const tag of candidates) {\n      const result = tag.resolve(source, false, tag.tagName)\n      if (result !== NOT_RESOLVED) return { value: result, tag }\n    }\n  }\n\n  return { value: strTag.resolve(source, false, strTag.tagName), tag: strTag }\n}\n\nfunction collectionTag<Tag extends SequenceTagDefinition | MappingTagDefinition> (\n  state: ConstructorState,\n  event: SequenceEvent | MappingEvent,\n  exact: Record<string, Tag>,\n  prefix: readonly Tag[],\n  defaultTagName: string,\n  nodeKind: Tag['nodeKind']\n) {\n  const rawTag = event.tagStart === NO_RANGE\n    ? ''\n    : state.source.slice(event.tagStart, event.tagEnd)\n  const tagName = rawTag === '' || rawTag === '!'\n    ? defaultTagName\n    : tagNameFull(rawTag, state.tagHandlers)\n\n  return {\n    tagName,\n    tag: findExplicitTag(state, exact, prefix, tagName, nodeKind)\n  }\n}\n\n// A merge source must be a mapping; every mapping tag exposes the read side.\nfunction isMappingTag (tag: AnyTag): tag is MappingTagDefinition<any, any> {\n  return tag.nodeKind === 'mapping'\n}\n\n// Fold the keys of one mapping source into the target frame, honoring merge\n// precedence: an already-present key (explicit or from an earlier source) wins.\nfunction mergeKeys (state: ConstructorState, frame: MappingFrame, source: unknown, sourceTag: MappingTagDefinition<any, any>) {\n  for (const sourceKey of sourceTag.keys(source)) {\n    if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {\n      throwError(state, `merge keys exceeded maxTotalMergeKeys (${state.maxTotalMergeKeys})`)\n    }\n\n    if (frame.tag.has(frame.value, sourceKey)) continue\n\n    const err = frame.tag.addPair(frame.value, sourceKey, sourceTag.get(source, sourceKey))\n    if (err) throwError(state, err)\n    ;(frame.overridable ??= new Set()).add(sourceKey)\n  }\n}\n\n// The value of a `<<` key: either a mapping (fold its keys) or a sequence of\n// mappings (fold each). A merge sequence has already had every element validated\n// as a mapping on arrival (see addValue), and its elements were built by the\n// target's own mapping tag, so they are read back with it.\nfunction mergeSource (state: ConstructorState, frame: MappingFrame, source: unknown, sourceTag: AnyTag) {\n  state.position = frame.keyPosition\n\n  if (isMappingTag(sourceTag)) {\n    mergeKeys(state, frame, source, sourceTag)\n  } else if (sourceTag.nodeKind === 'sequence' && Array.isArray(source)) {\n    for (const element of source) {\n      mergeKeys(state, frame, element, frame.tag)\n    }\n  } else {\n    throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n  }\n}\n\nfunction addMappingValue (state: ConstructorState, frame: MappingFrame, key: unknown, value: unknown, tag: AnyTag) {\n  state.position = frame.keyPosition\n\n  // `<<` is intercepted before dedup, so a repeated merge key is allowed.\n  if (key === MERGE_KEY) {\n    mergeSource(state, frame, value, tag)\n    return\n  }\n\n  if (!state.json && frame.tag.has(frame.value, key) && !frame.overridable?.has(key)) {\n    throwError(state, 'duplicated mapping key')\n  }\n\n  const err = frame.tag.addPair(frame.value, key, value)\n  if (err) throwError(state, err)\n  frame.overridable?.delete(key)\n}\n\nfunction addValue (state: ConstructorState, value: unknown, tag: AnyTag) {\n  const frame = state.frames[state.frames.length - 1]!\n\n  if (frame.kind === 'document') {\n    frame.value = value\n    frame.hasValue = true\n  } else if (frame.kind === 'sequence') {\n    if (frame.merge) {\n      // Element of a `<<: [...]` list: validate it is a mapping, then collect\n      // it like any other item for the target to fold in.\n      if (!isMappingTag(tag)) {\n        throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n      }\n    }\n    const err = frame.tag.addItem(frame.value, value, frame.index++)\n    if (err) throwError(state, err)\n  } else if (frame.hasKey) {\n    const key = frame.key\n    frame.key = undefined\n    frame.hasKey = false\n    addMappingValue(state, frame, key, value, tag)\n  } else {\n    frame.key = value\n    frame.keyPosition = state.position\n    frame.hasKey = true\n  }\n}\n\nfunction storeAnchor (\n  state: ConstructorState,\n  event: ScalarEvent | SequenceEvent | MappingEvent,\n  value: unknown,\n  tag: AnyTag,\n  isValueFinal: boolean\n): Anchor | null {\n  if (event.anchorStart !== NO_RANGE) {\n    const anchor = {\n      value,\n      tag,\n      isValueFinal\n    }\n    state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), anchor)\n    return anchor\n  }\n\n  return null\n}\n\nfunction constructFromEvents (events: Event[], options: ConstructorOptions): unknown[] {\n  const state: ConstructorState = {\n    ...DEFAULT_CONSTRUCTOR_OPTIONS,\n    ...options,\n    events,\n    documents: [],\n    eventIndex: 0,\n    position: 0,\n    frames: [],\n    anchors: new Map(),\n    tagHandlers: Object.create(null),\n    totalMergeKeys: 0,\n    aliasCount: 0\n  }\n\n  while (state.eventIndex < state.events.length) {\n    const event = state.events[state.eventIndex++]\n    state.position = eventPosition(event)\n\n    switch (event.type) {\n      case EVENT_DOCUMENT:\n        state.anchors = new Map()\n        state.aliasCount = 0\n        state.tagHandlers = Object.create(null)\n        for (const directive of event.directives) {\n          if (directive.kind === 'tag') state.tagHandlers[directive.handle] = directive.prefix\n        }\n        state.frames.push({ kind: 'document', position: state.position, value: undefined, hasValue: false })\n        break\n\n      case EVENT_SCALAR: {\n        const { value, tag } = constructScalar(state, event)\n        storeAnchor(state, event, value, tag, true)\n        addValue(state, value, tag)\n        break\n      }\n\n      case EVENT_SEQUENCE: {\n        const definition = collectionTag(\n          state,\n          event,\n          state.schema.exact.sequence,\n          state.schema.prefix.sequence,\n          'tag:yaml.org,2002:seq',\n          'sequence'\n        )\n        const value = definition.tag.create(definition.tagName)\n        const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult)\n\n        // `<<: [...]` — the parent mapping is waiting on a merge key, so this\n        // sequence is a list of merge sources: its elements must be mappings.\n        // It is still built and delivered as a normal value; the target folds it.\n        const parent = state.frames[state.frames.length - 1]\n        const merge = parent !== undefined && parent.kind === 'mapping' &&\n          parent.hasKey && parent.key === MERGE_KEY\n\n        state.frames.push({\n          kind: 'sequence', position: state.position, value, tag: definition.tag, anchor, index: 0, merge\n        })\n        break\n      }\n\n      case EVENT_MAPPING: {\n        const definition = collectionTag(\n          state,\n          event,\n          state.schema.exact.mapping,\n          state.schema.prefix.mapping,\n          'tag:yaml.org,2002:map',\n          'mapping'\n        )\n        const value = definition.tag.create(definition.tagName)\n        const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult)\n        state.frames.push({\n          kind: 'mapping',\n          position: state.position,\n          value,\n          tag: definition.tag,\n          anchor,\n          key: undefined,\n          keyPosition: state.position,\n          hasKey: false,\n          overridable: null\n        })\n        break\n      }\n\n      case EVENT_ALIAS: {\n        if (state.maxAliases !== -1 && ++state.aliasCount > state.maxAliases) {\n          throwError(state, `aliases exceeded maxAliases (${state.maxAliases})`)\n        }\n\n        const name = state.source.slice(event.anchorStart, event.anchorEnd)\n        const anchor = state.anchors.get(name)\n        if (!anchor) {\n          throwError(state, `unidentified alias \"${name}\"`)\n        }\n        if (!anchor.isValueFinal) {\n          throwError(state, `recursive alias \"${name}\" is not supported for tag ${anchor.tag.tagName} because it uses finalize()`)\n        }\n        addValue(state, anchor.value, anchor.tag)\n        break\n      }\n\n      case EVENT_POP: {\n        const frame = state.frames.pop()!\n\n        if (frame.kind === 'document') {\n          state.documents.push(frame.value)\n        } else {\n          const value = frame.tag.carrierIsResult\n            ? frame.value\n            : finalizeCollection(state, frame.position, frame.tag, frame.value)\n          if (frame.anchor) {\n            frame.anchor.value = value\n            frame.anchor.isValueFinal = true\n          }\n          addValue(state, value, frame.tag)\n        }\n        break\n      }\n    }\n  }\n\n  return state.documents\n}\n\nexport {\n  constructFromEvents,\n  DEFAULT_CONSTRUCTOR_OPTIONS,\n  type ConstructorOptions\n}\n","import {\n  EVENT_DOCUMENT,\n  EVENT_SEQUENCE,\n  EVENT_MAPPING,\n  EVENT_SCALAR,\n  EVENT_ALIAS,\n  EVENT_POP,\n  SCALAR_STYLE_PLAIN,\n  SCALAR_STYLE_SINGLE_QUOTED,\n  SCALAR_STYLE_DOUBLE_QUOTED,\n  SCALAR_STYLE_LITERAL_BLOCK,\n  SCALAR_STYLE_FOLDED_BLOCK,\n  COLLECTION_STYLE_BLOCK,\n  COLLECTION_STYLE_FLOW,\n  CHOMPING_CLIP,\n  CHOMPING_STRIP,\n  CHOMPING_KEEP,\n  type Event,\n  type ScalarStyle,\n  type CollectionStyle,\n  type Chomping,\n  type DocumentDirective,\n  type TagHandlers\n} from './events.ts'\nimport { throwErrorAt } from '../common/exception.ts'\n\nconst NO_RANGE = -1\nconst HAS_OWN = Object.prototype.hasOwnProperty\n\nconst CONTEXT_FLOW_IN = 1\nconst CONTEXT_FLOW_OUT = 2\nconst CONTEXT_BLOCK_IN = 3\nconst CONTEXT_BLOCK_OUT = 4\n\n// eslint-disable-next-line no-control-regex\nconst PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_FLOW_INDICATORS = /[,\\[\\]{}]/\n// YAML 1.2.2, [91] c-tag-handle.\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/\n// YAML 1.2.2, [39] ns-uri-char.\n// eslint-disable-next-line no-useless-escape\nconst NS_URI_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])`\n// YAML 1.2.2, [40] ns-tag-char = ns-uri-char - \"!\" - c-flow-indicator.\n// eslint-disable-next-line no-useless-escape\nconst NS_TAG_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$.~*'()_])`\nconst PATTERN_TAG_URI = new RegExp(`^(?:${NS_URI_CHAR})*$`)\n// YAML 1.2.2, [99] c-ns-shorthand-tag suffix part.\nconst PATTERN_TAG_SUFFIX = new RegExp(`^(?:${NS_TAG_CHAR})+$`)\n// YAML 1.2.2, [93] ns-tag-prefix.\nconst PATTERN_TAG_PREFIX = new RegExp(`^(?:!(?:${NS_URI_CHAR})*|${NS_TAG_CHAR}(?:${NS_URI_CHAR})*)$`)\n\ntype NodeContext =\n  typeof CONTEXT_FLOW_IN | typeof CONTEXT_FLOW_OUT |\n  typeof CONTEXT_BLOCK_IN | typeof CONTEXT_BLOCK_OUT\n\ninterface NodeProperties {\n  anchorStart: number\n  anchorEnd: number\n  tagStart: number\n  tagEnd: number\n}\n\ninterface ParserSnapshot {\n  position: number\n  line: number\n  lineStart: number\n  lineIndent: number\n  firstTabInLine: number\n  eventsLength: number\n}\n\ninterface ParserOptions {\n  filename?: string\n  maxDepth?: number\n}\n\nconst DEFAULT_PARSER_OPTIONS: Required<ParserOptions> = {\n  filename: '',\n  maxDepth: 100\n}\n\ninterface ParserState extends Required<ParserOptions> {\n  input: string\n  length: number\n  position: number\n  line: number\n  lineStart: number\n  lineIndent: number\n  firstTabInLine: number\n  depth: number\n  directives: DocumentDirective[]\n  tagHandlers: TagHandlers\n  events: Event[]\n}\n\nfunction addDocumentEvent (\n  state: ParserState,\n  explicitStart: boolean,\n  explicitEnd: boolean\n) {\n  state.events.push({\n    type: EVENT_DOCUMENT,\n    explicitStart,\n    explicitEnd,\n    directives: state.directives\n  })\n}\n\nfunction addSequenceEvent (\n  state: ParserState,\n  start: number,\n  anchorStart: number,\n  anchorEnd: number,\n  tagStart: number,\n  tagEnd: number,\n  style: CollectionStyle\n) {\n  state.events.push({\n    type: EVENT_SEQUENCE,\n    start,\n    anchorStart,\n    anchorEnd,\n    tagStart,\n    tagEnd,\n    style\n  })\n}\n\nfunction addMappingEvent (\n  state: ParserState,\n  start: number,\n  anchorStart: number,\n  anchorEnd: number,\n  tagStart: number,\n  tagEnd: number,\n  style: CollectionStyle\n) {\n  state.events.push({\n    type: EVENT_MAPPING,\n    start,\n    anchorStart,\n    anchorEnd,\n    tagStart,\n    tagEnd,\n    style\n  })\n}\n\nfunction addScalarEvent (\n  state: ParserState,\n  valueStart: number,\n  valueEnd: number,\n  anchorStart: number,\n  anchorEnd: number,\n  tagStart: number,\n  tagEnd: number,\n  style: ScalarStyle,\n  chomping: Chomping = CHOMPING_CLIP,\n  indent = -1,\n  fast = false\n) {\n  state.events.push({\n    type: EVENT_SCALAR,\n    valueStart,\n    valueEnd,\n    anchorStart,\n    anchorEnd,\n    tagStart,\n    tagEnd,\n    style,\n    chomping,\n    indent,\n    fast\n  })\n}\n\nfunction addAliasEvent (\n  state: ParserState,\n  anchorStart: number,\n  anchorEnd: number\n) {\n  state.events.push({\n    type: EVENT_ALIAS,\n    anchorStart,\n    anchorEnd\n  })\n}\n\nfunction addPopEvent (state: ParserState) {\n  state.events.push({ type: EVENT_POP })\n}\n\nfunction addEmptyScalarEvent (state: ParserState) {\n  addScalarEvent(\n    state,\n    NO_RANGE,\n    NO_RANGE,\n    NO_RANGE,\n    NO_RANGE,\n    NO_RANGE,\n    NO_RANGE,\n    SCALAR_STYLE_PLAIN\n  )\n}\n\nfunction emptyProperties (): NodeProperties {\n  return {\n    anchorStart: NO_RANGE,\n    anchorEnd: NO_RANGE,\n    tagStart: NO_RANGE,\n    tagEnd: NO_RANGE\n  }\n}\n\nfunction snapshotState (state: ParserState): ParserSnapshot {\n  return {\n    position: state.position,\n    line: state.line,\n    lineStart: state.lineStart,\n    lineIndent: state.lineIndent,\n    firstTabInLine: state.firstTabInLine,\n    eventsLength: state.events.length\n  }\n}\n\nfunction restoreState (state: ParserState, snapshot: ParserSnapshot) {\n  state.position = snapshot.position\n  state.line = snapshot.line\n  state.lineStart = snapshot.lineStart\n  state.lineIndent = snapshot.lineIndent\n  state.firstTabInLine = snapshot.firstTabInLine\n  state.events.length = snapshot.eventsLength\n}\n\nfunction throwError (state: ParserState, message: string): never {\n  throwErrorAt(state.input.slice(0, state.length), state.position, message, state.filename)\n}\n\nfunction isEol (c: number) {\n  return c === 0x0A/* LF */ || c === 0x0D/* CR */\n}\n\nfunction isWhiteSpace (c: number) {\n  return c === 0x09/* Tab */ || c === 0x20/* Space */\n}\n\nfunction isWsOrEol (c: number) {\n  return isWhiteSpace(c) || isEol(c)\n}\n\nfunction isWsOrEolOrEnd (c: number) {\n  return c === 0 || isWsOrEol(c)\n}\n\nfunction isFlowIndicator (c: number) {\n  return c === 0x2C/* , */ ||\n         c === 0x5B/* [ */ ||\n         c === 0x5D/* ] */ ||\n         c === 0x7B/* { */ ||\n         c === 0x7D/* } */\n}\n\nfunction fromDecimalCode (c: number) {\n  return c >= 0x30/* 0 */ && c <= 0x39/* 9 */ ? c - 0x30 : -1\n}\n\nfunction fromHexCode (c: number) {\n  if (c >= 0x30/* 0 */ && c <= 0x39/* 9 */) return c - 0x30\n  const lc = c | 0x20\n  if (lc >= 0x61/* a */ && lc <= 0x66/* f */) return lc - 0x61 + 10\n  return -1\n}\n\nfunction escapedHexLen (c: number) {\n  if (c === 0x78/* x */) return 2\n  if (c === 0x75/* u */) return 4\n  if (c === 0x55/* U */) return 8\n  return 0\n}\n\nfunction isSimpleEscape (c: number) {\n  return c === 0x30/* 0 */ ||\n         c === 0x61/* a */ ||\n         c === 0x62/* b */ ||\n         c === 0x74/* t */ ||\n         c === 0x09/* Tab */ ||\n         c === 0x6E/* n */ ||\n         c === 0x76/* v */ ||\n         c === 0x66/* f */ ||\n         c === 0x72/* r */ ||\n         c === 0x65/* e */ ||\n         c === 0x20/* Space */ ||\n         c === 0x22/* \" */ ||\n         c === 0x2F/* / */ ||\n         c === 0x5C/* \\ */ ||\n         c === 0x4E/* N */ ||\n         c === 0x5F/* _ */ ||\n         c === 0x4C/* L */ ||\n         c === 0x50/* P */\n}\n\n// Precondition: state.position points at LF or CR.\nfunction consumeLineBreak (state: ParserState) {\n  const ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x0A/* LF */) {\n    state.position++\n  } else {\n    state.position++\n    if (state.input.charCodeAt(state.position) === 0x0A/* LF */) state.position++\n  }\n\n  state.line++\n  state.lineStart = state.position\n  state.lineIndent = 0\n  state.firstTabInLine = -1\n}\n\nfunction skipSeparationSpace (state: ParserState, allowComments: boolean) {\n  let lineBreaks = 0\n  let ch = state.input.charCodeAt(state.position)\n  let hasSeparation = state.position === state.lineStart ||\n    isWsOrEol(state.input.charCodeAt(state.position - 1))\n\n  while (ch !== 0) {\n    while (isWhiteSpace(ch)) {\n      hasSeparation = true\n      if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n        state.firstTabInLine = state.position\n      }\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    if (allowComments && hasSeparation && ch === 0x23/* # */) {\n      do { ch = state.input.charCodeAt(++state.position) }\n      while (!isEol(ch) && ch !== 0)\n    }\n\n    if (!isEol(ch)) break\n\n    consumeLineBreak(state)\n    lineBreaks++\n    hasSeparation = true\n    ch = state.input.charCodeAt(state.position)\n\n    while (ch === 0x20/* Space */) {\n      state.lineIndent++\n      ch = state.input.charCodeAt(++state.position)\n    }\n  }\n\n  return lineBreaks\n}\n\nfunction testDocumentSeparator (state: ParserState, position = state.position) {\n  const ch = state.input.charCodeAt(position)\n\n  if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n      ch === state.input.charCodeAt(position + 1) &&\n      ch === state.input.charCodeAt(position + 2)) {\n    const following = state.input.charCodeAt(position + 3)\n    return following === 0 || isWsOrEol(following)\n  }\n\n  return false\n}\n\nfunction skipUntilLineEnd (state: ParserState) {\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0 && !isEol(ch)) {\n    ch = state.input.charCodeAt(++state.position)\n  }\n}\n\nfunction checkPrintable (state: ParserState, start: number, end: number) {\n  if (PATTERN_NON_PRINTABLE.test(state.input.slice(start, end))) {\n    throwError(state, 'the stream contains non-printable characters')\n  }\n}\n\nfunction readTagProperty (state: ParserState, props: NodeProperties, inFlow: boolean) {\n  if (state.input.charCodeAt(state.position) !== 0x21/* ! */) return false\n  if (props.tagStart !== NO_RANGE) throwError(state, 'duplication of a tag property')\n\n  const start = state.position\n  let isVerbatim = false\n  let isNamed = false\n  let tagHandle = '!'\n  let ch = state.input.charCodeAt(++state.position)\n\n  if (ch === 0x3C/* < */) {\n    isVerbatim = true\n    ch = state.input.charCodeAt(++state.position)\n  } else if (ch === 0x21/* ! */) {\n    isNamed = true\n    tagHandle = '!!'\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  let suffixStart = state.position\n  let tagName\n\n  if (isVerbatim) {\n    while (ch !== 0 && ch !== 0x3E/* > */) ch = state.input.charCodeAt(++state.position)\n    if (ch !== 0x3E/* > */) throwError(state, 'unexpected end of the stream within a verbatim tag')\n    tagName = state.input.slice(suffixStart, state.position)\n    state.position++\n  } else {\n    while (ch !== 0 && !isWsOrEol(ch) && !(inFlow && isFlowIndicator(ch))) {\n      if (ch === 0x21/* ! */) {\n        if (!isNamed) {\n          tagHandle = state.input.slice(suffixStart - 1, state.position + 1)\n          if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, 'named tag handle cannot contain such characters')\n          isNamed = true\n          suffixStart = state.position + 1\n        } else {\n          throwError(state, 'tag suffix cannot contain exclamation marks')\n        }\n      }\n\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    tagName = state.input.slice(suffixStart, state.position)\n    if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, 'tag suffix cannot contain flow indicator characters')\n  }\n\n  if (tagName && !(isVerbatim ? PATTERN_TAG_URI.test(tagName) : PATTERN_TAG_SUFFIX.test(tagName))) {\n    throwError(state, `tag name cannot contain such characters: ${tagName}`)\n  }\n  try {\n    decodeURIComponent(tagName)\n  } catch {\n    throwError(state, `tag name is malformed: ${tagName}`)\n  }\n\n  if (!isVerbatim && tagHandle !== '!' && tagHandle !== '!!' && !HAS_OWN.call(state.tagHandlers, tagHandle)) {\n    throwError(state, `undeclared tag handle \"${tagHandle}\"`)\n  }\n\n  props.tagStart = start\n  props.tagEnd = state.position\n  return true\n}\n\nfunction readAnchorProperty (state: ParserState, props: NodeProperties) {\n  if (state.input.charCodeAt(state.position) !== 0x26/* & */) return false\n  if (props.anchorStart !== NO_RANGE) throwError(state, 'duplication of an anchor property')\n\n  state.position++\n  const start = state.position\n\n  while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) {\n    state.position++\n  }\n\n  if (state.position === start) throwError(state, 'name of an anchor node must contain at least one character')\n\n  props.anchorStart = start\n  props.anchorEnd = state.position\n  return true\n}\n\nfunction readAlias (state: ParserState, props: NodeProperties) {\n  if (state.input.charCodeAt(state.position) !== 0x2A/* * */) return false\n  if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n    throwError(state, 'alias node should not have any properties')\n  }\n\n  state.position++\n  const start = state.position\n\n  while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) {\n    state.position++\n  }\n\n  if (state.position === start) throwError(state, 'name of an alias node must contain at least one character')\n\n  addAliasEvent(state, start, state.position)\n  return true\n}\n\nfunction readFlowScalarBreak (state: ParserState, nodeIndent: number) {\n  skipSeparationSpace(state, false)\n\n  if (state.lineIndent < nodeIndent) {\n    throwError(state, 'deficient indentation')\n  }\n}\n\nfunction readSingleQuotedScalar (state: ParserState, nodeIndent: number, props: NodeProperties) {\n  if (state.input.charCodeAt(state.position) !== 0x27/* ' */) return false\n\n  state.position++\n  const start = state.position\n  // A single-quoted scalar is sliceable verbatim when it has no '' escape pairs\n  // and no folded line breaks (see getScalarValue fast path).\n  let simple = true\n\n  while (state.input.charCodeAt(state.position) !== 0) {\n    const ch = state.input.charCodeAt(state.position)\n\n    if (ch === 0x27/* ' */) {\n      if (state.input.charCodeAt(state.position + 1) === 0x27/* ' */) {\n        simple = false\n        state.position += 2\n        continue\n      }\n\n      const end = state.position\n      state.position++\n      addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE_SINGLE_QUOTED, CHOMPING_CLIP, -1, simple)\n      return true\n    }\n\n    if (isEol(ch)) {\n      simple = false\n      readFlowScalarBreak(state, nodeIndent)\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a single quoted scalar')\n    } else if (ch !== 0x09/* Tab */ && ch < 0x20) {\n      throwError(state, 'expected valid JSON character')\n    } else {\n      state.position++\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a single quoted scalar')\n}\n\nfunction readDoubleQuotedScalar (state: ParserState, nodeIndent: number, props: NodeProperties) {\n  if (state.input.charCodeAt(state.position) !== 0x22/* \" */) return false\n\n  state.position++\n  const start = state.position\n  // A double-quoted scalar is sliceable verbatim when it has no \\ escapes and\n  // no folded line breaks (see getScalarValue fast path).\n  let simple = true\n\n  while (state.input.charCodeAt(state.position) !== 0) {\n    const ch = state.input.charCodeAt(state.position)\n\n    if (ch === 0x22/* \" */) {\n      const end = state.position\n      state.position++\n      addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE_DOUBLE_QUOTED, CHOMPING_CLIP, -1, simple)\n      return true\n    }\n\n    if (ch === 0x5C/* \\ */) {\n      simple = false\n      const escaped = state.input.charCodeAt(++state.position)\n\n      if (isEol(escaped)) {\n        readFlowScalarBreak(state, nodeIndent)\n      } else if (isSimpleEscape(escaped)) {\n        state.position++\n      } else {\n        let hexLength = escapedHexLen(escaped)\n\n        if (hexLength === 0) throwError(state, 'unknown escape sequence')\n\n        while (hexLength-- > 0) {\n          state.position++\n          if (fromHexCode(state.input.charCodeAt(state.position)) < 0) {\n            throwError(state, 'expected hexadecimal character')\n          }\n        }\n        state.position++\n      }\n    } else if (isEol(ch)) {\n      simple = false\n      readFlowScalarBreak(state, nodeIndent)\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a double quoted scalar')\n    } else if (ch !== 0x09/* Tab */ && ch < 0x20) {\n      throwError(state, 'expected valid JSON character')\n    } else {\n      state.position++\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a double quoted scalar')\n}\n\nfunction readBlockScalar (state: ParserState, parentIndent: number, props: NodeProperties) {\n  const ch = state.input.charCodeAt(state.position)\n  let chomping: Chomping = CHOMPING_CLIP\n  let indent = -1\n  let detectedIndent = false\n\n  if (ch !== 0x7C/* | */ && ch !== 0x3E/* > */) return false\n\n  const style = ch === 0x7C/* | */ ? SCALAR_STYLE_LITERAL_BLOCK : SCALAR_STYLE_FOLDED_BLOCK\n  state.position++\n\n  while (state.input.charCodeAt(state.position) !== 0) {\n    const current = state.input.charCodeAt(state.position)\n    const digit = fromDecimalCode(current)\n\n    if (current === 0x2B/* + */ || current === 0x2D/* - */) {\n      if (chomping !== CHOMPING_CLIP) throwError(state, 'repeat of a chomping mode identifier')\n      chomping = current === 0x2B/* + */ ? CHOMPING_KEEP : CHOMPING_STRIP\n      state.position++\n    } else if (digit >= 0) {\n      if (digit === 0) {\n        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')\n      }\n      if (detectedIndent) throwError(state, 'repeat of an indentation width identifier')\n      indent = parentIndent + digit - 1\n      detectedIndent = true\n      state.position++\n    } else {\n      break\n    }\n  }\n\n  let hadWhitespace = false\n  while (isWhiteSpace(state.input.charCodeAt(state.position))) {\n    hadWhitespace = true\n    state.position++\n  }\n  if (hadWhitespace && state.input.charCodeAt(state.position) === 0x23/* # */) skipUntilLineEnd(state)\n\n  if (isEol(state.input.charCodeAt(state.position))) {\n    consumeLineBreak(state)\n  } else if (state.input.charCodeAt(state.position) !== 0) {\n    throwError(state, 'a line break is expected')\n  }\n\n  let contentIndent = detectedIndent ? indent : -1\n  let maxLeadingIndent = 0\n  const valueStart = state.position\n  let valueEnd = state.position\n\n  while (state.input.charCodeAt(state.position) !== 0) {\n    const linePosition = state.position\n    let column = 0\n\n    while (state.input.charCodeAt(linePosition + column) === 0x20/* Space */) column++\n\n    const first = state.input.charCodeAt(linePosition + column)\n    if (first === 0) {\n      // End of input acts as a line terminator, but there is no line break to\n      // include here. A final all-spaces line still counts: when the block has a\n      // content indent, the spaces beyond it are real content; in a wholly blank\n      // block (contentIndent < 0) the spaces form a blank line that chomping must\n      // see, exactly as it would if the line ended with a break. Capture the line\n      // in both cases; otherwise the block ends at the start of this empty line.\n      if (contentIndent >= 0) {\n        if (column > contentIndent) valueEnd = linePosition + column\n      } else if (column > 0) {\n        valueEnd = linePosition + column\n      }\n      break\n    }\n    if (linePosition === state.lineStart && testDocumentSeparator(state, linePosition)) break\n\n    if (!detectedIndent && contentIndent === -1 && isEol(first)) {\n      maxLeadingIndent = Math.max(maxLeadingIndent, column)\n    }\n\n    if (!detectedIndent && contentIndent === -1 && !isEol(first)) {\n      if (first === 0x09/* Tab */ && column < parentIndent) {\n        state.position = linePosition + column\n        throwError(state, 'tab characters must not be used in indentation')\n      }\n      if (column < maxLeadingIndent) {\n        state.position = linePosition + column\n        throwError(state, 'bad indentation of a mapping entry')\n      }\n    }\n\n    if (contentIndent === -1 && first !== 0 && !isEol(first) && column < parentIndent) {\n      state.lineIndent = column\n      state.position = linePosition + column\n      break\n    }\n\n    if (!detectedIndent && first !== 0 && !isEol(first) && contentIndent === -1) {\n      contentIndent = column\n    }\n\n    const requiredIndent = contentIndent === -1 ? parentIndent + 1 : contentIndent\n    if (first !== 0 && !isEol(first) && column < requiredIndent) {\n      state.lineIndent = column\n      state.position = linePosition + column\n      break\n    }\n\n    skipUntilLineEnd(state)\n    valueEnd = state.position\n    if (isEol(state.input.charCodeAt(state.position))) {\n      consumeLineBreak(state)\n      // Include the line break in the range so trailing blank lines are\n      // preserved. This is what lets cook tell apart an empty `|+` (range \"\",\n      // value \"\") from a `|+` with one blank line (range \"\\n\", value \"\\n\").\n      // De-indent and chomping are applied later in getScalarValue.\n      valueEnd = state.position\n    }\n  }\n\n  checkPrintable(state, valueStart, valueEnd)\n  addScalarEvent(\n    state,\n    valueStart,\n    valueEnd,\n    props.anchorStart,\n    props.anchorEnd,\n    props.tagStart,\n    props.tagEnd,\n    style,\n    chomping,\n    contentIndent\n  )\n  return true\n}\n\nfunction canStartPlainScalar (state: ParserState, nodeContext: NodeContext) {\n  const ch = state.input.charCodeAt(state.position)\n  const inFlow = nodeContext === CONTEXT_FLOW_IN\n\n  if (ch === 0 ||\n      isWsOrEol(ch) ||\n      ch === 0x23/* # */ ||\n      ch === 0x26/* & */ ||\n      ch === 0x2A/* * */ ||\n      ch === 0x21/* ! */ ||\n      ch === 0x7C/* | */ ||\n      ch === 0x3E/* > */ ||\n      ch === 0x27/* ' */ ||\n      ch === 0x22/* \" */ ||\n      ch === 0x25/* % */ ||\n      ch === 0x40/* @ */ ||\n      ch === 0x60/* ` */ ||\n      (inFlow && isFlowIndicator(ch))) {\n    return false\n  }\n\n  if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n    const following = state.input.charCodeAt(state.position + 1)\n    if (isWsOrEolOrEnd(following) || (inFlow && isFlowIndicator(following))) return false\n  }\n\n  return true\n}\n\nfunction readPlainScalar (state: ParserState, nodeIndent: number, nodeContext: NodeContext, props: NodeProperties) {\n  if (!canStartPlainScalar(state, nodeContext)) return false\n\n  const start = state.position\n  let end = state.position\n  let ch = state.input.charCodeAt(state.position)\n  const inFlow = nodeContext === CONTEXT_FLOW_IN\n  // A single-line plain scalar is sliceable verbatim: the parser already trims\n  // trailing whitespace from the range, so no folding is needed (see\n  // getScalarValue fast path). Folded line breaks make it non-simple.\n  let multiline = false\n\n  while (ch !== 0) {\n    if (state.position === state.lineStart && testDocumentSeparator(state)) break\n\n    if (ch === 0x3A/* : */) {\n      const following = state.input.charCodeAt(state.position + 1)\n      if (isWsOrEolOrEnd(following) || (inFlow && isFlowIndicator(following))) break\n    } else if (ch === 0x23/* # */) {\n      const preceding = state.input.charCodeAt(state.position - 1)\n      if (isWsOrEol(preceding)) break\n    } else if (inFlow && isFlowIndicator(ch)) {\n      break\n    } else if (isEol(ch)) {\n      const savedPosition = state.position\n      const savedLine = state.line\n      const savedLineStart = state.lineStart\n      const savedLineIndent = state.lineIndent\n\n      skipSeparationSpace(state, false)\n\n      if (state.lineIndent >= nodeIndent) {\n        multiline = true\n        ch = state.input.charCodeAt(state.position)\n        continue\n      }\n\n      state.position = savedPosition\n      state.line = savedLine\n      state.lineStart = savedLineStart\n      state.lineIndent = savedLineIndent\n      break\n    }\n\n    if (!isWhiteSpace(ch)) end = state.position + 1\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  if (end === start) return false\n\n  checkPrintable(state, start, end)\n  addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, SCALAR_STYLE_PLAIN, CHOMPING_CLIP, -1, !multiline)\n  return true\n}\n\nfunction findBlockMappingColon (state: ParserState) {\n  let position = state.position\n  let flowLevel = 0\n\n  while (position < state.length) {\n    const ch = state.input.charCodeAt(position)\n\n    if (isEol(ch)) return -1\n    if (ch === 0x23/* # */ && isWsOrEol(state.input.charCodeAt(position - 1))) return -1\n\n    if ((ch === 0x2A/* * */ || ch === 0x26/* & */) && position === state.position) {\n      do { position++ }\n      while (state.input.charCodeAt(position) !== 0 &&\n             !isWsOrEol(state.input.charCodeAt(position)) &&\n             !isFlowIndicator(state.input.charCodeAt(position)))\n      continue\n    }\n\n    if (ch === 0x5B/* [ */ || ch === 0x7B/* { */) {\n      flowLevel++\n    } else if (ch === 0x5D/* ] */ || ch === 0x7D/* } */) {\n      if (flowLevel > 0) flowLevel--\n    } else if (flowLevel === 0 && ch === 0x3A/* : */ && isWsOrEol(state.input.charCodeAt(position + 1))) {\n      return position\n    }\n\n    if ((flowLevel > 0 || position === state.position) &&\n        (ch === 0x27/* ' */ || ch === 0x22/* \" */)) {\n      const quote = ch\n      position++\n\n      while (position < state.length && state.input.charCodeAt(position) !== quote) {\n        if (state.input.charCodeAt(position) === 0x5C/* \\ */ && quote === 0x22/* \" */) position++\n        position++\n      }\n    }\n\n    position++\n  }\n\n  return -1\n}\n\nfunction skipFlowSeparationSpace (state: ParserState, nodeIndent: number) {\n  const startLine = state.line\n  skipSeparationSpace(state, true)\n\n  if ((state.line > startLine && state.lineIndent < nodeIndent) ||\n      (state.firstTabInLine !== -1 && state.lineIndent < nodeIndent)) {\n    throwError(state, 'deficient indentation')\n  }\n}\n\nfunction readFlowCollection (state: ParserState, nodeIndent: number, props: NodeProperties) {\n  const ch = state.input.charCodeAt(state.position)\n  const isMapping = ch === 0x7B/* { */\n  const start = state.position\n  let readNext = true\n\n  if (ch !== 0x5B/* [ */ && ch !== 0x7B/* { */) return false\n\n  const terminator = isMapping ? 0x7D/* } */ : 0x5D/* ] */\n\n  if (isMapping) {\n    addMappingEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE_FLOW)\n  } else {\n    addSequenceEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE_FLOW)\n  }\n\n  state.position++\n\n  while (state.input.charCodeAt(state.position) !== 0) {\n    skipFlowSeparationSpace(state, nodeIndent)\n\n    let ch = state.input.charCodeAt(state.position)\n\n    if (ch === terminator) {\n      state.position++\n      addPopEvent(state)\n      return true\n    } else if (!readNext) {\n      throwError(state, 'missed comma between flow collection entries')\n    } else if (ch === 0x2C/* , */) {\n      throwError(state, \"expected the node content, but found ','\")\n    }\n\n    let isPair = false\n    let isExplicitPair = false\n\n    if (ch === 0x3F/* ? */ && isWsOrEol(state.input.charCodeAt(state.position + 1))) {\n      isPair = isExplicitPair = true\n      state.position += 1\n      skipFlowSeparationSpace(state, nodeIndent)\n    }\n\n    const entryLine = state.line\n    const entryStart = snapshotState(state)\n\n    const keyWasRead = parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n    skipFlowSeparationSpace(state, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if ((isMapping || isExplicitPair || state.line === entryLine) && ch === 0x3A/* : */) {\n      isPair = true\n      state.position++\n      skipFlowSeparationSpace(state, nodeIndent)\n      if (!isMapping) {\n        restoreState(state, entryStart)\n        addMappingEvent(state, entryStart.position, NO_RANGE, NO_RANGE, NO_RANGE, NO_RANGE, COLLECTION_STYLE_FLOW)\n        if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) {\n          addEmptyScalarEvent(state)\n        }\n        skipFlowSeparationSpace(state, nodeIndent)\n        state.position++\n        skipFlowSeparationSpace(state, nodeIndent)\n      } else if (!keyWasRead) {\n        addEmptyScalarEvent(state)\n      }\n      if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) {\n        addEmptyScalarEvent(state)\n      }\n      skipFlowSeparationSpace(state, nodeIndent)\n      if (!isMapping) addPopEvent(state)\n    } else if (isMapping && isPair) {\n      if (!keyWasRead) addEmptyScalarEvent(state)\n      addEmptyScalarEvent(state)\n    } else if (isMapping) {\n      addEmptyScalarEvent(state)\n    } else if (isPair) {\n      restoreState(state, entryStart)\n      addMappingEvent(state, entryStart.position, NO_RANGE, NO_RANGE, NO_RANGE, NO_RANGE, COLLECTION_STYLE_FLOW)\n      parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n      addEmptyScalarEvent(state)\n      addPopEvent(state)\n    }\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (ch === 0x2C/* , */) {\n      readNext = true\n      state.position++\n    } else {\n      readNext = false\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a flow collection')\n}\n\nfunction readBlockSequence (state: ParserState, nodeIndent: number, props: NodeProperties) {\n  if (state.firstTabInLine !== -1 || state.input.charCodeAt(state.position) !== 0x2D/* - */ || !isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n    return false\n  }\n\n  addSequenceEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE_BLOCK)\n\n  while (state.input.charCodeAt(state.position) === 0x2D/* - */ && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n    if (state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    const entryLine = state.line\n    state.position++\n\n    const hadBreak = skipSeparationSpace(state, true) > 0\n    if (state.firstTabInLine !== -1 &&\n        state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n        isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n      throwError(state, 'bad indentation of a sequence entry')\n    }\n\n    if (hadBreak && state.lineIndent <= nodeIndent) {\n      addEmptyScalarEvent(state)\n    } else {\n      parseNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)\n    }\n\n    skipSeparationSpace(state, true)\n\n    if (state.lineIndent < nodeIndent || state.position >= state.length) break\n    if (state.lineIndent > nodeIndent) throwError(state, 'bad indentation of a sequence entry')\n    if (state.line === entryLine &&\n        state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n        isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {\n      throwError(state, 'bad indentation of a sequence entry')\n    }\n  }\n\n  addPopEvent(state)\n  return true\n}\n\nfunction readBlockMapping (state: ParserState, nodeIndent: number, flowIndent: number, props: NodeProperties) {\n  let atExplicitKey = false\n  let detected = false\n  let mappingOpened = false\n  let pendingExplicitKey = false\n\n  if (state.firstTabInLine !== -1) return false\n\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    if (!atExplicitKey && state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    const following = state.input.charCodeAt(state.position + 1)\n    const entryLine = state.line\n\n    if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEolOrEnd(following)) {\n      if (!mappingOpened) {\n        addMappingEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE_BLOCK)\n        mappingOpened = true\n      }\n\n      if (ch === 0x3F/* ? */) {\n        if (atExplicitKey) addEmptyScalarEvent(state)\n        detected = true\n        atExplicitKey = true\n      } else if (atExplicitKey) {\n        atExplicitKey = false\n      } else {\n        addEmptyScalarEvent(state)\n        detected = true\n        atExplicitKey = false\n      }\n\n      state.position += 1\n      pendingExplicitKey = true\n    } else {\n      // An explicit key awaiting its value, followed by an implicit key, means\n      // the explicit key's value is empty. Emit it now (append-only) so it is\n      // ordered before the implicit key node read just below.\n      if (atExplicitKey) {\n        addEmptyScalarEvent(state)\n        atExplicitKey = false\n      }\n\n      const beforeKey = snapshotState(state)\n\n      if (!parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n        break\n      }\n\n      if (state.line === entryLine) {\n        ch = state.input.charCodeAt(state.position)\n\n        while (isWhiteSpace(ch)) {\n          ch = state.input.charCodeAt(++state.position)\n        }\n\n        if (ch === 0x3A/* : */) {\n          ch = state.input.charCodeAt(++state.position)\n\n          if (!isWsOrEolOrEnd(ch)) {\n            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')\n          }\n\n          if (!mappingOpened) {\n            restoreState(state, beforeKey)\n            addMappingEvent(state, beforeKey.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE_BLOCK)\n            mappingOpened = true\n            // The key, the `:` and the space after it were already validated\n            // above, before the rollback. Re-reading the same input cannot\n            // fail, so just consume it again without error checks.\n            parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)\n\n            ch = state.input.charCodeAt(state.position)\n            while (isWhiteSpace(ch)) {\n              ch = state.input.charCodeAt(++state.position)\n            }\n\n            state.position++\n          }\n\n          detected = true\n          atExplicitKey = false\n          pendingExplicitKey = false\n        } else if (detected) {\n          throwError(state, \"expected ':' after a mapping key\")\n        } else {\n          // Not a mapping. If outer properties are pending, roll back so the\n          // caller re-reads this node with them attached (events are append-only).\n          if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n            restoreState(state, beforeKey)\n            return false\n          }\n          return true\n        }\n      } else if (detected) {\n        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')\n      } else {\n        if (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE) {\n          restoreState(state, beforeKey)\n          return false\n        }\n        return true\n      }\n    }\n\n    if (parseNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, pendingExplicitKey)) {\n      pendingExplicitKey = false\n    }\n\n    if (!atExplicitKey) {\n      if (pendingExplicitKey) {\n        addEmptyScalarEvent(state)\n        pendingExplicitKey = false\n      }\n    }\n\n    skipSeparationSpace(state, true)\n    ch = state.input.charCodeAt(state.position)\n\n    if ((state.line === entryLine || state.lineIndent > nodeIndent) && ch !== 0) {\n      throwError(state, 'bad indentation of a mapping entry')\n    } else if (state.lineIndent < nodeIndent) {\n      break\n    }\n  }\n\n  if (!detected) return false\n  if (atExplicitKey) addEmptyScalarEvent(state)\n  if (mappingOpened) addPopEvent(state)\n  return true\n}\n\nfunction parseNode (\n  state: ParserState,\n  parentIndent: number,\n  nodeContext: NodeContext,\n  allowToSeek: boolean,\n  allowCompact: boolean,\n  allowPropertyMapping = true\n): boolean {\n  if (state.depth >= state.maxDepth) {\n    throwError(state, `nesting exceeded maxDepth (${state.maxDepth})`)\n  }\n\n  state.depth++\n\n  let indentStatus = 1\n  let atNewLine = false\n  let hasContent = false\n  let propertyStart: ParserSnapshot | null = null\n  const props = emptyProperties()\n\n  let allowBlockScalars = nodeContext === CONTEXT_BLOCK_OUT || nodeContext === CONTEXT_BLOCK_IN\n  let allowBlockCollections = allowBlockScalars\n  const allowBlockStyles = allowBlockScalars\n\n  if (allowToSeek && skipSeparationSpace(state, true)) {\n    atNewLine = true\n\n    if (state.lineIndent > parentIndent) {\n      indentStatus = 1\n    } else if (state.lineIndent === parentIndent) {\n      indentStatus = 0\n    } else {\n      indentStatus = -1\n    }\n  }\n\n  if (state.position === state.lineStart && testDocumentSeparator(state)) {\n    state.depth--\n    return false\n  }\n\n  if (indentStatus === 1) {\n    while (true) {\n      const ch = state.input.charCodeAt(state.position)\n      const propertyState = snapshotState(state)\n\n      if (atNewLine &&\n          indentStatus !== 1 &&\n          (ch === 0x21/* ! */ || ch === 0x26/* & */)) {\n        break\n      }\n\n      if (atNewLine &&\n          allowBlockStyles &&\n          (props.tagStart !== NO_RANGE || props.anchorStart !== NO_RANGE) &&\n          (ch === 0x21/* ! */ || ch === 0x26/* & */)) {\n        const fallbackState = snapshotState(state)\n        const flowIndent = parentIndent + 1\n        const mappingIndent = state.position - state.lineStart\n\n        if (readBlockMapping(state, mappingIndent, flowIndent, props) &&\n            state.events[fallbackState.eventsLength]?.type === EVENT_MAPPING) {\n          state.depth--\n          return true\n        }\n\n        restoreState(state, fallbackState)\n      }\n\n      if (atNewLine &&\n          ((ch === 0x21/* ! */ && props.tagStart !== NO_RANGE) ||\n           (ch === 0x26/* & */ && props.anchorStart !== NO_RANGE))) {\n        break\n      }\n\n      if (!readTagProperty(state, props, nodeContext === CONTEXT_FLOW_IN) && !readAnchorProperty(state, props)) {\n        break\n      }\n\n      if (propertyStart === null) propertyStart = propertyState\n\n      if (skipSeparationSpace(state, true)) {\n        atNewLine = true\n        allowBlockCollections = allowBlockStyles\n\n        if (state.lineIndent > parentIndent) {\n          indentStatus = 1\n        } else if (state.lineIndent === parentIndent) {\n          indentStatus = 0\n        } else {\n          indentStatus = -1\n        }\n      } else {\n        allowBlockCollections = false\n      }\n    }\n  }\n\n  if (allowBlockCollections) {\n    allowBlockCollections = atNewLine || allowCompact\n  }\n\n  if (indentStatus === 1 || nodeContext === CONTEXT_BLOCK_OUT) {\n    const flowIndent = nodeContext === CONTEXT_FLOW_IN || nodeContext === CONTEXT_FLOW_OUT\n      ? parentIndent\n      : parentIndent + 1\n    const blockIndent = state.position - state.lineStart\n\n    if (indentStatus === 1) {\n      if ((allowBlockCollections &&\n          (readBlockSequence(state, blockIndent, props) ||\n           readBlockMapping(state, blockIndent, flowIndent, props))) ||\n          readFlowCollection(state, flowIndent, props)) {\n        hasContent = true\n      } else {\n        const ch = state.input.charCodeAt(state.position)\n\n        if (propertyStart !== null && allowPropertyMapping && allowBlockStyles && !allowBlockCollections &&\n            ch !== 0x7C/* | */ && ch !== 0x3E/* > */) {\n          const fallbackState = snapshotState(state)\n          const propertyIndent = propertyStart.position - propertyStart.lineStart\n\n          restoreState(state, propertyStart)\n\n          if (readBlockMapping(state, propertyIndent, flowIndent, emptyProperties()) &&\n              state.events[fallbackState.eventsLength]?.type === EVENT_MAPPING) {\n            hasContent = true\n          } else {\n            restoreState(state, fallbackState)\n          }\n        }\n\n        if (!hasContent &&\n            ((allowBlockScalars && readBlockScalar(state, flowIndent, props)) ||\n             readSingleQuotedScalar(state, flowIndent, props) ||\n             readDoubleQuotedScalar(state, flowIndent, props) ||\n             readAlias(state, props) ||\n             readPlainScalar(state, flowIndent, nodeContext, props))) {\n          hasContent = true\n        }\n      }\n    } else if (indentStatus === 0) {\n      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent, props)\n    }\n  }\n\n  allowBlockScalars = allowBlockScalars && !hasContent\n\n  if (!hasContent && (props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE || allowBlockScalars)) {\n    addScalarEvent(\n      state,\n      NO_RANGE,\n      NO_RANGE,\n      props.anchorStart,\n      props.anchorEnd,\n      props.tagStart,\n      props.tagEnd,\n      SCALAR_STYLE_PLAIN\n    )\n    hasContent = true\n  }\n\n  state.depth--\n  return hasContent || props.anchorStart !== NO_RANGE || props.tagStart !== NO_RANGE\n}\n\nfunction readDirective (state: ParserState) {\n  if (state.lineIndent > 0 || state.input.charCodeAt(state.position) !== 0x25/* % */) return false\n\n  state.position++\n  const nameStart = state.position\n\n  while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++\n\n  const name = state.input.slice(nameStart, state.position)\n  const args: string[] = []\n\n  if (name.length === 0) throwError(state, 'directive name must not be less than one character in length')\n\n  while (state.input.charCodeAt(state.position) !== 0 && !isEol(state.input.charCodeAt(state.position))) {\n    while (isWhiteSpace(state.input.charCodeAt(state.position))) state.position++\n    if (state.input.charCodeAt(state.position) === 0x23/* # */ || isEol(state.input.charCodeAt(state.position)) || state.input.charCodeAt(state.position) === 0) break\n\n    const start = state.position\n    while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++\n    args.push(state.input.slice(start, state.position))\n  }\n\n  if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state)\n\n  if (name === 'YAML') {\n    if (state.directives.some(directive => directive.kind === 'yaml')) throwError(state, 'duplication of %YAML directive')\n    if (args.length !== 1) throwError(state, 'YAML directive accepts exactly one argument')\n\n    const match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0])\n    if (match === null) throwError(state, 'ill-formed argument of the YAML directive')\n    if (parseInt(match[1], 10) !== 1) throwError(state, 'unacceptable YAML version of the document')\n\n    state.directives.push({ kind: 'yaml', version: args[0] })\n  } else if (name === 'TAG') {\n    if (args.length !== 2) throwError(state, 'TAG directive accepts exactly two arguments')\n\n    const [handle, prefix] = args\n    if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')\n    if (HAS_OWN.call(state.tagHandlers, handle)) throwError(state, `there is a previously declared suffix for \"${handle}\" tag handle`)\n    if (!PATTERN_TAG_PREFIX.test(prefix)) throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')\n    try {\n      decodeURIComponent(prefix)\n    } catch {\n      throwError(state, `tag prefix is malformed: ${prefix}`)\n    }\n\n    state.tagHandlers[handle] = prefix\n    state.directives.push({ kind: 'tag', handle, prefix })\n  }\n\n  return true\n}\n\nfunction readDocument (state: ParserState) {\n  state.directives = []\n  state.tagHandlers = Object.create(null)\n  let hasDirectives = false\n\n  skipSeparationSpace(state, true)\n\n  while (readDirective(state)) {\n    hasDirectives = true\n    skipSeparationSpace(state, true)\n  }\n\n  let explicitStart = false\n  let explicitEnd = false\n  let allowCompact = true\n\n  if (state.lineIndent === 0 &&\n      state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 2) === 0x2D/* - */ &&\n      isWsOrEolOrEnd(state.input.charCodeAt(state.position + 3))) {\n    explicitStart = true\n    const markerLine = state.line\n    state.position += 3\n    skipSeparationSpace(state, true)\n    allowCompact = state.line > markerLine\n  } else if (hasDirectives) {\n    throwError(state, 'directives end mark is expected')\n  }\n\n  const documentEventIndex = state.events.length\n  if (!explicitStart &&\n      state.position === state.lineStart &&\n      state.input.charCodeAt(state.position) === 0x2E/* . */ &&\n      testDocumentSeparator(state)) {\n    state.position += 3\n    skipSeparationSpace(state, true)\n    return\n  }\n\n  addDocumentEvent(state, explicitStart, false)\n  if (!parseNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, allowCompact, allowCompact)) {\n    addEmptyScalarEvent(state)\n  }\n  skipSeparationSpace(state, true)\n\n  if (state.position === state.lineStart && testDocumentSeparator(state)) {\n    explicitEnd = state.input.charCodeAt(state.position) === 0x2E/* . */\n    if (explicitEnd) {\n      const markerLine = state.line\n      state.position += 3\n      skipSeparationSpace(state, true)\n      if (state.line === markerLine && state.position < state.length) {\n        throwError(state, 'end of the stream or a document separator is expected')\n      }\n    }\n  }\n\n  const documentEvent = state.events[documentEventIndex]\n  if (documentEvent?.type === EVENT_DOCUMENT) documentEvent.explicitEnd = explicitEnd\n\n  addPopEvent(state)\n\n  if (!explicitEnd &&\n      state.position < state.length &&\n      !(state.position === state.lineStart && testDocumentSeparator(state))) {\n    throwError(state, 'end of the stream or a document separator is expected')\n  }\n}\n\nfunction parseEvents (input: string, options: ParserOptions): Event[] {\n  const length = input.length\n  const state: ParserState = {\n    ...DEFAULT_PARSER_OPTIONS,\n    ...options,\n    input: `${input}\\0`,\n    length,\n    position: 0,\n    line: 0,\n    lineStart: 0,\n    lineIndent: 0,\n    firstTabInLine: -1,\n    depth: 0,\n    directives: [],\n    tagHandlers: Object.create(null),\n    events: []\n  }\n\n  const nullpos = input.indexOf('\\0')\n  if (nullpos !== -1) throwErrorAt(input, nullpos, 'null byte is not allowed in input', state.filename)\n\n  if (state.input.charCodeAt(state.position) === 0xFEFF) state.position++\n\n  while (state.position < state.length) {\n    skipSeparationSpace(state, true)\n    if (state.position >= state.length) break\n    const documentStart = state.position\n    readDocument(state)\n    if (state.position === documentStart) {\n      // Internal progress guard: if readDocument() ever returns without\n      // consuming input, stop here instead of looping forever.\n      /* c8 ignore next */\n      throwError(state, 'can not read a document')\n    }\n  }\n\n  return state.events\n}\n\nexport {\n  parseEvents,\n  DEFAULT_PARSER_OPTIONS,\n  type ParserOptions\n}\n","import { YAMLException } from './common/exception.ts'\nimport { pick } from './common/object.ts'\nimport {\n  constructFromEvents,\n  DEFAULT_CONSTRUCTOR_OPTIONS,\n  type ConstructorOptions\n} from './parser/constructor.ts'\nimport {\n  parseEvents,\n  DEFAULT_PARSER_OPTIONS,\n  type ParserOptions\n} from './parser/parser.ts'\n\n// `source` is supplied by `loadDocuments` itself, not by the public caller.\ninterface LoadOptions extends ParserOptions, Omit<ConstructorOptions, 'source'> {}\n\ntype LoadAllIterator = (document: unknown) => void\n\nconst DEFAULT_LOAD_OPTIONS: Required<LoadOptions> = {\n  ...DEFAULT_PARSER_OPTIONS,\n  ...DEFAULT_CONSTRUCTOR_OPTIONS\n}\n\nfunction loadDocuments (input: string, options: LoadOptions = {}) {\n  const opts = { ...DEFAULT_LOAD_OPTIONS, ...options }\n  const source = String(input)\n\n  const PARSER_OPT_KEYS = Object.keys(DEFAULT_PARSER_OPTIONS) as\n    (keyof typeof DEFAULT_PARSER_OPTIONS)[]\n  const CONSTRUCTOR_OPT_KEYS = Object.keys(DEFAULT_CONSTRUCTOR_OPTIONS) as\n    (keyof typeof DEFAULT_CONSTRUCTOR_OPTIONS)[]\n\n  const events = parseEvents(source, pick(opts, PARSER_OPT_KEYS))\n  return constructFromEvents(events, { ...pick(opts, CONSTRUCTOR_OPT_KEYS), source })\n}\n\n// Signatures with iterator are deprecated. Will be removed in the next versions.\nfunction loadAll (input: string, options?: LoadOptions): unknown[]\nfunction loadAll (input: string, iterator: null, options?: LoadOptions): unknown[]\nfunction loadAll (input: string, iterator: LoadAllIterator, options?: LoadOptions): void\nfunction loadAll (\n  input: string,\n  iteratorOrOptions?: LoadAllIterator | LoadOptions | null,\n  options?: LoadOptions\n) {\n  let iterator: LoadAllIterator | null = null\n\n  if (typeof iteratorOrOptions === 'function') {\n    iterator = iteratorOrOptions\n  } else if (iteratorOrOptions !== null && typeof iteratorOrOptions === 'object') {\n    options = iteratorOrOptions\n  }\n\n  const documents = loadDocuments(input, options)\n\n  if (iterator === null) return documents\n  for (const document of documents) iterator(document)\n}\n\nfunction load (input: string, options?: LoadOptions) {\n  const documents = loadDocuments(input, options)\n\n  if (documents.length === 0) throw new YAMLException('expected a document, but the input is empty')\n  if (documents.length === 1) return documents[0]\n\n  throw new YAMLException('expected a single document in the stream, but found more')\n}\n\nexport {\n  load,\n  loadAll,\n  type LoadOptions\n}\n","// Plain-object discriminated union shared by the dumper (built by `jsToAst`,\n// rendered by the presenter) and, later, by load. Behaviour lives in the walkers,\n// not on the nodes.\n\nimport { type DocumentDirective } from '../parser/events.ts'\n\nclass Style {\n  tagged = false\n  flow = false\n  singleQuoted = false\n  doubleQuoted = false\n  literal = false\n  folded = false\n}\n\ninterface NodeBase {\n  // YAML tag. Untagged nodes carry the semantic resolved tag; tagged nodes carry\n  // the printable/verbatim tag spelling.\n  tag: string\n  style: Style\n  anchor?: string\n\n  // Reserved for the formatting layer; not populated by the dumper yet.\n  commentBefore?: string\n  comment?: string\n  commentAfter?: string\n  blankBefore?: number\n}\n\ninterface ScalarNode extends NodeBase {\n  kind: 'scalar'\n  value: string\n}\n\ninterface SequenceNode extends NodeBase {\n  kind: 'sequence'\n  items: Node[]\n}\n\ninterface MappingNode extends NodeBase {\n  kind: 'mapping'\n  items: Array<{ key: Node, value: Node }>\n}\n\ninterface AliasNode extends NodeBase {\n  kind: 'alias'\n  // The anchor name this alias points at (`*name`).\n  anchor: string\n}\n\ntype Node = ScalarNode | SequenceNode | MappingNode | AliasNode\n\n// The layer above `Node`: each document wraps one content node plus its own\n// markers/directives. Not a member of `Node` — the fields differ. Document\n// directives are ordered presentation data.\ninterface Document {\n  contents: Node | null            // null = empty document\n  explicitStart?: boolean          // print '---'\n  explicitEnd?: boolean            // print '...'\n  directives: DocumentDirective[]\n}\n\nexport {\n  Style,\n\n  type Node,\n  type Document,\n  type NodeBase,\n  type ScalarNode,\n  type SequenceNode,\n  type MappingNode,\n  type AliasNode\n}\n","// JS value graph → AST. Knows tags (`identify` / `represent`). A single\n// identity-`Map` walk handles dedup: a repeat occurrence of an object (including\n// a cycle) becomes an `alias`, and the first occurrence gets an `anchor`.\n\nimport { YAMLException } from '../common/exception.ts'\nimport { type Schema } from '../schema.ts'\nimport { type TagDefinition } from '../tag.ts'\nimport { tagNameShort } from '../common/tagname.ts'\nimport {\n  Style,\n  type Document,\n  type Node,\n  type ScalarNode,\n  type SequenceNode,\n  type MappingNode\n} from './nodes.ts'\n\ninterface FromJsOptions {\n  noRefs?: boolean\n  skipInvalid?: boolean\n}\n\n// A match candidate. `implicitTag` means the tag is not printed (implicit\n// scalars and the default str/seq/map tags).\ninterface RepresentType {\n  tag: TagDefinition\n  implicitTag: boolean\n}\n\n// Returned by `build` when no tag matched.\nconst INVALID = Symbol('INVALID')\n\ninterface FromJsState {\n  representTypes: RepresentType[]\n  noRefs: boolean\n  skipInvalid: boolean\n\n  // Already-built collection values → their node, for anchor/alias dedup.\n  refs: Map<unknown, Node>\n  refCounter: number\n}\n\nfunction buildRepresentTypes (schema: Schema): RepresentType[] {\n  const defaultTags = new Set<TagDefinition>([\n    schema.defaultScalarTag,\n    schema.defaultSequenceTag,\n    schema.defaultMappingTag\n  ].filter((t): t is TagDefinition => t !== undefined))\n\n  // Default container/str tags go last so a more specific tag identifying the\n  // same JS value (e.g. a custom tag on a plain object) wins.\n  const implicitScalars = schema.implicitScalarTags\n  const explicitTags = schema.tags.filter(t =>\n    !(t.nodeKind === 'scalar' && t.implicit) && !defaultTags.has(t))\n  const defaultTagsLast = schema.tags.filter(t => defaultTags.has(t))\n\n  return [\n    ...implicitScalars.map(tag => ({ tag, implicitTag: true })),\n    ...explicitTags.map(tag => ({ tag, implicitTag: false })),\n    ...defaultTagsLast.map(tag => ({ tag, implicitTag: true }))\n  ]\n}\n\n// First tag whose `identify` accepts `object`.\nfunction matchTag (state: FromJsState, object: unknown): { tag: TagDefinition, tagName: string, implicitTag: boolean } | null {\n  for (let index = 0, length = state.representTypes.length; index < length; index += 1) {\n    const { tag, implicitTag } = state.representTypes[index]\n\n    if (tag.identify && tag.identify(object)) {\n      let tagName: string\n      if (tag.matchByTagPrefix && tag.representTagName) {\n        tagName = tag.representTagName(object)\n      } else {\n        tagName = tag.tagName\n      }\n      return { tag, tagName, implicitTag }\n    }\n  }\n\n  return null\n}\n\n// Build a node for `object`, or INVALID when no tag matches. `undefined` never\n// throws (caller decides: null in a sequence, skip in a mapping, '' at root);\n// any other unrepresentable value throws unless `skipInvalid`.\nfunction build (state: FromJsState, object: unknown): Node | typeof INVALID {\n  if (!state.noRefs && object !== null && typeof object === 'object') {\n    const existing = state.refs.get(object)\n    if (existing) {\n      if (existing.anchor === undefined) existing.anchor = `ref_${state.refCounter++}`\n      return { kind: 'alias', tag: '', style: new Style(), anchor: existing.anchor }\n    }\n  }\n\n  const matched = matchTag(state, object)\n\n  if (!matched) {\n    if (object === undefined) return INVALID\n    if (state.skipInvalid) return INVALID\n    throw new YAMLException(`unacceptable kind of an object to dump ${Object.prototype.toString.call(object)}`)\n  }\n\n  const { tag, tagName, implicitTag } = matched\n  const nodeTagName = implicitTag ? tagName : tagNameShort(tagName)\n\n  if (tag.nodeKind === 'scalar') {\n    const style = new Style()\n    style.tagged = !implicitTag\n    const node: ScalarNode = {\n      kind: 'scalar',\n      tag: nodeTagName,\n      style,\n      value: tag.represent(object)\n    }\n    return node\n  }\n\n  if (tag.nodeKind === 'sequence') {\n    const container = tag.represent(object)\n    const style = new Style()\n    style.tagged = !implicitTag\n    const node: SequenceNode = { kind: 'sequence', tag: nodeTagName, style, items: [] }\n    if (!state.noRefs) state.refs.set(object, node)\n\n    for (let index = 0, length = container.length; index < length; index += 1) {\n      let item = build(state, container[index])\n      // An invalid element becomes null; a still-invalid null then skips/throws.\n      if (item === INVALID && container[index] === undefined) item = build(state, null)\n      if (item === INVALID) continue\n      node.items.push(item)\n    }\n    return node\n  }\n\n  // mapping — the canonical form is always a `Map`.\n  const map = tag.represent(object)\n  const style = new Style()\n  style.tagged = !implicitTag\n  const node: MappingNode = { kind: 'mapping', tag: nodeTagName, style, items: [] }\n  if (!state.noRefs) state.refs.set(object, node)\n\n  for (const [objectKey, objectValue] of map) {\n    const key = build(state, objectKey)\n    if (key === INVALID) continue // invalid key skips the pair\n    const value = build(state, objectValue)\n    if (value === INVALID) continue // invalid value skips the pair\n    node.items.push({ key, value })\n  }\n  return node\n}\n\n// A JS value is one YAML document. An unrepresentable root becomes an empty\n// document, which the presenter renders as an empty string.\nfunction jsToAst (input: unknown, schema: Schema, options: FromJsOptions = {}): Document[] {\n  const state: FromJsState = {\n    representTypes: buildRepresentTypes(schema),\n    noRefs: options.noRefs ?? false,\n    skipInvalid: options.skipInvalid ?? false,\n    refs: new Map(),\n    refCounter: 0\n  }\n\n  const root = build(state, input)\n  return [{ contents: root === INVALID ? null : root, directives: [] }]\n}\n\nexport {\n  jsToAst,\n  type FromJsOptions\n}\n","// Depth-first AST traversal. Mirrors the `kind` walk of the presenter and the\n// `from_*` builders, but stays read-oriented: nodes are plain objects, so a\n// visitor mutates them in place. Control signals let it prune or stop the walk.\n\nimport {\n  type Node,\n  type Document\n} from './nodes.ts'\n\n// Returned by a visitor to control the walk; anything else (incl. `undefined`)\n// descends as usual.\nconst VISIT_BREAK = Symbol('visit:break') // stop the whole traversal\nconst VISIT_SKIP = Symbol('visit:skip')   // don't descend into this node's children\n\ntype VisitControl = typeof VISIT_BREAK | typeof VISIT_SKIP | undefined | void\n\n// Traversal-derived position of the current node. Kept off the node itself: a\n// node may sit in several places (alias/dedup reuse), so depth/role belong to\n// the walk, not the node. `parent.kind` + `isKey` pin the exact slot.\ninterface VisitContext {\n  depth: number        // 0 = document content root\n  parent: Node | null  // enclosing sequence/mapping, null at the root\n  isKey: boolean       // node sits in a mapping key position\n}\n\ntype Visitor = (node: Node, ctx: VisitContext) => VisitControl\n\n// Returns `true` once `VISIT_BREAK` was seen, so callers can unwind the walk.\nfunction visitNode (node: Node, visitor: Visitor, ctx: VisitContext): boolean {\n  const control = visitor(node, ctx)\n  if (control === VISIT_BREAK) return true\n  if (control === VISIT_SKIP) return false\n\n  const depth = ctx.depth + 1\n\n  switch (node.kind) {\n    case 'sequence':\n      for (const item of node.items) {\n        if (visitNode(item, visitor, { depth, parent: node, isKey: false })) return true\n      }\n      break\n    case 'mapping':\n      for (const { key, value } of node.items) {\n        if (visitNode(key, visitor, { depth, parent: node, isKey: true })) return true\n        if (visitNode(value, visitor, { depth, parent: node, isKey: false })) return true\n      }\n      break\n  }\n\n  return false\n}\n\n// Walk every node in the documents, calling `visitor` once per node (pre-order).\nfunction visit (documents: Document[], visitor: Visitor): void {\n  for (const doc of documents) {\n    if (doc.contents && visitNode(doc.contents, visitor, { depth: 0, parent: null, isKey: false })) return\n  }\n}\n\nexport {\n  visit,\n  VISIT_BREAK,\n  VISIT_SKIP,\n  type Visitor,\n  type VisitContext\n}\n","// AST → text. Walks the node `kind`; the scalar machinery (style selection,\n// quoting, folding) is driven by node text, not by sniffing a JS value.\n\nimport { YAMLException } from '../common/exception.ts'\nimport { tagNameShort } from '../common/tagname.ts'\nimport { type Schema } from '../schema.ts'\nimport { NOT_RESOLVED, type ScalarTagDefinition } from '../tag.ts'\nimport {\n  type Node,\n  type Document,\n  type ScalarNode,\n  type SequenceNode,\n  type MappingNode\n} from './nodes.ts'\n\nconst CHAR_BOM = 0xFEFF\nconst CHAR_TAB = 0x09 /* Tab */\nconst CHAR_LINE_FEED = 0x0A /* LF */\nconst CHAR_CARRIAGE_RETURN = 0x0D /* CR */\nconst CHAR_SPACE = 0x20 /* Space */\nconst CHAR_EXCLAMATION = 0x21 /* ! */\nconst CHAR_DOUBLE_QUOTE = 0x22 /* \" */\nconst CHAR_SHARP = 0x23 /* # */\nconst CHAR_PERCENT = 0x25 /* % */\nconst CHAR_AMPERSAND = 0x26 /* & */\nconst CHAR_SINGLE_QUOTE = 0x27 /* ' */\nconst CHAR_ASTERISK = 0x2A /* * */\nconst CHAR_COMMA = 0x2C /* , */\nconst CHAR_MINUS = 0x2D /* - */\nconst CHAR_COLON = 0x3A /* : */\nconst CHAR_EQUALS = 0x3D /* = */\nconst CHAR_GREATER_THAN = 0x3E /* > */\nconst CHAR_QUESTION = 0x3F /* ? */\nconst CHAR_COMMERCIAL_AT = 0x40 /* @ */\nconst CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */\nconst CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */\nconst CHAR_GRAVE_ACCENT = 0x60 /* ` */\nconst CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */\nconst CHAR_VERTICAL_LINE = 0x7C /* | */\nconst CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */\n\nconst ESCAPE_SEQUENCES: Record<number, string> = {}\n\nESCAPE_SEQUENCES[0x00] = '\\\\0'\nESCAPE_SEQUENCES[0x07] = '\\\\a'\nESCAPE_SEQUENCES[0x08] = '\\\\b'\nESCAPE_SEQUENCES[0x09] = '\\\\t'\nESCAPE_SEQUENCES[0x0A] = '\\\\n'\nESCAPE_SEQUENCES[0x0B] = '\\\\v'\nESCAPE_SEQUENCES[0x0C] = '\\\\f'\nESCAPE_SEQUENCES[0x0D] = '\\\\r'\nESCAPE_SEQUENCES[0x1B] = '\\\\e'\nESCAPE_SEQUENCES[0x22] = '\\\\\"'\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\'\nESCAPE_SEQUENCES[0x85] = '\\\\N'\nESCAPE_SEQUENCES[0xA0] = '\\\\_'\nESCAPE_SEQUENCES[0x2028] = '\\\\L'\nESCAPE_SEQUENCES[0x2029] = '\\\\P'\n\ninterface PresenterOptions {\n  schema: Schema\n  indent?: number\n  seqNoIndent?: boolean\n  seqInlineFirst?: boolean\n  sortKeys?: boolean | ((a: any, b: any) => number)\n  lineWidth?: number\n  flowBracketPadding?: boolean\n  flowSkipCommaSpace?: boolean\n  flowSkipColonSpace?: boolean\n  quoteFlowKeys?: boolean\n  quoteStyle?: 'single' | 'double'\n  forceQuotes?: boolean\n  tagBeforeAnchor?: boolean\n}\n\nconst DEFAULT_PRESENTER_OPTIONS: Required<Omit<PresenterOptions, 'schema'>> = {\n  indent: 2,\n  seqNoIndent: false,\n  seqInlineFirst: true,\n  sortKeys: false,\n  lineWidth: 80,\n  flowBracketPadding: false,\n  flowSkipCommaSpace: false,\n  flowSkipColonSpace: false,\n  quoteFlowKeys: false,\n  quoteStyle: 'single',\n  forceQuotes: false,\n  tagBeforeAnchor: false\n}\n\ninterface PresenterState extends Required<PresenterOptions> {\n  defaultScalarTagName: string\n  implicitResolvers: readonly ScalarTagDefinition[]\n}\n\nfunction nodeTagShort (node: Node) {\n  return node.style.tagged ? node.tag : tagNameShort(node.tag)\n}\n\nfunction createPresenterState (options: PresenterOptions): PresenterState {\n  const opts = {\n    ...DEFAULT_PRESENTER_OPTIONS,\n    ...options\n  }\n\n  return {\n    ...opts,\n    defaultScalarTagName: opts.schema.defaultScalarTag.tagName,\n    implicitResolvers: opts.schema.implicitScalarTags\n  }\n}\n\nfunction encodeNonPrintable (character: number) {\n  // YAML non-printable code points are all in BMP (max FFFF);\n  // astral code points are printable and can't come here.\n  const string = character.toString(16).toUpperCase()\n  const handle = character <= 0xFF ? 'x' : 'u'\n  const length = character <= 0xFF ? 2 : 4\n\n  return `\\\\${handle}${'0'.repeat(length - string.length)}${string}`\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString (string: string, spaces: number) {\n  const ind = ' '.repeat(spaces)\n  let position = 0\n  let result = ''\n  const length = string.length\n\n  while (position < length) {\n    let line\n    const next = string.indexOf('\\n', position)\n    if (next === -1) {\n      line = string.slice(position)\n      position = length\n    } else {\n      line = string.slice(position, next + 1)\n      position = next + 1\n    }\n\n    if (line.length && line !== '\\n') result += ind\n\n    result += line\n  }\n\n  return result\n}\n\nfunction generateNextLine (state: PresenterState, level: number) {\n  return `\\n${' '.repeat(state.indent * level)}`\n}\n\n// Indentation/width numbers that govern how a scalar lays out at `level`.\n// Scalar-only: collections compute their own indent via `generateNextLine`.\n//   indent      - spaces prepended to the scalar's content (block styles)\n//   blockIndent - the block indentation indicator digit (`|2` / `>2`); at the\n//                 document root (level 0) it is one greater than the spaces we\n//                 actually prepend (reader applies it relative to parent n = -1)\n//   lineWidth   - fold width at this depth, shrinking monotonically toward\n//                 min(state.lineWidth, 40) as indentation deepens; -1 = no limit\nfunction scalarLayout (state: PresenterState, level: number) {\n  const indent = state.indent * Math.max(1, level) // no 0-indent scalars\n  const blockIndent = level === 0 ? state.indent + 1 : state.indent\n  const lineWidth = (state.lineWidth === -1)\n    ? -1\n    : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)\n\n  return { indent, blockIndent, lineWidth }\n}\n\nfunction resolveImplicitTag (state: PresenterState, str: string) {\n  for (let index = 0, length = state.implicitResolvers.length; index < length; index += 1) {\n    const tagDefinition = state.implicitResolvers[index]\n\n    if (tagDefinition.resolve(str, false, tagDefinition.tagName) !== NOT_RESOLVED) {\n      return tagDefinition.tagName\n    }\n  }\n\n  return state.defaultScalarTagName\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace (c: number) {\n  return c === CHAR_SPACE || c === CHAR_TAB\n}\n\n// Mirrors parser.testDocumentSeparator(): `---` and `...` are document\n// markers when followed by separation whitespace, a line break, or EOF.\nfunction startsWithDocumentSeparator (string: string) {\n  const marker = string.charCodeAt(0)\n\n  if ((marker !== CHAR_MINUS && marker !== 0x2E/* . */) ||\n      string.charCodeAt(1) !== marker || string.charCodeAt(2) !== marker) return false\n\n  if (string.length === 3) return true\n\n  const following = string.charCodeAt(3)\n  return isWhitespace(following) ||\n    following === CHAR_CARRIAGE_RETURN || following === CHAR_LINE_FEED\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable (c: number) {\n  return (c >= 0x00020 && c <= 0x00007E) ||\n    ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||\n    ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||\n    (c >= 0x10000 && c <= 0x10FFFF)\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char  ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace (c: number) {\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    // - b-char\n    c !== CHAR_CARRIAGE_RETURN &&\n    c !== CHAR_LINE_FEED\n}\n\n// [127]  ns-plain-safe(c) ::= c = flow-out  ⇒ ns-plain-safe-out\n//                             c = flow-in   ⇒ ns-plain-safe-in\n//                             c = block-key ⇒ ns-plain-safe-out\n//                             c = flow-key  ⇒ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129]  ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130]  ns-plain-char(c) ::=  ( ns-plain-safe(c) - “:” - “#” )\n//                            | ( /* An ns-char preceding */ “#” )\n//                            | ( “:” /* Followed by an ns-plain-safe(c) */ )\n// `prev` is the previous code point, or -1 when `c` is the first character\n// (no preceding character). -1 is not a valid code point, so it can never\n// collide with a real one and safely disables the prev-dependent cases below.\nfunction isPlainSafe (c: number, prev: number, inblock: boolean) {\n  const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)\n  const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)\n  return (\n    (\n      // ns-plain-safe\n      inblock // c = flow-in\n        ? cIsNsCharOrWhitespace\n        : cIsNsCharOrWhitespace &&\n          // - c-flow-indicator\n          c !== CHAR_COMMA &&\n          c !== CHAR_LEFT_SQUARE_BRACKET &&\n          c !== CHAR_RIGHT_SQUARE_BRACKET &&\n          c !== CHAR_LEFT_CURLY_BRACKET &&\n          c !== CHAR_RIGHT_CURLY_BRACKET\n    ) &&\n    // ns-plain-char\n    c !== CHAR_SHARP && // false on '#'\n    !(prev === CHAR_COLON && !cIsNsChar)\n  ) || // false on ': '\n  (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'\n  (prev === CHAR_COLON && cIsNsChar) // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst (c: number) {\n  // Uses a subset of ns-char - c-indicator\n  // where ns-char = nb-char - s-white.\n  // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    !isWhitespace(c) && // - s-white\n    // - (c-indicator ::=\n    // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n    c !== CHAR_MINUS &&\n    c !== CHAR_QUESTION &&\n    c !== CHAR_COLON &&\n    c !== CHAR_COMMA &&\n    c !== CHAR_LEFT_SQUARE_BRACKET &&\n    c !== CHAR_RIGHT_SQUARE_BRACKET &&\n    c !== CHAR_LEFT_CURLY_BRACKET &&\n    c !== CHAR_RIGHT_CURLY_BRACKET &&\n    // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n    c !== CHAR_SHARP &&\n    c !== CHAR_AMPERSAND &&\n    c !== CHAR_ASTERISK &&\n    c !== CHAR_EXCLAMATION &&\n    c !== CHAR_VERTICAL_LINE &&\n    c !== CHAR_EQUALS &&\n    c !== CHAR_GREATER_THAN &&\n    c !== CHAR_SINGLE_QUOTE &&\n    c !== CHAR_DOUBLE_QUOTE &&\n    // | “%” | “@” | “`”)\n    c !== CHAR_PERCENT &&\n    c !== CHAR_COMMERCIAL_AT &&\n    c !== CHAR_GRAVE_ACCENT\n}\n\nfunction isPlainSafeAtStart (string: string, inblock: boolean) {\n  const first = codePointAt(string, 0)\n\n  if (isPlainSafeFirst(first)) return true\n\n  if (\n    string.length > 1 &&\n    (first === CHAR_MINUS || first === CHAR_QUESTION || first === CHAR_COLON)\n  ) {\n    const second = codePointAt(string, 1)\n\n    // The relaxed isPlainSafe() accepts whitespace inside a scalar, but the\n    // indicator exception in ns-plain-first requires an ns-plain-safe\n    // *non-space* character. Otherwise `- value` and `? value` start block\n    // collections instead of plain scalars.\n    return !isWhitespace(second) && isPlainSafe(second, first, inblock)\n  }\n\n  return false\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast (c: number) {\n  // just not whitespace or colon, it will be checked to be plain character later\n  return !isWhitespace(c) && c !== CHAR_COLON\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt (string: string, pos: number) {\n  const first = string.charCodeAt(pos)\n  let second\n\n  if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n    second = string.charCodeAt(pos + 1)\n    if (second >= 0xDC00 && second <= 0xDFFF) {\n      // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n    }\n  }\n  return first\n}\n\nfunction needIndentIndicator (string: string) {\n  const leadingSpaceRe = /^\\n* /\n  return leadingSpaceRe.test(string)\n}\n\nconst STYLE_PLAIN = 1\nconst STYLE_SINGLE = 2\nconst STYLE_LITERAL = 3\nconst STYLE_FOLDED = 4\nconst STYLE_DOUBLE = 5\n\ntype ScalarStyleId =\n  typeof STYLE_PLAIN |\n  typeof STYLE_SINGLE |\n  typeof STYLE_LITERAL |\n  typeof STYLE_FOLDED |\n  typeof STYLE_DOUBLE\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n//    STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n//    STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n//    STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle (state: PresenterState, string: string, layout: ReturnType<typeof scalarLayout>,\n  singleLineOnly: boolean, forceQuote: boolean, inblock: boolean): ScalarStyleId {\n  const { blockIndent, lineWidth } = layout\n  let i\n  let char = 0\n  let prevChar = -1 // -1 = no previous character yet (see isPlainSafe)\n  let hasLineBreak = false\n  let hasFoldableLine = false // only checked if shouldTrackWidth\n  const shouldTrackWidth = lineWidth !== -1\n  let previousLineBreak = -1 // count the first line correctly\n  // Document markers are recognized as whole tokens at the start of a line,\n  // so character-level plain-scalar checks alone cannot reject them.\n  let plain = !startsWithDocumentSeparator(string) &&\n    isPlainSafeAtStart(string, inblock) &&\n    isPlainSafeLast(codePointAt(string, string.length - 1))\n\n  if (singleLineOnly || forceQuote) {\n    // Case: no block styles.\n    // Check for disallowed characters to rule out plain and single.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n  } else {\n    // Case: block styles permitted.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (char === CHAR_LINE_FEED) {\n        hasLineBreak = true\n        // Check if any line can be folded.\n        if (shouldTrackWidth) {\n          hasFoldableLine = hasFoldableLine ||\n            // Foldable line = too long, and not more-indented.\n            (i - previousLineBreak - 1 > lineWidth &&\n             string[previousLineBreak + 1] !== ' ')\n          previousLineBreak = i\n        }\n      } else if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n    // in case the end is missing a \\n\n    hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n      (i - previousLineBreak - 1 > lineWidth &&\n       string[previousLineBreak + 1] !== ' '))\n  }\n  // Although every style can represent \\n without escaping, prefer block styles\n  // for multiline, since they're more readable and they don't add empty lines.\n  // Also prefer folding a super-long line.\n  if (!hasLineBreak && !hasFoldableLine) {\n    // Syntactic verdict only: whether the bare text round-trips to the node's\n    // tag is a semantic check the caller applies (see resolveScalarStyle).\n    if (plain && !forceQuote) return STYLE_PLAIN\n    return state.quoteStyle === 'double' ? STYLE_DOUBLE : STYLE_SINGLE\n  }\n  // Edge case: block indentation indicator can only have one digit.\n  if (blockIndent > 9 && needIndentIndicator(string)) {\n    return STYLE_DOUBLE\n  }\n  // At this point we know block styles are valid.\n  // Prefer literal style unless we want to fold.\n  return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL\n}\n\n// Renders `string` in the given numeric style with the given layout.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n//  since the dumper adds its own newline. This always works:\n//    • No ending newline => unaffected; already using strip \"-\" chomping.\n//    • Ending newline    => removed then restored.\n//  Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction renderScalarStyle (string: string, style: ScalarStyleId, layout: ReturnType<typeof scalarLayout>) {\n  const { indent, blockIndent, lineWidth } = layout\n\n  switch (style) {\n    case STYLE_PLAIN:\n      return encodeFlowBreaks(string, indent)\n    case STYLE_SINGLE:\n      return `'${encodeFlowBreaks(string, indent).replace(/'/g, \"''\")}'`\n    case STYLE_LITERAL:\n      return '|' + blockHeader(string, blockIndent) +\n        dropEndingNewline(indentString(string, indent))\n    case STYLE_FOLDED:\n      return '>' + blockHeader(string, blockIndent) +\n        dropEndingNewline(indentString(foldBlockScalar(string, lineWidth), indent))\n    case STYLE_DOUBLE:\n      return `\"${escapeString(string)}\"`\n  }\n}\n\n// Picks the scalar style for `node`: a style hint carried on the node wins,\n// otherwise the style chosen by the machinery. Returns a numeric STYLE_*.\nfunction resolveScalarStyle (state: PresenterState, node: ScalarNode,\n  layout: ReturnType<typeof scalarLayout>, iskey: boolean, inblock: boolean): ScalarStyleId {\n  // Without knowing if keys are implicit/explicit, assume implicit for safety.\n  const singleLineOnly = iskey || !inblock\n\n  // Style hints carried on the node take precedence. They were valid in their\n  // original context; only a parent change can break them, and only block\n  // styles in a single-line context — quoted styles survive any context. A\n  // rejected block hint falls through to selection by content below.\n  if (node.style.singleQuoted) return STYLE_SINGLE\n  if (node.style.doubleQuoted) return STYLE_DOUBLE\n  if (!singleLineOnly) {\n    if (node.style.literal) return STYLE_LITERAL\n    if (node.style.folded) return STYLE_FOLDED\n  }\n\n  const string = node.value\n\n  if (string.length === 0) {\n    // An empty scalar is safe when its tag is explicit or resolves back to the\n    // node tag (notably, the default null representation). A real empty string\n    // does neither and therefore remains quoted.\n    if (node.style.tagged || resolveImplicitTag(state, string) === node.tag) return STYLE_PLAIN\n    return state.quoteStyle === 'double' ? STYLE_DOUBLE : STYLE_SINGLE\n  }\n\n  // v4's forceQuotes deliberately excluded keys. Keys are still quoted when\n  // syntax or tag resolution requires it, using quoteStyle as the preference.\n  const style = chooseScalarStyle(\n    state, string, layout, singleLineOnly, state.forceQuotes && !iskey, inblock)\n\n  // Plain writes no tag, so it round-trips only if the bare text resolves back\n  // to the node's tag (or the tag gets printed explicitly). Else downgrade.\n  // Downgrade to the preferred quote style here.\n  if (style === STYLE_PLAIN && !node.style.tagged && resolveImplicitTag(state, string) !== node.tag) {\n    return state.quoteStyle === 'double' ? STYLE_DOUBLE : STYLE_SINGLE\n  }\n  return style\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader (string: string, indentPerLevel: number) {\n  const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''\n\n  // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n  const clip = string[string.length - 1] === '\\n'\n  const keep = clip && (string[string.length - 2] === '\\n' || string === '\\n')\n  const chomp = keep ? '+' : (clip ? '' : '-')\n\n  return `${indentIndicator}${chomp}\\n`\n}\n\n// Flow scalars (plain, single-quoted) fold line breaks: a run of k source line\n// breaks reparses to k-1 literal `\\n`. So a single break is just line-wrapping\n// (folds back to a space), while a literal `\\n` in the value must be emitted as\n// a blank line (two breaks). Encode each run of p literal `\\n` as p+1 breaks and\n// indent the following content line so the continuation isn't read as a new node\n// (a bare break would yield invalid \"deficient indentation\" output).\n// `foldBlockScalar` can't be reused here: it treats a leading space as a\n// \"more-indented\" line and suppresses the doubling, which a flow scalar must not.\nfunction encodeFlowBreaks (string: string, indent: number) {\n  let nextLF = string.indexOf('\\n')\n  if (nextLF === -1) return string\n\n  const pad = ' '.repeat(indent)\n  let result = string.slice(0, nextLF) // first line follows the quote, no indent\n\n  const lineRe = /(\\n+)([^\\n]*)/g\n  lineRe.lastIndex = nextLF\n  let match\n  while ((match = lineRe.exec(string))) {\n    const breaks = match[1].length\n    const line = match[2]\n    // line === '' only at the end (the greedy \\n+ leaves no empty line mid-string);\n    // pad it so the closing quote carries indent instead of sitting at column 0.\n    result += '\\n'.repeat(breaks + 1) + pad + line\n  }\n\n  return result\n}\n\n// Strips one trailing newline from a block scalar: the dumper adds its own,\n// so without this a \"+\" (keep) chomp would gain an extra blank line.\nfunction dropEndingNewline (string: string) {\n  return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldBlockScalar (string: string, width: number) {\n  // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n  // unless they're before or after a more-indented line, or at the very\n  // beginning or end, in which case $k$ maps to $k$.\n  // Therefore, parse each chunk as newline(s) followed by a content line.\n  const lineRe = /(\\n+)([^\\n]*)/g\n\n  // first line (possibly an empty line)\n  let nextLF = string.indexOf('\\n')\n  if (nextLF === -1) nextLF = string.length\n  lineRe.lastIndex = nextLF\n  let result = foldLine(string.slice(0, nextLF), width)\n  // If we haven't reached the first content line yet, don't add an extra \\n.\n  let prevMoreIndented = string[0] === '\\n' || string[0] === ' '\n  let moreIndented\n\n  // rest of the lines\n  let match\n  while ((match = lineRe.exec(string))) {\n    const prefix = match[1]\n    const line = match[2]\n\n    moreIndented = (line[0] === ' ')\n    result += prefix +\n      ((!prevMoreIndented && !moreIndented && line !== '') ? '\\n' : '') +\n      foldLine(line, width)\n    prevMoreIndented = moreIndented\n  }\n\n  return result\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine (line: string, width: number) {\n  if (line === '' || line[0] === ' ') return line\n\n  // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n  const breakRe = / [^ ]/g // note: the match index will always be <= length-2.\n  let match\n  // start is an inclusive index. end, curr, and next are exclusive.\n  let start = 0\n  let end\n  let curr = 0\n  let next = 0\n  let result = ''\n\n  // Invariants: 0 <= start <= length-1.\n  //   0 <= curr <= next <= max(0, length-2). curr - start <= width.\n  // Inside the loop:\n  //   A match implies length >= 2, so curr and next are <= length-2.\n  while ((match = breakRe.exec(line))) {\n    next = match.index\n    // maintain invariant: curr - start <= width\n    if (next - start > width) {\n      end = (curr > start) ? curr : next // derive end <= length-2\n      result += `\\n${line.slice(start, end)}`\n      // skip the space that was output as \\n\n      start = end + 1                    // derive start <= length-1\n    }\n    curr = next\n  }\n\n  // By the invariants, start <= length-1, so there is something left over.\n  // It is either the whole string or a part starting from non-whitespace.\n  result += '\\n'\n  // Insert a break if the remainder is too long and there is a break available.\n  if (line.length - start > width && curr > start) {\n    result += `${line.slice(start, curr)}\\n${line.slice(curr + 1)}`\n  } else {\n    result += line.slice(start)\n  }\n\n  return result.slice(1) // drop extra \\n joiner\n}\n\nfunction escapeString (string: string) {\n  let result = ''\n  let char = 0\n\n  for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n    char = codePointAt(string, i)\n    const escapeSeq = ESCAPE_SEQUENCES[char]\n\n    if (escapeSeq) {\n      result += escapeSeq\n      continue\n    }\n\n    if (isPrintable(char)) {\n      result += string[i]\n      if (char >= 0x10000) result += string[i + 1]\n      continue\n    }\n\n    result += encodeNonPrintable(char)\n  }\n\n  return result\n}\n\nfunction writeFlowSequence (state: PresenterState, level: number, node: SequenceNode) {\n  let result = ''\n\n  for (let index = 0, length = node.items.length; index < length; index += 1) {\n    const item = writeNode(state, level, node.items[index], {})\n    if (result !== '') result += `,${!state.flowSkipCommaSpace ? ' ' : ''}`\n    result += item\n  }\n\n  const pad = state.flowBracketPadding && result !== '' ? ' ' : ''\n  return `[${pad}${result}${pad}]`\n}\n\nfunction writeBlockSequence (state: PresenterState, level: number, node: SequenceNode, compact: boolean) {\n  let result = ''\n\n  for (let index = 0, length = node.items.length; index < length; index += 1) {\n    const item = writeNode(state, level + 1, node.items[index],\n      { block: true, compact: state.seqInlineFirst, isblockseq: true })\n\n    if (!compact || result !== '') {\n      result += generateNextLine(state, level)\n    }\n\n    // No trailing space when the value renders empty (e.g. null → '').\n    if (item === '' || CHAR_LINE_FEED === item.charCodeAt(0)) {\n      result += '-'\n    } else {\n      result += '- '\n    }\n\n    result += item\n  }\n\n  return result\n}\n\nfunction writeFlowMapping (state: PresenterState, level: number, node: MappingNode) {\n  let result = ''\n  const items = sortMappingItems(state, node.items)\n\n  for (const { key, value } of items) {\n    let pairBuffer = ''\n    if (result !== '') pairBuffer += `,${!state.flowSkipCommaSpace ? ' ' : ''}`\n\n    const keyText = writeNode(state, level, key, { iskey: true })\n    const explicitPair = keyText.length > 1024\n\n    if (explicitPair) {\n      pairBuffer += '? '\n    } else if (state.quoteFlowKeys) {\n      pairBuffer += '\"'\n    }\n\n    const valueText = writeNode(state, level, value, {})\n    // No separating space when the value renders empty (e.g. null → '').\n    const sep = state.flowSkipColonSpace || valueText === '' ? '' : ' '\n\n    pairBuffer += `${keyText}${state.quoteFlowKeys && !explicitPair ? '\"' : ''}:${sep}${valueText}`\n\n    result += pairBuffer\n  }\n\n  const pad = state.flowBracketPadding && result !== '' ? ' ' : ''\n  return `{${pad}${result}${pad}}`\n}\n\n// A scalar key sorts by its text; the default sort and a custom comparator both\n// see that, matching the original keys-array sort.\nfunction sortKeyValue (key: Node): any {\n  return key.kind === 'scalar' ? key.value : key\n}\n\nfunction sortMappingItems (state: PresenterState, items: MappingNode['items']) {\n  if (!state.sortKeys) return items\n\n  const copy = items.slice()\n\n  if (state.sortKeys === true) {\n    copy.sort((a, b) => {\n      const x = sortKeyValue(a.key)\n      const y = sortKeyValue(b.key)\n      if (x < y) return -1\n      if (x > y) return 1\n      return 0\n    })\n  } else {\n    const fn = state.sortKeys\n    copy.sort((a, b) => fn(sortKeyValue(a.key), sortKeyValue(b.key)))\n  }\n\n  return copy\n}\n\nfunction writeBlockMapping (state: PresenterState, level: number, node: MappingNode, compact: boolean) {\n  let result = ''\n  const items = sortMappingItems(state, node.items)\n\n  for (let index = 0, length = items.length; index < length; index += 1) {\n    let pairBuffer = ''\n\n    if (!compact || result !== '') {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    const { key, value } = items[index]\n\n    // A block key — a block collection (mapping/sequence) or a block scalar\n    // (literal/folded) — can't sit on a `key:` line, so it's written with block\n    // context and the pair takes the explicit `? key / : value` form. A simple\n    // scalar key stays inline (flow-vs-block is invisible there).\n    const keyIsBlock =\n      ((key.kind === 'mapping' || key.kind === 'sequence') &&\n        !key.style.flow && key.items.length !== 0) ||\n      (key.kind === 'scalar' && (key.style.literal || key.style.folded))\n\n    // The `?`/`:` indicators shift content right like a `-`, so a block key or\n    // value that stays on the indicator line keeps its indentation under\n    // seqNoIndent (`isblockseq`). One that drops to its own line (tag/anchor)\n    // collapses to the parent indent, so leave the flag off there.\n    const keyText = keyIsBlock\n      ? writeNode(state, level + 1, key,\n        { block: true, compact: true, isblockseq: !cannotBeCompact(state, key, level + 1) })\n      : writeNode(state, level + 1, key, { block: true, compact: true, iskey: true })\n\n    // Block key, over-long key, or multiline scalar key forces explicit form.\n    // Multiline isn't a spec requirement — just matches pyyaml's simple-key rule.\n    const keyHasLineBreak = key.kind === 'scalar' && key.value.indexOf('\\n') !== -1\n    const explicitPair = keyIsBlock || keyHasLineBreak || keyText.length > 1024\n\n    if (explicitPair) {\n      if (keyText && CHAR_LINE_FEED === keyText.charCodeAt(0)) {\n        pairBuffer += '?'\n      } else {\n        pairBuffer += '? '\n      }\n    }\n\n    pairBuffer += keyText\n\n    if (explicitPair) {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    const valueText = writeNode(state, level + 1, value,\n      { block: true, compact: explicitPair, isblockseq: explicitPair && !cannotBeCompact(state, value, level + 1) })\n\n    // Keep a space before the colon when the key text ends in a leading\n    // property rather than scalar content, so the colon can't be read as part\n    // of it. Two cases: an inline alias key (`*b : v`), and an empty scalar key\n    // whose whole text is its anchor/tag (`&a :`, `!!str :`) — without the\n    // space `&a:` reparses as an anchored value, dropping the null key.\n    const keyIsBareProps = key.kind === 'scalar' && key.value === '' &&\n      keyText !== '' &&\n      keyText.charCodeAt(keyText.length - 1) !== CHAR_SINGLE_QUOTE &&\n      keyText.charCodeAt(keyText.length - 1) !== CHAR_DOUBLE_QUOTE\n    const keyColonSep = !explicitPair && (key.kind === 'alias' || keyIsBareProps) ? ' ' : ''\n\n    // No trailing space when the value renders empty (e.g. null → '').\n    if (valueText === '' || CHAR_LINE_FEED === valueText.charCodeAt(0)) {\n      pairBuffer += `${keyColonSep}:`\n    } else {\n      pairBuffer += `${keyColonSep}: `\n    }\n\n    pairBuffer += valueText\n\n    result += pairBuffer\n  }\n\n  return result\n}\n\n// Where a node sits relative to its parent — drives layout/style decisions.\n// All flags default to false (the flow-context, non-key, non-compact case).\ninterface NodeContext {\n  block?: boolean      // block context (vs flow); propagates downward\n  compact?: boolean    // may start on the current line (no leading newline)\n  iskey?: boolean      // node is a mapping key\n  isblockseq?: boolean // content follows an indicator (`-`, or `?`/`:` in an\n                       // explicit pair) that already shifted it right; keeps\n                       // its indentation under seqNoIndent\n}\n\n// A node can't sit compact on its parent's indicator (`-`/`?`/`:`) line when it\n// carries leading props (tag/anchor) that would collide with the indicator, or\n// when the indent step is too narrow for the 2-char indicator. Such a node drops\n// to its own line; a block collection that does so also collapses its seqNoIndent\n// indentation back to the parent.\nfunction cannotBeCompact (state: PresenterState, node: Node, level: number) {\n  return node.style.tagged || node.anchor !== undefined || (state.indent < 2 && level > 0)\n}\n\nfunction writeNode (state: PresenterState, level: number, node: Node, ctx: NodeContext): string {\n  if (node.kind === 'alias') return `*${node.anchor}`\n\n  const { block = false, iskey = false, isblockseq = false } = ctx\n  let compact = ctx.compact ?? false\n\n  const hasAnchor = node.anchor !== undefined\n\n  if (cannotBeCompact(state, node, level)) {\n    compact = false\n  }\n\n  let body: string\n  let shouldPrintTag = node.style.tagged\n  const useBlockCollection = block &&\n    (node.kind === 'mapping' || node.kind === 'sequence') &&\n    !node.style.flow && node.items.length !== 0\n\n  if (node.kind === 'mapping') {\n    if (useBlockCollection) {\n      body = writeBlockMapping(state, level, node, compact)\n    } else {\n      body = writeFlowMapping(state, level, node)\n    }\n  } else if (node.kind === 'sequence') {\n    if (useBlockCollection) {\n      if (state.seqNoIndent && !isblockseq && level > 0) {\n        body = writeBlockSequence(state, level - 1, node, compact)\n      } else {\n        body = writeBlockSequence(state, level, node, compact)\n      }\n    } else {\n      body = writeFlowSequence(state, level, node)\n    }\n  } else {\n    const layout = scalarLayout(state, level)\n    const style = resolveScalarStyle(state, node, layout, iskey, block)\n    body = renderScalarStyle(node.value, style, layout)\n    shouldPrintTag = node.style.tagged || (style !== STYLE_PLAIN && node.tag !== state.defaultScalarTagName)\n  }\n\n  // An indicator plus its mandatory separator occupies 2 columns. For wider\n  // indentation, pad a compact block collection so its first item starts at\n  // the same column as the following items.\n  if (useBlockCollection && compact && level > 0 && state.indent > 2) {\n    body = `${' '.repeat(state.indent - 2)}${body}`\n  }\n\n  if (shouldPrintTag || hasAnchor) {\n    const props: string[] = []\n    const tag = shouldPrintTag ? nodeTagShort(node) : null\n    const anchor = hasAnchor ? `&${node.anchor}` : null\n\n    if (state.tagBeforeAnchor) {\n      if (tag !== null) props.push(tag)\n      if (anchor !== null) props.push(anchor)\n    } else {\n      if (anchor !== null) props.push(anchor)\n      if (tag !== null) props.push(tag)\n    }\n\n    // No separator when the body is empty (e.g. `&anchor` on a null node) or\n    // already starts on its own line.\n    const sep = body === '' || body.charCodeAt(0) === CHAR_LINE_FEED ? '' : ' '\n    body = `${props.join(' ')}${sep}${body}`\n  }\n\n  return body\n}\n\n// A bare (untagged, unanchored) non-empty block collection: writeNode renders it\n// in compact form with its first item on the opening line. That works mid-stream,\n// but right after a `---` the first item must drop to the next line. A tag/anchor\n// already forces the body onto its own line, so those stay on the `---` line.\nfunction rootStartsOwnLine (node: Node) {\n  return (node.kind === 'sequence' || node.kind === 'mapping') &&\n    !node.style.flow &&\n    node.items.length !== 0 &&\n    !node.style.tagged &&\n    node.anchor === undefined\n}\n\n// A document whose serialization ends with a keep-chomped (`+`) block scalar is\n// open-ended: the trailing blank line(s) would otherwise be ambiguous, so it\n// needs a `...` terminator. Mirrors the keep test in `blockHeader`.\nfunction isOpenEnded (node: Node) {\n  // Descend to the last leaf, always taking the last item of a block collection\n  // (a flow collection renders on one line, so it ends the document itself).\n  let leaf = node\n  while ((leaf.kind === 'sequence' || leaf.kind === 'mapping') &&\n    !leaf.style.flow && leaf.items.length !== 0) {\n    leaf = leaf.kind === 'sequence'\n      ? leaf.items[leaf.items.length - 1]\n      : leaf.items[leaf.items.length - 1].value\n  }\n\n  if (leaf.kind !== 'scalar' || !(leaf.style.literal || leaf.style.folded)) return false\n  const { value } = leaf\n  // Keep chomping: ends in a blank line (`\\n\\n`) or is a lone `\\n`.\n  return value.endsWith('\\n\\n') || value === '\\n'\n}\n\nfunction writeDocumentDirectives (doc: Document) {\n  let result = ''\n\n  for (const directive of doc.directives) {\n    if (directive.kind === 'yaml') {\n      result += `%YAML ${directive.version}\\n`\n      continue\n    }\n\n    const { handle, prefix } = directive\n    result += `%TAG ${handle} ${prefix}\\n`\n  }\n\n  return result\n}\n\n// Documents → text, including the trailing newline.\nfunction present (documents: Document[], options: PresenterOptions): string {\n  const state = createPresenterState(options)\n  let result = ''\n  let previousEnded = false\n\n  for (let index = 0; index < documents.length; index += 1) {\n    const doc = documents[index]\n    const directives = writeDocumentDirectives(doc)\n    const hasDirectives = directives !== ''\n    const marker = doc.explicitStart || hasDirectives || (index > 0 && !previousEnded)\n\n    result += directives\n\n    if (doc.contents === null) {\n      if (marker) result += '---\\n'\n    } else if (marker) {\n      const body = writeNode(state, 0, doc.contents, { block: true, compact: true })\n      // Content shares the `---` line, except: an empty render (no separator at\n      // all), a bare block collection (wraps to the next line), or directives\n      // forcing `---` onto its own line.\n      const sep = body === '' ? '' : (hasDirectives || rootStartsOwnLine(doc.contents) ? '\\n' : ' ')\n      result += `---${sep}${body}\\n`\n    } else {\n      result += writeNode(state, 0, doc.contents, { block: true, compact: true }) + '\\n'\n    }\n\n    previousEnded = doc.explicitEnd || (doc.contents !== null && isOpenEnded(doc.contents))\n    if (previousEnded) {\n      result += '...\\n'\n    }\n  }\n\n  return result\n}\n\nexport {\n  DEFAULT_PRESENTER_OPTIONS,\n  present,\n  type PresenterOptions\n}\n","import { YAML11_SCHEMA, type Schema } from './schema.ts'\nimport { jsToAst } from './ast/from_js.ts'\nimport { visit, VISIT_SKIP } from './ast/visit.ts'\nimport { type Document } from './ast/nodes.ts'\nimport {\n  DEFAULT_PRESENTER_OPTIONS,\n  present,\n  type PresenterOptions\n} from './ast/presenter.ts'\nimport { pick } from './common/object.ts'\nimport { NOT_RESOLVED } from './tag.ts'\nimport { intCoreTag } from './tag/scalar/int_core.ts'\nimport { intYaml11Tag } from './tag/scalar/int_yaml11.ts'\nimport { floatCoreTag } from './tag/scalar/float_core.ts'\nimport { floatYaml11Tag } from './tag/scalar/float_yaml11.ts'\n\ninterface DumpOptions extends Omit<PresenterOptions, 'schema'> {\n  schema?: Schema\n  skipInvalid?: boolean\n  noRefs?: boolean\n  flowLevel?: number\n  transform?: (documents: Document[]) => void\n}\n\n// YAML 1.1 misses YAML 1.2 `0o...` ints and exponent-only floats.\n// Combine resolvers so all possible collisions are quoted.\nconst DEFAULT_DUMP_SCHEMA = YAML11_SCHEMA.withTags(\n  {\n    ...intYaml11Tag,\n    resolve: (source, isExplicit, tagName) => {\n      const result = intYaml11Tag.resolve(source, isExplicit, tagName)\n      return result === NOT_RESOLVED ? intCoreTag.resolve(source, isExplicit, tagName) : result\n    }\n  },\n  {\n    ...floatYaml11Tag,\n    resolve: (source, isExplicit, tagName) => {\n      const result = floatYaml11Tag.resolve(source, isExplicit, tagName)\n      return result === NOT_RESOLVED ? floatCoreTag.resolve(source, isExplicit, tagName) : result\n    }\n  }\n)\n\nconst DEFAULT_DUMP_OPTIONS: Required<DumpOptions> = {\n  ...DEFAULT_PRESENTER_OPTIONS,\n  schema: DEFAULT_DUMP_SCHEMA,\n  skipInvalid: false,\n  noRefs: false,\n  flowLevel: -1,\n  transform: () => {}\n}\n\n// Options that need the JS value (tags, format, dedup) go to `jsToAst`; purely\n// presentational ones go to `present`.\nfunction dump (input: any, options: DumpOptions = {}) {\n  const opts = { ...DEFAULT_DUMP_OPTIONS, ...options }\n\n  const documents = jsToAst(input, opts.schema, {\n    noRefs: opts.noRefs,\n    skipInvalid: opts.skipInvalid\n  })\n\n  // flowLevel: every node at this depth switches to flow; the presenter forces\n  // everything below into flow too, so the walk stops there.\n  if (opts.flowLevel >= 0) {\n    visit(documents, (node, ctx) => {\n      if (ctx.depth < opts.flowLevel) return\n      node.style.flow = true\n      return VISIT_SKIP\n    })\n  }\n\n  opts.transform(documents)\n\n  const PRESENTER_OPT_KEYS = Object.keys(DEFAULT_PRESENTER_OPTIONS) as\n    (keyof typeof DEFAULT_PRESENTER_OPTIONS)[]\n\n  return present(documents, { ...pick(opts, PRESENTER_OPT_KEYS), schema: opts.schema })\n}\n\nexport {\n  dump,\n\n  type DumpOptions\n}\n","// Parser events → AST. The second entry into the AST world (the first being\n// `jsToAst`): instead of building JS values like the constructor, it mirrors the\n// same document/sequence/mapping frame walk and emits `Node`s that keep the\n// original styles, tags and anchors, so parsed YAML can be re-dumped faithfully.\n\nimport {\n  EVENT_ALIAS,\n  EVENT_DOCUMENT,\n  EVENT_MAPPING,\n  EVENT_POP,\n  EVENT_SCALAR,\n  EVENT_SEQUENCE,\n  SCALAR_STYLE_PLAIN,\n  SCALAR_STYLE_SINGLE_QUOTED,\n  SCALAR_STYLE_DOUBLE_QUOTED,\n  SCALAR_STYLE_LITERAL_BLOCK,\n  SCALAR_STYLE_FOLDED_BLOCK,\n  COLLECTION_STYLE_FLOW,\n  type Event,\n  type MappingEvent,\n  type ScalarEvent,\n  type SequenceEvent\n} from '../parser/events.ts'\nimport { getScalarValue } from '../parser/parser_scalar.ts'\nimport { type Schema } from '../schema.ts'\nimport { NOT_RESOLVED } from '../tag.ts'\nimport {\n  Style,\n  type Node,\n  type Document,\n  type ScalarNode,\n  type SequenceNode,\n  type MappingNode,\n  type AliasNode\n} from './nodes.ts'\n\nconst NO_RANGE = -1\n\ninterface DocumentFrame {\n  kind: 'document'\n  doc: Document\n}\n\ninterface SequenceFrame {\n  kind: 'sequence'\n  node: SequenceNode\n}\n\ninterface MappingFrame {\n  kind: 'mapping'\n  node: MappingNode\n  key: Node | null\n}\n\ntype Frame = DocumentFrame | SequenceFrame | MappingFrame\n\ninterface FromEventsOptions {\n  source: string\n  schema: Schema\n}\n\ninterface FromEventsState {\n  source: string\n  schema: Schema\n  eventIndex: number\n  position: number\n  frames: Frame[]\n  documents: Document[]\n}\n\nfunction eventPosition (event: Event) {\n  if ('tagStart' in event && event.tagStart !== NO_RANGE) return event.tagStart\n  if ('anchorStart' in event && event.anchorStart !== NO_RANGE) return event.anchorStart\n  if ('valueStart' in event && event.valueStart !== NO_RANGE) return event.valueStart\n  if ('start' in event) return event.start\n  return 0\n}\n\nfunction rawTag (state: FromEventsState, event: ScalarEvent | SequenceEvent | MappingEvent) {\n  return event.tagStart === NO_RANGE\n    ? ''\n    : state.source.slice(event.tagStart, event.tagEnd)\n}\n\nfunction anchorName (state: FromEventsState, event: ScalarEvent | SequenceEvent | MappingEvent) {\n  return event.anchorStart === NO_RANGE\n    ? undefined\n    : state.source.slice(event.anchorStart, event.anchorEnd)\n}\n\n// Tag name carried by an empty/plain scalar with no explicit tag: the first\n// implicit scalar resolver that accepts the text, falling back to str. Mirrors\n// the implicit branch of `constructScalar`, but we only want the tag name.\nfunction implicitScalarTagName (state: FromEventsState, source: string) {\n  const { schema } = state\n  const candidates = schema.implicitScalarByFirstChar.get(source.charAt(0)) ??\n    schema.implicitScalarAnyFirstChar\n  for (const tag of candidates) {\n    if (tag.resolve(source, false, tag.tagName) !== NOT_RESOLVED) return tag.tagName\n  }\n  return schema.defaultScalarTag.tagName\n}\n\nfunction buildScalar (state: FromEventsState, event: ScalarEvent): ScalarNode {\n  const value = getScalarValue(state.source, event)\n  const raw = rawTag(state, event)\n  const style = new Style()\n\n  switch (event.style) {\n    case SCALAR_STYLE_SINGLE_QUOTED: style.singleQuoted = true; break\n    case SCALAR_STYLE_DOUBLE_QUOTED: style.doubleQuoted = true; break\n    case SCALAR_STYLE_LITERAL_BLOCK: style.literal = true; break\n    case SCALAR_STYLE_FOLDED_BLOCK: style.folded = true; break\n  }\n\n  let tag: string\n  if (raw !== '') {\n    style.tagged = true\n    tag = raw\n  } else if (event.style === SCALAR_STYLE_PLAIN) {\n    tag = implicitScalarTagName(state, value)\n  } else {\n    tag = state.schema.defaultScalarTag.tagName\n  }\n\n  return { kind: 'scalar', tag, style, anchor: anchorName(state, event), value }\n}\n\nfunction buildCollection (\n  state: FromEventsState,\n  event: SequenceEvent | MappingEvent,\n  defaultTagName: string\n): { tag: string, style: Style, anchor?: string } {\n  const raw = rawTag(state, event)\n  const style = new Style()\n  if (event.style === COLLECTION_STYLE_FLOW) style.flow = true\n\n  let tag: string\n  if (raw === '') {\n    tag = defaultTagName\n  } else {\n    tag = raw\n    style.tagged = true\n  }\n\n  return { tag, style, anchor: anchorName(state, event) }\n}\n\nfunction addNode (state: FromEventsState, node: Node) {\n  const frame = state.frames[state.frames.length - 1]\n\n  if (frame.kind === 'document') {\n    frame.doc.contents = node\n  } else if (frame.kind === 'sequence') {\n    frame.node.items.push(node)\n  } else if (frame.key) {\n    frame.node.items.push({ key: frame.key, value: node })\n    frame.key = null\n  } else {\n    frame.key = node\n  }\n}\n\nfunction eventsToAst (events: Event[], options: FromEventsOptions): Document[] {\n  const state: FromEventsState = {\n    source: options.source,\n    schema: options.schema,\n    eventIndex: 0,\n    position: 0,\n    frames: [],\n    documents: []\n  }\n\n  while (state.eventIndex < events.length) {\n    const event = events[state.eventIndex++]\n    state.position = eventPosition(event)\n\n    switch (event.type) {\n      case EVENT_DOCUMENT: {\n        const doc: Document = {\n          contents: null,\n          explicitStart: event.explicitStart,\n          explicitEnd: event.explicitEnd,\n          directives: event.directives\n        }\n        state.frames.push({ kind: 'document', doc })\n        break\n      }\n\n      case EVENT_SCALAR:\n        addNode(state, buildScalar(state, event))\n        break\n\n      case EVENT_SEQUENCE: {\n        const { tag, style, anchor } = buildCollection(state, event, 'tag:yaml.org,2002:seq')\n        const node: SequenceNode = { kind: 'sequence', tag, style, anchor, items: [] }\n        state.frames.push({ kind: 'sequence', node })\n        break\n      }\n\n      case EVENT_MAPPING: {\n        const { tag, style, anchor } = buildCollection(state, event, 'tag:yaml.org,2002:map')\n        const node: MappingNode = { kind: 'mapping', tag, style, anchor, items: [] }\n        state.frames.push({ kind: 'mapping', node, key: null })\n        break\n      }\n\n      case EVENT_ALIAS: {\n        const name = state.source.slice(event.anchorStart, event.anchorEnd)\n        const node: AliasNode = { kind: 'alias', tag: '', style: new Style(), anchor: name }\n        addNode(state, node)\n        break\n      }\n\n      case EVENT_POP: {\n        const frame = state.frames.pop()!\n        if (frame.kind === 'document') {\n          state.documents.push(frame.doc)\n        } else {\n          addNode(state, frame.node)\n        }\n        break\n      }\n    }\n  }\n\n  return state.documents\n}\n\nexport {\n  eventsToAst,\n  type FromEventsOptions\n}\n"],"mappings":";;AAAA,IAAM,eAA8B,OAAO,cAAc;AACzD,IAAM,YAA2B,OAAO,WAAW;AAoHnD,SAAS,gBAAyB,SAAiB,SAAgE;CACjH,OAAO;EACL;EACA,UAAU;EACV,UAAU,QAAQ,YAAY;EAC9B,kBAAkB,QAAQ,oBAAoB;EAC9C,oBAAoB,QAAQ,sBAAsB;EAClD,SAAS,QAAQ;EACjB,UAAU,QAAQ,YAAY;EAC9B,WAAW,QAAQ,eAAc,SAAQ,OAAO,IAAI;EACpD,kBAAkB,QAAQ,oBAAoB;CAChD;AACF;AAEA,SAAS,kBAA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AAO,GAAG;AAC9B,IAAM,kBAAkB,IAAI,OAAO,OAAO,YAAY,IAAI;AAE1D,IAAM,qBAAqB,IAAI,OAAO,OAAO,YAAY,IAAI;AAE7D,IAAM,qBAAqB,IAAI,OAAO,WAAW,YAAY,KAAK,YAAY,KAAK,YAAY,KAAK;AA2BpG,IAAM,yBAAkD;CACtD,UAAU;CACV,UAAU;AACZ;AAgBA,SAAS,iBACP,OACA,eACA,aACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAA;EACA;EACA;EACA,YAAY,MAAM;CACpB,CAAC;AACH;AAEA,SAAS,iBACP,OACA,OACA,aACA,WACA,UACA,QACA,OACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAS,gBACP,OACA,OACA,aACA,WACA,UACA,QACA,OACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAS,eACP,OACA,YACA,UACA,aACA,WACA,UACA,QACA,OACA,WAAA,GACA,SAAS,IACT,OAAO,OACP;CACA,MAAM,OAAO,KAAK;EAChB,MAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAS,cACP,OACA,aACA,WACA;CACA,MAAM,OAAO,KAAK;EAChB,MAAA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAS,YAAa,OAAoB;CACxC,MAAM,OAAO,KAAK,EAAE,MAAA,EAAgB,CAAC;AACvC;AAEA,SAAS,oBAAqB,OAAoB;CAChD,eACE,OACA,YACA,YACA,YACA,YACA,YACA,YAAA,CAEF;AACF;AAEA,SAAS,kBAAmC;CAC1C,OAAO;EACL,aAAa;EACb,WAAW;EACX,UAAU;EACV,QAAQ;CACV;AACF;AAEA,SAAS,cAAe,OAAoC;CAC1D,OAAO;EACL,UAAU,MAAM;EAChB,MAAM,MAAM;EACZ,WAAW,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