"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CallbackDetails=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),theme_1=require("@redocly/theme"),Responses_1=require("../Responses"),RequestDetails_1=require("../Request/RequestDetails"),LinkToField_1=require("../common/LinkToField"),services_1=require("../../services");function CallbackDetailsComponent({operation:e}){var t;const i=(0,react_1.useCallback)((t=>(0,jsx_runtime_1.jsxs)(Title,{children:[(0,jsx_runtime_1.jsx)(LinkToField_1.LinkToField,{to:(0,services_1.makeDeepLink)(e.id,`${e.callbackId}/callback-response&c=${t.key}`)}),"Callback Response"]})),[e.callbackId,e.id]);return(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(RequestDetails_1.RequestDetails,{operation:e,title:(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(LinkToField_1.LinkToField,{to:(0,services_1.makeDeepLink)(e.id,`${e.callbackId}/callback-request`)}),"Callback Request"]})}),(null===(t=e.responses)||void 0===t?void 0:t.length)?(0,jsx_runtime_1.jsx)(Responses_1.OperationResponseList,{responses:e.responses,operationId:e.id,operationPointer:e.pointer,callbackId:e.callbackId,renderTitle:i}):null]})}exports.CallbackDetails=(0,react_1.memo)(CallbackDetailsComponent);const Title=styled_components_1.default.h4`
  position: relative;
  font-size: var(--font-size-lg);
  font-weight: var(--h4-font-weight);
  line-height: var(--h4-line-height);
  padding: 0;
  color: var(--h4-text-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 var(--spacing-sm) 0 0;

  :hover {
    ${theme_1.LinkIcon} {
      opacity: 1;
      visibility: visible;
    }
  }
`;
//# sourceMappingURL=CallbackDetails.js.map