<commit_before>/**
 * Created by quasarchimaere on 20.11.2018.
 */
import angular from "angular";
import ngAnimate from "angular-animate";
import dropdownModule from "./covering-dropdown.js";
import { attach, delay } from "../utils.js";
import { actionCreators } from "../actions/actions.js";
import { connect2Redux, resendEmailVerification } from "../won-utils.js";

import * as srefUtils from "../sref-utils.js";

import "style/_slidein.scss";

function genSlideInConf() {
  let template = `
        <div class="slide-in" ng-class="{'visible': self.connectionHasBeenLost}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_warning"></use>
            </svg>
            <span class="si__text">
                Lost connection &ndash; make sure your internet-connection
                is working, then click &ldquo;reconnect&rdquo;.
            </span>
            <button
                ng-show="self.connectionHasBeenLost && !self.reconnecting"
                ng-click="self.reconnect__start()"
                class="si__button">
                    Reconnect
            </button>

            <svg class="hspinner" ng-show="self.reconnecting">
                <use xlink:href="#ico_loading_anim" href="#ico_loading_anim"></use>
            </svg>
        </div>
        <div class="slide-in" ng-class="{'visible': self.loggedIn && !self.emailVerified}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_warning"></use>
            </svg>
            <span class="si__text" ng-if="!self.clickedResend">
                E-Mail has not been verified yet, check your Inbox.
            </span>
            <span class="si__text" ng-if="self.clickedResend">
                E-Mail has been resent to {{ self.email }}, check your Inbox.
            </span>
            <button
              class="si__button"
              ng-disabled="self.clickedResend"
              ng-click="self.resendEmailVerification()">
                Resend E-Mail
            </button>
        </div>
        <div class="slide-in" ng-class="{'visible': self.loggedIn && !self.acceptedTermsOfService}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_warning"></use>
            </svg>
            <span class="si__text"> <!-- TODO: INCLUDE LINK TO TOS -->
                You have not accepted the
                <a target="_blank"
                   href="{{ self.absHRef(self.$state, 'about', {'aboutSection': 'aboutTermsOfService'}) }}">
                   Terms Of Service
                 </a> yet.
            </span>
            <button
              class="si__button"
              ng-if="!self.processingAcceptTermsOfService"
              ng-click="self.account__acceptTermsOfService()">
                Accept
            </button>
            <svg class="hspinner" ng-if="self.processingAcceptTermsOfService">
                <use xlink:href="#ico_loading_anim" href="#ico_loading_anim"></use>
            </svg>
        </div>
        <div class="slide-in" ng-class="{'visible': !self.acceptedDisclaimer}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_info"></use>
            </svg>
            <div class="si__smalltext">
                This is the demonstrator of an ongoing research project. Please keep in mind:
                <ul><commit_msg>Made slide-ins only visible if the connectionLost slide-in is not visible<commit_after>/**
 * Created by quasarchimaere on 20.11.2018.
 */
import angular from "angular";
import ngAnimate from "angular-animate";
import dropdownModule from "./covering-dropdown.js";
import { attach, delay } from "../utils.js";
import { actionCreators } from "../actions/actions.js";
import { connect2Redux, resendEmailVerification } from "../won-utils.js";

import * as srefUtils from "../sref-utils.js";

import "style/_slidein.scss";

function genSlideInConf() {
  let template = `
        <div class="slide-in" ng-class="{'visible': self.connectionHasBeenLost}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_warning"></use>
            </svg>
            <span class="si__text">
                Lost connection &ndash; make sure your internet-connection
                is working, then click &ldquo;reconnect&rdquo;.
            </span>
            <button
                ng-show="self.connectionHasBeenLost && !self.reconnecting"
                ng-click="self.reconnect__start()"
                class="si__button">
                    Reconnect
            </button>

            <svg class="hspinner" ng-show="self.reconnecting">
                <use xlink:href="#ico_loading_anim" href="#ico_loading_anim"></use>
            </svg>
        </div>
        <div class="slide-in" ng-class="{'visible': self.loggedIn && !self.connectionHasBeenLost && !self.emailVerified}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_warning"></use>
            </svg>
            <span class="si__text" ng-if="!self.clickedResend">
                E-Mail has not been verified yet, check your Inbox.
            </span>
            <span class="si__text" ng-if="self.clickedResend">
                E-Mail has been resent to {{ self.email }}, check your Inbox.
            </span>
            <button
              class="si__button"
              ng-disabled="self.clickedResend"
              ng-click="self.resendEmailVerification()">
                Resend E-Mail
            </button>
        </div>
        <div class="slide-in" ng-class="{'visible': self.loggedIn && !self.connectionHasBeenLost && !self.acceptedTermsOfService}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_warning"></use>
            </svg>
            <span class="si__text"> <!-- TODO: INCLUDE LINK TO TOS -->
                You have not accepted the
                <a target="_blank"
                   href="{{ self.absHRef(self.$state, 'about', {'aboutSection': 'aboutTermsOfService'}) }}">
                   Terms Of Service
                 </a> yet.
            </span>
            <button
              class="si__button"
              ng-if="!self.processingAcceptTermsOfService"
              ng-click="self.account__acceptTermsOfService()">
                Accept
            </button>
            <svg class="hspinner" ng-if="self.processingAcceptTermsOfService">
                <use xlink:href="#ico_loading_anim" href="#ico_loading_anim"></use>
            </svg>
        </div>
        <div class="slide-in" ng-class="{'visible': !self.connectionHasBeenLost && !self.acceptedDisclaimer}">
            <svg class="si__icon" style="--local-primary:white;">
                <use xlink:href="#ico16_indicator_warning" href="#ico16_indicator_info"></use>
            </svg>
            <div class="si__smalltext">
                This is the demonstrator of an ongoing research project. Please keep in mind:
                <ul>
{'fraction_non_alphanumeric': 0.13877331901758153, 'fraction_numerical': 0.006710508656556167, 'mean_word_length': 2.08955223880597, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3524209', 'n_tokens_mistral': 2166, 'n_tokens_neox': 2058, 'n_words': 428}