<commit_before><UserControl
    x:Class="Certify.UI.Controls.ManagedCertificate.MiscOptions"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns:Resources="clr-namespace:Certify.Locales;assembly=Certify.Locales"
    xmlns:certifyui="clr-namespace:Certify.UI"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:Certify.UI.Controls.ManagedCertificate"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:utils="clr-namespace:Certify.UI.Utils"
    d:DataContext="{d:DesignInstance Type=certifyui:ManagedCertificateDesignViewModel,
                                     IsDesignTimeCreatable=True}"
    Loaded="UserControl_Loaded"
    mc:Ignorable="d">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
        <utils:InverseBooleanConverter x:Key="InvBoolConverter" />
        <utils:OptionalBooleanToVisibilityConverter
            x:Key="InvBoolVisConverter"
            False="Visible"
            True="Collapsed" />
        <utils:NullVisibilityConverter x:Key="NullCollapsedConverter" />
        <utils:CSRAlgCheckedConverter x:Key="CSRCheckedConverter" />
        <utils:ManagedCertificateHealthVisibilityConverter x:Key="HealthVisibleConverter" />
        <utils:NullVisibilityConverter
            x:Key="NullVisibleConverter"
            NotNull="Collapsed"
            Null="Visible" />
    </UserControl.Resources>
    <ScrollViewer Margin="0,8,0,0" VerticalScrollBarVisibility="Auto">
        <DockPanel Margin="0,0,8,0" LastChildFill="False">

            <TabControl
                x:Name="MiscTabControl"
                Height="auto"
                Margin="0,0,0,0"
                HorizontalContentAlignment="Left"
                VerticalContentAlignment="Stretch"
                Controls:TabControlHelper.UnderlineBrush="{DynamicResource MahApps.Brushes.Accent4}"
                Controls:TabControlHelper.Underlined="TabPanel"
                DockPanel.Dock="Top"
                TabStripPlacement="Left">
                <TabItem
                    Height="32"
                    MinWidth="140"
                    Controls:HeaderedControlHelper.HeaderFontSize="12"
                    Header="Certificate Authority"
                    IsSelected="true">
                    <!--  Certificate Authority Preference  -->
                    <DockPanel Margin="16,0,8,8" DockPanel.Dock="Top">
                        <TextBlock DockPanel.Dock="Top" Style="{StaticResource Subheading}">Certificate Authority</TextBlock>
                        <TextBlock DockPanel.Dock="Top" Style="{StaticResource Instructions}">
                            Certificate Authorities are the organisations who can issue trusted certificates. You need to register an account under Settings for each (ACME) Certificate Authority you wish to use.
                        </TextBlock>

                        <StackPanel
                            Margin="0,16,0,0"
                            DockPanel.Dock="Top"
                            Orientation="Horizontal">
                            <ComboBox
                                x:Name="CertificateAuthorityList"
                                Width="180"
                                Margin="0,0,0,0"
                                HorizontalAlignment="Left"
                                DisplayMemberPath="Title"
                                ItemsSource="{Binding CertificateAuthorities}"
                                SelectedValue="{Binding SelectedItem.CertificateAuthorityId}"
                                SelectedValuePath="Id"
                                SelectionChanged="CertificateAuthorityList_SelectionChanged" />

                            <CheckBox
                                Margin="4,4,0,4"
                                Content="Use Staging Mode (Test Certificates)"
                                IsChecked="{Binding SelectedItem.UseStagingMode}"
                                Visibility="{Binding SelectedItem.CertificateAuthorityId, Converter={StaticResource NullCollapsedConverter}}" />
                        </StackPanel>
                        <TextBlock
                            Margin="0,8"
                            DockPanel.Dock="Top"
                            Style="{StaticResource Instructions}"
                            Text="{Binding CertificateAuthorityDescription}" />
                    </DockPanel>
                </TabItem><commit_msg>Add UI to set preferred chain pref per managed cert<commit_after><UserControl
    x:Class="Certify.UI.Controls.ManagedCertificate.MiscOptions"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns:Resources="clr-namespace:Certify.Locales;assembly=Certify.Locales"
    xmlns:certifyui="clr-namespace:Certify.UI"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:Certify.UI.Controls.ManagedCertificate"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:utils="clr-namespace:Certify.UI.Utils"
    d:DataContext="{d:DesignInstance Type=certifyui:ManagedCertificateDesignViewModel,
                                     IsDesignTimeCreatable=True}"
    Loaded="UserControl_Loaded"
    mc:Ignorable="d">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
        <utils:InverseBooleanConverter x:Key="InvBoolConverter" />
        <utils:OptionalBooleanToVisibilityConverter
            x:Key="InvBoolVisConverter"
            False="Visible"
            True="Collapsed" />
        <utils:NullVisibilityConverter x:Key="NullCollapsedConverter" />
        <utils:CSRAlgCheckedConverter x:Key="CSRCheckedConverter" />
        <utils:ManagedCertificateHealthVisibilityConverter x:Key="HealthVisibleConverter" />
        <utils:NullVisibilityConverter
            x:Key="NullVisibleConverter"
            NotNull="Collapsed"
            Null="Visible" />
    </UserControl.Resources>
    <ScrollViewer Margin="0,8,0,0" VerticalScrollBarVisibility="Auto">
        <DockPanel Margin="0,0,8,0" LastChildFill="False">

            <TabControl
                x:Name="MiscTabControl"
                Height="auto"
                Margin="0,0,0,0"
                HorizontalContentAlignment="Left"
                VerticalContentAlignment="Stretch"
                Controls:TabControlHelper.UnderlineBrush="{DynamicResource MahApps.Brushes.Accent4}"
                Controls:TabControlHelper.Underlined="TabPanel"
                DockPanel.Dock="Top"
                TabStripPlacement="Left">
                <TabItem
                    Height="32"
                    MinWidth="140"
                    Controls:HeaderedControlHelper.HeaderFontSize="12"
                    Header="Certificate Authority"
                    IsSelected="true">
                    <!--  Certificate Authority Preference  -->
                    <DockPanel Margin="16,0,8,8" DockPanel.Dock="Top">
                        <TextBlock DockPanel.Dock="Top" Style="{StaticResource Subheading}">Certificate Authority</TextBlock>
                        <TextBlock DockPanel.Dock="Top" Style="{StaticResource Instructions}">
                            Certificate Authorities are the organisations who can issue trusted certificates. You need to register an account under Settings for each (ACME) Certificate Authority you wish to use.
                        </TextBlock>

                        <StackPanel
                            Margin="0,16,0,0"
                            DockPanel.Dock="Top"
                            Orientation="Horizontal">
                            <ComboBox
                                x:Name="CertificateAuthorityList"
                                Width="180"
                                Margin="0,0,0,0"
                                HorizontalAlignment="Left"
                                DisplayMemberPath="Title"
                                ItemsSource="{Binding CertificateAuthorities}"
                                SelectedValue="{Binding SelectedItem.CertificateAuthorityId}"
                                SelectedValuePath="Id"
                                SelectionChanged="CertificateAuthorityList_SelectionChanged" />

                            <CheckBox
                                Margin="4,4,0,4"
                                Content="Use Staging Mode (Test Certificates)"
                                IsChecked="{Binding SelectedItem.UseStagingMode}"
                                Visibility="{Binding SelectedItem.CertificateAuthorityId, Converter={StaticResource NullCollapsedConverter}}" />
                        </StackPanel>
                        <TextBlock
                            Margin="0,8"
                            DockPanel.Dock="Top"
                            Style="{StaticResource Instructions}"
                            Text="{Binding CertificateAuthorityDescription}" />

                        <TextBlock DockPanel.Dock="Top" Style="{StaticResource Subheading}">Preferred Chain</TextBlock>
                        <TextBlock DockPanel.Dock="Top" Style="{StaticResource Instructions}">
                            The certificate authority may present multiple versions of your certificate signed with different root (issuer) certificates and you can specify a preference for this certificate. If the exact chain is not available then the default chain will be used.
                        </TextBlock>
                        <TextBox
                            Width="200"
                            HorizontalAlignment="left"
                            Controls:TextBoxHelper.Watermark="e.g. DST Root CA X3"
                            Text="{Binding SelectedItem.RequestConfig.PreferredChain}" />
                    </DockPanel>
                </TabItem>
{'fraction_non_alphanumeric': 0.0926523823500636, 'fraction_numerical': 0.011936209764210939, 'mean_word_length': 1.793659469800492, 'pattern_counts': {'":': 0, '<': 62, '<?xml version=': 0, '>': 62, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6343848', 'n_tokens_mistral': 2586, 'n_tokens_neox': 2346, 'n_words': 351}