"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const reactBinding = require("@contember/react-binding");
const AddNewBlockButton = require("./AddNewBlockButton.cjs");
const SortableBlock = require("./SortableBlock.cjs");
const useNormalizedBlocks = require("../../blocks/useNormalizedBlocks.cjs");
const Repeater = require("../Repeater/Repeater.cjs");
const DiscriminatedBlocks = require("../../blocks/DiscriminatedBlocks.cjs");
const BlockRepeater = reactBinding.Component(
  ({ discriminationField, ...props }) => {
    const normalizedBlocks = useNormalizedBlocks.useNormalizedBlocks(props.children);
    const extraProps = {
      normalizedBlocks,
      discriminationField
    };
    return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
      Repeater.Repeater,
      {
        ...props,
        addButtonComponent: AddNewBlockButton.AddNewBlockButton,
        addButtonComponentExtraProps: extraProps,
        itemComponent: SortableBlock.SortableBlock,
        itemComponentExtraProps: extraProps,
        children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, {}, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx",
          lineNumber: 39,
          columnNumber: 5
        }, void 0)
      },
      void 0,
      false,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx",
        lineNumber: 32,
        columnNumber: 4
      },
      void 0
    );
  },
  (props) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(Repeater.Repeater, { ...props, initialEntityCount: 0, children: [
    typeof props.discriminationField === "string" && /* @__PURE__ */ jsxDevRuntime.jsxDEV(DiscriminatedBlocks.DiscriminatedBlocks, { field: props.discriminationField, label: props.label, children: props.children }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx",
      lineNumber: 46,
      columnNumber: 5
    }, void 0),
    typeof props.discriminationField === "string" || /* @__PURE__ */ jsxDevRuntime.jsxDEV(DiscriminatedBlocks.DiscriminatedBlocks, { ...props.discriminationField, label: props.label, children: props.children }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx",
      lineNumber: 51,
      columnNumber: 5
    }, void 0)
  ] }, void 0, true, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx",
    lineNumber: 44,
    columnNumber: 3
  }, void 0),
  "SortableBlockRepeater"
);
exports.BlockRepeater = BlockRepeater;
//# sourceMappingURL=BlockRepeater.cjs.map
