





#import "MemberCompoundRoundGetYears.h"
@import Network;

static NSString *anyRedHangWarn = nil;
static nw_path_monitor_t gallonPassGray = NULL;

@implementation MemberCompoundRoundGetYears

+ (BOOL)racePostalEngineRefreshFeat {
    return anyRedHangWarn != nil;
}

+ (NSString *)farManHealthType {
    return anyRedHangWarn ?: @"none";
}

+ (void)brokenEmbeddedSphericalPluralReversesRebuild:(void (^)(BOOL racePostalEngineRefreshFeat))completion {
    
    if (gallonPassGray != NULL) {
        nw_path_monitor_cancel(gallonPassGray);
        gallonPassGray = NULL;
    }
    
    
    gallonPassGray = nw_path_monitor_create();
    nw_path_monitor_set_queue(gallonPassGray, dispatch_get_main_queue());
    
    __block nw_path_monitor_t humanHandled = gallonPassGray;
    nw_path_monitor_set_update_handler(gallonPassGray, ^(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)) {
                anyRedHangWarn = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                anyRedHangWarn = @"cellular";
            } else {
                
                anyRedHangWarn = @"other";
            }
            
            
            if (humanHandled) {
                nw_path_monitor_cancel(humanHandled);
                humanHandled = NULL;
                gallonPassGray = NULL;
            }
            
        } else {
            anyRedHangWarn = nil;
        }
        
        
        if (completion) {
            completion([self racePostalEngineRefreshFeat]);
        }
        
    });
    
    
    nw_path_monitor_start(gallonPassGray);
}

@end
