import{k as e}from"../../../../../vendor-element-plus.js?ver=3.1.10";import{aQ as r,W as i,X as a,Z as t,J as s,az as n,aa as l,ab as d,a5 as o,a9 as c,a8 as _,b$ as f}from"../../../../../vendor.js?ver=3.1.10";import v from"./Filters.js?ver=3.1.10";import{_ as m,I as u}from"../../../../../fc-bits-ui.js?ver=3.1.10";import"../../../../../_AjaxSelector.js?ver=3.1.10";import"../../../../../_TaxonomyTermsSelector.js?ver=3.1.10";import"../../../../../_OptionSelector.js?ver=3.1.10";const p={class:"fcrm_rich_container"},h={class:"fcrm_rich_wrap"},b={class:"fcrm_rich_filter"},y={class:"fcrm_filter_group_header"},j={class:"fcrm_and_label"},R={key:0,class:"fcrm_cond_or"},G={class:"icon","aria-hidden":"true"},O={class:"fcrm_cond_or"},g={class:"icon","aria-hidden":"true"};const C=m({name:"RichFilterContainer",components:{Icons:u,RichFilter:v},props:{advanced_filters:{type:Array,default:function(){return[[]]}},add_label:{type:String,default:function(){return this.$t("Filters.instruction")}},filterOptions:{type:Array,default:function(){return[]}}},methods:{maybeRemoveGroup(e){this.advanced_filters.length>1&&this.advanced_filters.splice(e,1)},addConditionGroup(){this.advanced_filters.push([])}},mounted(){this.advanced_filters&&f(this.advanced_filters)&&0!=this.advanced_filters.length||(this.advanced_filters=[[]])}},[["render",function(f,v,m,u,C,$){const k=r("rich-filter"),x=r("Icons"),A=e;return i(),a("div",p,[t("div",h,[(i(!0),a(s,null,n(m.advanced_filters,(e,r)=>(i(),a("div",{key:r},[t("div",b,[t("div",y,[t("div",j,l(f.$t("And")),1),d(k,{filterOptions:m.filterOptions,add_label:m.add_label,button_text:f.$t("Add Property"),canDeleteGroup:m.advanced_filters.length>1,onMaybeRemove:e=>$.maybeRemoveGroup(r),items:e},null,8,["filterOptions","add_label","button_text","canDeleteGroup","onMaybeRemove","items"])])]),r<m.advanced_filters.length-1?(i(),a("div",R,[v[2]||(v[2]=t("div",{class:"fcrm_or_divider_line"},null,-1)),d(A,{size:"small",onClick:v[0]||(v[0]=e=>$.addConditionGroup())},{default:o(()=>[t("span",G,[d(x,{"icon-name":"plus"})]),c(" "+l(f.$t("OR")),1)],void 0),_:1}),v[3]||(v[3]=t("div",{class:"fcrm_or_divider_line"},null,-1))])):_("",!0)]))),128))]),t("div",O,[v[4]||(v[4]=t("div",{class:"fcrm_or_divider_line"},null,-1)),d(A,{size:"small",onClick:v[1]||(v[1]=e=>$.addConditionGroup())},{default:o(()=>[t("span",g,[d(x,{"icon-name":"plus"})]),c(" "+l(f.$t("OR")),1)],void 0),_:1}),v[5]||(v[5]=t("div",{class:"fcrm_or_divider_line"},null,-1))])])}]]);export{C as default};
