import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Fragment as d}from"react";import{SecurityIcon as v}from"@redocly/theme/icons/SecurityIcon/SecurityIcon";import{Panel as u}from"@redocly/theme/components/Panel/Panel";import{Button as b}from"@redocly/theme/components/Button/Button";import{Tooltip as y}from"@redocly/theme/components/Tooltip/Tooltip";import{WarningFilledIcon as x}from"@redocly/theme/icons/WarningFilledIcon/WarningFilledIcon";import{useTranslate as w}from"../../hooks/index.js";import{styled as r}from"../../styled-components.js";import{deprecatedCss as S}from"../common/index.js";import{RequiredScopes as j}from"./RequiredScopes.js";function W({securities:a,onClick:m}){const o=w();return e(T,{header:()=>i(B,{children:[e(v,{}),e(D,{children:o("openapi.security","Security")}),e(C,{onClick:m,variant:"link",children:o("openapi.viewSecurityDetails","View details")})]}),isExpandable:!1,children:e(H,{children:a.map((t,n)=>{const s=a.length>1&&t.schemes.length>1,h=t.schemes.map(({id:l,scopes:g,deprecated:c=!1},f)=>i(d,{children:[i(k,{deprecated:c,children:[l,c&&e(y,{tip:o("openapi.badges.deprecated","Deprecated"),children:e(x,{color:"var(--badge-deprecated-bg-color)"})})]}),e(j,{scopes:g}),f<t.schemes.length-1&&e(p,{children:" and "})]},l));return i(d,{children:[s?"(":"",h,s?")":"",n<a.length-1&&e(p,{children:" or "})]},n)})})})}const k=r.span`
  ${({deprecated:a})=>a&&S}
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xxs);
  font-weight: var(--font-weight-medium);
`,T=r(u)`
  margin-top: var(--spacing-base);
  border: var(--panel-border);
  border-radius: var(--panel-border-radius);
`,B=r.div`
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-xs);
  color: var(--link-color-primary);
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--layer-color);
  border-bottom: var(--panel-border);
  border-radius: var(--panel-border-radius) var(--panel-border-radius) 0 0;
`,C=r(b)`
  margin-left: auto;
  font-size: var(--font-size-sm);
`,D=r.span`
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-color-primary);
`,H=r.div`
  display: block;
  overflow: hidden;
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-color-primary);
  line-height: var(--line-height-base);
`,p=r.span`
  color: var(--text-color-description);
  line-height: var(--line-height-base);
`;export{W as SecurityButton};
