"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const reactBinding = require("@contember/react-binding");
const getFileUrlDataExtractor = ({ urlField }) => ({
  staticRender: () => /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.SugaredField, { field: urlField }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getFileUrlDataExtractor.tsx",
    lineNumber: 13,
    columnNumber: 22
  }, void 0),
  populateFields: ({ entity, uploadResult }) => {
    if (!uploadResult.fileUrl || typeof uploadResult.fileUrl !== "string") {
      return;
    }
    entity.getField(urlField).updateValue(uploadResult.fileUrl);
  },
  getErrorsHolders: ({ entity, environment }) => {
    const desugaredUrlField = reactBinding.QueryLanguage.desugarRelativeSingleField(urlField, environment);
    const owningEntity = entity.getRelativeSingleEntity({
      hasOneRelationPath: desugaredUrlField.hasOneRelationPath
    });
    return [entity.getField(urlField), owningEntity];
  }
});
exports.getFileUrlDataExtractor = getFileUrlDataExtractor;
//# sourceMappingURL=getFileUrlDataExtractor.cjs.map
