{"id":8690,"date":"2026-05-04T11:21:13","date_gmt":"2026-05-04T08:21:13","guid":{"rendered":"https:\/\/music-ditva.by\/?page_id=8690"},"modified":"2026-08-16T18:43:15","modified_gmt":"2026-08-16T15:43:15","slug":"%d1%83%d0%bf%d1%80%d0%b0%d0%b2%d0%bb%d0%b5%d0%bd%d0%b8%d0%b5-%d0%b1%d0%b5%d0%b3%d1%83%d1%89%d0%b5%d0%b9-%d1%81%d1%82%d1%80%d0%be%d0%ba%d0%be%d0%b9","status":"publish","type":"page","link":"https:\/\/music-ditva.by\/?page_id=8690","title":{"rendered":"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0435\u0433\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"8690\" class=\"elementor elementor-8690\">\n\t\t\t\t<div class=\"elementor-element elementor-element-f82d45d e-con-full e-flex e-con e-parent\" data-id=\"f82d45d\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3af562c elementor-widget elementor-widget-html\" data-id=\"3af562c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<!DOCTYPE html>\n<html lang=\"ru\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0435\u0433\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439<\/title>\n    <style>\n        * { box-sizing: border-box; }\n        body { margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f0f2f5; color: #2d3436; }\n        #admin-panel { max-width: 900px; margin: 0 auto; padding: 20px; }\n        .header-gradient { background: linear-gradient(135deg, #fab1a0 0%, #ff7675 100%); padding: 30px; border-radius: 25px 25px 0 0; color: #fff; text-align: center; }\n        .header-gradient h1 { margin: 0; font-style: italic; font-size: 28px; }\n        .panel-body { background: #fff; padding: 35px; border-radius: 0 0 25px 25px; box-shadow: 0 30px 80px rgba(0,0,0,0.15); }\n        \n        .login-section { background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%); border: 2px solid #fdcb6e; border-radius: 12px; padding: 20px; margin-bottom: 25px; text-align: center; }\n        .login-section.unlocked { background: linear-gradient(135deg, #55efc4 0%, #00b894 100%); border-color: #00b894; color: white; }\n        .login-input { padding: 14px; border: 2px solid #dfe6e9; border-radius: 12px; font-size: 16px; width: 220px; text-align: center; letter-spacing: 3px; font-weight: bold; }\n        .login-btn { padding: 14px 28px; background: linear-gradient(135deg, #ff7675 0%, #d63031 100%); color: white; border: none; border-radius: 12px; cursor: pointer; font-size: 16px; font-weight: bold; margin-left: 10px; }\n        \n        .section { margin-bottom: 25px; padding: 20px; border-radius: 12px; background: #f8f9fa; border: 2px solid #e9ecef; }\n        label.block-label { display: block; font-weight: 700; margin-bottom: 12px; text-transform: uppercase; font-size: 14px; }\n        input, select, textarea { padding: 12px; border: 2px solid #dfe6e9; border-radius: 10px; font-size: 15px; width: 100%; font-family: inherit; }\n        input:disabled, button:disabled { background: #e9ecef !important; cursor: not-allowed !important; opacity: 0.6; }\n        button { padding: 12px 20px; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; font-family: inherit; }\n        .btn-primary { background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); color: white; }\n        .btn-success { background: linear-gradient(135deg, #55efc4 0%, #00b894 100%); color: white; }\n        .btn-danger { background: linear-gradient(135deg, #ff7675 0%, #d63031 100%); color: white; }\n        .btn-warning { background: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%); color: white; }\n        .flex-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }\n        \n        .news-card { background: linear-gradient(135deg, #fff5f5 0%, #ffeaa7 100%); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-left: 4px solid #ff7675; }\n        .news-link { font-size: 12px; color: #0984e3; background: rgba(9,132,227,0.08); padding: 4px 8px; border-radius: 6px; display: inline-block; word-break: break-all; margin-top: 6px; }\n        .news-link.empty { color: #b2bec3; background: rgba(178,190,195,0.15); }\n        .badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }\n        \n        .status-bar { position: fixed; bottom: 20px; right: 20px; padding: 16px 24px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 40px rgba(0,0,0,0.2); z-index: 10000; transition: all 0.4s ease; max-width: 400px; }\n        .status-bar.hidden { transform: translateY(200px); opacity: 0; }\n        .status-bar.success { background: #d4edda; color: #155724; }\n        .status-bar.error { background: #f8d7da; color: #721c24; }\n        .status-bar.info { background: #d1ecf1; color: #0c5460; }\n        \n        .url-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #e8f4f8; border-radius: 10px; margin-bottom: 8px; word-break: break-all; }\n        .time-slot-btn { padding: 8px 14px; border: 2px solid #dfe6e9; background: white; border-radius: 8px; cursor: pointer; font-weight: 600; color: #636e72; }\n        .time-slot-btn.active { background: linear-gradient(135deg, #00b894 0%, #00cec9 100%); color: white; border-color: #00b894; }\n        .period-btn { flex: 1; padding: 10px; background: white; border: 2px solid #dfe6e9; border-radius: 8px; cursor: pointer; font-weight: 600; color: #636e72; }\n        .period-btn.active { background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%); color: white; border-color: #0984e3; }\n        .info-box { background: linear-gradient(135deg, #55efc4 0%, #00b894 100%); color: white; padding: 20px; border-radius: 12px; margin-bottom: 20px; border: 2px solid #00b894; }\n        \n        @media (max-width: 600px) { .panel-body { padding: 20px; } .flex-row { flex-direction: column; align-items: stretch; } .login-input { width: 100%; margin-bottom: 10px; } }\n    <\/style>\n<\/head>\n<body>\n\n<div id=\"admin-panel\">\n    <div class=\"header-gradient\">\n        <h1>\u270f\ufe0f \u0410\u0434\u043c\u0438\u043d-\u043f\u0430\u043d\u0435\u043b\u044c<\/h1>\n        <p>\u0413\u0423\u041e \u00ab\u0414\u0438\u0442\u0432\u044f\u043d\u0441\u043a\u0430\u044f \u0414\u041c\u0428\u0418\u00bb \u2014 \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0435\u0433\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439<\/p>\n    <\/div>\n    <div class=\"panel-body\">\n        \n        <div id=\"loginSection\" class=\"login-section\">\n            <div style=\"font-size:32px; margin-bottom:10px;\">\ud83d\udd10<\/div>\n            <h3 id=\"loginTitle\">\u041f\u0430\u043d\u0435\u043b\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430<\/h3>\n            <p style=\"margin-bottom:15px; font-size:14px; opacity:0.9;\">\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n            <div class=\"flex-row\" style=\"justify-content:center;\">\n                <input type=\"password\" id=\"adminPassword\" class=\"login-input\" placeholder=\"\u2022\u2022\u2022\u2022\" maxlength=\"10\">\n                <button class=\"login-btn\" onclick=\"checkPassword()\" id=\"loginBtn\">\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/button>\n            <\/div>\n            <div id=\"loginError\" style=\"color:#d63031; margin-top:10px; font-weight:600; display:none;\"><\/div>\n        <\/div>\n\n        <div class=\"info-box section\">\n            <h4 style=\"margin:0 0 10px 0;\">\u2139\ufe0f \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430<\/h4>\n            <p style=\"font-size:14px; opacity:0.95;\">\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0449\u0435\u0442 \u0434\u0430\u0442\u0443 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0437\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434. <strong>\u0421\u0441\u044b\u043b\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438!<\/strong><\/p>\n        <\/div>\n\n        <div class=\"section\">\n            <label class=\"block-label\">\u26a1 \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438<\/label>\n            <div class=\"flex-row\" style=\"justify-content:center; gap:15px;\">\n                <button class=\"btn-danger\" onclick=\"changeSpeed(-1)\" disabled>\u2212<\/button>\n                <input type=\"number\" id=\"speedInput\" min=\"1\" max=\"10\" value=\"5\" style=\"width:80px; text-align:center; font-size:22px; font-weight:800; color:#ff7675; border-width:3px;\" disabled>\n                <button class=\"btn-success\" onclick=\"changeSpeed(1)\" disabled>+<\/button>\n            <\/div>\n        <\/div>\n\n        <div class=\"section\" style=\"background:linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%); border:2px solid #fdcb6e;\">\n            <div class=\"flex-row\" style=\"justify-content:space-between; margin-bottom:15px;\">\n                <label class=\"block-label\" style=\"margin:0;\">\ud83d\udd04 \u0410\u0432\u0442\u043e\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/label>\n                <span id=\"autoBadge\" class=\"badge\" style=\"background:#dfe6e9; color:#636e72;\">\u0412\u042b\u041a\u041b<\/span>\n            <\/div>\n            <div style=\"margin-bottom:15px;\">\n                <label style=\"display:block; font-size:13px; color:#636e72; margin-bottom:8px; font-weight:600;\">\u23f0 \u0412\u0440\u0435\u043c\u044f:<\/label>\n                <div class=\"flex-row\" id=\"timeSlots\">\n                    <button class=\"time-slot-btn\" data-hour=\"8\" onclick=\"toggleTimeSlot(8)\" disabled>08:00<\/button>\n                    <button class=\"time-slot-btn\" data-hour=\"12\" onclick=\"toggleTimeSlot(12)\" disabled>12:00<\/button>\n                    <button class=\"time-slot-btn\" data-hour=\"18\" onclick=\"toggleTimeSlot(18)\" disabled>18:00<\/button>\n                    <button class=\"time-slot-btn\" data-hour=\"21\" onclick=\"toggleTimeSlot(21)\" disabled>21:00<\/button>\n                <\/div>\n            <\/div>\n            <div style=\"margin-bottom:15px;\">\n                <label style=\"display:block; font-size:13px; color:#636e72; margin-bottom:8px; font-weight:600;\">\ud83d\udcc5 \u041f\u0435\u0440\u0438\u043e\u0434:<\/label>\n                <div class=\"flex-row\">\n                    <button class=\"period-btn\" data-period=\"today\" onclick=\"setAutoPeriod('today')\" disabled>\u0421\u0435\u0433\u043e\u0434\u043d\u044f<\/button>\n                    <button class=\"period-btn\" data-period=\"week\" onclick=\"setAutoPeriod('week')\" disabled>\u041d\u0435\u0434\u0435\u043b\u044f<\/button>\n                    <button class=\"period-btn\" data-period=\"month\" onclick=\"setAutoPeriod('month')\" disabled>\u041c\u0435\u0441\u044f\u0446<\/button>\n                    <button class=\"period-btn\" data-period=\"year\" onclick=\"setAutoPeriod('year')\" disabled>\u0413\u043e\u0434<\/button>\n                    <button class=\"period-btn\" data-period=\"all\" onclick=\"setAutoPeriod('all')\" disabled>\u0412\u0441\u0451<\/button>\n                <\/div>\n                <p style=\"font-size:12px; color:#b2bec3; margin-top:8px;\">\u0412\u044b\u0431\u0440\u0430\u043d\u043e: <span id=\"autoPeriodLabel\" style=\"color:#0984e3; font-weight:600;\">\u041d\u0435\u0434\u0435\u043b\u044f<\/span><\/p>\n            <\/div>\n            <div class=\"flex-row\">\n                <button id=\"btnAutoUpdate\" class=\"btn-warning\" onclick=\"toggleAutoUpdate()\" style=\"flex:1; font-size:15px;\" disabled>\u25b6\ufe0f \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/button>\n                <button class=\"btn-primary\" onclick=\"forceUpdateNow()\" disabled>\ud83d\udd04 \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441<\/button>\n            <\/div>\n            <div id=\"nextUpdateRow\" style=\"margin-top:12px; text-align:center; opacity:0; transition:opacity 0.5s;\">\n                <span style=\"font-size:12px; color:#636e72;\">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435: <span id=\"nextUpdateText\" style=\"font-weight:600; color:#0984e3;\">\u2014<\/span><\/span>\n            <\/div>\n        <\/div>\n\n        <div class=\"section\" style=\"background:linear-gradient(135deg, #fff5f5 0%, #f5f5f5 100%); border:2px solid #fab1a0;\">\n            <label class=\"block-label\">\ud83d\udcc5 \u0420\u0443\u0447\u043d\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439<\/label>\n            <div class=\"flex-row\" style=\"margin-bottom:15px;\">\n                <div style=\"flex:1;\"><label style=\"display:block; font-size:13px; color:#636e72; margin-bottom:5px;\">\u0421 \u0434\u0430\u0442\u044b:<\/label><input type=\"date\" id=\"dateFrom\" disabled><\/div>\n                <div style=\"font-size:20px; color:#ff7675; font-weight:bold;\">\u2192<\/div>\n                <div style=\"flex:1;\"><label style=\"display:block; font-size:13px; color:#636e72; margin-bottom:5px;\">\u041f\u043e \u0434\u0430\u0442\u0443:<\/label><input type=\"date\" id=\"dateTo\" disabled><\/div>\n            <\/div>\n            <div class=\"flex-row\">\n                <button class=\"btn-primary\" onclick=\"setPeriod('today')\" disabled>\u0421\u0435\u0433\u043e\u0434\u043d\u044f<\/button>\n                <button class=\"btn-primary\" onclick=\"setPeriod('week')\" disabled>\u041d\u0435\u0434\u0435\u043b\u044f<\/button>\n                <button class=\"btn-primary\" onclick=\"setPeriod('month')\" disabled>\u041c\u0435\u0441\u044f\u0446<\/button>\n                <button class=\"btn-primary\" onclick=\"setPeriod('year')\" disabled>\u0413\u043e\u0434<\/button>\n                <button class=\"btn-primary\" onclick=\"setPeriod('all')\" disabled>\u0412\u0441\u0451<\/button>\n            <\/div>\n        <\/div>\n\n        <div class=\"section\">\n            <label class=\"block-label\">\ud83d\udd17 URL \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/label>\n            <div id=\"urlList\" style=\"background:#fff; border-radius:12px; padding:18px; max-height:250px; overflow-y:auto; border:2px solid #dfe6e9; margin-bottom:12px;\">\n                <div style=\"color:#b2bec3; text-align:center; padding:20px;\">\u041d\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 URL<\/div>\n            <\/div>\n            <div class=\"flex-row\">\n                <input type=\"text\" id=\"sourceUrl\" placeholder=\"https:\/\/music-diva.by\/novosti\/\" disabled>\n                <button class=\"btn-danger\" onclick=\"addUrl()\" disabled>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c<\/button>\n            <\/div>\n            <button class=\"btn-primary\" onclick=\"fetchFromUrls()\" style=\"margin-top:10px; width:100%;\" disabled>\ud83d\udd04 \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434<\/button>\n        <\/div>\n\n        <div class=\"section\" style=\"background:linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border:2px solid #7dd3fc;\">\n            <label class=\"block-label\">\ud83d\udcdd \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/label>\n            <div style=\"margin-bottom:12px;\">\n                <label style=\"display:block; font-size:13px; color:#636e72; margin-bottom:5px; font-weight:600;\">\u0422\u0435\u043a\u0441\u0442 \u043d\u043e\u0432\u043e\u0441\u0442\u0438:<\/label>\n                <input type=\"text\" id=\"manualInput\" placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442 \u043d\u043e\u0432\u043e\u0441\u0442\u0438...\" disabled>\n            <\/div>\n            <div style=\"margin-bottom:15px;\">\n                <label style=\"display:block; font-size:13px; color:#636e72; margin-bottom:5px; font-weight:600;\">\ud83d\udd17 \u0421\u0441\u044b\u043b\u043a\u0430 (\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e):<\/label>\n                <input type=\"text\" id=\"manualLink\" placeholder=\"https:\/\/site.ru\/novosti\/zapis-1\/\" disabled>\n            <\/div>\n            <div class=\"flex-row\">\n                <button class=\"btn-danger\" onclick=\"addManualNews()\" style=\"flex:1;\" disabled>\u2795 \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e \u0441\u0441\u044b\u043b\u043a\u043e\u0439<\/button>\n                <button class=\"btn-primary\" onclick=\"addManualNewsNoLink()\" style=\"flex:1;\" disabled>\ud83d\udcdd \u0411\u0435\u0437 \u0441\u0441\u044b\u043b\u043a\u0438<\/button>\n            <\/div>\n        <\/div>\n\n        <div class=\"section\">\n            <label class=\"block-label\">\ud83d\udccb \u0422\u0435\u043a\u0443\u0449\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 (<span id=\"newsCount\">0<\/span>)<\/label>\n            <div id=\"newsList\" style=\"background:#fff; border-radius:12px; padding:18px; max-height:300px; overflow-y:auto; border:2px solid #dfe6e9;\">\n                <div style=\"color:#b2bec3; text-align:center; padding:20px;\">\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430...<\/div>\n            <\/div>\n            <button onclick=\"addNewsPrompt()\" style=\"width:100%; margin-top:12px; padding:14px; background:#fff; color:#ff7675; border:2px dashed #ff7675; border-radius:12px; cursor:pointer; font-size:15px; font-weight:600;\" disabled>+ \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043d\u043e\u0432\u043e\u0441\u0442\u044c<\/button>\n        <\/div>\n\n        <div class=\"flex-row\">\n            <button class=\"btn-success\" onclick=\"saveAll()\" style=\"flex:1; font-size:18px; padding:16px;\" disabled>\ud83d\udcbe \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c<\/button>\n        <\/div>\n    <\/div>\n<\/div>\n\n<div id=\"statusBar\" class=\"status-bar hidden info\"><\/div>\n\n<script type=\"module\">\n    import { initializeApp } from \"https:\/\/www.gstatic.com\/firebasejs\/10.12.0\/firebase-app.js\";\n    import { getDatabase, ref, set, onValue } from \"https:\/\/www.gstatic.com\/firebasejs\/10.12.0\/firebase-database.js\";\n\n    const firebaseConfig = {\n        apiKey: \"AIzaSyAUptsUUaN5G668Lb7s64XR4O2td11fwfM\",\n        authDomain: \"dmshi-ticker.firebaseapp.com\",\n        databaseURL: \"https:\/\/dmshi-ticker-default-rtdb.europe-west1.firebasedatabase.app\",\n        projectId: \"dmshi-ticker\",\n        storageBucket: \"dmshi-ticker.firebasestorage.app\",\n        messagingSenderId: \"624920276757\",\n        appId: \"1:624920276757:web:524e88be9b2ae9c27a831c\"\n    };\n\n    const app = initializeApp(firebaseConfig);\n    const db = getDatabase(app);\n    const tickerRef = ref(db, 'ticker');\n\n    const PASSWORD = '\u04103418';\n    let isUnlocked = false;\n    let newsData = [];\n    let sourceUrls = [];\n    let scrollSpeed = 5;\n    let autoUpdateEnabled = false;\n    let autoPeriodType = 'week';\n    let selectedTimeSlots = [8, 18];\n    let autoUpdateInterval = null;\n    let statusTimeout = null;\n\n    const NOW = new Date();\n    const CURRENT_YEAR = NOW.getFullYear();\n    const PERIOD_LABELS = { 'today': '\u0421\u0435\u0433\u043e\u0434\u043d\u044f', 'week': '\u041d\u0435\u0434\u0435\u043b\u044f', 'month': '\u041c\u0435\u0441\u044f\u0446', 'year': '\u0413\u043e\u0434', 'all': '\u0412\u0441\u0451' };\n\n    \/\/ ====== \u041f\u0410\u0420\u041e\u041b\u042c ======\n    window.checkPassword = function() {\n        const input = document.getElementById('adminPassword');\n        const err = document.getElementById('loginError');\n        const section = document.getElementById('loginSection');\n        if (input.value === PASSWORD) {\n            isUnlocked = true;\n            section.className = 'login-section unlocked';\n            document.getElementById('loginTitle').textContent = '\u2705 \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e';\n            section.querySelector('p').textContent = '\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438';\n            document.getElementById('loginBtn').style.display = 'none';\n            input.style.display = 'none';\n            err.style.display = 'none';\n            unlockAll();\n            showStatus('\ud83d\udd13 \u041f\u0430\u043d\u0435\u043b\u044c \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0430!', 'success');\n        } else {\n            err.style.display = 'block';\n            err.textContent = '\u274c \u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c!';\n            input.value = '';\n            input.focus();\n        }\n    };\n\n    function unlockAll() {\n        document.querySelectorAll('input, button, select, textarea').forEach(el => {\n            if (el.id === 'loginBtn' || el.id === 'adminPassword') return;\n            el.disabled = false;\n        });\n    }\n    function lockAll() {\n        document.querySelectorAll('input:not(#adminPassword), button:not(#loginBtn), select, textarea').forEach(el => el.disabled = true);\n    }\n\n    \/\/ ====== \u0417\u0410\u0413\u0420\u0423\u0417\u041a\u0410 ======\n    function init() {\n        lockAll();\n        onValue(tickerRef, (snapshot) => {\n            const data = snapshot.val();\n            if (data) applyData(data);\n            else loadDefaults();\n        }, (error) => {\n            console.error(error);\n            showStatus('\u274c \u041e\u0448\u0438\u0431\u043a\u0430 \u0447\u0442\u0435\u043d\u0438\u044f Firebase: ' + error.message, 'error');\n            loadDefaults();\n        });\n    }\n\n    function applyData(data) {\n        newsData = normalizeNews(data.news || []);\n        sourceUrls = data.sourceUrls || [];\n        scrollSpeed = data.speed || 5;\n        autoUpdateEnabled = data.autoUpdateEnabled || false;\n        autoPeriodType = data.autoPeriodType || 'week';\n        selectedTimeSlots = data.selectedTimeSlots || [8, 18];\n\n        document.getElementById('speedInput').value = scrollSpeed;\n        if (data.dateFrom) document.getElementById('dateFrom').value = data.dateFrom;\n        if (data.dateTo) document.getElementById('dateTo').value = data.dateTo;\n\n        updateTimeSlotsUI();\n        updateAutoPeriodUI();\n        updateAutoUpdateUI();\n        if (isUnlocked && autoUpdateEnabled) startAutoUpdateTimer();\n        \n        renderUrlList();\n        renderNewsList();\n        updateNewsCount();\n    }\n\n    function loadDefaults() {\n        newsData = [\n            { text: '\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442 \u0414\u0438\u0442\u0432\u044f\u043d\u0441\u043a\u043e\u0439 \u0414\u041c\u0428\u0418!', link: null },\n            { text: '\u041d\u0430\u0431\u043e\u0440 \u0432 \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u0442\u043a\u0440\u044b\u0442 \u043a\u0440\u0443\u0433\u043b\u044b\u0439 \u0433\u043e\u0434', link: null }\n        ];\n        const today = NOW.toISOString().split('T')[0];\n        document.getElementById('dateFrom').value = today;\n        document.getElementById('dateTo').value = today;\n        updateTimeSlotsUI();\n        updateAutoPeriodUI();\n        renderNewsList();\n        updateNewsCount();\n    }\n\n    function normalizeNews(news) {\n        if (!news || !Array.isArray(news)) return [];\n        return news.map(n => typeof n === 'string' ? { text: n, link: null } : { text: n.text || '\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f', link: n.link || null });\n    }\n\n    \/\/ ====== \u0421\u041a\u041e\u0420\u041e\u0421\u0422\u042c ======\n    window.changeSpeed = function(delta) {\n        const input = document.getElementById('speedInput');\n        let val = parseInt(input.value) + delta;\n        if (val < 1) val = 1; if (val > 10) val = 10;\n        input.value = val; scrollSpeed = val;\n        showStatus('\u2705 \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c: ' + val);\n    };\n\n    \/\/ ====== \u0412\u0420\u0415\u041c\u042f ======\n    window.toggleTimeSlot = function(hour) {\n        const idx = selectedTimeSlots.indexOf(hour);\n        if (idx > -1) { if (selectedTimeSlots.length > 1) selectedTimeSlots.splice(idx, 1); }\n        else { selectedTimeSlots.push(hour); selectedTimeSlots.sort((a, b) => a - b); }\n        updateTimeSlotsUI();\n    };\n    function updateTimeSlotsUI() {\n        document.querySelectorAll('.time-slot-btn').forEach(btn => {\n            btn.classList.toggle('active', selectedTimeSlots.includes(parseInt(btn.dataset.hour)));\n        });\n    }\n\n    \/\/ ====== \u041f\u0415\u0420\u0418\u041e\u0414 ======\n    window.setAutoPeriod = function(period) {\n        autoPeriodType = period;\n        updateAutoPeriodUI();\n        showStatus('\ud83d\udcc5 \u041f\u0435\u0440\u0438\u043e\u0434: ' + PERIOD_LABELS[period]);\n    };\n    function updateAutoPeriodUI() {\n        document.querySelectorAll('.period-btn').forEach(btn => {\n            btn.classList.toggle('active', btn.dataset.period === autoPeriodType);\n        });\n        document.getElementById('autoPeriodLabel').textContent = PERIOD_LABELS[autoPeriodType];\n    }\n\n    \/\/ ====== \u0410\u0412\u0422\u041e\u041e\u0411\u041d\u041e\u0412\u041b\u0415\u041d\u0418\u0415 ======\n    window.toggleAutoUpdate = function() {\n        if (!isUnlocked) return;\n        autoUpdateEnabled = !autoUpdateEnabled;\n        updateAutoUpdateUI();\n        if (autoUpdateEnabled) startAutoUpdateTimer(); else stopAutoUpdateTimer();\n        showStatus(autoUpdateEnabled ? '\u2705 \u0410\u0432\u0442\u043e\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0412\u041a\u041b\u042e\u0427\u0415\u041d\u041e!' : '\u23f9\ufe0f \u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e.');\n    };\n    function updateAutoUpdateUI() {\n        const badge = document.getElementById('autoBadge');\n        const btn = document.getElementById('btnAutoUpdate');\n        const row = document.getElementById('nextUpdateRow');\n        if (autoUpdateEnabled) {\n            badge.textContent = '\u0412\u041a\u041b'; badge.style.background = '#00b894'; badge.style.color = 'white';\n            btn.innerHTML = '\u23f9\ufe0f \u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435'; btn.className = 'btn-danger';\n            row.style.opacity = '1';\n        } else {\n            badge.textContent = '\u0412\u042b\u041a\u041b'; badge.style.background = '#dfe6e9'; badge.style.color = '#636e72';\n            btn.innerHTML = '\u25b6\ufe0f \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435'; btn.className = 'btn-warning';\n            row.style.opacity = '0';\n        }\n    }\n    function startAutoUpdateTimer() {\n        stopAutoUpdateTimer();\n        autoUpdateInterval = setInterval(checkAndPerformUpdate, 60000);\n        checkAndPerformUpdate(); updateNextUpdateTime();\n    }\n    function stopAutoUpdateTimer() {\n        if (autoUpdateInterval) { clearInterval(autoUpdateInterval); autoUpdateInterval = null; }\n    }\n    function checkAndPerformUpdate() {\n        const now = new Date();\n        const h = now.getHours(), m = now.getMinutes();\n        if (selectedTimeSlots.includes(h) && m <= 1) {\n            const key = `lastAuto_${h}`, today = now.toDateString();\n            if (localStorage.getItem(key) !== today) {\n                localStorage.setItem(key, today);\n                performAutoUpdate();\n            }\n        }\n        updateNextUpdateTime();\n    }\n    function updateNextUpdateTime() {\n        const row = document.getElementById('nextUpdateRow');\n        const txt = document.getElementById('nextUpdateText');\n        if (!autoUpdateEnabled) { row.style.opacity = '0'; return; }\n        const now = new Date();\n        let next = selectedTimeSlots.find(h => h > now.getHours());\n        if (!next) next = selectedTimeSlots[0];\n        const d = new Date(now);\n        if (next <= now.getHours()) d.setDate(d.getDate() + 1);\n        d.setHours(next, 0, 0, 0);\n        txt.textContent = d.toLocaleString('ru-RU', {day:'2-digit', month:'2-digit', hour:'2-digit', minute:'2-digit'});\n        row.style.opacity = '1';\n    }\n    async function performAutoUpdate() {\n        autoAdjustPeriod(autoPeriodType);\n        await fetchFromUrls(true);\n        await saveAll(true);\n    }\n    window.forceUpdateNow = async function() {\n        showStatus('\u23f3 \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435...', 'info');\n        await performAutoUpdate();\n        showStatus('\u2705 \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e!', 'success');\n    };\n    function autoAdjustPeriod(period) {\n        const now = new Date();\n        const y = now.getFullYear(), m = String(now.getMonth()+1).padStart(2,'0'), d = String(now.getDate()).padStart(2,'0');\n        const today = `${y}-${m}-${d}`; let from = today;\n        switch(period) {\n            case 'week': { const w = new Date(now.getTime() - 7*86400000); from = `${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,'0')}-${String(w.getDate()).padStart(2,'0')}`; break; }\n            case 'month': from = `${y}-${m}-01`; break;\n            case 'year': from = `${y}-01-01`; break;\n            case 'all': from = '2020-01-01'; break;\n        }\n        document.getElementById('dateFrom').value = from;\n        document.getElementById('dateTo').value = today;\n    }\n\n    \/\/ ====== URL ======\n    window.addUrl = function() {\n        const input = document.getElementById('sourceUrl');\n        let url = input.value.trim();\n        if (!url) { showStatus('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL!', 'error'); return; }\n        url = url.replace(\/\\s\/g, '');\n        if (!\/^https?:\\\/\\\/\/i.test(url)) url = 'https:\/\/' + url;\n        const norm = url.toLowerCase().replace(\/\\\/+$\/, '');\n        if (sourceUrls.some(u => u.toLowerCase().replace(\/\\\/+$\/, '') === norm)) { showStatus('URL \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d!', 'error'); return; }\n        sourceUrls.push(url); input.value = '';\n        renderUrlList(); showStatus('\u2705 URL \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d!');\n    };\n    window.deleteUrl = function(idx) { sourceUrls.splice(idx, 1); renderUrlList(); };\n    window.renderUrlList = function() {\n        const list = document.getElementById('urlList');\n        if (!sourceUrls.length) { list.innerHTML = '<div style=\"color:#b2bec3; text-align:center; padding:20px;\">\u041d\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 URL<\/div>'; return; }\n        list.innerHTML = sourceUrls.map((url, i) => `\n            <div class=\"url-item\">\n                <div style=\"flex:1; margin-right:10px;\">\n                    <div style=\"font-size:11px; color:#74b9ff; font-weight:600;\">#${i+1}<\/div>\n                    <div style=\"font-size:13px; word-break:break-all;\">${escapeHtml(url)}<\/div>\n                <\/div>\n                <button class=\"btn-danger\" onclick=\"deleteUrl(${i})\" ${!isUnlocked?'disabled':''} style=\"padding:6px 12px; font-size:12px;\">\u0423\u0434\u0430\u043b\u0438\u0442\u044c<\/button>\n            <\/div>\n        `).join('');\n    };\n\n    \/\/ ====== \u0420\u0423\u0427\u041d\u041e\u0415 \u0414\u041e\u0411\u0410\u0412\u041b\u0415\u041d\u0418\u0415 ======\n    window.addManualNews = function() {\n        const txt = document.getElementById('manualInput').value.trim();\n        const lnk = document.getElementById('manualLink').value.trim();\n        if (!txt) { showStatus('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442!', 'error'); return; }\n        newsData.push({ text: txt, link: lnk || null });\n        document.getElementById('manualInput').value = '';\n        document.getElementById('manualLink').value = '';\n        renderNewsList(); updateNewsCount(); showStatus('\u2705 \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e!');\n    };\n    window.addManualNewsNoLink = function() {\n        const txt = document.getElementById('manualInput').value.trim();\n        if (!txt) { showStatus('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442!', 'error'); return; }\n        newsData.push({ text: txt, link: null });\n        document.getElementById('manualInput').value = '';\n        renderNewsList(); updateNewsCount(); showStatus('\u2705 \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e!');\n    };\n    window.addNewsPrompt = function() {\n        const txt = prompt('\u0422\u0435\u043a\u0441\u0442 \u043d\u043e\u0432\u043e\u0441\u0442\u0438:');\n        if (!txt || !txt.trim()) return;\n        const lnk = prompt('\u0421\u0441\u044b\u043b\u043a\u0430 (\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e):');\n        newsData.push({ text: txt.trim(), link: lnk && lnk.trim() ? lnk.trim() : null });\n        renderNewsList(); updateNewsCount(); showStatus('\u2705 \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e!');\n    };\n\n    \/\/ ====== \u0421\u041f\u0418\u0421\u041e\u041a \u041d\u041e\u0412\u041e\u0421\u0422\u0415\u0419 ======\n    window.renderNewsList = function() {\n        const list = document.getElementById('newsList');\n        if (!newsData.length) { list.innerHTML = '<div style=\"color:#b2bec3; text-align:center; padding:20px;\">\u041d\u0435\u0442 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439<\/div>'; updateNewsCount(); return; }\n        list.innerHTML = newsData.map((n, i) => `\n            <div class=\"news-card\">\n                <div style=\"font-size:14px; color:#2d3436; line-height:1.4; margin-bottom:6px;\">${escapeHtml(n.text)}<\/div>\n                ${n.link ? `<div class=\"news-link\">\ud83d\udd17 ${escapeHtml(n.link)}<\/div>` : '<div class=\"news-link empty\">\ud83d\udd17 \u041d\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438<\/div>'}\n                <div class=\"flex-row\" style=\"margin-top:8px;\">\n                    <button class=\"btn-primary\" onclick=\"editNews(${i})\" ${!isUnlocked?'disabled':''} style=\"padding:6px 12px; font-size:12px;\">\u270f\ufe0f \u0422\u0435\u043a\u0441\u0442<\/button>\n                    <button class=\"btn-primary\" onclick=\"editNewsLink(${i})\" ${!isUnlocked?'disabled':''} style=\"padding:6px 12px; font-size:12px;\">\ud83d\udd17 \u0421\u0441\u044b\u043b\u043a\u0430<\/button>\n                    <button class=\"btn-danger\" onclick=\"deleteNews(${i})\" ${!isUnlocked?'disabled':''} style=\"padding:6px 12px; font-size:12px;\">\ud83d\uddd1\ufe0f \u0423\u0434\u0430\u043b\u0438\u0442\u044c<\/button>\n                <\/div>\n            <\/div>\n        `).join('');\n    };\n    window.editNews = function(i) {\n        const t = prompt('\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442:', newsData[i].text);\n        if (t !== null && t.trim()) { newsData[i].text = t.trim(); renderNewsList(); showStatus('\u2705 \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u043e!'); }\n    };\n    window.editNewsLink = function(i) {\n        const l = prompt('\u0421\u0441\u044b\u043b\u043a\u0430 (\u043f\u0443\u0441\u0442\u043e = \u0443\u0434\u0430\u043b\u0438\u0442\u044c):', newsData[i].link || '');\n        if (l !== null) { newsData[i].link = l.trim() || null; renderNewsList(); showStatus(l.trim()?'\u2705 \u0421\u0441\u044b\u043b\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0430!':'\u2705 \u0421\u0441\u044b\u043b\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430!'); }\n    };\n    window.deleteNews = function(i) {\n        if (!confirm('\u0423\u0434\u0430\u043b\u0438\u0442\u044c?')) return;\n        newsData.splice(i, 1); renderNewsList(); updateNewsCount(); showStatus('\ud83d\uddd1\ufe0f \u0423\u0434\u0430\u043b\u0435\u043d\u043e!');\n    };\n    function updateNewsCount() { document.getElementById('newsCount').textContent = newsData.length; }\n\n    \/\/ ====== \u041f\u0415\u0420\u0418\u041e\u0414 ======\n    window.setPeriod = function(period) {\n        const now = new Date();\n        const y = now.getFullYear(), m = String(now.getMonth()+1).padStart(2,'0'), d = String(now.getDate()).padStart(2,'0');\n        const today = `${y}-${m}-${d}`; let from = today;\n        switch(period) {\n            case 'week': { const w = new Date(now.getTime() - 7*86400000); from = `${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,'0')}-${String(w.getDate()).padStart(2,'0')}`; break; }\n            case 'month': from = `${y}-${m}-01`; break;\n            case 'year': from = `${y}-01-01`; break;\n            case 'all': from = '2020-01-01'; break;\n        }\n        document.getElementById('dateFrom').value = from;\n        document.getElementById('dateTo').value = today;\n        showStatus(`\ud83d\udcc5 ${PERIOD_LABELS[period]}`);\n    };\n\n    \/\/ ====== \u041f\u0410\u0420\u0421\u0418\u041d\u0413 ======\n    function findPostDate(el) {\n        if (!el) return null;\n        const time = el.querySelector('time[datetime]');\n        if (time) { const d = new Date(time.getAttribute('datetime')); if (!isNaN(d)) return d; }\n        const sel = ['.entry-date','.published','.post-date','[class*=\\\"entry-date\\\"]','[class*=\\\"post-date\\\"]'];\n        for (const s of sel) {\n            const e = el.querySelector(s);\n            if (e) {\n                const a = e.getAttribute('datetime');\n                if (a) { const d = new Date(a); if (!isNaN(d)) return d; }\n                const d = parseDateText(e.textContent); if (d) return d;\n            }\n        }\n        const meta = el.querySelector('meta[property=\\\"article:published_time\\\"]');\n        if (meta) { const d = new Date(meta.getAttribute('content')); if (!isNaN(d)) return d; }\n        return parseDateText(el.textContent);\n    }\n    function parseDateText(t) {\n        if (!t) return null;\n        const c = t.toLowerCase().trim();\n        const patterns = [\n            {r:\/(\\d{1,2})\\.(\\d{1,2})\\.(\\d{4})\/, y:3,m:2,d:1},\n            {r:\/(\\d{4})-(\\d{1,2})-(\\d{1,2})\/, y:1,m:2,d:3}\n        ];\n        for (const p of patterns) {\n            const m = c.match(p.r);\n            if (m) {\n                const yy=parseInt(m[p.y]), mm=parseInt(m[p.m]), dd=parseInt(m[p.d]);\n                if (yy>=2020 && yy<=2035 && mm>=1 && mm<=12 && dd>=1 && dd<=31) return new Date(yy,mm-1,dd);\n            }\n        }\n        const months = {'\u044f\u043d\u0432\u0430\u0440\u044f':0,'\u0444\u0435\u0432\u0440\u0430\u043b\u044f':1,'\u043c\u0430\u0440\u0442\u0430':2,'\u0430\u043f\u0440\u0435\u043b\u044f':3,'\u043c\u0430\u044f':4,'\u0438\u044e\u043d\u044f':5,'\u0438\u044e\u043b\u044f':6,'\u0430\u0432\u0433\u0443\u0441\u0442\u0430':7,'\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f':8,'\u043e\u043a\u0442\u044f\u0431\u0440\u044f':9,'\u043d\u043e\u044f\u0431\u0440\u044f':10,'\u0434\u0435\u043a\u0430\u0431\u0440\u044f':11};\n        const mm = c.match(\/(\\d{1,2})\\s+(\u044f\u043d\u0432\u0430\u0440\u044f|\u0444\u0435\u0432\u0440\u0430\u043b\u044f|\u043c\u0430\u0440\u0442\u0430|\u0430\u043f\u0440\u0435\u043b\u044f|\u043c\u0430\u044f|\u0438\u044e\u043d\u044f|\u0438\u044e\u043b\u044f|\u0430\u0432\u0433\u0443\u0441\u0442\u0430|\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f|\u043e\u043a\u0442\u044f\u0431\u0440\u044f|\u043d\u043e\u044f\u0431\u0440\u044f|\u0434\u0435\u043a\u0430\u0431\u0440\u044f)(?:\\s+(\\d{4}))?\/);\n        if (mm) {\n            const dd=parseInt(mm[1]), mon=months[mm[2]], yy=mm[3]?parseInt(mm[3]):CURRENT_YEAR;\n            if (dd>=1 && dd<=31 && mon!==undefined) return new Date(yy,mon,dd);\n        }\n        if (c.includes('\u0441\u0435\u0433\u043e\u0434\u043d\u044f')) return new Date(CURRENT_YEAR, NOW.getMonth(), NOW.getDate());\n        if (c.includes('\u0432\u0447\u0435\u0440\u0430')) return new Date(NOW.getTime()-86400000);\n        return null;\n    }\n    function inRange(date, from, to) {\n        if (!date) return true;\n        const f = new Date(from), t = new Date(to);\n        t.setHours(23,59,59,999);\n        return date>=f && date<=t;\n    }\n\n    \/\/ ====== \u0417\u0410\u0413\u0420\u0423\u0417\u041a\u0410 \u0421 URL ======\n    window.fetchFromUrls = async function(isAuto=false) {\n        if (!sourceUrls.length) { if (!isAuto) showStatus('\u041d\u0435\u0442 URL!', 'error'); return; }\n        const from = document.getElementById('dateFrom').value;\n        const to = document.getElementById('dateTo').value;\n        if (!from || !to) { if (!isAuto) showStatus('\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0435\u0440\u0438\u043e\u0434!', 'error'); return; }\n        if (!isAuto) showStatus('\u23f3 \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430...', 'info');\n        let loaded=0, skipped=0, noDate=0;\n        \n        for (const url of sourceUrls) {\n            try {\n                const proxy = 'https:\/\/api.allorigins.win\/raw?url=' + encodeURIComponent(url);\n                const resp = await fetch(proxy);\n                const html = await resp.text();\n                const parser = new DOMParser();\n                const doc = parser.parseFromString(html, 'text\/html');\n                const base = url.replace(\/\\\/+$\/,'');\n                const posts = doc.querySelectorAll('article, .post, .entry, [class*=\\\"post-\\\"], [class*=\\\"entry-\\\"]');\n                \n                if (posts.length) {\n                    for (const post of posts) {\n                        const a = post.querySelector('h2 a, h1 a, h3 a, .entry-title a, a[rel=\\\"bookmark\\\"]');\n                        if (!a) continue;\n                        const title = a.textContent.trim();\n                        if (!title || title.length<10) continue;\n                        let href = a.getAttribute('href');\n                        if (href) {\n                            if (href.startsWith('\/')) href = new URL(base).origin + href;\n                            else if (!\/^https?:\\\/\\\/\/i.test(href)) href = base + '\/' + href;\n                        }\n                        const pub = findPostDate(post);\n                        if (pub && inRange(pub, from, to)) {\n                            if (!newsData.some(n => n.text===title)) { newsData.push({text:title, link:href||null}); loaded++; }\n                        } else if (!pub) {\n                            if (!newsData.some(n => n.text===title)) { newsData.push({text:title, link:href||null}); noDate++; }\n                        } else { skipped++; }\n                    }\n                } else {\n                    const titles = doc.querySelectorAll('h2 a, h3 a, .entry-title a');\n                    titles.forEach(t => {\n                        const txt = t.textContent.trim();\n                        if (txt && txt.length>10 && !newsData.some(n => n.text===txt)) {\n                            let h = t.getAttribute('href');\n                            if (h) {\n                                if (h.startsWith('\/')) h = new URL(base).origin + h;\n                                else if (!\/^https?:\\\/\\\/\/i.test(h)) h = base + '\/' + h;\n                            }\n                            newsData.push({text:txt, link:h||null}); noDate++;\n                        }\n                    });\n                }\n            } catch(e) { console.log('\u041e\u0448\u0438\u0431\u043a\u0430:', e); }\n        }\n        renderNewsList();\n        if (!isAuto) {\n            let msg = loaded ? `\u2705 \u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e ${loaded}` : (noDate ? `\u2705 \u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e ${noDate} (\u0431\u0435\u0437 \u0434\u0430\u0442)` : '\u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e');\n            if (skipped) msg += ` | \u041f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043e ${skipped}`;\n            showStatus(msg, loaded || noDate ? 'success' : 'info');\n        }\n    };\n\n    \/\/ ====== \u0421\u041e\u0425\u0420\u0410\u041d\u0415\u041d\u0418\u0415 (\u0422\u041e\u041b\u042c\u041a\u041e FIREBASE) ======\n    window.saveAll = async function(isAuto=false) {\n        try {\n            const payload = {\n                news: newsData,\n                sourceUrls: sourceUrls,\n                speed: scrollSpeed,\n                dateFrom: document.getElementById('dateFrom').value,\n                dateTo: document.getElementById('dateTo').value,\n                autoUpdateEnabled: autoUpdateEnabled,\n                autoPeriodType: autoPeriodType,\n                selectedTimeSlots: selectedTimeSlots,\n                updatedAt: new Date().toISOString()\n            };\n            await set(tickerRef, payload);\n            if (!isAuto) showStatus('\u2705 \u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e \u0432 Firebase! \u041d\u043e\u0432\u043e\u0441\u0442\u0435\u0439: ' + newsData.length, 'success');\n        } catch(e) {\n            console.error(e);\n            if (!isAuto) showStatus('\u274c \u041e\u0448\u0438\u0431\u043a\u0430 Firebase: ' + e.message + '. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 Rules (\u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c true)', 'error');\n        }\n    };\n\n    \/\/ ====== \u0423\u0422\u0418\u041b\u0418\u0422\u042b ======\n    function escapeHtml(text) {\n        const div = document.createElement('div');\n        div.textContent = text;\n        return div.innerHTML;\n    }\n    function showStatus(msg, type='info') {\n        const bar = document.getElementById('statusBar');\n        bar.textContent = msg;\n        bar.className = 'status-bar ' + (type || 'info');\n        if (statusTimeout) clearTimeout(statusTimeout);\n        statusTimeout = setTimeout(() => bar.classList.add('hidden'), 5000);\n        bar.classList.remove('hidden');\n    }\n\n    \/\/ Enter keys\n    document.getElementById('adminPassword').addEventListener('keypress', e => { if (e.key === 'Enter') checkPassword(); });\n    document.getElementById('sourceUrl').addEventListener('keypress', e => { if (e.key === 'Enter') addUrl(); });\n    document.getElementById('manualInput').addEventListener('keypress', e => { if (e.key === 'Enter') { e.preventDefault(); document.getElementById('manualLink').focus(); } });\n    document.getElementById('manualLink').addEventListener('keypress', e => { if (e.key === 'Enter') addManualNews(); });\n\n    init();\n<\/script>\n\n<\/body>\n<\/html>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-d73ce2b e-con e-atomic-element e-flexbox-base e-caedf1d \" data-id=\"d73ce2b\" data-element_type=\"e-flexbox\" data-e-type=\"e-flexbox\" data-interaction-id=\"d73ce2b\">\n    \n<\/div>\n\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0435\u0433\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u270f\ufe0f \u0410\u0434\u043c\u0438\u043d-\u043f\u0430\u043d\u0435\u043b\u044c \u0413\u0423\u041e \u00ab\u0414\u0438\u0442\u0432\u044f\u043d\u0441\u043a\u0430\u044f \u0414\u041c\u0428\u0418\u00bb \u2014 \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0435\u0433\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \ud83d\udd10 \u041f\u0430\u043d\u0435\u043b\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2139\ufe0f \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0449\u0435\u0442 \u0434\u0430\u0442\u0443 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0437\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434. \u0421\u0441\u044b\u043b\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438! \u26a1 \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u2212 + \ud83d\udd04 \u0410\u0432\u0442\u043e\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0412\u042b\u041a\u041b \u23f0 \u0412\u0440\u0435\u043c\u044f: 08:00 12:00 18:00 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-8690","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/music-ditva.by\/index.php?rest_route=\/wp\/v2\/pages\/8690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/music-ditva.by\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/music-ditva.by\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/music-ditva.by\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/music-ditva.by\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8690"}],"version-history":[{"count":48,"href":"https:\/\/music-ditva.by\/index.php?rest_route=\/wp\/v2\/pages\/8690\/revisions"}],"predecessor-version":[{"id":9914,"href":"https:\/\/music-ditva.by\/index.php?rest_route=\/wp\/v2\/pages\/8690\/revisions\/9914"}],"wp:attachment":[{"href":"https:\/\/music-ditva.by\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}