function ensureTag(e,t){let a=document.querySelector(e);return a||(a=t(),document.head.appendChild(a)),a}function normalizePath(e){return"/"!==e&&e.endsWith("/")?e.slice(0,-1):e}function getRouteMeta(e){return"/"===e?{title:"R6Data: R6 Stats, R6 Tracker, R6 Database - Rainbow Six Siege Stats Tracker",description:"Free R6 tracker with live player statistics, rank tracking, K/D ratio, win rate. Complete Rainbow Six Siege database: operators, maps, weapons, seasons.",keywords:"r6 stats, r6 tracker, rainbow six siege stats, siege tracker, free r6 stats tracker, r6 player stats, rainbow six siege tracker, r6 database"}:e.startsWith("/weapons")?{title:"R6 Weapons Database - Rainbow Six Siege Weapons Stats & Damage Guide",description:"Damage, fire rate, recoil patterns and best loadouts.",keywords:"r6 weapons, siege weapons stats, weapon damage, recoil, r6 gun guide"}:"/operators"===e?{title:"R6 Operators Guide - Complete Rainbow Six Siege Operators List & Stats",description:"Abilities, weapons, stats and tips for all operators.",keywords:"r6 operators, siege operators, operator stats, rainbow six abilities"}:e.startsWith("/operators/")||e.startsWith("/support/t/")?null:"/maps"===e?{title:"R6 Maps Database - All Rainbow Six Siege Maps with Layouts & Callouts",description:"Layouts, callouts and strategies for ranked/competitive.",keywords:"r6 maps, siege maps, map layouts, callouts, r6 strategies"}:"/ranks"===e?{title:"R6 Ranks Guide - Rainbow Six Siege Ranking System & MMR Explained",description:"Requirements, distribution and seasonal changes.",keywords:"r6 ranks, rainbow six ranking system, siege mmr, r6 champion rank"}:"/seasons"===e?{title:"R6 Seasons History - Rainbow Six Siege Seasons Timeline & Updates",description:"History with dates, operators, maps and updates.",keywords:"r6 seasons, siege updates, rainbow six timeline, r6 history"}:"/status"===e?{title:"R6 Server Status - Rainbow Six Siege Service Status & Maintenance",description:"Live server status for PC, PlayStation and Xbox.",keywords:"r6 server status, rainbow six siege status, siege maintenance, ubisoft servers"}:"/attachments"===e?{title:"R6 Attachments Database - Rainbow Six Siege Weapon Attachments Guide",description:"Scopes, grips, barrels and best combinations.",keywords:"r6 attachments, siege scopes, weapon grips, r6 mods"}:"/charms"===e?{title:"R6 Charms Collection - Rainbow Six Siege Weapon Charms Database",description:"Charms collection with rarity and availability.",keywords:"r6 charms, siege charms, r6 cosmetics, rainbow six charms collection"}:"/skins"===e?{title:"R6 Skins Database - Rainbow Six Siege Universal Weapon Skins",description:"Universal skins with previews and prices.",keywords:"r6 skins, siege weapon skins, r6 cosmetics, rainbow six skins"}:"/stats"===e?{title:"R6 Stats Tracker - Live Rainbow Six Siege Player Statistics & Rank Tracker",description:"K/D, rank progression, seasonal statistics, match history.",keywords:"r6 stats tracker, rainbow six siege stats, r6 player tracker, siege stats"}:"/r6data-game"===e?{title:"R6 Data Game | Quiz Rainbow Six Siege | R6Info",description:"Test your Rainbow Six Siege knowledge with our interactive quiz. Questions about operators, weapons, maps, and more!",keywords:"r6 data game, rainbow six quiz, r6 minigame, siege knowledge test"}:"/discord"===e?{title:"Discord Integration | R6 Discord Webhooks | R6Data",description:"Send Rainbow Six Siege player stats directly to your Discord channels using our rich presence webhooks and Discord bots.",keywords:"r6 discord bot, siege webhook, rainbow six discord integration"}:"/streaming-widget"===e?{title:"Streaming Widget Builder | Custom R6 Stats for OBS | R6Info",description:"Design your custom Rainbow Six Siege streaming widget. Real-time stats, multiple layouts, and easy OBS integration.",keywords:"r6 widget builder, siege stream stats, obs r6 overlay, custom r6 graphics"}:"/r6-streaming-widget"===e?{title:"R6 Streaming Widget Builder | Stream, Tournaments & Custom Matches",description:"Create custom Rainbow Six Siege OBS streaming widgets of multiple types: from single player stream widgets to full 10-player tournament and custom match lobbies.",keywords:"r6 streaming widget, rainbow six siege widget, stream graphics, tournament widget, custom r6 widget"}:"/pricing"===e?{title:"R6Data Plans | Free & Pro",description:"Choose between R6Data Free and Pro plans. Pro unlocks drastically higher API rate limits and billing management.",keywords:"r6data plans, r6 api pricing, rainbow six siege api plans, free r6 stats api"}:"/support"===e?{title:"Support & Feedback | R6Data — Rainbow Six Siege Community Forum",description:"Ask questions, report bugs, and share feedback about R6Data — the ultimate Rainbow Six Siege database. Browse community topics, search answers, and join the discussion.",keywords:"r6data support, rainbow six siege forum, r6 tracker feedback, r6 bug report"}:{title:"R6Data - Best Free Rainbow Six Siege Stats Tracker & Database 2025",description:"Free R6 tracker with live statistics and complete database.",keywords:"r6 stats, siege tracker, rainbow six database"}}function updateHeadForCurrentRoute(){const e=window.location.origin,t=normalizePath(window.location.pathname),a=e+t,r=getRouteMeta(t);r&&(ensureTag('link[rel="canonical"]',()=>{const e=document.createElement("link");return e.setAttribute("rel","canonical"),e}).setAttribute("href",a),ensureTag('meta[property="og:url"]',()=>{const e=document.createElement("meta");return e.setAttribute("property","og:url"),e}).setAttribute("content",a),document.title!==r.title&&(document.title=r.title),ensureTag('meta[name="description"]',()=>{const e=document.createElement("meta");return e.setAttribute("name","description"),e}).setAttribute("content",r.description),ensureTag('meta[name="keywords"]',()=>{const e=document.createElement("meta");return e.setAttribute("name","keywords"),e}).setAttribute("content",r.keywords),ensureTag('meta[property="og:title"]',()=>{const e=document.createElement("meta");return e.setAttribute("property","og:title"),e}).setAttribute("content",r.title),ensureTag('meta[property="og:description"]',()=>{const e=document.createElement("meta");return e.setAttribute("property","og:description"),e}).setAttribute("content",r.description),ensureTag('meta[name="twitter:title"]',()=>{const e=document.createElement("meta");return e.setAttribute("name","twitter:title"),e}).setAttribute("content",r.title),ensureTag('meta[name="twitter:description"]',()=>{const e=document.createElement("meta");return e.setAttribute("name","twitter:description"),e}).setAttribute("content",r.description))}document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("error",function(e){if("img"===e.target.tagName.toLowerCase()){if(console.log("Errore caricamento immagine:",e.target.src),e.target.src.includes("r6_ranks_img")){const t=document.createElement("div");t.className="image-fallback",t.style.width=e.target.width+"px",t.style.height=e.target.height+"px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.backgroundColor="rgba(0,0,0,0.2)",t.style.borderRadius="4px",t.innerHTML='emoji_events',e.target.parentNode.replaceChild(t,e.target)}if(e.target.src.includes("operators")){const t=document.createElement("div");t.className="operator-avatar-fallback",t.style.width=e.target.width+"px",t.style.height=e.target.height+"px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.backgroundColor="var(--primary-color)",t.style.borderRadius="50%",t.innerHTML='person',e.target.parentNode.replaceChild(t,e.target)}if(e.target.src.includes("profilePicture")){const t=document.createElement("div");t.className="profile-avatar-fallback",t.style.width=e.target.width+"px",t.style.height=e.target.height+"px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.backgroundColor="var(--primary-color)",t.style.borderRadius="50%",t.innerHTML='person',e.target.parentNode.replaceChild(t,e.target)}}},!0),initNavbar(),initFooter(),initRouter(),document.querySelectorAll(".navbar-link, .mobile-menu-item").forEach(e=>{e.addEventListener("click",function(e){const t=(this.getAttribute("href")||"").trim();if(t&&"_blank"!==this.getAttribute("target")&&!(/^(https?:)?\/\//i.test(t)||t.startsWith("mailto:")||t.startsWith("tel:")||t.startsWith("data:")||t.startsWith("blob:"))){if("true"===this.getAttribute("data-no-router")||t.endsWith(".html"))return e.preventDefault(),void(window.location.href=t);if(t.startsWith("?")){const a=t.toLowerCase();return e.preventDefault(),a.includes("login")?window.location.replace("/login.html"):a.includes("register")?window.location.replace("/register.html"):a.includes("dashboard")?window.location.replace("/dashboard.html"):a.includes("api-docs")?window.location.replace("/api-docs.html"):navigateTo(t)}e.preventDefault(),navigateTo(t)}})});const e=document.querySelector(".navbar-mobile-menu"),t=document.querySelector(".mobile-menu");e&&t&&e.addEventListener("click",()=>{t.classList.toggle("open")}),updateHeadForCurrentRoute()}),window.addEventListener("popstate",()=>{handleRouteChange(),queueMicrotask(updateHeadForCurrentRoute)}),function(){const e=history.pushState,t=history.replaceState;history.pushState=function(){const t=e.apply(this,arguments);return queueMicrotask(updateHeadForCurrentRoute),t},history.replaceState=function(){const e=t.apply(this,arguments);return queueMicrotask(updateHeadForCurrentRoute),e}}();