






#import "MonthSayTheViewController.h"
#import "SDWebImageManager.h"
#import "BusToast.h"
#import "NSString+PrettyHex.h"

@interface MonthSayTheViewController ()

@property (nonatomic, strong) UIImageView *andAcceptedImageView;
@property (nonatomic, strong) UITextField *airSwitchTextField;
@property (nonatomic, strong) UITextField *nineCapNameTextField;

@end

@implementation MonthSayTheViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.bagDesktopButton.hidden = [self.modalKeyDid[0] boolValue];
    
    CGFloat cupArrangerSingleFractionsTertiary = PinMovement.cupFormatSun.bigDefineAre;
    
    UILabel *popLabel = [PinMovement searchBadPinMagnesiumClamped:PinMovement.otherPhasePlug.sugarConsumerTwentyEnterQuery];
    popLabel.numberOfLines = 0;
    [self.view addSubview:popLabel];
    [popLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(PinMovement.cupFormatSun.flipTrustDue);
        make.left.mas_equalTo(PinMovement.cupFormatSun.squashCanIts);
        make.right.mas_equalTo(-PinMovement.cupFormatSun.squashCanIts);
    }];
    
    
    self.airSwitchTextField = [PinMovement pinModifierField:PinMovement.otherPhasePlug.logoYetFetchedAnyBadgeBook isSecure:NO];
    [self.view addSubview:self.airSwitchTextField];
    [self.airSwitchTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(popLabel.mas_bottom).offset(cupArrangerSingleFractionsTertiary);
        make.left.mas_equalTo(PinMovement.cupFormatSun.mandatoryTen);
        make.right.mas_equalTo(-PinMovement.cupFormatSun.mandatoryTen);
        make.height.mas_equalTo(PinMovement.cupFormatSun.ratioBengali);
    }];
    
    
    self.nineCapNameTextField = [PinMovement pinModifierField:PinMovement.otherPhasePlug.persistDrainMultiplyStickyDogNative isSecure:NO];;
    [self.view addSubview:self.nineCapNameTextField];
    [self.nineCapNameTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.airSwitchTextField.mas_bottom).offset(cupArrangerSingleFractionsTertiary);
        make.left.right.equalTo(self.airSwitchTextField);
        make.height.mas_equalTo(PinMovement.cupFormatSun.ratioBengali);
    }];
    
    
    UIImageView *familyImageView = nil;
    if ([self.modalKeyDid[1] length] > 0) {
        
        familyImageView = [[UIImageView alloc] init];
        familyImageView.backgroundColor = UIColor.lightGrayColor;
        familyImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:familyImageView];
        [familyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.nineCapNameTextField.mas_bottom).offset(cupArrangerSingleFractionsTertiary);
            make.width.mas_equalTo(self.nineCapNameTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.andAcceptedImageView = familyImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.modalKeyDid[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(), ^{
                familyImageView.image = image2;
                CGFloat seven = image2.size.height / image2.size.width;
                [familyImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((PinMovement.cupFormatSun.penPreviewLessQuitArgumentsWidth -PinMovement.cupFormatSun.mandatoryTen*2)*seven);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.andAcceptedImageView ? self.andAcceptedImageView.frame.size.height + PinMovement.cupFormatSun.bigDefineAre +PinMovement.cupFormatSun.swashesIterateSignalDietaryDogDownload : PinMovement.cupFormatSun.swashesIterateSignalDietaryDogDownload;
                    
                    make.size.mas_equalTo(CGSizeMake(PinMovement.cupFormatSun.penPreviewLessQuitArgumentsWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.andAcceptedImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.andAcceptedImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *signLegalButton = [PinMovement narrativeForbidAlignedAcuteGrayColor:PinMovement.otherPhasePlug.commentDensePenReturnWarn];
    [signLegalButton addTarget:self action:@selector(callMoleLettersForceQuechuaCustodian:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:signLegalButton];
    [signLegalButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-PinMovement.cupFormatSun.consumedBank);
        make.left.right.equalTo(self.airSwitchTextField);
        make.height.mas_equalTo(PinMovement.cupFormatSun.bigSongPhoto);
    }];
    
}

- (void)callMoleLettersForceQuechuaCustodian:(id)sender {
if (self.airSwitchTextField.text.typeUnderWax || self.nineCapNameTextField.text.typeUnderWax) {
        [CarAlertView referencePopPassivelyScannerOfferComposite:PinMovement.otherPhasePlug.hoursBlob message:PinMovement.otherPhasePlug.trashEarlyPrimeArmResourcesDelete completion:nil];
        return;
    }
    if ([self.flagTrapMixer respondsToSelector:@selector(endsBadTopSumWrittenShoulderWithName:winNot:completion:)]) {
        [ClickInnerView waxBlackTwistWindow];
        [self.flagTrapMixer endsBadTopSumWrittenShoulderWithName:self.airSwitchTextField.text winNot:self.nineCapNameTextField.text completion:^(id object) {
            [ClickInnerView wakeOrnamentRespectsConsumedRemovalWindow];
            if ([object boolValue]) {
                [[UnpluggedManager shared] policyHitOurWindow];
                [BusToast numberVery:PinMovement.otherPhasePlug.coloredFixUpdateRenameRecorderLaw];
            }
        }];
    }
}

@end
