






#import "EachOverwriteViewController.h"
#import "PanToast.h"
#import "SobIllInfo.h"

@interface EachOverwriteViewController ()

@property (nonatomic, strong) UIImageView *absentManView;
@property (nonatomic, strong) UIButton *justRegionsButton;
@property (nonatomic, strong) UIView *traitFactView;
@property (nonatomic, strong) UILabel *triangleLabel;
@property (nonatomic, strong) UITextField *requestSplitTextField;
@property (nonatomic, strong) UITextField *diagnoseBurstTextField;
@end

@implementation EachOverwriteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.bikeDarwinButton.hidden = YES;
    
    if ([SobIllInfo dayAliveFloatingEpisodeCreditImage]) {
        self.absentManView = [[UIImageView alloc] initWithImage:[SobIllInfo dayAliveFloatingEpisodeCreditImage]];
        [self.view addSubview:self.absentManView];
        self.absentManView.hidden = YES;
        [self.absentManView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(FrictionShe.headphoneMay.beatTouchMap);
            make.left.equalTo(self.squareButButton.mas_right);
            make.top.equalTo(self.view).offset(FrictionShe.headphoneMay.widthDateBox);
        }];
    }
    
    self.traitFactView = [FrictionShe traitFactView];
    self.traitFactView.hidden = YES;
    [self.view addSubview:self.traitFactView];
    [self.traitFactView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([SobIllInfo dayAliveFloatingEpisodeCreditImage]) {
            make.centerY.equalTo(self.absentManView);
            make.left.equalTo(self.absentManView.mas_right).offset(FrictionShe.headphoneMay.chainAccept);
        }else {
            make.top.equalTo(self.view).offset(FrictionShe.headphoneMay.widthDateBox);
            make.left.equalTo(self.squareButButton.mas_right).offset(FrictionShe.headphoneMay.chainAccept);
        }
        make.right.equalTo(self.bikeDarwinButton.mas_left);
        make.height.mas_equalTo(FrictionShe.headphoneMay.beatTouchMap);
    }];
    
    self.triangleLabel = [FrictionShe taskDifferentHexItemMarkup:FrictionShe.saltBurstFinal.canadianRedSeventeenKnowWarning];
    self.triangleLabel.numberOfLines = 0;
    [self.view addSubview:self.triangleLabel];
    [self.triangleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(FrictionShe.headphoneMay.attachAffine);
        make.left.mas_equalTo(FrictionShe.headphoneMay.finderSunBig);
        make.right.mas_equalTo(-FrictionShe.headphoneMay.finderSunBig);
    }];
    
    
    self.requestSplitTextField = [FrictionShe sixteenLemmaProvisionOperandFailAccount];
    self.requestSplitTextField.enabled = NO;
    self.requestSplitTextField.text = self.wonSiblings[FrictionShe.headphoneMay.unionIntentName];
    [self oddSwipeKinAnswerJobArtworkView:self.requestSplitTextField text:FrictionShe.saltBurstFinal.desiredSedentaryParameterDismissedHidden];
    [self.view addSubview:self.requestSplitTextField];
    [self.requestSplitTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.triangleLabel.mas_bottom).offset(FrictionShe.headphoneMay.busEndpoints);
        make.left.mas_equalTo(FrictionShe.headphoneMay.identifyMill);
        make.right.mas_equalTo(-FrictionShe.headphoneMay.identifyMill);
        make.height.mas_equalTo(FrictionShe.headphoneMay.wetDolbySeed);
    }];
    
    
    self.diagnoseBurstTextField = [FrictionShe sixteenLemmaProvisionOperandFailAccount];
    self.diagnoseBurstTextField.enabled = NO;
    self.diagnoseBurstTextField.text = self.wonSiblings[FrictionShe.headphoneMay.renewAnchorKey];
    [self oddSwipeKinAnswerJobArtworkView:self.diagnoseBurstTextField text:FrictionShe.saltBurstFinal.succeededMagnesiumQuickIronSon];
    [self.view addSubview:self.diagnoseBurstTextField];
    [self.diagnoseBurstTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.requestSplitTextField.mas_bottom).offset(FrictionShe.headphoneMay.busEndpoints);
        make.left.right.equalTo(self.requestSplitTextField);
        make.height.mas_equalTo(FrictionShe.headphoneMay.wetDolbySeed);
    }];
    
    
    UIButton *mailExitsButton = [FrictionShe icyThiaminFarsiReadoutRetColor:FrictionShe.saltBurstFinal.remembersResultsMoodCocoaMight];
    [mailExitsButton addTarget:self action:@selector(readMidAlbanianReversesVerifyAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:mailExitsButton];
    [mailExitsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.diagnoseBurstTextField.mas_bottom).offset(FrictionShe.headphoneMay.busEndpoints);
        make.left.right.equalTo(self.diagnoseBurstTextField);
        make.height.mas_equalTo(FrictionShe.headphoneMay.beatTouchMap);
    }];
    
    
    self.justRegionsButton = [FrictionShe velocityResultSearchingSignalingParser:FrictionShe.saltBurstFinal.outSoloistTabAnchoredStrokingDetailed];
    [self.justRegionsButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.justRegionsButton addTarget:self action:@selector(watchedDayWideBottomSubjectAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.justRegionsButton];
    [self.justRegionsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(mailExitsButton.mas_bottom).offset(FrictionShe.headphoneMay.badTenPhoto);
        make.centerX.equalTo(self.view);
    }];
}

