"use client";
var r = /* @__PURE__ */ ((E) => (E[E.PENDING = 0] = "PENDING", E[E.ASSIGNED = 1] = "ASSIGNED", E[E.EXTRACTED = 2] = "EXTRACTED", E[E.COMPLETED = 3] = "COMPLETED", E[E.SETTLED = 4] = "SETTLED", E[E.EXPIRED = 5] = "EXPIRED", E[E.CANCELLED = 6] = "CANCELLED", E[E.REFUND_PENDING = 7] = "REFUND_PENDING", E[E.REFUNDED = 8] = "REFUNDED", E[E.REVERTED = 9] = "REVERTED", E))(r || {});
function P(E) {
  const i = E < r.EXTRACTED || E === void 0, T = E === r.EXTRACTED, f = E >= r.COMPLETED && E < r.EXPIRED, N = E === r.EXPIRED, c = E === r.REVERTED, D = E === r.REFUND_PENDING, o = E === r.REFUNDED;
  return {
    isPending: i,
    inProgress: T,
    isCompleted: f,
    isExpired: N,
    isReverted: c,
    isRefunded: o,
    isRefunding: D
  };
}
const I = "609913096e1b3962cecd0ee5cd3d95f618d6a49af0fe870fef0faf88ff367039708902197e0b2b78b1d76cb0837ad0b318baedceb5fef75aad43e6cb";
function A({
  query: E,
  apiKey: i,
  body: T,
  method: f = "GET",
  affiliateId: N
}) {
  if (!i)
    throw new Error("API Key is required for bungeeApiFetcher");
  let c = {
    "x-api-key": i,
    affiliate: N || I
  };
  return T && f === "POST" && (c = {
    ...c,
    "Content-Type": "application/json"
  }), fetch(E, {
    headers: c,
    body: T,
    method: f
  }).then((D) => D.ok ? D.json() : D.json().then((o) => {
    console.log("error data: ", o);
    const n = o.message || "An error occurred";
    throw new Error(`${D.status}: ${n}`);
  }));
}
export {
  r as R,
  A as b,
  P as g
};
//# sourceMappingURL=fetcher-D4o2k9tU.js.map
