import{jsx as n,jsxs as g}from"react/jsx-runtime";import{memo as f}from"react";import{useAtomValue as u}from"jotai";import{Schema as x}from"../Schema/index.js";import{FieldDetails as k}from"./FieldDetails.js";import{generateDeepLink as w}from"../common/LinkToField.js";import{activeMimeNameAtom as D}from"../../jotai/app.js";import{styled as L}from"../../styled-components.js";function $({field:e,skipWriteOnly:m,skipReadOnly:p,level:d=1,showTitle:c,renderDiscriminatorSwitch:l,isFirst:h,fieldParentsName:o,disableDeepLinks:i,oneOfLevel:b,slug:r,onOneOfChange:v}){const y=u(D),t=i?void 0:w(e,y),a=r&&t?`${r}&${t.replace("#","")}`:t,s=!e.schema.isPrimitive&&!e.schema.isCircular;return g(O,{isFist:h,expanded:s,className:"property",children:[n(k,{field:e,renderDiscriminatorSwitch:l,deepLink:a,fieldParentsName:o}),s&&n(x,{schema:e.schema,skipReadOnly:p,skipWriteOnly:m,showTitle:c,expandable:!0,level:d+1,fieldParentsName:[...o||[],e.name],deepLink:a,required:e.required,disableDeepLinks:i,oneOfLevel:b,slug:r,onOneOfChange:v})]})}const M=f($),O=L.div`
  width: 100%;
  padding: ${({isFist:e})=>`var(--schema-${e?"fist-":""}property-details-spacing)`} 0
    ${({expanded:e})=>e?0:"var(--schema-property-details-spacing)"};
  ${({expanded:e})=>!e&&"border-bottom: 1px solid var(--border-color-primary)"};

  // This styles needs to override the dividers when array closing label is present
  &:has(+ span.array-closing-label) {
    border-bottom: none;
    padding-bottom: calc(var(--schema-property-details-spacing) / 2);

    .view-nested-wrapper {
      border-bottom: none;
      padding-bottom: 0;
    }
  }
`;export{M as PropertyDetails};
