// Path: src/main/java/analytics/ActionType.java
// public enum ActionType {
//     START, STOP, SYNCHRONIZE
// }
// 
// Path: src/main/java/analytics/AnalyticsLogger.java
// public class AnalyticsLogger {
// 
//     public static String url = "https://www.iliasdownloadertool.de/api/v1/analytics";
// 
//     public static AnalyticsLogger logger;
// 
//     private final String sessionID;
// 
//     private final String iliasVersion;
// 
//     private final String userID;
// 
//     private final String iliasPortal;
// 
//     private AnalyticsLogger() {
//         this.sessionID = generateSessionID();
//         this.iliasVersion = new VersionValidator().getVersion();
//         this.userID = generateUserID();
//         this.iliasPortal = IliasManager.getInstance().getShortName();
//     }
// 
//     public static AnalyticsLogger getInstance() {
//         if (logger == null) {
//             logger = new AnalyticsLogger();
//         }
//         return logger;
//     }
// 
//     private String generateUserID() {
//         String pluginShortName = IliasManager.getInstance().getShortName();
//         User user = Settings.getInstance().getUser();
// 
//         if (user.getName() == null) {
//             return hash("init");
//         } else {
//             String name = hash(user.getName());
//             return hash(name + hash(pluginShortName) + hash("G(xpt+OgoLltz5b#e(Bu-YcYF$cokfmp9349fdjd!-4sdvf2"));
//         }
//     }
// 
//     private String generateSessionID() {
//         return hash(UUID.randomUUID().toString());
//     }
// 
//     public void log(Enum actionType) {
//         new Thread(() -> {
//             CloseableHttpClient client = HttpClients.createDefault();
// 
//             HttpPost httpPost = new HttpPost(url);
// 
//             SessionLog sessionLog = new SessionLog(this.userID, this.sessionID, actionType,
//                     this.iliasVersion, this.iliasPortal);
// 
//             StringEntity entity;
//             try {
//                 entity = new StringEntity(sessionLog.toJson());
//                 httpPost.setEntity(entity);
//                 httpPost.setHeader("Accept", "application/json");
//                 httpPost.setHeader("Content-type", "application/json");
// 
//                 client.execute(httpPost);
//                 client.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }).start();
//     }
// 
//     private String hash(String s) {
//         SHA3.DigestSHA3 digestSHA3 = new SHA3.Digest256();
//         byte[] digest = digestSHA3.digest(s.getBytes());
// 
//         return Hex.toHexString(digest);
//     }
// 
// }


import java.io.*;
import java.security.*;
import analytics.ActionType;
import analytics.AnalyticsLogger;
import javafx.animation.*;
import javafx.application.*;
import javafx.concurrent.*;
import javafx.event.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.image.*;
import javafx.scene.layout.*;
import javafx.scene.web.*;
import javafx.stage.*;
import javafx.util.*;
import lombok.extern.slf4j.Slf4j;
import model.*;
import model.persistance.*;
import org.bouncycastle.jce.provider.*;
import org.controlsfx.control.textfield.*;
import control.*;

package view;





@Slf4j
public class Dashboard extends Application {

	private Dashboard dashboard;
	private Stage stage;
	private Scene scene;
	private LoginFader loginFader;
	private SplitPane splitPane;
	private StackPane stackPane;
	private GridPane actualisationTimePane;
	private BorderPane background;
	private WebView webView;
	private static Label lastUpdateTime;
	private static ResultList resultList;
	private Button settingsButton;
	private Button refreshButton;
	private static Label statusFooterText;
	private static CoursesTreeView courses;
	private Button signIn;
	private GridPane actionBar;
	private LoginFader loginFader2;
	private boolean loaderRunning;
	private CustomTextField searchField;
	private Button showLocalNotThere;
	private Button showIgnored;
	private RotateTransition refreshTransition;

	static {
		Security.insertProviderAt(new BouncyCastleProvider(), 1);
	}

