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);

// src/plus/pisellReservation/hooks/phoneGridInfiniteDataUtils.ts
var phoneGridInfiniteDataUtils_exports = {};
__export(phoneGridInfiniteDataUtils_exports, {
  mergePhoneGridRowsByRowKey: () => mergePhoneGridRowsByRowKey,
  resolvePhoneGridRowKey: () => resolvePhoneGridRowKey
});
module.exports = __toCommonJS(phoneGridInfiniteDataUtils_exports);
function resolvePhoneGridRowKey(record, rowKey) {
  if (typeof rowKey === "function") {
    return rowKey(record);
  }
  const value = record[rowKey];
  return value == null ? void 0 : value;
}
function mergePhoneGridRowsByRowKey(prev, nextPage, rowKey) {
  if (nextPage.length === 0) return prev;
  const seen = /* @__PURE__ */ new Set();
  const merged = [];
  const append = (row) => {
    if (row == null || typeof row !== "object") return;
    const key = resolvePhoneGridRowKey(row, rowKey);
    if (key != null) {
      if (seen.has(key)) return;
      seen.add(key);
    }
    merged.push(row);
  };
  prev.forEach(append);
  nextPage.forEach(append);
  return merged;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  mergePhoneGridRowsByRowKey,
  resolvePhoneGridRowKey
});
