import{P as e}from"./semantic-ui-react-m4AAKEby.js";var t=async({type:t,status:n,limit:r,offset:i,sortBy:a,sortOrder:o}={})=>{let s=new URLSearchParams;t&&s.append(`type`,t),n&&s.append(`status`,n),r&&s.append(`limit`,r.toString()),i&&s.append(`offset`,i.toString()),a&&s.append(`sortBy`,a),o&&s.append(`sortOrder`,o);let c=s.toString(),l=`/jobs${c?`?${c}`:``}`;return(await e.get(l)).data},n=async({artistId:t,profile:n=`CoreDiscography`,targetDirectory:r=``})=>(await e.post(`/jobs/discography`,{artist_id:t,profile:n,target_dir:r})).data,r=async({mbReleaseId:t,targetDir:n=``,tracks:r=`all`,constraints:i=null})=>(await e.post(`/jobs/mb-release`,{mb_release_id:t,target_dir:n,tracks:r,constraints:i})).data,i=async()=>{try{let t=await e.get(`/multisource/jobs`);return Array.isArray(t.data?.jobs)?t.data.jobs:[]}catch(e){return console.debug(`Failed to fetch swarm jobs:`,e),[]}},a=async t=>{try{return(await e.get(`/multisource/jobs/${encodeURIComponent(t)}`)).data}catch(e){if(e?.response?.status===404)return null;throw e}},o=async t=>{try{return(await e.get(`/traces/${encodeURIComponent(t)}/summary`)).data}catch(e){return e?.response?.status===404||console.debug(`Failed to fetch swarm trace summary:`,e),null}};export{a,t as i,r as n,o,i as r,n as t};