(function(){'use strict';console.info('AnalyEdge v1.0.0 - https://visitor.metaqiu.cn');const s=document.currentScript;let u=s.getAttribute('data-base-url'),p=s.getAttribute('data-page-pv-id'),v=s.getAttribute('data-page-uv-id');const A={version:'1.0.0'};let b='https://visitor.metaqiu.cn';A.p='page_pv';A.v='page_uv';if(u)b=u;if(p)A.p=p;if(v)A.v=v;A.init=async function(){try{const l=parseURL(window.location.href),pe=document.getElementById(A.p),ve=document.getElementById(A.v),d={url:l.pathname,hostname:l.hostname,referrer:document.referrer};if(pe)d.pv=true;if(ve)d.uv=true;const r=await fetch(`${b}/api/visit`,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(d)}).then(res=>res.json());if(r.ret==='OK'){if(pe&&r.data.pv!==undefined)pe.textContent=r.data.pv;if(ve&&r.data.uv!==undefined)ve.textContent=r.data.uv;}else{console.error('AnalyEdge error:',r.message);}}catch(e){console.error('AnalyEdge init failed:',e);}};function parseURL(href){const a=document.createElement('a');a.href=href;return{hostname:a.hostname,pathname:a.pathname};}if(typeof window!=='undefined'){window.AnalyEdge=A;A.init();}})();