"use strict";(globalThis.webpackChunkacadlix=globalThis.webpackChunkacadlix||[]).push([["admin_quiz_free_question_paragraph_section"],{"./src/free/admin/question/sections/QuestionParagraphSection.js":(e,a,s)=>{s.r(a),s.d(a,{default:()=>h});var r=s("./node_modules/@mui/material/esm/Card/Card.js"),o=s("./node_modules/@mui/material/esm/CardHeader/CardHeader.js"),l=s("./node_modules/@mui/material/esm/CardContent/CardContent.js"),t=s("./node_modules/@mui/material/esm/FormControlLabel/FormControlLabel.js"),i=s("./node_modules/@mui/material/esm/Autocomplete/Autocomplete.js"),n=s("./node_modules/@mui/material/esm/TextField/TextField.js"),d=s("./node_modules/@mui/material/esm/Grid/Grid.js"),m=(s("react"),s("./src/components/CustomSwitch.js")),p=s("@wordpress/i18n"),u=s("./src/components/CustomFeatureElement.js"),c=s("react/jsx-runtime");const h=e=>(0,c.jsx)(d.A,{size:{xs:12,sm:12},children:(0,c.jsxs)(r.A,{children:[(0,c.jsx)(o.A,{title:(0,p.__)("Paragraph Options","acadlix")}),(0,c.jsx)(l.A,{children:(0,c.jsxs)(d.A,{container:!0,spacing:4,children:[(0,c.jsx)(d.A,{size:{xs:12,sm:4},children:(0,c.jsx)(t.A,{control:(0,c.jsx)(m.A,{disabled:!0,onChange:a=>{e?.setValue("paragraph_enabled",a?.target?.checked,{shouldDirty:!0})}}),label:(0,c.jsx)(u.A,{element:"text",label:(0,p.__)("Enable Paragraph","acadlix"),iconsx:{color:"#fff"}})})}),e?.watch("paragraph_enabled")&&(0,c.jsxs)(d.A,{size:{xs:12,sm:4},children:[(0,c.jsx)(i.A,{fullWidth:!0,size:"small",disabled:!0,options:e?.paragraphs?e?.paragraphs:[],getOptionLabel:e=>e?.post_title||"",isOptionEqualToValue:(e,a)=>e?.ID===a?.ID,renderInput:e=>(0,c.jsx)(n.A,{...e,inputProps:{...e.inputProps},label:(0,p.__)("Select Paragraph","acadlix"),InputProps:{...e.InputProps}}),onChange:(a,s)=>{var r;e?.setValue("paragraph_id",null!==(r=s?.ID)&&void 0!==r?r:null,{shouldDirty:!0})}}),Boolean(e?.formState?.errors?.paragraph_id)&&(0,c.jsx)(Typography,{component:"p",color:"error",children:e?.formState?.errors?.paragraph_id?.message})]})]})})]})})}}]);