import { Item } from "@payfunc/model";
import { Settlement, State } from "@payfunc/model-acquirer";
export { Settlement as AcquirerSettlement };
export { State as ModelState };
import { Type } from "selectively";
import { Event } from "@payfunc/model";
export { Type as SelectivelyType };
export { Event as modelEvent };
export function getWarningMessage(entry) {
  var _a, _b, _c, _d, _e, _f, _g;
  const message = (_f = (_c = (_b = (_a = entry.data.body) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.description) !== null && _c !== void 0 ? _c : (_e = (_d = entry.data.body) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.type) !== null && _f !== void 0 ? _f : (_g = entry.data.body) === null || _g === void 0 ? void 0 : _g.type;
  return message ? message.replace(".", "").toLowerCase() : entry.level;
}
export function hasValue(element) {
  return element.value == undefined || typeof element.value === "string";
}
export function isDefined(value) {
  return value != undefined;
}
export function itemToAmount(item) {
  var _a;
  return Array.isArray(item)
    ? item.reduce((r, i) => (r += i.price ? i.price : 0), 0)
    : Item.is(item)
      ? (_a = item.price) !== null && _a !== void 0 ? _a : 0
      : item;
}
