import{ay as e,aL as l,aK as o}from"./vendor-element-plus.js?ver=3.1.0";import{K as t,a,o as s,w as i,c as d,Q as r,as as m}from"./vendor.js?ver=3.1.0";import{_ as n}from"./fc-bits-ui.js?ver=3.1.0";const h=n({name:"TaxonomySelector",props:["field","modelValue"],emits:["update:modelValue"],data(){return{model:this.modelValue,loading:!1,options:[]}},watch:{model(e){this.$emit("update:modelValue",e)}},methods:{fetchOptions(e){this.loading=!0,this.$get("reports/taxonomy-terms",{search:e,values:this.model,taxonomy:this.field.taxonomy}).then(e=>{this.options=e.options}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})}},mounted(){this.fetchOptions("")}},[["render",function(n,h,p,u,f,c){const v=l,y=o,b=e;return t((s(),a(y,{modelValue:f.model,"onUpdate:modelValue":h[0]||(h[0]=e=>f.model=e),multiple:p.field.is_multiple,filterable:"",remote:"","reserve-keyword":"",disabled:p.field.disabled,size:p.field.size,placeholder:p.field.placeholder||n.$t("Please enter a keyword"),"remote-method":c.fetchOptions},{default:i(()=>[(s(!0),d(r,null,m(f.options,e=>(s(),a(v,{key:e.id,label:e.title,value:e.id},null,8,["label","value"]))),128))],void 0),_:1},8,["modelValue","multiple","disabled","size","placeholder","remote-method"])),[[b,f.loading]])}]]);export{h as T};
