<!DOCTYPE html><html lang="cs"><head><!-- Meta Tags --><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description" content="Aplikace, která umí usnadnit život všem energetikům"><meta name="author" content="FINFORCE s.r.o."><!-- Favicon --><link rel="apple-touch-icon" sizes="180x180" href="{{ asset('apple-touch-icon.png') }}"><link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicon-32x32.png') }}"><link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicon-16x16.png') }}"><link rel="manifest" href="{{ asset('site.webmanifest') }}" crossorigin="use-credentials"><!-- App css -->{{ encore_entry_link_tags('app-styles-icons') }}<title>{% block title %}E-Manažer{% endblock %}</title>{% block stylesheets %}{% endblock %}<script>window.locale = '{{ app.request.locale }}';</script>{% block chatcode %}{% endblock %}{# Unified idle logout script for both app and admin, only for authenticated users #}{% if app.user is not null %}{% set __route = app.request.attributes.get('_route') ?? '' %}{% set __path = app.request.getPathInfo() %}{% set __is_admin = (__route starts with 'admin_') or (__path starts with '/admin') %}<script>(function () {var TIMEOUT_MS = 24 * 60 * 1000; // 24 minutesvar BROADCAST_THROTTLE_MS = 2000;var STORAGE_KEY = 'em_idle:lastActivity';var LOGOUT_URL = '{{ __is_admin ? path('admin_logout', {'timeout': 1}) : path('logout', {'timeout': 1}) }}';var lastActivity = Date.now();var lastBroadcast = 0;var timerId = null;var storageAvailable = false;try {storageAvailable = typeof window.localStorage !== 'undefined' && window.localStorage !== null;} catch (e) {storageAvailable = false;}function triggerLogout() {try {var current = window.location.href;var sep = LOGOUT_URL.indexOf('?') === -1 ? '?' : '&';window.location.href = LOGOUT_URL + sep + 'rt=' + encodeURIComponent(current);} catch (e) {window.location.href = LOGOUT_URL;}}function scheduleCheck() {if (timerId) {clearTimeout(timerId);}var remaining = (lastActivity + TIMEOUT_MS) - Date.now();if (remaining <= 0) {triggerLogout();return;}timerId = setTimeout(onDeadline, remaining);}function onDeadline() {timerId = null;if (Date.now() - lastActivity >= TIMEOUT_MS) {triggerLogout();} else {scheduleCheck();}}function broadcastActivity(now) {if (!storageAvailable) {return;}if (now - lastBroadcast < BROADCAST_THROTTLE_MS) {return;}lastBroadcast = now;try {window.localStorage.setItem(STORAGE_KEY, String(now));} catch (e) {// storage may be full or disabled in private mode}}function recordLocalActivity() {var now = Date.now();lastActivity = now;broadcastActivity(now);scheduleCheck();}function recordRemoteActivity(timestamp) {if (timestamp > lastActivity) {lastActivity = timestamp;scheduleCheck();}}var events = ['click', 'mousemove', 'keydown', 'scroll', 'touchstart', 'wheel'];events.forEach(function (evt) {window.addEventListener(evt, recordLocalActivity, { passive: true });});document.addEventListener('visibilitychange', function () {if (document.hidden) {return;}if (storageAvailable) {try {var stored = parseInt(window.localStorage.getItem(STORAGE_KEY), 10);if (!isNaN(stored) && stored > lastActivity) {lastActivity = stored;}} catch (e) {// ignore}}recordLocalActivity();});if (storageAvailable) {window.addEventListener('storage', function (event) {if (event.key !== STORAGE_KEY || event.newValue === null) {return;}var remote = parseInt(event.newValue, 10);if (!isNaN(remote)) {recordRemoteActivity(remote);}});try {var initial = parseInt(window.localStorage.getItem(STORAGE_KEY), 10);if (!isNaN(initial) && initial > lastActivity) {lastActivity = initial;}} catch (e) {// ignore}}recordLocalActivity();})();</script>{% endif %}</head>{% block body %}<body></body>{% endblock %}</html>