function i(t){if(!t)return"Never";const o=new Date(t),r=o-new Date,e=r>0,s=Math.abs(r),n=Math.round(s/(1e3*60)),a=Math.round(s/(1e3*60*60)),c=Math.round(s/(1e3*60*60*24));return s<1e3*60?"Now":n<=60?e?`In ${n} minute${n===1?"":"s"}`:n===1?"a minute ago":`${n} minutes ago`:a<=24?e?`In ${a} hour${a===1?"":"s"}`:a===1?"an hour ago":`${a} hours ago`:c<=14?e?`In ${c} day${c===1?"":"s"}`:c===1?"a day ago":`${c} days ago`:o.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})}const f=()=>history.back()||window.close(),h=t=>{try{if(!t||!t.includes(":"))return t;const o=n=>n.replace(/^\[|\]$/g,""),u=o(new URL(`http://[${t}]/`).hostname),[r,e]=u.split("::").map(n=>n?n.split(":"):[]),s=e?[...r,...Array(8-r.length-e.length).fill("0"),...e]:r;return o(new URL(`http://[${s.slice(0,4).join(":")}::]/`).hostname).replace(/::$/,"")}catch(o){return console.error("hostIP processing failed for:",t,o),t}};export{i as f,f as g,h};
