"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const reactBindingUi = require("@contember/react-binding-ui");
const defaultUploader = require("../../defaultUploader.cjs");
const getVideoFileDataExtractor = require("../../fileDataExtractors/getVideoFileDataExtractor.cjs");
const getFileUrlDataExtractor = require("../../fileDataExtractors/getFileUrlDataExtractor.cjs");
const getGenericFileMetadataExtractor = require("../../fileDataExtractors/getGenericFileMetadataExtractor.cjs");
const acceptVideoFile = ({ file }) => file.type.startsWith("video");
const renderVideoFilePreview = ({ objectUrl }) => /* @__PURE__ */ jsxRuntime.jsx("video", { src: objectUrl, controls: true });
const getStockVideoFileKind = ({
  additionalExtractors = [],
  acceptMimeTypes = "video/*",
  acceptFile = acceptVideoFile,
  baseEntity,
  children,
  durationField,
  fileSizeField,
  fileTypeField,
  lastModifiedField,
  fileNameField,
  renderFilePreview = renderVideoFilePreview,
  renderUploadedFile,
  heightField,
  widthField,
  uploader = defaultUploader.defaultUploader,
  urlField,
  childrenOutsideBaseEntity
}) => {
  const extractors = [
    getFileUrlDataExtractor.getFileUrlDataExtractor({ urlField }),
    getGenericFileMetadataExtractor.getGenericFileMetadataExtractor({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }),
    getVideoFileDataExtractor.getVideoFileDataExtractor({ heightField, widthField, durationField }),
    ...additionalExtractors
  ];
  return {
    acceptMimeTypes,
    acceptFile,
    renderFilePreview,
    uploader,
    renderUploadedFile: renderUploadedFile ?? /* @__PURE__ */ jsxRuntime.jsx(reactBindingUi.VideoFieldView, { srcField: urlField }),
    children,
    childrenOutsideBaseEntity,
    baseEntity,
    extractors
  };
};
exports.acceptVideoFile = acceptVideoFile;
exports.getStockVideoFileKind = getStockVideoFileKind;
exports.renderVideoFilePreview = renderVideoFilePreview;
//# sourceMappingURL=getStockVideoFileKind.cjs.map
