import{j as t,aB as v,S,D as h}from"./vendor-ClLR6ncd.js";import{o as _,l as d,m as q,j as u,h as k,d as g,n as j,p,q as y}from"./lodash-ZyeDnt0e.js";import{n as F}from"./index-OtVJl4GC.js";import{r as c}from"./configs-Cm_sEDXb.js";const P=(i,e)=>r=>{if(!r.required)return r;const a=i[r.key],s=i[`${r.key}-error`];return{...r,defaultValue:void 0,value:a,helperText:s,error:!!s,setter:e(i.id,r.key)}};function O({sx:i,statement:e,updateStatement:r,Header:a,statementInputs:s}){const{value:m}=F();return t.jsxs(v,{sx:{p:1,pl:2,...i},elevation:4,children:[a,t.jsx(S,{spacing:m?0:1,sx:{pr:1},children:s.map(P(e,r)).map(({Component:f,key:n,label:o,...x})=>t.jsx(f,{label:o,value:e[n],setter:r(e.id,n),..._(x,["queryParameter"])},o))})]})}function l(i){return!i}const R=(i,e)=>i(d([k(g,"statements",{}),e,r=>({statements:r,invalid:j(r)===0||p(r,a=>p(y(a,c),l))})])),$=i=>(e,r)=>a=>R(i,d([u([e,r],a),c.includes(r)?u([e,`${r}-error`],l(a)?"Input must not be empty":""):q]));function z(){return{id:h(),Subject:"",Predicate:"",Object:"",Graph:"",Attributes:""}}export{O as S,R as a,z as i,$ as u};
