import{jsx as e,jsxs as i,Fragment as v}from"react/jsx-runtime";import{memo as A,useMemo as P}from"react";import{useAtomValue as R}from"jotai";import{Row as q}from"../common/index.js";import{Title as D}from"../common/OperationItemTitle.js";import{LinkToField as E}from"../common/LinkToField.js";import{makeDeepLink as F}from"../../services/index.js";import{Description as M}from"../OperationItem/Description.js";import{Security as N}from"../Security/index.js";import{hasNestedFields as T}from"../../utils/index.js";import{ExpandAllButton as b}from"../ExpandAllButton/index.js";import{RequestParameters as w}from"../RequestParameters/index.js";import{activeMimeNameAtom as y}from"../../jotai/app.js";import{getActiveMediaType as C}from"../../models/mediaContent.js";import{styled as _}from"../../styled-components.js";import{Extensions as I}from"../common/Extensions.js";function L({operation:{id:o,description:m,externalDocs:n,parameters:r,requestBody:t,pointer:l,security:f,extensions:s,callbackId:u},title:d,translate:h,onPanelToggle:x}){const a=R(y),g=P(()=>{const p=r.some(({schema:c})=>!c.isPrimitive&&!c.isCircular);if(!t?.content||p)return p;const{schema:k}=C(t.content,a)||{};return T(k)},[a,r,t?.content]),j=Object.keys(s||{}).length>0;return i(v,{children:[e(q,{children:i(H,{children:[i(D,{children:[o&&e(E,{to:F(o,"request")}),d||h?.("openapi.request","Request"),g&&e(b,{operationPointer:l,type:"request",onPanelToggle:x})]}),e(M,{description:m||n?m:void 0,externalDocs:n}),j&&e(I,{extensions:s}),e(N,{securities:f})]})}),e(w,{parameters:r,body:t,operationId:o,callbackId:u})]})}const H=_.div`
  width: 100%;
`,te=A(L);export{te as RequestDetails};