	public static void main(String[] args) {

// Path: src/main/java/analytics/ActionType.java
// public enum ActionType {
//     START, STOP, SYNCHRONIZE
// }
// 
// Path: src/main/java/analytics/AnalyticsLogger.java
// public class AnalyticsLogger {
// 
//     public static String url = "https://www.iliasdownloadertool.de/api/v1/analytics";
// 
//     public static AnalyticsLogger logger;
// 
//     private final String sessionID;
// 
//     private final String iliasVersion;
// 
//     private final String userID;
// 
//     private final String iliasPortal;
// 
//     private AnalyticsLogger() {
//         this.sessionID = generateSessionID();
//         this.iliasVersion = new VersionValidator().getVersion();
//         this.userID = generateUserID();
//         this.iliasPortal = IliasManager.getInstance().getShortName();
//     }
// 
//     public static AnalyticsLogger getInstance() {
//         if (logger == null) {
//             logger = new AnalyticsLogger();
//         }
//         return logger;
//     }
// 
//     private String generateUserID() {
//         String pluginShortName = IliasManager.getInstance().getShortName();
//         User user = Settings.getInstance().getUser();
// 
//         if (user.getName() == null) {
//             return hash("init");
//         } else {
//             String name = hash(user.getName());
//             return hash(name + hash(pluginShortName) + hash("G(xpt+OgoLltz5b#e(Bu-YcYF$cokfmp9349fdjd!-4sdvf2"));
//         }
//     }
// 
//     private String generateSessionID() {
//         return hash(UUID.randomUUID().toString());
//     }
// 
//     public void log(Enum actionType) {
//         new Thread(() -> {
//             CloseableHttpClient client = HttpClients.createDefault();
// 
//             HttpPost httpPost = new HttpPost(url);
// 
//             SessionLog sessionLog = new SessionLog(this.userID, this.sessionID, actionType,
//                     this.iliasVersion, this.iliasPortal);
// 
//             StringEntity entity;
//             try {
//                 entity = new StringEntity(sessionLog.toJson());
//                 httpPost.setEntity(entity);
//                 httpPost.setHeader("Accept", "application/json");
//                 httpPost.setHeader("Content-type", "application/json");
// 
//                 client.execute(httpPost);
//                 client.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }).start();
//     }
// 
//     private String hash(String s) {
//         SHA3.DigestSHA3 digestSHA3 = new SHA3.Digest256();
//         byte[] digest = digestSHA3.digest(s.getBytes());
// 
//         return Hex.toHexString(digest);
//     }
// 
// }


// Path: src/main/java/view/Dashboard.java
import java.io.*;
import java.security.*;
import analytics.ActionType;
import analytics.AnalyticsLogger;
import javafx.animation.*;
import javafx.application.*;
import javafx.concurrent.*;
import javafx.event.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.image.*;
import javafx.scene.layout.*;
import javafx.scene.web.*;
import javafx.stage.*;
import javafx.util.*;
import lombok.extern.slf4j.Slf4j;
import model.*;
import model.persistance.*;
import org.bouncycastle.jce.provider.*;
import org.controlsfx.control.textfield.*;
import control.*;

package view;





@Slf4j
public class Dashboard extends Application {

	private Dashboard dashboard;
	private Stage stage;
	private Scene scene;
	private LoginFader loginFader;
	private SplitPane splitPane;
	private StackPane stackPane;
	private GridPane actualisationTimePane;
	private BorderPane background;
	private WebView webView;
	private static Label lastUpdateTime;
	private static ResultList resultList;
	private Button settingsButton;
	private Button refreshButton;
	private static Label statusFooterText;
	private static CoursesTreeView courses;
	private Button signIn;
	private GridPane actionBar;
	private LoginFader loginFader2;
	private boolean loaderRunning;
	private CustomTextField searchField;
	private Button showLocalNotThere;
	private Button showIgnored;
	private RotateTransition refreshTransition;

	static {
		Security.insertProviderAt(new BouncyCastleProvider(), 1);
	}

	public static void main(String[] args) {

		AnalyticsLogger analyticsLogger = AnalyticsLogger.getInstance();