- (void)oddSwipeKinAnswerJobArtworkView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(FrictionShe.headphoneMay.beatTouchMap, FrictionShe.headphoneMay.wetDolbySeed)};
    UILabel *capCivil = [[UILabel alloc] initWithFrame:frame];
    capCivil.text = text;
    capCivil.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = capCivil;
}

- (void)watchedDayWideBottomSubjectAction:(UIButton *)sender {
    [[OpaqueKeyManager shared] periodScreenYearsExposeWatchedExtendingViewController:self.navigationController];
}

- (void)readMidAlbanianReversesVerifyAction:(UIButton *)sender {
    sender.hidden = YES;
    self.triangleLabel.hidden = YES;
    self.traitFactView.hidden = NO;
    self.absentManView.hidden = NO;
    self.justRegionsButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(FrictionShe.headphoneMay.cubicBouncingSpaBirthdayTwoWidth, FrictionShe.headphoneMay.detectedAudiogramKirghizBrownHeaderIssuer-FrictionShe.headphoneMay.cloudHasGram));
    }];
    [self.requestSplitTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.traitFactView.mas_bottom).offset(FrictionShe.headphoneMay.busEndpoints);
    }];
    [self.view layoutIfNeeded];
    
    BOOL inner = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:FrictionShe.headphoneMay.qualifiedApplePlateArrangedExplicitMobileEquality];
    if (!inner) {
        self.bikeDarwinButton.hidden = NO;
        [ItsAlertView hellmanPrefixedLongBetterNormalTied:nil message:FrictionShe.saltBurstFinal.settlingCardioidEllipsisLossyElement completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= FrictionShe.headphoneMay.totalCluster;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:luminanceSquashChatLacrosseDepartureMartial:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image luminanceSquashChatLacrosseDepartureMartial:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[OpaqueKeyManager shared] periodScreenYearsExposeWatchedExtendingViewController:self.navigationController];
        [PanToast mapForm:FrictionShe.saltBurstFinal.magnesiumPasswordRotateQuickPoster];
    }else {
        self.bikeDarwinButton.hidden = NO;
        [ItsAlertView hellmanPrefixedLongBetterNormalTied:nil message:FrictionShe.saltBurstFinal.settlingCardioidEllipsisLossyElement completion:nil];
    }
}

@end
