import*as a from"react";import i from"styled-components";import{RedoclyOpenAPIDocs as c}from"@redocly/openapi-docs";import{LayoutVariant as s}from"@redocly/config";import{ThreePanelLayout as m}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as p}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{useUserClaims as u}from"../../../../client/app/hooks";import{usePageSharedData as d}from"../../../../client/providers/page-data/hooks";import{usePatchedStore as f}from"./helpers.js";function h({pageProps:t}){const o=u(),e=d("openAPIDocsStore"),n=a.useMemo(()=>({layout:t.apiOptions?.layout,userClaims:o}),[t.apiOptions?.layout,o]),r=f(e,t);if(!e)return"Something went wrong";const l=t.apiOptions?.layout;return a.createElement(g,null,a.createElement(v,{layout:l},a.createElement(p,{metadata:t.metadata})),a.createElement(c,{store:{options:r.options,definition:r.definition,withState:n}}))}const v=i(m)`
  && {
    padding-right: ${({layout:t})=>t===s.THREE_PANEL?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
  }
`,g=i.div`
  div[id] {
    scroll-margin-top: calc(var(--navbar-height) - var(--panel-gap-vertical));
  }
  a[id] {
    scroll-margin-top: calc(var(--navbar-height) + var(--panel-gap-vertical));
  }

  --sidebar-width: 0px;
`;export{h as default};
