function h(i,p=[]){const s=[];return i.reduce((t,e,r)=>((!(e instanceof Set)||e.size)&&t.push({state:e,idx:r}),t),[]).forEach(({state:t,idx:e})=>{const r=p?.[e];if(r){if(r.type==="date-range"&&"from"in t&&"to"in t){const{from:n,to:o}=t;if(!n&&!o)return;s.push(`${r.property}:${n||""}..${o||""}`)}else if(t instanceof Set&&t.size>0){const n=[];t.forEach(o=>{const c=o.includes(" ")?`"${o}"`:o;n.push(`${r.property}:${c}`)}),s.push(n.length>1?`(${n.join(" OR ")})`:n[0])}}}),s.length>0?s.join(" AND "):""}export{h as formatFilterQuery};
