import"./style-QAnagFj5.js";import{t as e}from"./message-box-C0C06-re.js";function t(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`[::1]`}catch{return!1}}async function n(n,r){if(t(n))return window.open(n,`_blank`),!0;try{return await e.confirm(r(`chat.external_link.confirm.message`,{url:n}),r(`chat.external_link.confirm.title`),{confirmButtonText:r(`yes`),cancelButtonText:r(`no`),type:`warning`}),window.open(n,`_blank`),!0}catch{return!1}}export{n as t};