<?php

declare(strict_types=1);
$AJAX_FOLDER = PROJECT_ASSETS_BASE_REF. "/ajax/";

const JS_CDN_FILES = [
    "https://cdn.metroui.org.ua/v4/js/metro.min.js" => [],
];

const JS_TSR = [ "js/trouble_shooting_routes.js" =>[] ];

const JS_FILES = [
    "js/router_loader.js" => [],
    "js/routes.js" => [],
];

$JS = "var ajax_folder = \"" . $AJAX_FOLDER . "\"" . PHP_EOL; /* assets AJAX foldername and path */
$JS .= "var debug = 1; /* Debug mode 1 = true */" . PHP_EOL;
$JS .= "function debug_print(msg) { if (debug === 1) console.log(msg); }" . PHP_EOL;
$JS .= \tts\assets::get_ajax_files(PROJECT_ASSETS_DIR . "/ajax/"); 
$html->add_to_javascript($JS);

$html->set_assets_from_array(JS_CDN_FILES, 'main_js', 'cdn');
$html->set_assets_from_array(JS_TSR, 'js', 'assets');
$html->set_assets_from_array(JS_FILES, 'js', 'project');