import { jsx as h } from "@emotion/react/jsx-runtime";
import { normalizeImageSelectorPropsFromBackend as L } from "./normalizeImageSelectorPropsFromBackend.js";
import { resolveFieldHelperMessage as M, resolveFieldMandatory as S } from "../../../resolveFieldContractAliases.js";
import { RHFImageSelector as z } from "../../../../../hook-form/RHFImageSelector/RHFImageSelector.js";
const q = {
  componentIds: ["RHFImageSelector"],
  /** Renders RHFImageSelector with normalized path-based resolvers and sync/async option handling. */
  render(r) {
    const { field: e, props: s } = r, { size: n = "medium", disabled: a, readOnly: l, getLabel: i, hostApiRemote: p, suppressLabel: m } = s, { name: d, endpoint: o, endpointParams: c } = e, g = M(e), b = S(e), u = L(e, i, p), {
      resolvedLabel: O,
      resolvedOptions: t,
      resolvedGetOptionImage: f,
      resolvedGetOptionLabel: v,
      resolvedIsOptionEqualToValue: y,
      ...I
    } = u, F = typeof o == "string" && o.trim() !== "" && t.length === 0;
    return /* @__PURE__ */ h(
      z,
      {
        name: d,
        size: n,
        ...!m && { label: O, mandatory: b },
        helperMessage: g || "",
        disabled: a || l,
        getOptionLabel: v,
        getOptionImage: f,
        isOptionEqualToValue: y,
        ...I,
        ...F ? {
          endpoint: o,
          parms: c
        } : {
          options: t
        }
      }
    );
  }
};
export {
  q as imageSelectorStrategy
};
