"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Discriminator=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),utils_1=require("../../utils"),SchemaSelection_1=require("../common/SchemaSelection"),common_1=require("../common");function DiscriminatorDropdownComponent({activeOneOfIdx:e,parent:t,onChange:o}){const r=(0,react_1.useMemo)((()=>(t.oneOf||[]).map(((e,t)=>({label:e.schema.deprecated?`${(0,utils_1.strikethroughText)(e.title)} (deprecated)`:e.title,value:t})))),[t.oneOf]);return void 0===t.oneOf?null:(0,jsx_runtime_1.jsxs)(Wrapper,{children:[(0,jsx_runtime_1.jsx)(common_1.SelectionTitle,{children:"Discriminator"}),(0,jsx_runtime_1.jsx)(SchemaSelection_1.SchemaSelection,{options:r,pointer:t.operationPointer,onChange:o,schema:t,defaultOneOfIdx:e})]})}exports.Discriminator=(0,react_1.memo)(DiscriminatorDropdownComponent);const Wrapper=styled_components_1.default.div`
  display: flex;
  flex-direction: column;
  align-items: flex-start;
`;
//# sourceMappingURL=Discriminator.js.map