"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.OAuthFlow=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),Markdown_1=require("../Markdown"),SecuritySchemeItem_1=require("./SecuritySchemeItem"),styled_1=require("./styled");function OAuthFlowComponent({flow:e}){const t=Object.keys((null==e?void 0:e.scopes)||{});return(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:"Authorization URL:",value:(null==e?void 0:e.authorizationUrl)&&(0,jsx_runtime_1.jsx)(styled_1.StyledLink,{target:"_blank",rel:"noopener noreferrer",href:null==e?void 0:e.authorizationUrl,children:null==e?void 0:e.authorizationUrl})}),(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:"Token URL:",value:null==e?void 0:e.tokenUrl}),(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:"Refresh URL:",value:null==e?void 0:e.refreshUrl}),t.length&&(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:"Scopes",value:" "}),t.map((t=>(0,jsx_runtime_1.jsx)(SecuritySchemeItem_1.SecuritySchemeItem,{label:(0,jsx_runtime_1.jsx)(StyledTag,{className:"tag-grey",children:t}),value:(0,jsx_runtime_1.jsx)(Markdown_1.Markdown,{source:(null==e?void 0:e.scopes[t])||""})},t)))]})||null]})}const StyledTag=(0,styled_components_1.default)(styled_1.Tag)`
  margin-left: var(--spacing-xs);
`;exports.OAuthFlow=(0,react_1.memo)(OAuthFlowComponent);
//# sourceMappingURL=OAuthFlow.js.map