function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
import { isMultiDayProduct } from "../../../components/booking/info2/service/addService/utils";
function isMultiDayLike(candidate) {
  var _candidate$flexible, _candidate$_extend;
  if (!candidate || _typeof(candidate) !== 'object') return false;
  if (isMultiDayProduct(candidate)) return true;
  if (candidate.duration_type === 'days') return true;
  if ((candidate === null || candidate === void 0 || (_candidate$flexible = candidate.flexible) === null || _candidate$flexible === void 0 || (_candidate$flexible = _candidate$flexible.duration) === null || _candidate$flexible === void 0 ? void 0 : _candidate$flexible.type) === 'days') return true;
  if ((candidate === null || candidate === void 0 || (_candidate$_extend = candidate._extend) === null || _candidate$_extend === void 0 ? void 0 : _candidate$_extend.sub_type) === 'days') return true;
  return false;
}

/**
 * 判断是否跨日商品（对齐 ticketBooking `isMultiDayProduct(detail || item)`，并回退到 catalog 商品）。
 *
 * 规格弹窗 callback 的 detail 往往不含 `duration`；列表商品有时只有 `duration_type` 等字段。
 */
export function resolveIsMultiDayProduct() {
  for (var _len = arguments.length, candidates = new Array(_len), _key = 0; _key < _len; _key++) {
    candidates[_key] = arguments[_key];
  }
  return candidates.some(function (item) {
    return isMultiDayLike(item);
  });
}