"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RequestParameters=void 0;const jsx_runtime_1=require("react/jsx-runtime"),ParametersGroup_1=require("./ParametersGroup"),Body_1=require("./Body"),services_1=require("../../services"),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"};function RequestParameters({body:e,parameters:r=[],operationId:t,callbackId:s}){if(!e&&!r.length)return null;const n=(e=>{const r={};return e.forEach((e=>{safePush(r,e.in,e)})),r})(r),a=r.length>0?PARAM_PLACES:[],{content:i,description:u,required:o}=e||{};return(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[a.map((e=>(0,jsx_runtime_1.jsx)(ParametersGroup_1.ParametersGroup,{title:PARAM_NAMES_MAP[e],parameters:n[e],deepLink:generateDeepLink(t,s,e)},e))),i&&(0,jsx_runtime_1.jsx)(Body_1.Body,{content:i,description:u,required:o,deepLink:generateDeepLink(t,s)})]})}function safePush(e,r="",t){e[r]||(e[r]=[]),e[r].push(t)}function generateDeepLink(e,r,t="body"){const s=""+(r?`${r}/request/${t}`:`request/${t}`);return(0,services_1.makeDeepLink)(e,s)}exports.RequestParameters=RequestParameters;
//# sourceMappingURL=RequestParameters.js.map