import{n as e}from"./chunk-DR8-3Aex.js";import{r as t,t as n}from"./execFileNoThrow-azCkYhmF.js";function r(e){let t;try{t=new URL(e)}catch{throw Error(`Invalid URL format: ${e}`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`Invalid URL protocol: must use http:// or https://, got ${t.protocol}`)}async function i(e){try{let t=process.platform;if(t===`win32`){let{code:t}=await n(`explorer`,[e]);return t===0}let{code:r}=await n(t===`darwin`?`open`:`xdg-open`,[e]);return r===0}catch{return!1}}async function a(e){try{r(e);let t=process.env.BROWSER,i=process.platform;if(i===`win32`){if(t){let{code:r}=await n(t,[`"${e}"`]);return r===0}let{code:r}=await n(`rundll32`,[`url,OpenURL`,e],{});return r===0}else{let{code:r}=await n(t||(i===`darwin`?`open`:`xdg-open`),[e]);return r===0}}catch{return!1}}var o=e((()=>{t()}));export{a as n,i as r,o as t};