import { jsxDEV } from "react/jsx-dev-runtime";
import { Component, BindingError, useEntityList, HasMany } from "@contember/binding";
import { RepeaterInner } from "./RepeaterInner.js";
const Repeater = Component(
  (props) => {
    {
      if ("sortableBy" in props && props.sortableBy !== void 0 && "orderBy" in props && props.orderBy !== void 0) {
        throw new BindingError(
          `Incorrect <Repeater /> use: cannot supply both the 'orderBy' and the 'sortableBy' properties.
	To allow the user to interactively order the items, use 'sortableBy'.
	To control the order in which the items are automatically displayed, use 'orderBy'.`
        );
      }
      if (!("sortableBy" in props) && !("orderBy" in props)) {
        throw new BindingError(
          `Using a <Repeater /> without either the 'orderBy' or the 'sortableBy' property. This will currently result in bad user experience as the items may shuffle unpredictably over time.	To allow the user to interactively order the items, use 'sortableBy'.
	To control the order in which the items are automatically displayed, use 'orderBy'.
	To disable this warning, set either of these to undefined.`
        );
      }
    }
    const entityList = useEntityList(props);
    return /* @__PURE__ */ jsxDEV(RepeaterInner, { ...props, accessor: entityList }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/Repeater.tsx",
      lineNumber: 42,
      columnNumber: 10
    }, globalThis);
  },
  (props, environment) => /* @__PURE__ */ jsxDEV(HasMany, { ...props, initialEntityCount: props.initialEntityCount ?? 1, children: RepeaterInner.staticRender(props, environment) }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/Repeater.tsx",
    lineNumber: 45,
    columnNumber: 3
  }, globalThis),
  "Repeater"
);
export {
  Repeater
};
//# sourceMappingURL=Repeater.js.map
