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/components/booking/info/hooks/useHolderConfig.ts
var useHolderConfig_exports = {};
__export(useHolderConfig_exports, {
  default: () => useHolderConfig_default
});
module.exports = __toCommonJS(useHolderConfig_exports);
var import_react = require("react");
var import_utils = require("../../utils");
var useHolderConfig = (state) => {
  var _a, _b, _c, _d, _e, _f;
  const appointment_subject = (0, import_react.useMemo)(() => {
    var _a2, _b2, _c2;
    return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_subject) || {};
  }, [(_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject]);
  const holder = (0, import_react.useMemo)(() => {
    var _a2;
    return ((_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.holder) || {};
  }, [(_d = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _d.holder]);
  const isFormSubject = (0, import_react.useMemo)(() => {
    return appointment_subject.type === "form";
  }, [appointment_subject.type]);
  const isWalkInBol = (0, import_react.useMemo)(() => {
    var _a2, _b2;
    return (0, import_utils.isWalkIn)((_b2 = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id);
  }, [(_f = (_e = state == null ? void 0 : state.client) == null ? void 0 : _e.value) == null ? void 0 : _f.id]);
  const isCustomerSubject = (0, import_react.useMemo)(() => {
    return appointment_subject.type === "customer";
  }, [appointment_subject.type]);
  const isShowChangeHolder = (0, import_react.useMemo)(() => {
    return isFormSubject && !isWalkInBol;
  }, [isFormSubject, isWalkInBol]);
  return {
    appointment_subject,
    holder,
    isFormSubject,
    isCustomerSubject,
    isWalkInBol,
    isShowChangeHolder
  };
};
var useHolderConfig_default = useHolderConfig;
