"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 wrappers_exports = {};
__export(wrappers_exports, {
  BoolValue: () => BoolValue,
  BytesValue: () => BytesValue,
  DoubleValue: () => DoubleValue,
  FloatValue: () => FloatValue,
  Int32Value: () => Int32Value,
  Int64Value: () => Int64Value,
  StringValue: () => StringValue,
  UInt32Value: () => UInt32Value,
  UInt64Value: () => UInt64Value
});
module.exports = __toCommonJS(wrappers_exports);
const baseDoubleValue = { value: 0 };
const DoubleValue = {
  fromJSON(object) {
    const message = { ...baseDoubleValue };
    message.value = object.value !== void 0 && object.value !== null ? Number(object.value) : 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = message.value);
    return obj;
  }
};
const baseFloatValue = { value: 0 };
const FloatValue = {
  fromJSON(object) {
    const message = { ...baseFloatValue };
    message.value = object.value !== void 0 && object.value !== null ? Number(object.value) : 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = message.value);
    return obj;
  }
};
const baseInt64Value = { value: "0" };
const Int64Value = {
  fromJSON(object) {
    const message = { ...baseInt64Value };
    message.value = object.value !== void 0 && object.value !== null ? String(object.value) : "0";
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = message.value);
    return obj;
  }
};
const baseUInt64Value = { value: "0" };
const UInt64Value = {
  fromJSON(object) {
    const message = { ...baseUInt64Value };
    message.value = object.value !== void 0 && object.value !== null ? String(object.value) : "0";
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = message.value);
    return obj;
  }
};
const baseInt32Value = { value: 0 };
const Int32Value = {
  fromJSON(object) {
    const message = { ...baseInt32Value };
    message.value = object.value !== void 0 && object.value !== null ? Number(object.value) : 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = Math.round(message.value));
    return obj;
  }
};
const baseUInt32Value = { value: 0 };
const UInt32Value = {
  fromJSON(object) {
    const message = { ...baseUInt32Value };
    message.value = object.value !== void 0 && object.value !== null ? Number(object.value) : 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = Math.round(message.value));
    return obj;
  }
};
const baseBoolValue = { value: false };
const BoolValue = {
  fromJSON(object) {
    const message = { ...baseBoolValue };
    message.value = object.value !== void 0 && object.value !== null ? Boolean(object.value) : false;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = message.value);
    return obj;
  }
};
const baseStringValue = { value: "" };
const StringValue = {
  fromJSON(object) {
    const message = { ...baseStringValue };
    message.value = object.value !== void 0 && object.value !== null ? String(object.value) : "";
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = message.value);
    return obj;
  }
};
const baseBytesValue = {};
const BytesValue = {
  fromJSON(object) {
    const message = { ...baseBytesValue };
    message.value = object.value !== void 0 && object.value !== null ? bytesFromBase64(object.value) : new Uint8Array();
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.value !== void 0 && (obj.value = base64FromBytes(
      message.value !== void 0 ? message.value : new Uint8Array()
    ));
    return obj;
  }
};
var globalThis = (() => {
  if (typeof globalThis !== "undefined") return globalThis;
  if (typeof self !== "undefined") return self;
  if (typeof window !== "undefined") return window;
  if (typeof global !== "undefined") return global;
  throw "Unable to locate global object";
})();
const atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64) {
  const bin = atob(b64);
  const arr = new Uint8Array(bin.length);
  for (let i = 0; i < bin.length; ++i) {
    arr[i] = bin.charCodeAt(i);
  }
  return arr;
}
const btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr) {
  const bin = [];
  for (const byte of arr) {
    bin.push(String.fromCharCode(byte));
  }
  return btoa(bin.join(""));
}
//# sourceMappingURL=wrappers.js.map
