<commit_before>// Copyright 2021-2022, University of Colorado Boulder

/**
 * A panel for the PreferencesDialog with controls for visual preferences. Includes freatures such as
 * "Interactive Highlights" and perhaps others in the future.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */

import merge from '../../../phet-core/js/merge.js';
import StringUtils from '../../../phetcommon/js/util/StringUtils.js';
import { Node, NodeOptions, Text, VBox, VoicingText } from '../../../scenery/js/imports.js';
import joist from '../joist.js';
import joistStrings from '../joistStrings.js';
import PreferencesDialog from './PreferencesDialog.js';
import PreferencesPanelSection from './PreferencesPanelSection.js';
import PreferencesToggleSwitch from './PreferencesToggleSwitch.js';
import { VisualModel } from './PreferencesModel.js';
import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import ProjectorModeToggleSwitch from './ProjectorModeToggleSwitch.js';
import Tandem from '../../../tandem/js/Tandem.js';
import Emitter from '../../../axon/js/Emitter.js';

// constants
const interactiveHighlightsString = joistStrings.preferences.tabs.visual.interactiveHighlights;
const interactiveHighlightsDescriptionString = joistStrings.preferences.tabs.visual.interactiveHighlightsDescription;
const interactiveHighlightsEnabledAlertString = joistStrings.a11y.preferences.tabs.visual.interactiveHighlights.enabledAlert;
const interactiveHighlightsDisabledAlertString = joistStrings.a11y.preferences.tabs.visual.interactiveHighlights.disabledAlert;
const labelledDescriptionPatternString = joistStrings.a11y.preferences.tabs.labelledDescriptionPattern;

class VisualPreferencesPanel extends Node {
  private readonly disposeVisualPreferencesPanel: () => void;

  public constructor( visualModel: VisualModel, providedOptions?: NodeOptions ) {

    const options = optionize<NodeOptions, EmptySelfOptions, NodeOptions>()( {
      tandem: Tandem.OPTIONAL,

      // pdom
      tagName: 'div',
      labelTagName: 'h2',
      labelContent: 'Visual'
    }, providedOptions );

    const tandem = options.tandem;
    options.tandem = Tandem.OPTIONAL;
    super( options );

    const disposeEmitter = new Emitter();

    const contentNode = new VBox( {
      spacing: PreferencesDialog.CONTENT_SPACING,
      align: 'left'
    } );

    if ( visualModel.supportsProjectorMode ) {<commit_msg>use string Properties for visual preferences, see https://github.com/phetsims/joist/issues/851<commit_after>// Copyright 2021-2022, University of Colorado Boulder

/**
 * A panel for the PreferencesDialog with controls for visual preferences. Includes freatures such as
 * "Interactive Highlights" and perhaps others in the future.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */

import merge from '../../../phet-core/js/merge.js';
import StringUtils from '../../../phetcommon/js/util/StringUtils.js';
import { Node, NodeOptions, Text, VBox, VoicingText } from '../../../scenery/js/imports.js';
import joist from '../joist.js';
import joistStrings from '../joistStrings.js';
import PreferencesDialog from './PreferencesDialog.js';
import PreferencesPanelSection from './PreferencesPanelSection.js';
import PreferencesToggleSwitch from './PreferencesToggleSwitch.js';
import { VisualModel } from './PreferencesModel.js';
import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import ProjectorModeToggleSwitch from './ProjectorModeToggleSwitch.js';
import Tandem from '../../../tandem/js/Tandem.js';
import Emitter from '../../../axon/js/Emitter.js';

// constants
const interactiveHighlightsString = joistStrings.preferences.tabs.visual.interactiveHighlightsStringProperty;
const interactiveHighlightsDescriptionString = joistStrings.preferences.tabs.visual.interactiveHighlightsDescriptionStringProperty;
const interactiveHighlightsEnabledAlertString = joistStrings.a11y.preferences.tabs.visual.interactiveHighlights.enabledAlertStringProperty;
const interactiveHighlightsDisabledAlertString = joistStrings.a11y.preferences.tabs.visual.interactiveHighlights.disabledAlertStringProperty;
const labelledDescriptionPatternString = joistStrings.a11y.preferences.tabs.labelledDescriptionPatternStringProperty;

class VisualPreferencesPanel extends Node {
  private readonly disposeVisualPreferencesPanel: () => void;

  public constructor( visualModel: VisualModel, providedOptions?: NodeOptions ) {

    const options = optionize<NodeOptions, EmptySelfOptions, NodeOptions>()( {
      tandem: Tandem.OPTIONAL,

      // pdom
      tagName: 'div',
      labelTagName: 'h2',
      labelContent: 'Visual'
    }, providedOptions );

    const tandem = options.tandem;
    options.tandem = Tandem.OPTIONAL;
    super( options );

    const disposeEmitter = new Emitter();

    const contentNode = new VBox( {
      spacing: PreferencesDialog.CONTENT_SPACING,
      align: 'left'
    } );

    if ( visualModel.supportsProjectorMode ) {
{'fraction_non_alphanumeric': 0.11522219987934848, 'fraction_numerical': 0.006635833500904886, 'mean_word_length': 4.658703071672355, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 1, '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': '7378359', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1325, 'n_words': 321}