import{j as e}from"./cm-1.0.63-CSIRHMXC.js";import{y as h}from"./index-1.0.63-oIDff4nA.js";import{u as C,a as D}from"./hooks-1.0.63-CWs3kTdT.js";import{l as y,bO as u}from"./lib-1.0.63-DJZPtMem.js";import{r as F}from"./redux-1.0.63-Df-eBzJn.js";import{u as L}from"./ExplorerActionAdmin-1.0.63-Crwt4B9D.js";import{A as j,a as b}from"./AccordionSummary-1.0.63-CweQ2Hjy.js";import{A as f}from"./AccordionDetails-1.0.63-nbUPBP1V.js";import{F as v,T as M,I as E,b as P}from"./TextField-1.0.63-C35Mfi1Q.js";import{B as _}from"./Spinner-1.0.63-zcgIyS7Z.js";import{S as T}from"./Select-1.0.63-BMejr8a7.js";import{M as i}from"./MenuItem-1.0.63-Bvb3IjMP.js";import"./vendor-1.0.63-CN03Eozo.js";import"./Typography-1.0.63-mecuj_Wl.js";import"./ButtonBase-1.0.63-CF10PFMS.js";import"./useEnhancedEffect-1.0.63-DnR0ZFqV.js";import"./ThemeProvider-1.0.63-Cq0KMgkh.js";import"./Modal-1.0.63-fMXTbfks.js";import"./notistack-1.0.63-B49ULGrj.js";import"./iconBase-1.0.63-CFvHhC4t.js";import"./loglevel-1.0.63-BZ7XahX3.js";import"./lodash-1.0.63-hMxolcpJ.js";import"./moment-1.0.63-C5S46NFB.js";import"./cmJson-1.0.63-CyZ2MfFg.js";import"./rehyperaw-1.0.63-AkovKNCK.js";import"./markdown-1.0.63-BJvkzZkj.js";import"./settings-1.0.63-Dh5mJf1z.js";import"./Link-1.0.63-wURABoab.js";import"./TabPanel-1.0.63-CSMGfwNU.js";import"./InputAdornment-1.0.63-q8tTbJxw.js";import"./cjs-1.0.63-4A2xol4v.js";import"./getThemeProps-1.0.63-5ZzcWe3G.js";import"./ConfirmDialog-1.0.63-eXgm3P8b.js";import"./AdminTheme-1.0.63-DhJ0rrw5.js";import"./DialogContent-1.0.63-B3W-DlSe.js";import"./Menu-1.0.63-DLh4HkF0.js";import"./CardHeader-1.0.63-nt62E5SM.js";import"./Tooltip-1.0.63-BIjHl44M.js";import"./ActionsExplorer-1.0.63-DQojhfpy.js";import"./RestApi-1.0.63-BUfzocgq.js";import"./index-1.0.63-BbQj9wqD.js";import"./ActionsDml-1.0.63-nhbCczlS.js";import"./ExplorerActionEnum-1.0.63-eclZgKpy.js";import"./useUiExplorerAction-1.0.63-dQBhpWd7.js";import"./Collapse-1.0.63-B-Rwe0o9.js";import"./createSvgIcon-1.0.63-DWL3J-DK.js";const H=()=>{const s=C(m=>m.manager.metaData);return y.debug("managerMetaData",s),s},Ce=({dbs:s,tbl:m,setIsUpdated:l})=>{var g;y.debug(s,m);const p=D(),r=L(),d=H(),[c,x]=F.useState(""),A=(o,a)=>{const t={...r,list_labels:{...r.list_labels,[o]:a}};p(u({settings:t})),l(!0)},I=(o,a)=>{const t={...r,form_labels:{...r.form_labels,[o]:a}};p(u({settings:t})),l(!0)},S=(o,a)=>{const t={...r,column_media:{...r.column_media,[o]:a}};p(u({settings:t})),l(!0)};return e.jsxs(j,{disableGutters:!0,slotProps:{transition:{unmountOnExit:!0}},children:[e.jsx(b,{expandIcon:e.jsx(h,{}),children:"Column Settings"}),e.jsx(f,{children:e.jsxs(v,{fullWidth:!0,children:[e.jsx(_,{sx:{display:"grid",gridGap:"10px",marginBottom:"20px"},children:e.jsxs(_,{children:[...(g=d==null?void 0:d.columns)==null?void 0:g.map((o,a)=>{const t=o.column_name;return e.jsxs(j,{expanded:c===t,onChange:()=>{x(c===t?"":t)},sx:{"&.MuiPaper-root.MuiPaper-elevation.Mui-expanded":{margin:0}},children:[e.jsx(b,{expandIcon:e.jsx(h,{}),children:o.column_name}),e.jsxs(f,{sx:{display:"grid",gridGap:"10px"},children:[e.jsx(M,{label:"Table label",value:r.list_labels[t],variant:"outlined",onChange:n=>{A(t,n.target.value)}}),e.jsx(M,{label:"Form label",value:r.form_labels[t],variant:"outlined",onChange:n=>{I(t,n.target.value)}}),e.jsxs(v,{children:[e.jsx(E,{id:"media_type_label"+a,variant:"outlined",children:"Media type"}),e.jsxs(T,{MenuProps:{id:"pp-select-menu"},labelId:"media_type_label"+a,id:"media_type"+a,label:"Media type",value:r.column_media[t]??"",variant:"outlined",onChange:n=>{S(t,n.target.value),n.stopPropagation()},children:[e.jsx(i,{value:"",children:" "},""),e.jsx(i,{value:"Attachment",children:"Attachment"},"Attachment"),e.jsx(i,{value:"Audio",children:"Audio"},"Audio"),e.jsx(i,{value:"Hyperlink",children:"Hyperlink"},"Hyperlink"),e.jsx(i,{value:"Image",children:"Image"},"Image"),e.jsx(i,{value:"ImageURL",children:"ImageURL"},"ImageURL"),e.jsx(i,{value:"Video",children:"Video"},"Video")]})]})]})]})})]})}),e.jsx(P,{children:"Default column labels and column media types"})]})})]})};export{Ce as default};
