# Path: vise/config.py
# def color(key, default):
#     ans = colors().get(key)
#     if not ans or ans == 'default':
#         ans = default
#     return ans
# 
# Path: vise/constants.py
# STATUS_BAR_HEIGHT = 24


from collections import namedtuple
from gettext import gettext as _
from time import monotonic
from xml.sax.saxutils import escape
from PyQt6.QtCore import Qt, QTimer, QUrl, pyqtSignal, QPointF
from PyQt6.QtGui import (QBrush, QColor, QLinearGradient, QPainter, QPalette,
                         QStaticText, QTextOption)
from PyQt6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QLineEdit,
                             QStackedWidget, QStatusBar, QWidget)
from .config import color
from .constants import STATUS_BAR_HEIGHT
        from vise.view import certificate_error_domains
        self.is_secure = False
        self.static_text = None
        self.current_key = None
        self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
        self.sb_background = QColor(color(sb_background, self.palette().color(QPalette.ColorRole.Window)))

    def focusInEvent(self, ev):
        # Needed because in Qt 5.11 the no focus focus policy is broken
        app = QApplication.instance()
        window = app.activeWindow()
        if hasattr(window, 'current_tab'):
            ct = window.current_tab
            if ct is not None:
                ct.setFocus(Qt.FocusReason.OtherFocusReason)

    def set_message(self, text, color_, bold=False, is_permanent=False):
        key = (text, color_.name(), bold, is_permanent)
        if key == self.current_key:
            return
        self.current_key = key
        self.is_permanent = is_permanent
        prefix = text.partition(':')[0]
        self.is_address = self.is_permanent and prefix.lower() in {'http', 'https', 'vise', 'file'}
        self.is_secure = prefix.lower() in {'https', 'vise', 'file'}
        color_ = color_ or self.palette().color(self.palette().WindowText)
        if self.is_address:
            qurl = QUrl(text)
            if self.is_secure and qurl.host() in certificate_error_domains:
                self.is_secure = False
            if qurl.scheme() in {'vise', 'file'}:

# Path: vise/config.py
# def color(key, default):
#     ans = colors().get(key)
#     if not ans or ans == 'default':
#         ans = default
#     return ans
# 
# Path: vise/constants.py
# STATUS_BAR_HEIGHT = 24


# Path: vise/status_bar.py
from collections import namedtuple
from gettext import gettext as _
from time import monotonic
from xml.sax.saxutils import escape
from PyQt6.QtCore import Qt, QTimer, QUrl, pyqtSignal, QPointF
from PyQt6.QtGui import (QBrush, QColor, QLinearGradient, QPainter, QPalette,
                         QStaticText, QTextOption)
from PyQt6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QLineEdit,
                             QStackedWidget, QStatusBar, QWidget)
from .config import color
from .constants import STATUS_BAR_HEIGHT
        from vise.view import certificate_error_domains

        self.is_secure = False
        self.static_text = None
        self.current_key = None
        self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
        self.sb_background = QColor(color(sb_background, self.palette().color(QPalette.ColorRole.Window)))

    def focusInEvent(self, ev):
        # Needed because in Qt 5.11 the no focus focus policy is broken
        app = QApplication.instance()
        window = app.activeWindow()
        if hasattr(window, 'current_tab'):
            ct = window.current_tab
            if ct is not None:
                ct.setFocus(Qt.FocusReason.OtherFocusReason)

    def set_message(self, text, color_, bold=False, is_permanent=False):
        key = (text, color_.name(), bold, is_permanent)
        if key == self.current_key:
            return
        self.current_key = key
        self.is_permanent = is_permanent
        prefix = text.partition(':')[0]
        self.is_address = self.is_permanent and prefix.lower() in {'http', 'https', 'vise', 'file'}
        self.is_secure = prefix.lower() in {'https', 'vise', 'file'}
        color_ = color_ or self.palette().color(self.palette().WindowText)
        if self.is_address:
            qurl = QUrl(text)
            if self.is_secure and qurl.host() in certificate_error_domains:
                self.is_secure = False
            if qurl.scheme() in {'vise', 'file'}:

                host = qurl.path()