"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 getFileUrlDataExtractor = require("../../fileDataExtractors/getFileUrlDataExtractor.cjs");
const getGenericFileMetadataExtractor = require("../../fileDataExtractors/getGenericFileMetadataExtractor.cjs");
const acceptAnyFile = () => true;
const renderAnyFilePreview = ({ objectUrl }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(
  "a",
  {
    style: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", direction: "rtl" },
    href: objectUrl,
    onClick: (e) => e.stopPropagation(),
    download: true,
    children: objectUrl.substring(Math.max(0, objectUrl.lastIndexOf("/") + 1))
  },
  void 0,
  false,
  {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockAnyFileKind.tsx",
    lineNumber: 13,
    columnNumber: 2
  },
  void 0
);
const getStockAnyFileKind = ({
  additionalExtractors = [],
  acceptMimeTypes = null,
  acceptFile = acceptAnyFile,
  baseEntity,
  children,
  fileSizeField,
  fileTypeField,
  lastModifiedField,
  fileNameField,
  renderFilePreview = renderAnyFilePreview,
  renderUploadedFile,
  uploader = defaultUploader.defaultUploader,
  urlField,
  childrenOutsideBaseEntity
}) => {
  const extractors = [
    getFileUrlDataExtractor.getFileUrlDataExtractor({ urlField }),
    getGenericFileMetadataExtractor.getGenericFileMetadataExtractor({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }),
    ...additionalExtractors
  ];
  return {
    acceptMimeTypes,
    acceptFile,
    renderFilePreview,
    renderUploadedFile: renderUploadedFile ?? /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBindingUi.FileUrlFieldView, { fileUrlField: urlField }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockAnyFileKind.tsx",
      lineNumber: 49,
      columnNumber: 45
    }, void 0),
    uploader,
    children,
    childrenOutsideBaseEntity,
    baseEntity,
    extractors
  };
};
exports.acceptAnyFile = acceptAnyFile;
exports.getStockAnyFileKind = getStockAnyFileKind;
exports.renderAnyFilePreview = renderAnyFilePreview;
//# sourceMappingURL=getStockAnyFileKind.cjs.map
