import{d as i,a$ as p,x as r,y as o,B as t,C as s,z as l,D as m,A as d,g as u}from"#entry";import{u as S}from"./DIRTgmGz.js";import{_ as f}from"./DPQgZEES.js";import{_ as w}from"./DlAUqK2U.js";import{a as V,V as h}from"./CiZyL2M5.js";import{V as C,b as N,a as b}from"./vRc2BJuY.js";const F=i({name:"ScannerSelect",components:{ScannerForm:f},props:{selectedScanner:{type:Object,default:null}},emits:["update:selectedScanner"],data(){return{scanner:this.selectedScanner,scanners:[],showNewScannerForm:!1}},computed:{...p(S)},watch:{selectedScanner(e){this.scanner=e},scanner(e){this.$emit("update:selectedScanner",e)}},mounted(){this.scanners=this.scannersStore?.scanners||[]},methods:{getScannerDetails(e){const n=(e.name||"").trim()!=="";return{title:n?e.name:e.endpoint,subtitle:n?e.endpoint:""}}}}),$={key:0,class:"mb-0"},y={key:1,class:"mb-0"};function v(e,n,g,k,D,_){const c=u("ScannerForm");return o(),r("div",null,[t(V,{modelValue:e.scanner,"onUpdate:modelValue":n[1]||(n[1]=a=>e.scanner=a),items:e.scanners,"item-props":e.getScannerDetails,"hide-details":"",variant:"outlined","item-title":"endpoint",density:"compact",clearable:"","return-object":"",label:"Select a scanner",placeholder:"Select or create a scanner to run the scan on","prepend-icon":"mdi-shield-search"},{selection:s(({item:a})=>[(a.raw.name||"").trim()!==""?(o(),r("p",$,[m(d(a.raw.name)+" (",1),l("code",null,d(a.raw.endpoint),1),n[4]||(n[4]=m(") ",-1))])):(o(),r("code",y,d(a.raw.endpoint),1))]),"no-data":s(()=>[l("p",{class:"create-scanner mb-0 pl-4 py-0",onClick:n[0]||(n[0]=a=>e.showNewScannerForm=!0)}," Create New Scanner ")]),_:1},8,["modelValue","items","item-props"]),t(h,{modelValue:e.showNewScannerForm,"onUpdate:modelValue":n[3]||(n[3]=a=>e.showNewScannerForm=a),persistent:"","max-width":"600px"},{default:s(()=>[t(C,null,{default:s(()=>[t(N,null,{default:s(()=>[...n[5]||(n[5]=[l("span",{class:"headline"},"Create New Scanner",-1)])]),_:1}),t(b,null,{default:s(()=>[t(c,{onCloseForm:n[2]||(n[2]=a=>e.showNewScannerForm=!1)})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const A=w(F,[["render",v],["__scopeId","data-v-93550484"]]);export{A as S};
