<commit_before>import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import classNames from 'classnames';
import { UnorderedListOutlined } from '@ant-design/icons';
import { Select, Row, Col, Popover, Button } from 'antd';

import * as utils from '../../utils';
import packageJson from '../../../../../package.json';
import Logo from './Logo';
import SearchBox from './SearchBox';
import More from './More';
import Navigation from './Navigation';
import Github from './Github';
import SiteContext from '../SiteContext';
import { ping } from '../../utils';

import './index.less';

const RESPONSIVE_XS = 1120;
const RESPONSIVE_SM = 1200;

const { Option } = Select;

const antdVersion: string = packageJson.version;

let docsearch: any;
if (typeof window !== 'undefined') {
  // eslint-disable-next-line global-require
  docsearch = require('docsearch.js');
}

function initDocSearch(locale: string) {
  if (!docsearch) {
    return;
  }
  const lang = locale === 'zh-CN' ? 'cn' : 'en';
  docsearch({
    apiKey: '60ac2c1a7d26ab713757e4a081e133d0',
    indexName: 'ant_design',
    inputSelector: '#search-box input',
    algoliaOptions: { facetFilters: [`tags:${lang}`] },
    transformData(hits: { url: string }[]) {
      hits.forEach(hit => {
        hit.url = hit.url.replace('ant.design', window.location.host);
        hit.url = hit.url.replace('https:', window.location.protocol);
      });
      return hits;
    },
    debug: false, // Set debug to true if you want to inspect the dropdown
  });
}

export interface HeaderProps {
  intl: {
    locale: string;
  };<commit_msg>fix: keep selected theme when searching (#30977)<commit_after>import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import classNames from 'classnames';
import { UnorderedListOutlined } from '@ant-design/icons';
import { Select, Row, Col, Popover, Button } from 'antd';

import * as utils from '../../utils';
import packageJson from '../../../../../package.json';
import Logo from './Logo';
import SearchBox from './SearchBox';
import More from './More';
import Navigation from './Navigation';
import Github from './Github';
import SiteContext from '../SiteContext';
import { ping } from '../../utils';

import './index.less';

const RESPONSIVE_XS = 1120;
const RESPONSIVE_SM = 1200;

const { Option } = Select;

const antdVersion: string = packageJson.version;

let docsearch: any;
if (typeof window !== 'undefined') {
  // eslint-disable-next-line global-require
  docsearch = require('docsearch.js');
}

function initDocSearch(locale: string) {
  if (!docsearch) {
    return;
  }
  const lang = locale === 'zh-CN' ? 'cn' : 'en';
  docsearch({
    apiKey: '60ac2c1a7d26ab713757e4a081e133d0',
    indexName: 'ant_design',
    inputSelector: '#search-box input',
    algoliaOptions: { facetFilters: [`tags:${lang}`] },
    transformData(hits: { url: string }[]) {
      const a = document.createElement('a');
      hits.forEach(hit => {
        // `new URL` is not supported in IE
        a.href = hit.url;
        hit.url = `${a.pathname}${window.location.search || ''}${a.hash}`;
      });
      return hits;
    },
    debug: false, // Set debug to true if you want to inspect the dropdown
  });
}

export interface HeaderProps {
  intl: {
    locale: string;
  };
{'fraction_non_alphanumeric': 0.16129032258064516, 'fraction_numerical': 0.018993066023515224, 'mean_word_length': 3.5081521739130435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3302917', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1042, 'n_words': 299}