{% load i18n static %}<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}">
<head>
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="robots" content="NONE,NOARCHIVE">
    <meta charset="utf-8">
    {% if favicon %}
        <link rel="icon" href="{{ favicon }}" />
    {% else %}
        <link rel="icon" href="{% static "se/logo.svg" %}" />
    {% endif %}
    <title>SOSSE</title>
    <noscript>
        <meta http-equiv="REFRESH" content="0;url=/?q={{ q|safe }}">
    </noscript>
    <script src="{% static 'se/base.js' %}"></script>
    <script>
        console.log('location', window.location.search.substr(1));
        const currentParams = new URLSearchParams(window.location.search.substr(1));
        let url = '{{ url }}';
        console.log('params', currentParams.toString());

        currentParams.delete('l');
        const lang = getLang();
        if (lang) {
          currentParams.append('l', lang);
        }

        currentParams.delete('ps');
        const pageSize = getPageSize({{ settings.SOSSE_DEFAULT_PAGE_SIZE }});
        if (pageSize) {
          currentParams.append('ps', pageSize);
        }

        if (getCachedLinks()) {
          currentParams.append('c', '1');
        }
        url = '{{ url }}?' + currentParams.toString();
        console.log('redirecting to', url);
        window.location = url;
    </script>
</head>
<body></body>
</html>
