






#import "ReturnedCapViewController.h"
#import "SDWebImageManager.h"
#import "AnyToast.h"
#import "NSString+Terabytes.h"

@interface ReturnedCapViewController ()

@property (nonatomic, strong) UIImageView *hexFindKeysImageView;
@property (nonatomic, strong) UITextField *yahooTagsTextField;
@property (nonatomic, strong) UITextField *netVignetteTextField;

@end

@implementation ReturnedCapViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.rawPinkCarButton.hidden = [self.moleShotRaw[0] boolValue];
    
    CGFloat restoredLockHourBookSum = VitalityTab.noneMidMicro.bikeReliable;
    
    UILabel *netLabel = [VitalityTab shelfUploadedLogAndGoogle:VitalityTab.foggyCycleUnit.drawingCoverHitDeepGray];
    netLabel.numberOfLines = 0;
    [self.view addSubview:netLabel];
    [netLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(VitalityTab.noneMidMicro.basalHairMid);
        make.left.mas_equalTo(VitalityTab.noneMidMicro.visualWaySaw);
        make.right.mas_equalTo(-VitalityTab.noneMidMicro.visualWaySaw);
    }];
    
    
    self.yahooTagsTextField = [VitalityTab menBayerRunField:VitalityTab.foggyCycleUnit.noteLoudLoadFactoriesNumberBorders isSecure:NO];
    [self.view addSubview:self.yahooTagsTextField];
    [self.yahooTagsTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(netLabel.mas_bottom).offset(restoredLockHourBookSum);
        make.left.mas_equalTo(VitalityTab.noneMidMicro.dispatchHand);
        make.right.mas_equalTo(-VitalityTab.noneMidMicro.dispatchHand);
        make.height.mas_equalTo(VitalityTab.noneMidMicro.minEmailRows);
    }];
    
    
    self.netVignetteTextField = [VitalityTab menBayerRunField:VitalityTab.foggyCycleUnit.expiredDrivenInstantPlainRhythmIcy isSecure:NO];;
    [self.view addSubview:self.netVignetteTextField];
    [self.netVignetteTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.yahooTagsTextField.mas_bottom).offset(restoredLockHourBookSum);
        make.left.right.equalTo(self.yahooTagsTextField);
        make.height.mas_equalTo(VitalityTab.noneMidMicro.minEmailRows);
    }];
    
    
    UIImageView *logBagImageView = nil;
    if ([self.moleShotRaw[1] length] > 0) {
        
        logBagImageView = [[UIImageView alloc] init];
        logBagImageView.backgroundColor = UIColor.lightGrayColor;
        logBagImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:logBagImageView];
        [logBagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.netVignetteTextField.mas_bottom).offset(restoredLockHourBookSum);
            make.width.mas_equalTo(self.netVignetteTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.hexFindKeysImageView = logBagImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.moleShotRaw[1]] options:0 progress:nil completed:^(UIImage * _Nullable image2, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            dispatch_async(dispatch_get_main_queue(), ^{
                logBagImageView.image = image2;
                CGFloat bleed = image2.size.height / image2.size.width;
                [logBagImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((VitalityTab.noneMidMicro.bufferDeliverBikeDiastolicSpecifierWidth -VitalityTab.noneMidMicro.dispatchHand*2)*bleed);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.hexFindKeysImageView ? self.hexFindKeysImageView.frame.size.height + VitalityTab.noneMidMicro.bikeReliable +VitalityTab.noneMidMicro.zoomPairUnlikelySlopeWaxMargins : VitalityTab.noneMidMicro.zoomPairUnlikelySlopeWaxMargins;
                    
                    make.size.mas_equalTo(CGSizeMake(VitalityTab.noneMidMicro.bufferDeliverBikeDiastolicSpecifierWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.hexFindKeysImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.hexFindKeysImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *acceptingButton = [VitalityTab cousinAlertRomanVibrancyIdleColor:VitalityTab.foggyCycleUnit.speakingRepeatsRegisterPhoneticSerialize];
    [acceptingButton addTarget:self action:@selector(slideGrayEnterHumanGuideThiamin:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:acceptingButton];
    [acceptingButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-VitalityTab.noneMidMicro.layerDidLogo);
        make.left.right.equalTo(self.yahooTagsTextField);
        make.height.mas_equalTo(VitalityTab.noneMidMicro.borderResume);
    }];
    
}

- (void)slideGrayEnterHumanGuideThiamin:(id)sender {
if (self.yahooTagsTextField.text.alertGetSolo || self.netVignetteTextField.text.alertGetSolo) {
        [SonAlertView presenceFloatMetadataCompoundPreparingEgg:VitalityTab.foggyCycleUnit.alertCase message:VitalityTab.foggyCycleUnit.procedureReturnedExchangesSingleUnderlineRecovery completion:nil];
        return;
    }
    if ([self.outMouthQuiet respondsToSelector:@selector(handleOverflowRedMuteMoreCutterWithName:dueSon:completion:)]) {
        [CommitBikeView movieShortcutWindow];
        [self.outMouthQuiet handleOverflowRedMuteMoreCutterWithName:self.yahooTagsTextField.text dueSon:self.netVignetteTextField.text completion:^(id object) {
            [CommitBikeView misplacedEscapingEarCampaignClipWindow];
            if ([object boolValue]) {
                [[InterlaceManager shared] replyHairSinWindow];
                [AnyToast indexRadio:VitalityTab.foggyCycleUnit.peakCancelObserversOddWelshReason];
            }
        }];
    }
}

@end
