         }
         switch sessionType {
         case .chrome:
-            CookieUtility.requestBrowserCookie(
-                browserType: .chrome,
-                completion: cookieCompletion)
+            CookieUtility.requestBrowserCookie(browserType: .chrome, completion: completion)
         case .safari:
-            CookieUtility.requestBrowserCookie(
-                browserType: .safari,
-                completion: cookieCompletion)
+            CookieUtility.requestBrowserCookie(browserType: .safari, completion: completion)
         case .login(let mail, let password):
-            CookieUtility.requestLoginCookie(
-                mailAddress: mail,
-                password: password,
-                completion: cookieCompletion)
+            CookieUtility.requestLoginCookie(mailAddress: mail, password: password, completion: completion)
         }
     }
 

        socket.write(string: message)
    }

    func decodeChat(text: String) {
        guard let data = text.data(using: .utf8) else { return }
        let decoder = JSONDecoder()
        decoder.keyDecodingStrategy = .convertFromSnakeCase
        guard let chat = try? decoder.decode(WebSocketChatData.self, from: data) else { return }
        // log.debug(chat)
        delegate?.nicoUtilityDidReceiveChat(self, chat: chat.toChat())
    }
}


// MARK: - Public Methods (Main)
extension NicoUtility {
    func connect(liveNumber: Int, sessionType: NicoSessionType, connectContext: NicoUtility.ConnectContext = .normal) {
        // 1. Save connection request.
        ongoingConnectRequest = ConnectRequest(
            liveNumber: liveNumber,
            sessionType: sessionType
        )
        lastEstablishedConnectRequest = nil

        // 2. Save chat numbers.
        switch connectContext {
        case .normal:
            chatNo.latest = 0
            chatNo.maxBeforeReconnect = 0
        case .reconnect:
            chatNo.maxBeforeReconnect = chatNo.latest
        }

        // 3. Cleanup current connection, if needed.
        if live != nil {
            disconnect()
        }

        // 4. Go direct to `connect()` IF the user session cookie is availale.
        clearUserSessionCookieIfReserved()
        delegate?.nicoUtilityWillPrepareLive(self)
        if let userSessionCookie = userSessionCookie {
