import{C as r}from"./p-d343a062.js";const o=(r,o)=>{const t={};return r.fields.forEach((r=>{const s=r.field||o.find((o=>o.id===r.fieldId));s.value&&(t[s.id]=s.value)})),t},t=(r,t)=>{const a=((r,o)=>r.fields.map((r=>r.field||o.find((o=>o.id===r.fieldId)))))(r,t);return s(a,o(r,a))},s=(r,o)=>{const t=[],s=a(r,o);return s.filters.length&&t.push(s),0===t.length?void 0:1===t.length?t[0]:{operator:"and",filters:t}},a=(o,t)=>({operator:"and",filters:o.filter((r=>!!t[r.id])).map((o=>({comparison:r.Eq,id:o.id,value:t[o.id]})))});export{s as a,o as b,t as g}