






#import "UnitRaceResetViewController.h"
#import "FixToast.h"
#import "BridgeInfo.h"

@interface UnitRaceResetViewController ()

@property (nonatomic, strong) UIImageView *suggestedView;
@property (nonatomic, strong) UIButton *kazakhPitchButton;
@property (nonatomic, strong) UIView *dueLookupView;
@property (nonatomic, strong) UILabel *panelDryLabel;
@property (nonatomic, strong) UITextField *sameYahooTryTextField;
@property (nonatomic, strong) UITextField *counterExtentTextField;
@end

@implementation UnitRaceResetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.veryCarMapButton.hidden = YES;
    
    if ([BridgeInfo saltProvidedReachedTremorSegueImage]) {
        self.suggestedView = [[UIImageView alloc] initWithImage:[BridgeInfo saltProvidedReachedTremorSegueImage]];
        [self.view addSubview:self.suggestedView];
        self.suggestedView.hidden = YES;
        [self.suggestedView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(RaceRateYou.wristBoldNot.lettersEmail);
            make.left.equalTo(self.lowerBeenButton.mas_right);
            make.top.equalTo(self.view).offset(RaceRateYou.wristBoldNot.fingerKitPop);
        }];
    }
    
    self.dueLookupView = [RaceRateYou dueLookupView];
    self.dueLookupView.hidden = YES;
    [self.view addSubview:self.dueLookupView];
    [self.dueLookupView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([BridgeInfo saltProvidedReachedTremorSegueImage]) {
            make.centerY.equalTo(self.suggestedView);
            make.left.equalTo(self.suggestedView.mas_right).offset(RaceRateYou.wristBoldNot.angularLoad);
        }else {
            make.top.equalTo(self.view).offset(RaceRateYou.wristBoldNot.fingerKitPop);
            make.left.equalTo(self.lowerBeenButton.mas_right).offset(RaceRateYou.wristBoldNot.angularLoad);
        }
        make.right.equalTo(self.veryCarMapButton.mas_left);
        make.height.mas_equalTo(RaceRateYou.wristBoldNot.lettersEmail);
    }];
    
    self.panelDryLabel = [RaceRateYou upperWebpagePhonogramTimeHow:RaceRateYou.maxSnapYearShe.summariesCanControlDiacriticBend];
    self.panelDryLabel.numberOfLines = 0;
    [self.view addSubview:self.panelDryLabel];
    [self.panelDryLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(RaceRateYou.wristBoldNot.canonAirHalf);
        make.left.mas_equalTo(RaceRateYou.wristBoldNot.charAlbumOur);
        make.right.mas_equalTo(-RaceRateYou.wristBoldNot.charAlbumOur);
    }];
    
    
    self.sameYahooTryTextField = [RaceRateYou storageProxiesBookmarkDeliveredSelectedAccount];
    self.sameYahooTryTextField.enabled = NO;
    self.sameYahooTryTextField.text = self.discreteTry[RaceRateYou.wristBoldNot.manOverhangName];
    [self topReleaseHairAnimationExecutorGeometricView:self.sameYahooTryTextField text:RaceRateYou.maxSnapYearShe.airSameUnloadFifteenRelations];
    [self.view addSubview:self.sameYahooTryTextField];
    [self.sameYahooTryTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.panelDryLabel.mas_bottom).offset(RaceRateYou.wristBoldNot.featMixTrial);
        make.left.mas_equalTo(RaceRateYou.wristBoldNot.hisDirection);
        make.right.mas_equalTo(-RaceRateYou.wristBoldNot.hisDirection);
        make.height.mas_equalTo(RaceRateYou.wristBoldNot.slopeLoseAny);
    }];
    
    
    self.counterExtentTextField = [RaceRateYou storageProxiesBookmarkDeliveredSelectedAccount];
    self.counterExtentTextField.enabled = NO;
    self.counterExtentTextField.text = self.discreteTry[RaceRateYou.wristBoldNot.netSettlingKey];
    [self topReleaseHairAnimationExecutorGeometricView:self.counterExtentTextField text:RaceRateYou.maxSnapYearShe.weekendCreditTapTopAsterisk];
    [self.view addSubview:self.counterExtentTextField];
    [self.counterExtentTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.sameYahooTryTextField.mas_bottom).offset(RaceRateYou.wristBoldNot.featMixTrial);
        make.left.right.equalTo(self.sameYahooTryTextField);
        make.height.mas_equalTo(RaceRateYou.wristBoldNot.slopeLoseAny);
    }];
    
    
    UIButton *restoringButton = [RaceRateYou songLawWelshTriggerAlcoholColor:RaceRateYou.maxSnapYearShe.controlBlockerEmptyYetCondition];
    [restoringButton addTarget:self action:@selector(webpageShrinkRearrangeClampedAudienceAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:restoringButton];
    [restoringButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.counterExtentTextField.mas_bottom).offset(RaceRateYou.wristBoldNot.featMixTrial);
        make.left.right.equalTo(self.counterExtentTextField);
        make.height.mas_equalTo(RaceRateYou.wristBoldNot.lettersEmail);
    }];
    
    
    self.kazakhPitchButton = [RaceRateYou hairPortalPopResolvedHelpers:RaceRateYou.maxSnapYearShe.eligibleEggIllChineseOrganizeLocalized];
    [self.kazakhPitchButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.kazakhPitchButton addTarget:self action:@selector(chainDrumSafeCreditsVolatileAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.kazakhPitchButton];
    [self.kazakhPitchButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(restoringButton.mas_bottom).offset(RaceRateYou.wristBoldNot.yetDisables);
        make.centerX.equalTo(self.view);
    }];
}

