// automatically generated by the FlatBuffers compiler, do not modify
// Generated from TypeScript using flatc --ts and esbuild

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/annotation.ts
import * as flatbuffers2 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/metadata.ts
import * as flatbuffers from "flatbuffers";
var Metadata = class _Metadata {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsMetadata(bb, obj) {
    return (obj || new _Metadata()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsMetadata(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
    return (obj || new _Metadata()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  datasourceNames(index, optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
  }
  datasourceNamesLength() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  static startMetadata(builder) {
    builder.startObject(1);
  }
  static addDatasourceNames(builder, datasourceNamesOffset) {
    builder.addFieldOffset(0, datasourceNamesOffset, 0);
  }
  static createDatasourceNamesVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startDatasourceNamesVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static endMetadata(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createMetadata(builder, datasourceNamesOffset) {
    _Metadata.startMetadata(builder);
    _Metadata.addDatasourceNames(builder, datasourceNamesOffset);
    return _Metadata.endMetadata(builder);
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/annotation.ts
var Annotation = class _Annotation {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsAnnotation(bb, obj) {
    return (obj || new _Annotation()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsAnnotation(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers2.SIZE_PREFIX_LENGTH);
    return (obj || new _Annotation()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  distance(index) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  distanceLength() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  distanceArray() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  duration(index) {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  durationLength() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  durationArray() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  datasources(index) {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  datasourcesLength() {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  datasourcesArray() {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  nodes(index) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  nodesLength() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  nodesArray() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  weight(index) {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  weightLength() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  weightArray() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  speed(index) {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  speedLength() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  speedArray() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  metadata(obj) {
    const offset = this.bb.__offset(this.bb_pos, 16);
    return offset ? (obj || new Metadata()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  }
  static startAnnotation(builder) {
    builder.startObject(7);
  }
  static addDistance(builder, distanceOffset) {
    builder.addFieldOffset(0, distanceOffset, 0);
  }
  static createDistanceVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt32(data[i]);
    }
    return builder.endVector();
  }
  static startDistanceVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addDuration(builder, durationOffset) {
    builder.addFieldOffset(1, durationOffset, 0);
  }
  static createDurationVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt32(data[i]);
    }
    return builder.endVector();
  }
  static startDurationVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addDatasources(builder, datasourcesOffset) {
    builder.addFieldOffset(2, datasourcesOffset, 0);
  }
  static createDatasourcesVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt32(data[i]);
    }
    return builder.endVector();
  }
  static startDatasourcesVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addNodes(builder, nodesOffset) {
    builder.addFieldOffset(3, nodesOffset, 0);
  }
  static createNodesVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt32(data[i]);
    }
    return builder.endVector();
  }
  static startNodesVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addWeight(builder, weightOffset) {
    builder.addFieldOffset(4, weightOffset, 0);
  }
  static createWeightVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt32(data[i]);
    }
    return builder.endVector();
  }
  static startWeightVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addSpeed(builder, speedOffset) {
    builder.addFieldOffset(5, speedOffset, 0);
  }
  static createSpeedVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addFloat32(data[i]);
    }
    return builder.endVector();
  }
  static startSpeedVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addMetadata(builder, metadataOffset) {
    builder.addFieldOffset(6, metadataOffset, 0);
  }
  static endAnnotation(builder) {
    const offset = builder.endObject();
    return offset;
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/error.ts
import * as flatbuffers3 from "flatbuffers";
var Error = class _Error {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsError(bb, obj) {
    return (obj || new _Error()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsError(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers3.SIZE_PREFIX_LENGTH);
    return (obj || new _Error()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  code(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  message(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  static startError(builder) {
    builder.startObject(2);
  }
  static addCode(builder, codeOffset) {
    builder.addFieldOffset(0, codeOffset, 0);
  }
  static addMessage(builder, messageOffset) {
    builder.addFieldOffset(1, messageOffset, 0);
  }
  static endError(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createError(builder, codeOffset, messageOffset) {
    _Error.startError(builder);
    _Error.addCode(builder, codeOffset);
    _Error.addMessage(builder, messageOffset);
    return _Error.endError(builder);
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/fbresult.ts
import * as flatbuffers12 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/route-object.ts
import * as flatbuffers9 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/leg.ts
import * as flatbuffers8 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/step.ts
import * as flatbuffers7 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/intersection.ts
import * as flatbuffers5 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/lane.ts
import * as flatbuffers4 from "flatbuffers";
var Lane = class _Lane {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsLane(bb, obj) {
    return (obj || new _Lane()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsLane(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers4.SIZE_PREFIX_LENGTH);
    return (obj || new _Lane()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  indications(index) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : null;
  }
  indicationsLength() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  indicationsArray() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  valid() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  }
  static startLane(builder) {
    builder.startObject(2);
  }
  static addIndications(builder, indicationsOffset) {
    builder.addFieldOffset(0, indicationsOffset, 0);
  }
  static createIndicationsVector(builder, data) {
    builder.startVector(1, data.length, 1);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt8(data[i]);
    }
    return builder.endVector();
  }
  static startIndicationsVector(builder, numElems) {
    builder.startVector(1, numElems, 1);
  }
  static addValid(builder, valid) {
    builder.addFieldInt8(1, +valid, 0);
  }
  static endLane(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createLane(builder, indicationsOffset, valid) {
    _Lane.startLane(builder);
    _Lane.addIndications(builder, indicationsOffset);
    _Lane.addValid(builder, valid);
    return _Lane.endLane(builder);
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/position.ts
var Position = class {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  longitude() {
    return this.bb.readFloat32(this.bb_pos);
  }
  latitude() {
    return this.bb.readFloat32(this.bb_pos + 4);
  }
  static sizeOf() {
    return 8;
  }
  static createPosition(builder, longitude, latitude) {
    builder.prep(4, 8);
    builder.writeFloat32(latitude);
    builder.writeFloat32(longitude);
    return builder.offset();
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/intersection.ts
var Intersection = class _Intersection {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsIntersection(bb, obj) {
    return (obj || new _Intersection()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsIntersection(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers5.SIZE_PREFIX_LENGTH);
    return (obj || new _Intersection()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  location(obj) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? (obj || new Position()).__init(this.bb_pos + offset, this.bb) : null;
  }
  bearings(index) {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readInt16(this.bb.__vector(this.bb_pos + offset) + index * 2) : 0;
  }
  bearingsLength() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  bearingsArray() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? new Int16Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  classes(index, optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
  }
  classesLength() {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  entry(index) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false;
  }
  entryLength() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  entryArray() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  inBearing() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
  }
  outBearing() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
  }
  lanes(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 16);
    return offset ? (obj || new Lane()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  }
  lanesLength() {
    const offset = this.bb.__offset(this.bb_pos, 16);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  static startIntersection(builder) {
    builder.startObject(7);
  }
  static addLocation(builder, locationOffset) {
    builder.addFieldStruct(0, locationOffset, 0);
  }
  static addBearings(builder, bearingsOffset) {
    builder.addFieldOffset(1, bearingsOffset, 0);
  }
  static createBearingsVector(builder, data) {
    builder.startVector(2, data.length, 2);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt16(data[i]);
    }
    return builder.endVector();
  }
  static startBearingsVector(builder, numElems) {
    builder.startVector(2, numElems, 2);
  }
  static addClasses(builder, classesOffset) {
    builder.addFieldOffset(2, classesOffset, 0);
  }
  static createClassesVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startClassesVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addEntry(builder, entryOffset) {
    builder.addFieldOffset(3, entryOffset, 0);
  }
  static createEntryVector(builder, data) {
    builder.startVector(1, data.length, 1);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt8(+data[i]);
    }
    return builder.endVector();
  }
  static startEntryVector(builder, numElems) {
    builder.startVector(1, numElems, 1);
  }
  static addInBearing(builder, inBearing) {
    builder.addFieldInt32(4, inBearing, 0);
  }
  static addOutBearing(builder, outBearing) {
    builder.addFieldInt32(5, outBearing, 0);
  }
  static addLanes(builder, lanesOffset) {
    builder.addFieldOffset(6, lanesOffset, 0);
  }
  static createLanesVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startLanesVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static endIntersection(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createIntersection(builder, locationOffset, bearingsOffset, classesOffset, entryOffset, inBearing, outBearing, lanesOffset) {
    _Intersection.startIntersection(builder);
    _Intersection.addLocation(builder, locationOffset);
    _Intersection.addBearings(builder, bearingsOffset);
    _Intersection.addClasses(builder, classesOffset);
    _Intersection.addEntry(builder, entryOffset);
    _Intersection.addInBearing(builder, inBearing);
    _Intersection.addOutBearing(builder, outBearing);
    _Intersection.addLanes(builder, lanesOffset);
    return _Intersection.endIntersection(builder);
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/step-maneuver.ts
import * as flatbuffers6 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/maneuver-type.ts
var ManeuverType = /* @__PURE__ */ ((ManeuverType2) => {
  ManeuverType2[ManeuverType2["Turn"] = 0] = "Turn";
  ManeuverType2[ManeuverType2["NewName"] = 1] = "NewName";
  ManeuverType2[ManeuverType2["Depart"] = 2] = "Depart";
  ManeuverType2[ManeuverType2["Arrive"] = 3] = "Arrive";
  ManeuverType2[ManeuverType2["Merge"] = 4] = "Merge";
  ManeuverType2[ManeuverType2["OnRamp"] = 5] = "OnRamp";
  ManeuverType2[ManeuverType2["OffRamp"] = 6] = "OffRamp";
  ManeuverType2[ManeuverType2["Fork"] = 7] = "Fork";
  ManeuverType2[ManeuverType2["EndOfRoad"] = 8] = "EndOfRoad";
  ManeuverType2[ManeuverType2["Continue"] = 9] = "Continue";
  ManeuverType2[ManeuverType2["Roundabout"] = 10] = "Roundabout";
  ManeuverType2[ManeuverType2["Rotary"] = 11] = "Rotary";
  ManeuverType2[ManeuverType2["RoundaboutTurn"] = 12] = "RoundaboutTurn";
  ManeuverType2[ManeuverType2["Notification"] = 13] = "Notification";
  ManeuverType2[ManeuverType2["ExitRoundabout"] = 14] = "ExitRoundabout";
  ManeuverType2[ManeuverType2["ExitRotary"] = 15] = "ExitRotary";
  return ManeuverType2;
})(ManeuverType || {});

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/turn.ts
var Turn = /* @__PURE__ */ ((Turn2) => {
  Turn2[Turn2["None"] = 0] = "None";
  Turn2[Turn2["UTurn"] = 1] = "UTurn";
  Turn2[Turn2["SharpRight"] = 2] = "SharpRight";
  Turn2[Turn2["Right"] = 3] = "Right";
  Turn2[Turn2["SlightRight"] = 4] = "SlightRight";
  Turn2[Turn2["Straight"] = 5] = "Straight";
  Turn2[Turn2["SlightLeft"] = 6] = "SlightLeft";
  Turn2[Turn2["Left"] = 7] = "Left";
  Turn2[Turn2["SharpLeft"] = 8] = "SharpLeft";
  return Turn2;
})(Turn || {});

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/step-maneuver.ts
var StepManeuver = class _StepManeuver {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsStepManeuver(bb, obj) {
    return (obj || new _StepManeuver()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsStepManeuver(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers6.SIZE_PREFIX_LENGTH);
    return (obj || new _StepManeuver()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  location(obj) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? (obj || new Position()).__init(this.bb_pos + offset, this.bb) : null;
  }
  bearingBefore() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
  }
  bearingAfter() {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
  }
  type() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.readInt8(this.bb_pos + offset) : 0 /* Turn */;
  }
  modifier() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.readInt8(this.bb_pos + offset) : 0 /* None */;
  }
  exit() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
  }
  static startStepManeuver(builder) {
    builder.startObject(6);
  }
  static addLocation(builder, locationOffset) {
    builder.addFieldStruct(0, locationOffset, 0);
  }
  static addBearingBefore(builder, bearingBefore) {
    builder.addFieldInt16(1, bearingBefore, 0);
  }
  static addBearingAfter(builder, bearingAfter) {
    builder.addFieldInt16(2, bearingAfter, 0);
  }
  static addType(builder, type) {
    builder.addFieldInt8(3, type, 0 /* Turn */);
  }
  static addModifier(builder, modifier) {
    builder.addFieldInt8(4, modifier, 0 /* None */);
  }
  static addExit(builder, exit) {
    builder.addFieldInt8(5, exit, 0);
  }
  static endStepManeuver(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createStepManeuver(builder, locationOffset, bearingBefore, bearingAfter, type, modifier, exit) {
    _StepManeuver.startStepManeuver(builder);
    _StepManeuver.addLocation(builder, locationOffset);
    _StepManeuver.addBearingBefore(builder, bearingBefore);
    _StepManeuver.addBearingAfter(builder, bearingAfter);
    _StepManeuver.addType(builder, type);
    _StepManeuver.addModifier(builder, modifier);
    _StepManeuver.addExit(builder, exit);
    return _StepManeuver.endStepManeuver(builder);
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/step.ts
var Step = class _Step {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsStep(bb, obj) {
    return (obj || new _Step()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsStep(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers7.SIZE_PREFIX_LENGTH);
    return (obj || new _Step()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  distance() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  duration() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  polyline(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  coordinates(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? (obj || new Position()).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
  }
  coordinatesLength() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  weight() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  name(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  ref(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 16);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  pronunciation(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 18);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  destinations(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 20);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  exits(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 22);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  mode(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 24);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  maneuver(obj) {
    const offset = this.bb.__offset(this.bb_pos, 26);
    return offset ? (obj || new StepManeuver()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  }
  intersections(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 28);
    return offset ? (obj || new Intersection()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  }
  intersectionsLength() {
    const offset = this.bb.__offset(this.bb_pos, 28);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  rotaryName(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 30);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  rotaryPronunciation(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 32);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  drivingSide() {
    const offset = this.bb.__offset(this.bb_pos, 34);
    return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  }
  static startStep(builder) {
    builder.startObject(16);
  }
  static addDistance(builder, distance) {
    builder.addFieldFloat32(0, distance, 0);
  }
  static addDuration(builder, duration) {
    builder.addFieldFloat32(1, duration, 0);
  }
  static addPolyline(builder, polylineOffset) {
    builder.addFieldOffset(2, polylineOffset, 0);
  }
  static addCoordinates(builder, coordinatesOffset) {
    builder.addFieldOffset(3, coordinatesOffset, 0);
  }
  static startCoordinatesVector(builder, numElems) {
    builder.startVector(8, numElems, 4);
  }
  static addWeight(builder, weight) {
    builder.addFieldFloat32(4, weight, 0);
  }
  static addName(builder, nameOffset) {
    builder.addFieldOffset(5, nameOffset, 0);
  }
  static addRef(builder, refOffset) {
    builder.addFieldOffset(6, refOffset, 0);
  }
  static addPronunciation(builder, pronunciationOffset) {
    builder.addFieldOffset(7, pronunciationOffset, 0);
  }
  static addDestinations(builder, destinationsOffset) {
    builder.addFieldOffset(8, destinationsOffset, 0);
  }
  static addExits(builder, exitsOffset) {
    builder.addFieldOffset(9, exitsOffset, 0);
  }
  static addMode(builder, modeOffset) {
    builder.addFieldOffset(10, modeOffset, 0);
  }
  static addManeuver(builder, maneuverOffset) {
    builder.addFieldOffset(11, maneuverOffset, 0);
  }
  static addIntersections(builder, intersectionsOffset) {
    builder.addFieldOffset(12, intersectionsOffset, 0);
  }
  static createIntersectionsVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startIntersectionsVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addRotaryName(builder, rotaryNameOffset) {
    builder.addFieldOffset(13, rotaryNameOffset, 0);
  }
  static addRotaryPronunciation(builder, rotaryPronunciationOffset) {
    builder.addFieldOffset(14, rotaryPronunciationOffset, 0);
  }
  static addDrivingSide(builder, drivingSide) {
    builder.addFieldInt8(15, +drivingSide, 0);
  }
  static endStep(builder) {
    const offset = builder.endObject();
    return offset;
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/leg.ts
var Leg = class _Leg {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsLeg(bb, obj) {
    return (obj || new _Leg()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsLeg(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers8.SIZE_PREFIX_LENGTH);
    return (obj || new _Leg()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  distance() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0;
  }
  duration() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0;
  }
  weight() {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0;
  }
  summary(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  annotations(obj) {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? (obj || new Annotation()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  }
  steps(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? (obj || new Step()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  }
  stepsLength() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  static startLeg(builder) {
    builder.startObject(6);
  }
  static addDistance(builder, distance) {
    builder.addFieldFloat64(0, distance, 0);
  }
  static addDuration(builder, duration) {
    builder.addFieldFloat64(1, duration, 0);
  }
  static addWeight(builder, weight) {
    builder.addFieldFloat64(2, weight, 0);
  }
  static addSummary(builder, summaryOffset) {
    builder.addFieldOffset(3, summaryOffset, 0);
  }
  static addAnnotations(builder, annotationsOffset) {
    builder.addFieldOffset(4, annotationsOffset, 0);
  }
  static addSteps(builder, stepsOffset) {
    builder.addFieldOffset(5, stepsOffset, 0);
  }
  static createStepsVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startStepsVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static endLeg(builder) {
    const offset = builder.endObject();
    return offset;
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/route-object.ts
var RouteObject = class _RouteObject {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsRouteObject(bb, obj) {
    return (obj || new _RouteObject()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsRouteObject(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers9.SIZE_PREFIX_LENGTH);
    return (obj || new _RouteObject()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  distance() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  duration() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  weight() {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  weightName(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  confidence() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  polyline(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  coordinates(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 16);
    return offset ? (obj || new Position()).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
  }
  coordinatesLength() {
    const offset = this.bb.__offset(this.bb_pos, 16);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  legs(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 18);
    return offset ? (obj || new Leg()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  }
  legsLength() {
    const offset = this.bb.__offset(this.bb_pos, 18);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  static startRouteObject(builder) {
    builder.startObject(8);
  }
  static addDistance(builder, distance) {
    builder.addFieldFloat32(0, distance, 0);
  }
  static addDuration(builder, duration) {
    builder.addFieldFloat32(1, duration, 0);
  }
  static addWeight(builder, weight) {
    builder.addFieldFloat32(2, weight, 0);
  }
  static addWeightName(builder, weightNameOffset) {
    builder.addFieldOffset(3, weightNameOffset, 0);
  }
  static addConfidence(builder, confidence) {
    builder.addFieldFloat32(4, confidence, 0);
  }
  static addPolyline(builder, polylineOffset) {
    builder.addFieldOffset(5, polylineOffset, 0);
  }
  static addCoordinates(builder, coordinatesOffset) {
    builder.addFieldOffset(6, coordinatesOffset, 0);
  }
  static startCoordinatesVector(builder, numElems) {
    builder.startVector(8, numElems, 4);
  }
  static addLegs(builder, legsOffset) {
    builder.addFieldOffset(7, legsOffset, 0);
  }
  static createLegsVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startLegsVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static endRouteObject(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createRouteObject(builder, distance, duration, weight, weightNameOffset, confidence, polylineOffset, coordinatesOffset, legsOffset) {
    _RouteObject.startRouteObject(builder);
    _RouteObject.addDistance(builder, distance);
    _RouteObject.addDuration(builder, duration);
    _RouteObject.addWeight(builder, weight);
    _RouteObject.addWeightName(builder, weightNameOffset);
    _RouteObject.addConfidence(builder, confidence);
    _RouteObject.addPolyline(builder, polylineOffset);
    _RouteObject.addCoordinates(builder, coordinatesOffset);
    _RouteObject.addLegs(builder, legsOffset);
    return _RouteObject.endRouteObject(builder);
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/table-result.ts
import * as flatbuffers11 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/waypoint.ts
import * as flatbuffers10 from "flatbuffers";

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/uint64-pair.ts
var Uint64Pair = class {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  first() {
    return this.bb.readUint64(this.bb_pos);
  }
  second() {
    return this.bb.readUint64(this.bb_pos + 8);
  }
  static sizeOf() {
    return 16;
  }
  static createUint64Pair(builder, first, second) {
    builder.prep(8, 16);
    builder.writeInt64(BigInt(second ?? 0));
    builder.writeInt64(BigInt(first ?? 0));
    return builder.offset();
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/waypoint.ts
var Waypoint = class _Waypoint {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsWaypoint(bb, obj) {
    return (obj || new _Waypoint()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsWaypoint(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers10.SIZE_PREFIX_LENGTH);
    return (obj || new _Waypoint()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  hint(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  distance() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0;
  }
  name(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  location(obj) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? (obj || new Position()).__init(this.bb_pos + offset, this.bb) : null;
  }
  nodes(obj) {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? (obj || new Uint64Pair()).__init(this.bb_pos + offset, this.bb) : null;
  }
  matchingsIndex() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
  }
  waypointIndex() {
    const offset = this.bb.__offset(this.bb_pos, 16);
    return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
  }
  alternativesCount() {
    const offset = this.bb.__offset(this.bb_pos, 18);
    return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
  }
  tripsIndex() {
    const offset = this.bb.__offset(this.bb_pos, 20);
    return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
  }
  static startWaypoint(builder) {
    builder.startObject(9);
  }
  static addHint(builder, hintOffset) {
    builder.addFieldOffset(0, hintOffset, 0);
  }
  static addDistance(builder, distance) {
    builder.addFieldFloat32(1, distance, 0);
  }
  static addName(builder, nameOffset) {
    builder.addFieldOffset(2, nameOffset, 0);
  }
  static addLocation(builder, locationOffset) {
    builder.addFieldStruct(3, locationOffset, 0);
  }
  static addNodes(builder, nodesOffset) {
    builder.addFieldStruct(4, nodesOffset, 0);
  }
  static addMatchingsIndex(builder, matchingsIndex) {
    builder.addFieldInt32(5, matchingsIndex, 0);
  }
  static addWaypointIndex(builder, waypointIndex) {
    builder.addFieldInt32(6, waypointIndex, 0);
  }
  static addAlternativesCount(builder, alternativesCount) {
    builder.addFieldInt32(7, alternativesCount, 0);
  }
  static addTripsIndex(builder, tripsIndex) {
    builder.addFieldInt32(8, tripsIndex, 0);
  }
  static endWaypoint(builder) {
    const offset = builder.endObject();
    return offset;
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/table-result.ts
var TableResult = class _TableResult {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsTableResult(bb, obj) {
    return (obj || new _TableResult()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsTableResult(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers11.SIZE_PREFIX_LENGTH);
    return (obj || new _TableResult()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  durations(index) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  durationsLength() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  durationsArray() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  rows() {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
  }
  cols() {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
  }
  distances(index) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  distancesLength() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  distancesArray() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  destinations(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? (obj || new Waypoint()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  }
  destinationsLength() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  fallbackSpeedCells(index) {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  }
  fallbackSpeedCellsLength() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  fallbackSpeedCellsArray() {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  }
  static startTableResult(builder) {
    builder.startObject(6);
  }
  static addDurations(builder, durationsOffset) {
    builder.addFieldOffset(0, durationsOffset, 0);
  }
  static createDurationsVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addFloat32(data[i]);
    }
    return builder.endVector();
  }
  static startDurationsVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addRows(builder, rows) {
    builder.addFieldInt16(1, rows, 0);
  }
  static addCols(builder, cols) {
    builder.addFieldInt16(2, cols, 0);
  }
  static addDistances(builder, distancesOffset) {
    builder.addFieldOffset(3, distancesOffset, 0);
  }
  static createDistancesVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addFloat32(data[i]);
    }
    return builder.endVector();
  }
  static startDistancesVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addDestinations(builder, destinationsOffset) {
    builder.addFieldOffset(4, destinationsOffset, 0);
  }
  static createDestinationsVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startDestinationsVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addFallbackSpeedCells(builder, fallbackSpeedCellsOffset) {
    builder.addFieldOffset(5, fallbackSpeedCellsOffset, 0);
  }
  static createFallbackSpeedCellsVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addInt32(data[i]);
    }
    return builder.endVector();
  }
  static startFallbackSpeedCellsVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static endTableResult(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createTableResult(builder, durationsOffset, rows, cols, distancesOffset, destinationsOffset, fallbackSpeedCellsOffset) {
    _TableResult.startTableResult(builder);
    _TableResult.addDurations(builder, durationsOffset);
    _TableResult.addRows(builder, rows);
    _TableResult.addCols(builder, cols);
    _TableResult.addDistances(builder, distancesOffset);
    _TableResult.addDestinations(builder, destinationsOffset);
    _TableResult.addFallbackSpeedCells(builder, fallbackSpeedCellsOffset);
    return _TableResult.endTableResult(builder);
  }
};

// ../../../../../tmp/fbresult-bundle/osrm/engine/api/fbresult/fbresult.ts
var FBResult = class _FBResult {
  bb = null;
  bb_pos = 0;
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsFBResult(bb, obj) {
    return (obj || new _FBResult()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsFBResult(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers12.SIZE_PREFIX_LENGTH);
    return (obj || new _FBResult()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  error() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  }
  code(obj) {
    const offset = this.bb.__offset(this.bb_pos, 6);
    return offset ? (obj || new Error()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  }
  dataVersion(optionalEncoding) {
    const offset = this.bb.__offset(this.bb_pos, 8);
    return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  }
  waypoints(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? (obj || new Waypoint()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  }
  waypointsLength() {
    const offset = this.bb.__offset(this.bb_pos, 10);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  routes(index, obj) {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? (obj || new RouteObject()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  }
  routesLength() {
    const offset = this.bb.__offset(this.bb_pos, 12);
    return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  }
  table(obj) {
    const offset = this.bb.__offset(this.bb_pos, 14);
    return offset ? (obj || new TableResult()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  }
  static startFBResult(builder) {
    builder.startObject(6);
  }
  static addError(builder, error) {
    builder.addFieldInt8(0, +error, 0);
  }
  static addCode(builder, codeOffset) {
    builder.addFieldOffset(1, codeOffset, 0);
  }
  static addDataVersion(builder, dataVersionOffset) {
    builder.addFieldOffset(2, dataVersionOffset, 0);
  }
  static addWaypoints(builder, waypointsOffset) {
    builder.addFieldOffset(3, waypointsOffset, 0);
  }
  static createWaypointsVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startWaypointsVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addRoutes(builder, routesOffset) {
    builder.addFieldOffset(4, routesOffset, 0);
  }
  static createRoutesVector(builder, data) {
    builder.startVector(4, data.length, 4);
    for (let i = data.length - 1; i >= 0; i--) {
      builder.addOffset(data[i]);
    }
    return builder.endVector();
  }
  static startRoutesVector(builder, numElems) {
    builder.startVector(4, numElems, 4);
  }
  static addTable(builder, tableOffset) {
    builder.addFieldOffset(5, tableOffset, 0);
  }
  static endFBResult(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static finishFBResultBuffer(builder, offset) {
    builder.finish(offset);
  }
  static finishSizePrefixedFBResultBuffer(builder, offset) {
    builder.finish(offset, void 0, true);
  }
};
export {
  Annotation,
  Error,
  FBResult,
  Intersection,
  Lane,
  Leg,
  ManeuverType,
  Metadata,
  Position,
  RouteObject,
  Step,
  StepManeuver,
  TableResult,
  Turn,
  Uint64Pair,
  Waypoint
};

// Create the namespace structure matching the old API for backward compatibility
const osrm = {
  engine: {
    api: {
      fbresult: {
        Annotation,
        Error,
        FBResult,
        Intersection,
        Lane,
        Leg,
        ManeuverType,
        Metadata,
        Position,
        RouteObject,
        Step,
        StepManeuver,
        TableResult,
        Turn,
        Uint64Pair,
        Waypoint
      }
    }
  }
};

export { osrm };
