






#import "RedCompoundViewController.h"
#import "SDWebImageManager.h"
#import "HerToast.h"
#import "NSString+SubEntity.h"

@interface RedCompoundViewController ()

@property (nonatomic, strong) UIImageView *safetyLeaseImageView;
@property (nonatomic, strong) UITextField *maskAdobeTextField;
@property (nonatomic, strong) UITextField *constantAirTextField;

@end

@implementation RedCompoundViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.browseWorkButton.hidden = [self.exceededAdd[0] boolValue];
    
    CGFloat callingCancelHailSenseDemand = MenTintSave.ironRouteMix.childLogUnit;
    
    UILabel *logLabel = [MenTintSave headSerialDismissedPlugExpected:MenTintSave.mixerRetDogPub.configurePasteSubSphericalCapable];
    logLabel.numberOfLines = 0;
    [self.view addSubview:logLabel];
    [logLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(MenTintSave.ironRouteMix.permanentMix);
        make.left.mas_equalTo(MenTintSave.ironRouteMix.mindSpectral);
        make.right.mas_equalTo(-MenTintSave.ironRouteMix.mindSpectral);
    }];
    
    
    self.maskAdobeTextField = [MenTintSave toolWithOldField:MenTintSave.mixerRetDogPub.respondsSecondaryEyeLoadingBankVortex isSecure:NO];
    [self.view addSubview:self.maskAdobeTextField];
    [self.maskAdobeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(logLabel.mas_bottom).offset(callingCancelHailSenseDemand);
        make.left.mas_equalTo(MenTintSave.ironRouteMix.outletAdverb);
        make.right.mas_equalTo(-MenTintSave.ironRouteMix.outletAdverb);
        make.height.mas_equalTo(MenTintSave.ironRouteMix.nowCubeIntro);
    }];
    
    
    self.constantAirTextField = [MenTintSave toolWithOldField:MenTintSave.mixerRetDogPub.siblingsSecretHerAdverbRevokedRow isSecure:NO];;
    [self.view addSubview:self.constantAirTextField];
    [self.constantAirTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.maskAdobeTextField.mas_bottom).offset(callingCancelHailSenseDemand);
        make.left.right.equalTo(self.maskAdobeTextField);
        make.height.mas_equalTo(MenTintSave.ironRouteMix.nowCubeIntro);
    }];
    
    
    UIImageView *escapeImageView = nil;
    if ([self.exceededAdd[1] length] > 0) {
        
        escapeImageView = [[UIImageView alloc] init];
        escapeImageView.backgroundColor = UIColor.lightGrayColor;
        escapeImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:escapeImageView];
        [escapeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.constantAirTextField.mas_bottom).offset(callingCancelHailSenseDemand);
            make.width.mas_equalTo(self.constantAirTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.safetyLeaseImageView = escapeImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.exceededAdd[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(), ^{
                escapeImageView.image = image2;
                CGFloat press = image2.size.height / image2.size.width;
                [escapeImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((MenTintSave.ironRouteMix.issueMastersOptionalTornadoPreviewsWidth -MenTintSave.ironRouteMix.outletAdverb*2)*press);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.safetyLeaseImageView ? self.safetyLeaseImageView.frame.size.height + MenTintSave.ironRouteMix.childLogUnit +MenTintSave.ironRouteMix.endpointCompactRedirectMailFillerLighten : MenTintSave.ironRouteMix.endpointCompactRedirectMailFillerLighten;
                    
                    make.size.mas_equalTo(CGSizeMake(MenTintSave.ironRouteMix.issueMastersOptionalTornadoPreviewsWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.safetyLeaseImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.safetyLeaseImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *gopherFitButton = [MenTintSave exhaustedRangePinDetectsOwnershipColor:MenTintSave.mixerRetDogPub.agentHalftoneCaseConvertHash];
    [gopherFitButton addTarget:self action:@selector(allowIdentityPreparedBrowseMacintoshConsumes:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:gopherFitButton];
    [gopherFitButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-MenTintSave.ironRouteMix.swappedStart);
        make.left.right.equalTo(self.maskAdobeTextField);
        make.height.mas_equalTo(MenTintSave.ironRouteMix.treeShiftLow);
    }];
    
}

- (void)allowIdentityPreparedBrowseMacintoshConsumes:(id)sender {

}

@end
