import{jsx as n}from"react/jsx-runtime";import{useAtom as d}from"jotai";import{MaximizeIcon as m}from"@redocly/theme/icons/MaximizeIcon/MaximizeIcon";import{Button as c}from"@redocly/theme/components/Button/Button";import{operationStore as x}from"../../jotai/operation.js";import{useTelemetry as u,useTranslate as f}from"../../hooks/index.js";import{styled as A}from"../../styled-components.js";const _=({operationPointer:a,type:e,onPanelToggle:s})=>{const l=f(),[t,r]=d(x(a)),i=u(),p=()=>{const o=!t[e].expandedAll;i.sendExpandCollapseAllClickedMessage([{id:`expand-collapse-${e}-panel`,object:"expand_collapse_all",uri:window.location.href,isExpanded:o}]),r({[e]:{expandedAll:o}}),s?.(o,e==="request"?"request":"responses")};return n(g,{icon:n(m,{}),iconPosition:"right",size:"small",variant:"ghost",onClick:p,children:t[e].expandedAll?l("openapi.collapseAll","Collapse all"):l("openapi.expandAll","Expand all")})},g=A(c)`
  margin-left: auto;
`;export{_ as ExpandAllButton};
