"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const reactBindingUi = require("@contember/react-binding-ui");
const defaultUploader = require("../../defaultUploader.cjs");
const getAudioFileDataExtractor = require("../../fileDataExtractors/getAudioFileDataExtractor.cjs");
const getFileUrlDataExtractor = require("../../fileDataExtractors/getFileUrlDataExtractor.cjs");
const getGenericFileMetadataExtractor = require("../../fileDataExtractors/getGenericFileMetadataExtractor.cjs");
const acceptAudioFile = ({ file }) => file.type.startsWith("audio");
const renderAudioFilePreview = ({ objectUrl }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV("audio", { src: objectUrl, controls: true }, void 0, false, {
  fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockAudioFileKind.tsx",
  lineNumber: 18,
  columnNumber: 84
}, void 0);
const getStockAudioFileKind = ({
  additionalExtractors = [],
  acceptMimeTypes = "audio/*",
  acceptFile = acceptAudioFile,
  baseEntity,
  children,
  durationField,
  fileSizeField,
  fileTypeField,
  lastModifiedField,
  fileNameField,
  renderFilePreview = renderAudioFilePreview,
  renderUploadedFile,
  uploader = defaultUploader.defaultUploader,
  urlField,
  childrenOutsideBaseEntity
}) => {
  const extractors = [
    getFileUrlDataExtractor.getFileUrlDataExtractor({ urlField }),
    getGenericFileMetadataExtractor.getGenericFileMetadataExtractor({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }),
    getAudioFileDataExtractor.getAudioFileDataExtractor({ durationField }),
    ...additionalExtractors
  ];
  return {
    acceptMimeTypes,
    acceptFile,
    renderFilePreview,
    uploader,
    renderUploadedFile: renderUploadedFile ?? /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBindingUi.FileUrlFieldView, { fileUrlField: urlField }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockAudioFileKind.tsx",
      lineNumber: 49,
      columnNumber: 45
    }, void 0),
    baseEntity,
    children,
    childrenOutsideBaseEntity,
    extractors
  };
};
exports.acceptAudioFile = acceptAudioFile;
exports.getStockAudioFileKind = getStockAudioFileKind;
exports.renderAudioFilePreview = renderAudioFilePreview;
//# sourceMappingURL=getStockAudioFileKind.cjs.map
