import{m as s}from"./memoize-C3Z21RQJ.js";import{k as i,x as l}from"./template-rpthWlT9.js";import{bi as p,r as u,gI as c}from"./index-9PRMimni.js";const o=u(!1),r=u([]);async function q({equipmentId:e}){if(!e&&e!==0){r.value=[];return}try{o.value=!0;const t=await i(e).then(n=>n?[n]:[]),a=c(t,n=>({label:n.productName,value:n.equipmentId,raw:n}));r.value=a}catch(t){r.value=[],console.error("Error fetching equipment:",t)}finally{o.value=!1}}const m=s(async e=>{try{o.value=!0;const t=await l(e);return c(t,n=>({label:n.productName,value:n.equipmentId,raw:n}))}catch(t){return console.error("Error fetching equipment:",t),[]}finally{o.value=!1}},e=>JSON.stringify(e));async function f(e){if(!e?.productName||!e?.productName?.length){r.value=[];return}const t=await m({...e});r.value=t}const v=p(f,500);async function E(e){if(!e&&e!==0)return null;try{const t=await i(e);return t?t.critical===!0?"1":"0":null}catch(t){return console.error("Error fetching equipment by ID:",t),null}}export{E as a,o as b,v as d,r as e,q as f};
