"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var experimental_features_exports = {};
__export(experimental_features_exports, {
  ExperimentalCommandInspectionService: () => ExperimentalCommandInspectionService,
  ExperimentalFeatures: () => ExperimentalFeatures,
  ExperimentalPartyTopologyEvents: () => ExperimentalPartyTopologyEvents,
  ExperimentalStaticTime: () => ExperimentalStaticTime
});
module.exports = __toCommonJS(experimental_features_exports);
var import_runtime = require("@protobuf-ts/runtime");
var import_runtime2 = require("@protobuf-ts/runtime");
var import_runtime3 = require("@protobuf-ts/runtime");
var import_runtime4 = require("@protobuf-ts/runtime");
class ExperimentalFeatures$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.ExperimentalFeatures", [
      {
        no: 1,
        name: "static_time",
        kind: "message",
        T: () => ExperimentalStaticTime
      },
      {
        no: 2,
        name: "command_inspection_service",
        kind: "message",
        T: () => ExperimentalCommandInspectionService
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.ExperimentalStaticTime static_time */
        1:
          message.staticTime = ExperimentalStaticTime.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.staticTime
          );
          break;
        case /* com.daml.ledger.api.v2.ExperimentalCommandInspectionService command_inspection_service */
        2:
          message.commandInspectionService = ExperimentalCommandInspectionService.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.commandInspectionService
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.staticTime)
      ExperimentalStaticTime.internalBinaryWrite(
        message.staticTime,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.commandInspectionService)
      ExperimentalCommandInspectionService.internalBinaryWrite(
        message.commandInspectionService,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ExperimentalFeatures = new ExperimentalFeatures$Type();
class ExperimentalStaticTime$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.ExperimentalStaticTime", [
      {
        no: 1,
        name: "supported",
        kind: "scalar",
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.supported = false;
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* bool supported */
        1:
          message.supported = reader.bool();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.supported !== false)
      writer.tag(1, import_runtime.WireType.Varint).bool(message.supported);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ExperimentalStaticTime = new ExperimentalStaticTime$Type();
class ExperimentalCommandInspectionService$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.ExperimentalCommandInspectionService", [
      {
        no: 1,
        name: "supported",
        kind: "scalar",
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.supported = false;
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* bool supported */
        1:
          message.supported = reader.bool();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.supported !== false)
      writer.tag(1, import_runtime.WireType.Varint).bool(message.supported);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ExperimentalCommandInspectionService = new ExperimentalCommandInspectionService$Type();
class ExperimentalPartyTopologyEvents$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.ExperimentalPartyTopologyEvents", [
      {
        no: 1,
        name: "supported",
        kind: "scalar",
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.supported = false;
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* bool supported */
        1:
          message.supported = reader.bool();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.supported !== false)
      writer.tag(1, import_runtime.WireType.Varint).bool(message.supported);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ExperimentalPartyTopologyEvents = new ExperimentalPartyTopologyEvents$Type();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ExperimentalCommandInspectionService,
  ExperimentalFeatures,
  ExperimentalPartyTopologyEvents,
  ExperimentalStaticTime
});
//# sourceMappingURL=experimental_features.cjs.map