

#import "AdobeViewController.h"
#import "Minor.h"
#import "DeleteMovementLeadTransmitCenterAdapter.h"
#import "ToolUplinkNewtonsWarningSob.h"
#import "CyclingHisConfig.h"

@interface AdobeViewController ()
@property (nonatomic, strong) UITextView *textView;
@property (nonatomic, strong) DeleteMovementLeadTransmitCenterAdapter *raiseIntroStampNumeratorNepali;
@property (nonatomic, strong) ToolUplinkNewtonsWarningSob *deepCardioidSupplyRenamingKin;
@property (nonatomic, strong) NSDate *selectedDate; 
@end

static ToolUplinkNewtonsWarningSob *panEmergencyScheduledRelationsAddReduction = nil;
static DeleteMovementLeadTransmitCenterAdapter *thicknessOurExerciseAfterRuleStarting = nil;

@implementation AdobeViewController

+ (void)laterDerive {
    
    [Minor fastestNotationCancelsContainerAccountInitially];

    thicknessOurExerciseAfterRuleStarting = [[DeleteMovementLeadTransmitCenterAdapter alloc] init];
    thicknessOurExerciseAfterRuleStarting.hiddenLevel = NativeAssistiveNonceCyrillicWax;

    [Minor styleRevertingSilentIntegralCompose:thicknessOurExerciseAfterRuleStarting];

    panEmergencyScheduledRelationsAddReduction = [[ToolUplinkNewtonsWarningSob alloc] init];
    panEmergencyScheduledRelationsAddReduction.hiddenLevel = SexualPicture;
    panEmergencyScheduledRelationsAddReduction.downNot = 7;
    panEmergencyScheduledRelationsAddReduction.kerningPortalReliablePenProposed = YES;
    [Minor styleRevertingSilentIntegralCompose:panEmergencyScheduledRelationsAddReduction];

    [panEmergencyScheduledRelationsAddReduction innerMailPause];
}

+ (ToolUplinkNewtonsWarningSob *)exceededIcyInsteadDiscreteDecodeBirthday {
    return panEmergencyScheduledRelationsAddReduction;
}
+ (DeleteMovementLeadTransmitCenterAdapter *)importantDeclinedSecurityBlockerRectifiedPick {
    return thicknessOurExerciseAfterRuleStarting;
}

- (DeleteMovementLeadTransmitCenterAdapter *)raiseIntroStampNumeratorNepali {
    return thicknessOurExerciseAfterRuleStarting;
}

+ (void)showFromViewController:(UIViewController *)parentVC {
    AdobeViewController *dutch = [[AdobeViewController alloc] init];
    UINavigationController *job = [[UINavigationController alloc] initWithRootViewController:dutch];
    job.modalPresentationStyle = UIModalPresentationFullScreen;
    [parentVC presentViewController:job animated:YES completion:nil];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = warpBuffers.uniqueLaunchingAlignedGeometricRevertWriting;
    self.view.backgroundColor = [UIColor systemBackgroundColor];

    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
                                            initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
                                            target:self
                                            action:@selector(proxyAction)];

    self.navigationItem.rightBarButtonItems = @[
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
                                                      target:self
                                                      action:@selector(subMillAction)],
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
                                                      target:self
                                                      action:@selector(levelAction)],
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks
                                                      target:self
                                                      action:@selector(planarSaltAction)]
    ];
    self.navigationController.navigationBar.layoutMargins = UIEdgeInsetsMake(0, 0, 0, -10);

    _textView = [[UITextView alloc] init];
    _textView.font = [UIFont systemFontOfSize:11];
    _textView.editable = NO;
    _textView.backgroundColor = [UIColor systemBackgroundColor];
    _textView.textColor = [UIColor labelColor];
    _textView.translatesAutoresizingMaskIntoConstraints = NO;
    _textView.showsVerticalScrollIndicator = YES;
    _textView.showsHorizontalScrollIndicator = YES;
    _textView.alwaysBounceVertical = YES;
    
    _textView.scrollEnabled = YES;
    [self.view addSubview:_textView];

    [NSLayoutConstraint activateConstraints:@[
        [_textView.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor],
        [_textView.leadingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.leadingAnchor constant:8],
        [_textView.trailingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.trailingAnchor constant:-8],
        [_textView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]
    ]];

    self.deepCardioidSupplyRenamingKin = [AdobeViewController exceededIcyInsteadDiscreteDecodeBirthday];

    [self useBegan];
}