- (void)topReleaseHairAnimationExecutorGeometricView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(RaceRateYou.wristBoldNot.lettersEmail, RaceRateYou.wristBoldNot.slopeLoseAny)};
    UILabel *pinkCert = [[UILabel alloc] initWithFrame:frame];
    pinkCert.text = text;
    pinkCert.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = pinkCert;
}

- (void)chainDrumSafeCreditsVolatileAction:(UIButton *)sender {
    [[SeparatedManager shared] storeGeometryRadialSubscriptWhoUndoViewController:self.navigationController];
}

- (void)webpageShrinkRearrangeClampedAudienceAction:(UIButton *)sender {
    sender.hidden = YES;
    self.panelDryLabel.hidden = YES;
    self.dueLookupView.hidden = NO;
    self.suggestedView.hidden = NO;
    self.kazakhPitchButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(RaceRateYou.wristBoldNot.sleepCropUnlimitedGreenUniformWidth, RaceRateYou.wristBoldNot.followRatingsEvaluatedAscentSurgeRecord-RaceRateYou.wristBoldNot.floorKernels));
    }];
    [self.sameYahooTryTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.dueLookupView.mas_bottom).offset(RaceRateYou.wristBoldNot.featMixTrial);
    }];
    [self.view layoutIfNeeded];
    
    BOOL exits = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:RaceRateYou.wristBoldNot.pendingNowPostcardTrialPinDismissalUnlocked];
    if (!exits) {
        self.veryCarMapButton.hidden = NO;
        [AddAlertView membersDeclinedSlideSobProcessesPlug:nil message:RaceRateYou.maxSnapYearShe.fillExecuteBlobSinkCollision completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= RaceRateYou.wristBoldNot.revertingFax;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:handDisorderHowConflictNorwegianInitiated:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image handDisorderHowConflictNorwegianInitiated:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[SeparatedManager shared] storeGeometryRadialSubscriptWhoUndoViewController:self.navigationController];
        [FixToast general:RaceRateYou.maxSnapYearShe.parameterGeorgianAbsoluteHintKilovolts];
    }else {
        self.veryCarMapButton.hidden = NO;
        [AddAlertView membersDeclinedSlideSobProcessesPlug:nil message:RaceRateYou.maxSnapYearShe.fillExecuteBlobSinkCollision completion:nil];
    }
}

@end
