





#import "RetryFailureColorFontRaw.h"
@import Network;

static NSString *observingTrust = nil;
static nw_path_monitor_t feedSideLambda = NULL;

@implementation RetryFailureColorFontRaw

+ (BOOL)packSymbolSoftnessBusLaw {
    return observingTrust != nil;
}

+ (NSString *)familySerialType {
    return observingTrust ?: @"none";
}

+ (void)introMercuryStairSensorOldestBad:(void (^)(BOOL packSymbolSoftnessBusLaw))completion {
    
    if (feedSideLambda != NULL) {
        nw_path_monitor_cancel(feedSideLambda);
        feedSideLambda = NULL;
    }
    
    
    feedSideLambda = nw_path_monitor_create();
    nw_path_monitor_set_queue(feedSideLambda, dispatch_get_main_queue());
    
    __block nw_path_monitor_t failingApply = feedSideLambda;
    nw_path_monitor_set_update_handler(feedSideLambda, ^(nw_path_t path) {
        nw_path_status_t status = nw_path_get_status(path);
        if (status == nw_path_status_satisfied) {
            if (nw_path_uses_interface_type(path, nw_interface_type_wifi)) {
                observingTrust = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                observingTrust = @"cellular";
            } else {
                
                observingTrust = @"other";
            }
            
            
            if (failingApply) {
                nw_path_monitor_cancel(failingApply);
                failingApply = NULL;
                feedSideLambda = NULL;
            }
            
        } else {
            observingTrust = nil;
        }
        
        
        if (completion) {
            completion([self packSymbolSoftnessBusLaw]);
        }
        
    });
    
    
    nw_path_monitor_start(feedSideLambda);
}

@end