- (void)useBegan {
    if (!self.deepCardioidSupplyRenamingKin) {
        _textView.text = warpBuffers.sameNotReversingAdaptorHowSoftness;
        return;
    }

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        NSString *logs;
        if (self.selectedDate) {
            logs = [self.deepCardioidSupplyRenamingKin winCoalesceDate:self.selectedDate];
        } else {
            logs = [self.deepCardioidSupplyRenamingKin mapWasAlong];
        }

        dispatch_async(dispatch_get_main_queue(), ^{
            if (logs.length > 0) {
                self.textView.text = logs;
                
                [self.textView scrollRangeToVisible:NSMakeRange(logs.length - 1, 1)];
            } else {
                self.textView.text = warpBuffers.justUplinkCyrillicProfileMalayExpecting;
            }

            [self updateTitle];
        });
    });
}

- (void)proxyAction {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)subMillAction {
    [self useBegan];
}

- (void)updateTitle {
    if (self.selectedDate) {
        NSDateFormatter *debugging = [[NSDateFormatter alloc] init];
        debugging.dateFormat = warpBuffers.greaterUpdatingDecryptedSecureAlongsideKeyNanograms;
        NSString *dueStartup = [debugging stringFromDate:self.selectedDate];

        NSCalendar *calendar = [NSCalendar currentCalendar];
        if ([calendar isDateInToday:self.selectedDate]) {
            self.title = warpBuffers.cardBasalWirelessProcessedSmoothedDiscount;
        } else if ([calendar isDateInYesterday:self.selectedDate]) {
            self.title = warpBuffers.wideLocalExpiredTwelveToneDueMargins;
        } else {
            self.title = dueStartup;
        }
    } else {
        self.title = warpBuffers.visitorShortEvaluatedPreferScanningFreezing;
    }
}

- (void)planarSaltAction {
    if (!self.deepCardioidSupplyRenamingKin) {
        return;
    }

    NSArray<NSDate *> *pastFeatBoxAdd = [self.deepCardioidSupplyRenamingKin datumFormat];
    if (pastFeatBoxAdd.count == 0) {
        UIAlertController *cloud = [UIAlertController alertControllerWithTitle:warpBuffers.ovulationBodyAccountActivityStayKin
                                                                       message:warpBuffers.justUplinkCyrillicProfileMalayExpecting
                                                                preferredStyle:UIAlertControllerStyleAlert];
        [cloud addAction:[UIAlertAction actionWithTitle:warpBuffers.magneticStrengthSpaResourceSigmoidFat style:UIAlertActionStyleDefault handler:nil]];
        [self presentViewController:cloud animated:YES completion:nil];
        return;
    }

    UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:warpBuffers.envelopePullCommentReplyBloodTextureSundanese
                                                                         message:nil
                                                                  preferredStyle:UIAlertControllerStyleActionSheet];

    [actionSheet addAction:[UIAlertAction actionWithTitle:warpBuffers.visitorShortEvaluatedPreferScanningFreezing
                                                    style:UIAlertActionStyleDefault
                                                  handler:^(UIAlertAction *action) {
        self.selectedDate = nil;
        [self useBegan];
    }]];

    NSDateFormatter *debugging = [[NSDateFormatter alloc] init];
    debugging.dateFormat = warpBuffers.greaterUpdatingDecryptedSecureAlongsideKeyNanograms;

    NSCalendar *calendar = [NSCalendar currentCalendar];

    for (NSDate *date in pastFeatBoxAdd) {
        NSString *title;
        if ([calendar isDateInToday:date]) {
            title = warpBuffers.cardBasalWirelessProcessedSmoothedDiscount;
        } else if ([calendar isDateInYesterday:date]) {
            title = warpBuffers.wideLocalExpiredTwelveToneDueMargins;
        } else {
            title = [debugging stringFromDate:date];
        }

        [actionSheet addAction:[UIAlertAction actionWithTitle:title
                                                        style:UIAlertActionStyleDefault
                                                      handler:^(UIAlertAction *action) {
            self.selectedDate = date;
            [self useBegan];
        }]];
    }

    [actionSheet addAction:[UIAlertAction actionWithTitle:warpBuffers.focalMapSpaceUnsavedDailyOutside style:UIAlertActionStyleCancel handler:nil]];

    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        actionSheet.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
    }

    [self presentViewController:actionSheet animated:YES completion:nil];
}

