(()=>{"use strict";const e=window.React,t=window.ReactDOM,n=(window.wp.hooks,window.ReactJSXRuntime),s=window.wp.components,a=window.wp.i18n,l=()=>{const[t,l]=(0,e.useState)({name:"",description:"",rows:5,columns:5}),r=e=>{l(t=>({...t,...e}))};return(0,n.jsx)("div",{style:{border:"1px solid #e0e0e0"},children:(0,n.jsxs)(s.Card,{children:[(0,n.jsx)(s.CardHeader,{children:(0,n.jsx)("h2",{children:(0,a.__)("Add New Table","tablepress")})}),(0,n.jsx)(s.CardBody,{children:(0,n.jsxs)(s.__experimentalVStack,{spacing:"20px",style:{maxWidth:"500px"},children:[(0,n.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,name:"table[name]",label:(0,a.__)("Table Name","tablepress"),help:(0,a.__)("The name or title of your table.","tablepress"),value:t.name,onChange:e=>r({name:e})}),(0,n.jsx)(s.TextareaControl,{__nextHasNoMarginBottom:!0,name:"table[description]",label:(0,a.__)("Description","tablepress")+" "+(0,a.__)("(optional)","tablepress"),help:(0,a.__)("A description of the contents of your table.","tablepress"),value:t.description,onChange:e=>r({description:e}),rows:"4"}),(0,n.jsxs)(s.__experimentalHStack,{alignment:"left",spacing:"20px",children:[(0,n.jsx)("div",{style:{width:"150px"},children:(0,n.jsx)(s.__experimentalNumberControl,{__next40pxDefaultSize:!0,name:"table[rows]",label:(0,a.__)("Number of Rows","tablepress"),help:(0,a.__)("The number of rows in your table.","tablepress"),title:(0,a.__)("This field must contain a positive number.","tablepress"),isDragEnabled:!1,value:t.rows,onChange:e=>r({rows:e}),min:1,max:99999,required:!0})}),(0,n.jsx)("div",{style:{width:"150px"},children:(0,n.jsx)(s.__experimentalNumberControl,{__next40pxDefaultSize:!0,name:"table[columns]",label:(0,a.__)("Number of Columns","tablepress"),help:(0,a.__)("The number of columns in your table.","tablepress"),title:(0,a.__)("This field must contain a positive number.","tablepress"),isDragEnabled:!1,value:t.columns,onChange:e=>r({columns:e}),min:1,max:99999,required:!0})})]}),(0,n.jsx)(s.__experimentalHStack,{children:(0,n.jsx)(s.Button,{variant:"primary",type:"submit",text:(0,a.__)("Add Table","tablepress")})})]})})]})})};((e,n)=>{const s=document.getElementById("tablepress-add-screen");s&&(0,t.createRoot)(s).render(n)})(0,(0,n.jsx)(l,{}))})();