import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{ParametersGroup}from"./ParametersGroup";import{Body}from"./Body";import{makeDeepLink}from"../../services";const PARAM_PLACES=["path","query","cookie","header"],PARAM_NAMES_MAP={[PARAM_PLACES[0]]:"Path",[PARAM_PLACES[1]]:"Query",[PARAM_PLACES[2]]:"Cookies",[PARAM_PLACES[3]]:"Headers"};export function RequestParameters({body:e,parameters:r=[],operationId:t,callbackId:n}){if(!e&&!r.length)return null;const s=(e=>{const r={};return e.forEach((e=>{safePush(r,e.in,e)})),r})(r),a=r.length>0?PARAM_PLACES:[],{content:o,description:i,required:A}=e||{};return _jsxs(_Fragment,{children:[a.map((e=>_jsx(ParametersGroup,{title:PARAM_NAMES_MAP[e],parameters:s[e],deepLink:generateDeepLink(t,n,e)},e))),o&&_jsx(Body,{content:o,description:i,required:A,deepLink:generateDeepLink(t,n)})]})}function safePush(e,r="",t){e[r]||(e[r]=[]),e[r].push(t)}function generateDeepLink(e,r,t="body"){return makeDeepLink(e,""+(r?`${r}/request/${t}`:`request/${t}`))}
//# sourceMappingURL=RequestParameters.js.map