- (void)levelAction {
    if (!self.deepCardioidSupplyRenamingKin) {
        return;
    }

    NSArray *cyrillic = [self.deepCardioidSupplyRenamingKin twoSmallTag];
    if (cyrillic.count == 0) {
        UIAlertController *cloud = [UIAlertController alertControllerWithTitle:warpBuffers.ovulationBodyAccountActivityStayKin
                                                                       message:warpBuffers.blindingOldSpanProvinceIncomingLocale
                                                                preferredStyle:UIAlertControllerStyleAlert];
        [cloud addAction:[UIAlertAction actionWithTitle:warpBuffers.magneticStrengthSpaResourceSigmoidFat style:UIAlertActionStyleDefault handler:nil]];
        [self presentViewController:cloud animated:YES completion:nil];
        return;
    }

    UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:warpBuffers.captionClimbingBrowsingShrinkTelephoneGetHit
                                                                         message:nil
                                                                  preferredStyle:UIAlertControllerStyleActionSheet];

    [actionSheet addAction:[UIAlertAction actionWithTitle:warpBuffers.renderFailEldestPrefixedRegionLessGranted
                                                    style:UIAlertActionStyleDefault
                                                  handler:^(UIAlertAction *action) {
        [self discountWait];
    }]];

    for (NSURL *fileURL in cyrillic) {
        NSString *fileName = fileURL.lastPathComponent;
        [actionSheet addAction:[UIAlertAction actionWithTitle:[NSString stringWithFormat:warpBuffers.syntaxFlowKinPastArcadeReuseFill, fileName]
                                                        style:UIAlertActionStyleDefault
                                                      handler:^(UIAlertAction *action) {
            [self duePlateFile:fileURL];
        }]];
    }

    [actionSheet addAction:[UIAlertAction actionWithTitle:warpBuffers.focalMapSpaceUnsavedDailyOutside style:UIAlertActionStyleCancel handler:nil]];

    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        actionSheet.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
    }

    [self presentViewController:actionSheet animated:YES completion:nil];
}

- (void)discountWait {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        
        NSString *starCar = [self.deepCardioidSupplyRenamingKin schemeListSort];

        dispatch_async(dispatch_get_main_queue(), ^{
            if (starCar.length > 0) {
                UIActivityViewController *zipButKnow = [[UIActivityViewController alloc]
                                                       initWithActivityItems:@[starCar]
                                                       applicationActivities:nil];

                if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
                    zipButKnow.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
                }

                [self presentViewController:zipButKnow animated:YES completion:nil];
            }
        });
    });
}

- (void)duePlateFile:(NSURL *)fileURL {
    UIActivityViewController *zipButKnow = [[UIActivityViewController alloc]
                                           initWithActivityItems:@[fileURL]
                                           applicationActivities:nil];

    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        zipButKnow.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
    }

    [self presentViewController:zipButKnow animated:YES completion:nil];
}

@end
