import{_}from"./DPQgZEES.js";import{u as x,V as b,D as v,b as V,a as h}from"./vRc2BJuY.js";import{d as k,r as l,b0 as C,u as S,o as w,x as B,B as t,af as o,C as s,y as u,D as g,T as d}from"#entry";import{V as K}from"./Debz9GBs.js";import"./DIRTgmGz.js";import"./DlAUqK2U.js";import"./D2lCyhx0.js";const A=k({__name:"new",setup(N){const p=x(),c=l(!1),a=C(),i=S(),r=l({endpoint:"",apiKey:"",name:""});w(()=>{const n=a.query.endpoint,e=a.query.key,y=a.query.name||"Local scanner";n!=null&&e!==void 0&&e!==null?(r.value={endpoint:n.toString(),apiKey:e.toString(),name:y},c.value=!0):(p.reportError("Invalid scanner configuration."),i.push({path:"/scanners"}))});const m=[{text:"Scanners",disabled:!1,to:"/scanners",exact:!0},{text:"New",disabled:!0,to:"/scanners",exact:!0}];function f(){r.value={endpoint:"",apiKey:"",name:""},i.push({path:"/scanners"})}return(n,e)=>(u(),B("div",null,[t(o(v),{breadcrumbs:m,class:"mb-5"}),t(b,{variant:"outlined",class:"my-4"},{default:s(()=>[t(V,null,{default:s(()=>[...e[0]||(e[0]=[g(" Add a new scanner ",-1)])]),_:1}),t(h,null,{default:s(()=>[o(c)===!0?(u(),d(_,{key:0,scanner:o(r),onCloseForm:f},null,8,["scanner"])):(u(),d(K,{key:1,type:"heading@3, button@2",width:"400px"}))]),_:1})]),_:1})]))}});export{A as default};
