<commit_before>import { QueryParameter } from '../base/query-parameter';

import { ActionResponse } from '../services/actionresponse';
import { DataStoreType } from '../services/datastore';
import { ViewModelBase } from '../services/viewmodelbase';

export class Gettingstarted extends ViewModelBase {
    architectureDiagram: string = '';
    downloadLink: string = '';
    isDownload: boolean = false;
    list1: string[] = [];
    list2: string[] = [];
    list1Title: string = this.MS.Translate.GETTING_STARTED_LIST_1;
    list2Title: string = this.MS.Translate.GETTING_STARTED_LIST_2;
    prerequisiteDescription: string = '';
    prerequisiteLink: string = '';
    prerequisiteLinkText: string = '';
    registration: string = '';
    registrationAccepted: boolean = false;
    registrationAction: string = '';
    registrationCompany: string = '';
    registrationDownload: string = '';
    registrationEmail: string = '';
    registrationEmailConfirmation: string = '';
    registrationEmailsToBlock: string = '';
    registrationError: string = '';
    registrationLink: string = '';
    registrationNameFirst: string = '';
    registrationNameLast: string = '';
    registrationPrivacy: string = '';
    registrationPrivacyTitle: string = '';
    registrationValidation: string = '';
    showPrivacy: boolean = true;
    subtitle: string = '';
    templateName: string = '';

    constructor() {
        super();
    }

    async GetDownloadLink() {
        let response = await this.MS.HttpService.executeAsync('Microsoft-GetMsiDownloadLink');
        if (this.registration) {
            this.registrationDownload = response.Body.value;
        } else {
            this.downloadLink = response.Body.value;
        }
    }

    async OnLoaded() {
        if (this.isDownload) {
            if (this.isAuthenticated) {
                this.GetDownloadLink();
            } else {
                this.downloadLink = 'Pending authentication'
            }
        } else {
            this.registration = '';
        }

        if (this.MS.HttpService.isOnPremise) {
            this.isValidated = true;
            this.isAuthenticated = true;
        } else {
            this.isValidated = false;

            if (this.isAuthenticated) {
                this.isValidated = true;
            } else {
                let queryParam = this.MS.UtilityService.GetItem('queryUrl');
                if (queryParam) {
                    let token = this.MS.UtilityService.GetQueryParameterFromUrl(QueryParameter.CODE, queryParam);
                    if (token === '') {
                        this.MS.ErrorService.message = this.MS.Translate.AZURE_LOGIN_UNKNOWN_ERROR;
                        this.MS.ErrorService.details = this.MS.UtilityService.GetQueryParameterFromUrl(QueryParameter.ERRORDESCRIPTION, queryParam);
                        this.MS.ErrorService.showContactUs = true;
                        return;
                    }
                    var tokenObj = { code: token };
                    let authToken = await this.MS.HttpService.executeAsync('Microsoft-GetAzureToken', tokenObj);

                    if (authToken.IsSuccess) {
                        this.isAuthenticated = true;
                        if (!this.registration) {
                            this.isValidated = true;
                        }
                        await this.MS.HttpService.executeAsync('Microsoft-PowerBiLogin');
                    }

                    this.MS.UtilityService.RemoveItem('queryUrl');
                }
            }
        }
    }

    async Register() {
        this.registrationError = '';

        this.registrationNameFirst = this.registrationNameFirst.trim();
        this.registrationNameLast = this.registrationNameLast.trim();
        this.registrationCompany = this.registrationCompany.trim();
        this.registrationEmail = this.registrationEmail.trim();<commit_msg>fix getting started page download link<commit_after>import { QueryParameter } from '../base/query-parameter';

import { ActionResponse } from '../services/actionresponse';
import { DataStoreType } from '../services/datastore';
import { ViewModelBase } from '../services/viewmodelbase';

export class Gettingstarted extends ViewModelBase {
    architectureDiagram: string = '';
    downloadLink: string = '';
    isDownload: boolean = false;
    list1: string[] = [];
    list2: string[] = [];
    list1Title: string = this.MS.Translate.GETTING_STARTED_LIST_1;
    list2Title: string = this.MS.Translate.GETTING_STARTED_LIST_2;
    prerequisiteDescription: string = '';
    prerequisiteLink: string = '';
    prerequisiteLinkText: string = '';
    registration: string = '';
    registrationAccepted: boolean = false;
    registrationAction: string = '';
    registrationCompany: string = '';
    registrationDownload: string = '';
    registrationEmail: string = '';
    registrationEmailConfirmation: string = '';
    registrationEmailsToBlock: string = '';
    registrationError: string = '';
    registrationLink: string = '';
    registrationNameFirst: string = '';
    registrationNameLast: string = '';
    registrationPrivacy: string = '';
    registrationPrivacyTitle: string = '';
    registrationValidation: string = '';
    showPrivacy: boolean = true;
    subtitle: string = '';
    templateName: string = '';

    constructor() {
        super();
    }

    async GetDownloadLink() {
        let response = await this.MS.HttpService.executeAsync('Microsoft-GetMsiDownloadLink');
        if (this.registration) {
            this.registrationDownload = response.Body.value;
        } else {
            this.downloadLink = response.Body.value;
        }
    }

    async OnLoaded() {
        if (this.isDownload) {
            if (this.isAuthenticated) {
                this.GetDownloadLink();
            } else {
                this.downloadLink = 'Pending authentication'
            }
        } else {
            this.registration = '';
        }

        if (this.MS.HttpService.isOnPremise) {
            this.isValidated = true;
            this.isAuthenticated = true;
        } else {
            this.isValidated = false;

            if (this.isAuthenticated) {
                this.isValidated = true;
            } else {
                let queryParam = this.MS.UtilityService.GetItem('queryUrl');
                if (queryParam) {
                    let token = this.MS.UtilityService.GetQueryParameterFromUrl(QueryParameter.CODE, queryParam);
                    if (token === '') {
                        this.MS.ErrorService.message = this.MS.Translate.AZURE_LOGIN_UNKNOWN_ERROR;
                        this.MS.ErrorService.details = this.MS.UtilityService.GetQueryParameterFromUrl(QueryParameter.ERRORDESCRIPTION, queryParam);
                        this.MS.ErrorService.showContactUs = true;
                        return;
                    }
                    var tokenObj = { code: token };
                    let authToken = await this.MS.HttpService.executeAsync('Microsoft-GetAzureToken', tokenObj);

                    if (authToken.IsSuccess) {
                        this.isAuthenticated = true;
                        if (!this.registration) {
                            this.isValidated = true;
                        }
                        await this.MS.HttpService.executeAsync('Microsoft-PowerBiLogin');
                        this.GetDownloadLink();
                    }

                    this.MS.UtilityService.RemoveItem('queryUrl');
                }
            }
        }
    }

    async Register() {
        this.registrationError = '';

        this.registrationNameFirst = this.registrationNameFirst.trim();
        this.registrationNameLast = this.registrationNameLast.trim();
        this.registrationCompany = this.registrationCompany.trim();
        this.registrationEmail = this.registrationEmail.trim();
{'fraction_non_alphanumeric': 0.10696674674421545, 'fraction_numerical': 0.0015172588190668858, 'mean_word_length': 2.019083969465649, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2363851', 'n_tokens_mistral': 2005, 'n_tokens_neox': 1929, 'n_words': 353}