var c = Object.defineProperty;
var s = (t, e) => c(t, "name", { value: e, configurable: !0 });
import { protoInt64 as u } from "../proto-int64.js";
import { ScalarType as r } from "../scalar.js";
function l(t, e, n) {
  if (e === n)
    return !0;
  if (t == r.BYTES) {
    if (!(e instanceof Uint8Array) || !(n instanceof Uint8Array) || e.length !== n.length)
      return !1;
    for (let a = 0; a < e.length; a++)
      if (e[a] !== n[a])
        return !1;
    return !0;
  }
  switch (t) {
    case r.UINT64:
    case r.FIXED64:
    case r.INT64:
    case r.SFIXED64:
    case r.SINT64:
      return e == n;
  }
  return !1;
}
s(l, "scalarEquals");
function I(t, e) {
  switch (t) {
    case r.BOOL:
      return !1;
    case r.UINT64:
    case r.FIXED64:
    case r.INT64:
    case r.SFIXED64:
    case r.SINT64:
      return e == 0 ? u.zero : "0";
    case r.DOUBLE:
    case r.FLOAT:
      return 0;
    case r.BYTES:
      return new Uint8Array(0);
    case r.STRING:
      return "";
    default:
      return 0;
  }
}
s(I, "scalarZeroValue");
function T(t, e) {
  switch (t) {
    case r.BOOL:
      return e === !1;
    case r.STRING:
      return e === "";
    case r.BYTES:
      return e instanceof Uint8Array && !e.byteLength;
    default:
      return e == 0;
  }
}
s(T, "isScalarZeroValue");
export {
  T as isScalarZeroValue,
  l as scalarEquals,
  I as scalarZeroValue
};
