var Modules;
(function (Modules) {
    /**
     * Class contains all functionality for the Law number 13.1.c
     * @returns
     */
    class _21_1_c {
        constructor() {
            $("#besonderheit").change((e) => this.handleBesonderheit(e));
        }
        handleBesonderheit(e) {
            Classes.Decision.Besonderheit = $(e.currentTarget).val();
            for (let besonderheit in Besonderheit) {
                if (besonderheit != Besonderheit[Besonderheit.Wähle]) {
                    $("#" + Besonderheit[besonderheit]).hide();
                }
            }
            $("#" + Besonderheit[Classes.Decision.Besonderheit]).show();
        }
        /**
         * Generates the word file for the gesetzestext
         */
        GenerateWord() {
            var template = "";
            switch (+this.besonderheit) {
                case Besonderheit.Technische: {
                    // select correct template
                    template = Classes.TemplateContainer.Grund_13_1_c_technische;
                    template = template.replace("{vob_21_1_c_alt1_3}", Modules.WordWriter.ReplaceSpecialCharacters(this.technischAnspruch));
                    template = template.replace("{vob_21_1_c_alt1_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.technischeSicht));
                    template = template.replace("{vob_21_1_c_alt1_2}", this.besonderheitZuschlagsempfänger);
                    switch (+this.kostensteigerungAndereAnbieterAlt) {
                        case KostensteigerungAndererAnbieter.Investitionsschutz: {
                            template = template.replace("{vob_21_1_c_alt1_3_1_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungAndereAnbieter));
                            template = template.replace("{vob_21_1_c_alt1_3_1_2}", "");
                            break;
                        }
                        case KostensteigerungAndererAnbieter.KnowHowTransfer: {
                            template = template.replace("{vob_21_1_c_alt1_3_1_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_1_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungAndereAnbieter));
                            break;
                        }
                        default: {
                            break;
                        }
                    }
                    switch (+this.kostensteigerungSonstigeAlt) {
                        case KostensteigerungSonstige.AufwandSchulung: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.AufwändigeAnpassungen: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.FlankierendeMassnahmen: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.BesondereRisiken: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Verzögerungen: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Qualitätseinbussen: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.KnowHowVerlust: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.SicherheitsRisiken: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            break;
                        }
                        case KostensteigerungSonstige.Andere: {
                            template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_7}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                            break;
                        }
                        default: {
                            break;
                        }
                    }
                    // replace placeholder of the other besonderheiten
                    template = template.replace("{vob_21_1_c_alt2_1}", "");
                    template = template.replace("{vob_21_1_c_alt2_2}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_1_1}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_1_2}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                    template = template.replace("{vob_21_1_c_alt3_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_1_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_1_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                    break;
                }
                case Besonderheit.Kuenstlerische: {
                    // select correct template
                    template = Classes.TemplateContainer.Grund_13_1_c_kuenstlerische;
                    template = template.replace("{vob_21_1_c_alt2_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.besondereKünstlerischeSicht));
                    template = template.replace("{vob_21_1_c_alt2_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.unangemesseneAlternative));
                    if (+this.kostensteigerungKunstlerischeAlternativeAlt === KostensteigerungAndererAnbieter.Investitionsschutz) {
                        template = template.replace("{vob_21_1_c_alt2_2_1_1}", "");
                        template = template.replace("{vob_21_1_c_alt2_2_1_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungKunstlerischeAlternative));
                    }
                    else if (+this.kostensteigerungKunstlerischeAlternativeAlt === KostensteigerungAndererAnbieter.KnowHowTransfer) {
                        template = template.replace("{vob_21_1_c_alt2_2_1_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungKunstlerischeAlternative));
                        template = template.replace("{vob_21_1_c_alt2_2_1_2}", "");
                    }
                    switch (+this.kunstlerischeKostensteigerungSonstigeAlt) {
                        case KostensteigerungSonstige.AufwandSchulung: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.AufwändigeAnpassungen: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.FlankierendeMassnahmen: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.BesondereRisiken: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Verzögerungen: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Qualitätseinbussen: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.KnowHowVerlust: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.SicherheitsRisiken: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Andere: {
                            template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt2_2_2_9}", Modules.WordWriter.ReplaceSpecialCharacters(this.kunstlerischeKostensteigerungSonstige));
                            break;
                        }
                        default: {
                            break;
                        }
                    }
                    // replace placeholder of the other besonderheiten
                    template = template.replace("{vob_21_1_c_alt1_1}", "");
                    template = template.replace("{vob_21_1_c_alt1_2}", "");
                    template = template.replace("{vob_21_1_c_alt1_3}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_1_1}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_1_2}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                    template = template.replace("{vob_21_1_c_alt3_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_1_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_1_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                    template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                    break;
                }
                case Besonderheit.GeistigesEigentum: {
                    // select correct template
                    template = Classes.TemplateContainer.Grund_13_1_c_geistiges_eigentum;
                    template = template.replace("{vob_21_1_c_alt3_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.aspekteGeistigesEigentum));
                    switch (+this.unangemesseneAlternativeAlt) {
                        case UnangemesseneAlternative.Mehraufwendungen: {
                            template = template.replace("{vob_21_1_c_alt3_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.unangemesseneAlternativeGeistiges));
                            template = template.replace("{vob_21_1_c_alt3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_3}", "");
                            break;
                        }
                        case UnangemesseneAlternative.Verzögerungen: {
                            template = template.replace("{vob_21_1_c_alt3_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.unangemesseneAlternativeGeistiges));
                            template = template.replace("{vob_21_1_c_alt3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_3}", "");
                            break;
                        }
                        case UnangemesseneAlternative.Qualitätsverlust: {
                            template = template.replace("{vob_21_1_c_alt3_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.unangemesseneAlternativeGeistiges));
                            template = template.replace("{vob_21_1_c_alt3_2_3}", "");
                            break;
                        }
                        case UnangemesseneAlternative.Kompatibilitaet: {
                            template = template.replace("{vob_21_1_c_alt3_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_3}", Modules.WordWriter.ReplaceSpecialCharacters(this.unangemesseneAlternativeGeistiges));
                            break;
                        }
                        default: {
                            break;
                        }
                    }
                    if (+this.kostensteigerungGeistigesAlternativeAlt === KostensteigerungAndererAnbieter.Investitionsschutz) {
                        template = template.replace("{vob_21_1_c_alt3_2_1_1}", "");
                        template = template.replace("{vob_21_1_c_alt3_2_1_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungGeistigesAlternative));
                    }
                    else if (+this.kostensteigerungGeistigesAlternativeAlt === KostensteigerungAndererAnbieter.KnowHowTransfer) {
                        template = template.replace("{vob_21_1_c_alt3_2_1_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.kostensteigerungGeistigesAlternative));
                        template = template.replace("{vob_21_1_c_alt3_2_1_2}", "");
                    }
                    switch (+this.geistigesKostensteigerungSonstigeAlt) {
                        case KostensteigerungSonstige.AufwandSchulung: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.AufwändigeAnpassungen: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.FlankierendeMassnahmen: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.BesondereRisiken: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Verzögerungen: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Qualitätseinbussen: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.KnowHowVerlust: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.SicherheitsRisiken: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", "");
                            break;
                        }
                        case KostensteigerungSonstige.Andere: {
                            template = template.replace("{vob_21_1_c_alt3_2_2_1}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_2}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_3}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_4}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_5}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_6}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_7}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_8}", "");
                            template = template.replace("{vob_21_1_c_alt3_2_2_9}", Modules.WordWriter.ReplaceSpecialCharacters(this.geistigesKostensteigerungSonstige));
                            break;
                        }
                        default: {
                            break;
                        }
                    }
                    // replace placeholder of the other besonderheiten
                    template = template.replace("{vob_21_1_c_alt2_1}", "");
                    template = template.replace("{vob_21_1_c_alt2_2}", "");
                    template = template.replace("{vob_21_1_c_alt1_3}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_1_1}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_1_2}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_4}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_5}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_6}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_7}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_8}", "");
                    template = template.replace("{vob_21_1_c_alt2_2_2_9}", "");
                    template = template.replace("{vob_21_1_c_alt1_1}", "");
                    template = template.replace("{vob_21_1_c_alt1_2}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_1_1}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_1_2}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_1}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_2}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_3}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_4}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_5}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_6}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_7}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_8}", "");
                    template = template.replace("{vob_21_1_c_alt1_3_2_9}", "");
                    break;
                }
                default: {
                    break;
                }
            }
            // replace placeholder which are used in any of them
            template = template.replace("{projekt}", Modules.WordWriter.ReplaceSpecialCharacters(Classes.Decision.Projekt));
            template = template.replace("{projekt_nr}", Modules.WordWriter.ReplaceSpecialCharacters(Classes.Decision.ProjektNr));
            return template;
        }
        /**
         * Checks all fields if they are filled
         * @returns
         */
        CheckFields() {
            var allValid = false;
            // first fill all fields
            this.besonderheit = $("#besonderheit").val();
            this.technischeSicht = $("#technische-sicht").val();
            this.technischAnspruch = $("#technisch-anspruch").val();
            this.besonderheitZuschlagsempfänger = $("#besonderheit-zuschlagsempfaenger").val();
            this.kostensteigerungAndereAnbieterAlt = $("#kostensteigerung-andere-anbieter-alt").val();
            this.kostensteigerungAndereAnbieter = $("#kostensteigerung-anderer-anbieter").val();
            this.kostensteigerungSonstigeAlt = $("#kostensteigerung-sonstige-alt").val();
            this.kostensteigerungSonstige = $("#kostensteigerung-sonstigekostensteigerung-sonstige").val();
            this.besondereKünstlerischeSicht = $("#besonderheit-künstlerische-sicht").val();
            this.unangemesseneAlternative = $("#unangemessene-alternative").val();
            this.kostensteigerungKunstlerischeAlternativeAlt = $("#kuenstlerisch-kostensteigerung-anderer-anbieter-alt").val();
            this.kostensteigerungKunstlerischeAlternative = $("#kuenstlerisch-kostensteigerung-anderer-anbieter").val();
            this.kunstlerischeKostensteigerungSonstigeAlt = $("#kunstlerische-sonstige-mehraufwaende-alt").val();
            this.kunstlerischeKostensteigerungSonstige = $("#kunstlerische-sonstige-mehraufwaende").val();
            this.aspekteGeistigesEigentum = $("#aspekte-geistiges-eigentum").val();
            this.unangemesseneAlternativeAlt = $("#unangemessene-alternative-alt").val();
            this.unangemesseneAlternativeGeistiges = $("#unangemessene-alternative-geistiges").val();
            this.kostensteigerungGeistigesAlternativeAlt = $("#geistiges-kostensteigerung-anderer-anbieter-alt").val();
            this.kostensteigerungGeistigesAlternative = $("#geistiges-kostensteigerung-anderer-anbieter").val();
            this.geistigesKostensteigerungSonstigeAlt = $("#geistiges-kostensteigerung-sonstige-alt").val();
            this.geistigesKostensteigerungSonstige = $("#geistiges-kostensteigerung-sonstigekostensteigerung-sonstige").val();
            switch (+this.besonderheit) {
                case Besonderheit.Technische: {
                    if (this.technischeSicht && this.technischAnspruch && this.besonderheitZuschlagsempfänger && +this.kostensteigerungAndereAnbieterAlt > 0 && this.kostensteigerungAndereAnbieter && +this.kostensteigerungSonstigeAlt > 0 && this.kostensteigerungSonstige) {
                        allValid = true;
                    }
                    break;
                }
                case Besonderheit.Kuenstlerische: {
                    if (this.besondereKünstlerischeSicht && this.unangemesseneAlternative && +this.kostensteigerungKunstlerischeAlternativeAlt > 0 && this.kostensteigerungKunstlerischeAlternative && +this.kunstlerischeKostensteigerungSonstigeAlt > 0 && this.kunstlerischeKostensteigerungSonstige) {
                        allValid = true;
                    }
                    break;
                }
                case Besonderheit.GeistigesEigentum: {
                    if (this.aspekteGeistigesEigentum && +this.unangemesseneAlternativeAlt > 0 && this.unangemesseneAlternativeGeistiges && +this.kostensteigerungGeistigesAlternativeAlt > 0 && this.kostensteigerungGeistigesAlternative && +this.geistigesKostensteigerungSonstigeAlt > 0 && this.geistigesKostensteigerungSonstige) {
                        allValid = true;
                    }
                    break;
                }
                default: {
                    break;
                }
            }
            return allValid;
        }
        /**
         * Resets all the fields of the reason 13_1_c
         */
        ResetGrund() {
            $("#besonderheit:nth-child(0)").prop("selected", true);
            $("#technische-sicht").val("");
            $("#technisch-anspruch").val("");
            $("#besonderheit-zuschlagsempfaenger").val("");
            $("#kostensteigerung-andere-anbieter-alt:nth-child(0)").prop("selected", true);
            $("#kostensteigerung-anderer-anbieter").val("");
            $("#kostensteigerung-sonstige-alt:nth-child(0)").prop("selected", true);
            $("#kostensteigerung-sonstigekostensteigerung-sonstige").val("");
            $("#aspekte-geistiges-eigentum").val("");
            $("#unangemessene-alternative-alt:nth-child(0)").prop("selected", true);
            $("#unangemessene-alternative-geistiges").val("");
            $("#geistiges-kostensteigerung-anderer-anbieter-alt:nth-child(0)").prop("selected", true);
            $("#geistiges-kostensteigerung-anderer-anbieter").val("");
            $("#geistiges-kostensteigerung-sonstige-alt:nth-child(0)").prop("selected", true);
            $("#geistiges-kostensteigerung-sonstigekostensteigerung-sonstige").val("");
            $("#besonderheit-künstlerische-sicht").val("");
            $("#unangemessene-alternative").val("");
            $("#kuenstlerisch-kostensteigerung-anderer-anbieter-alt:nth-child(0)").prop("selected", true);
            $("#kuenstlerisch-kostensteigerung-anderer-anbieter").val("");
            $("#kunstlerische-sonstige-mehraufwaende-alt:nth-child(0)").prop("selected", true);
            $("#kunstlerische-sonstige-mehraufwaende").val("");
        }
    }
    Modules._21_1_c = _21_1_c;
})(Modules || (Modules = {}));
//# sourceMappingURL=_21_1_c.js.map