






#import "BeatSpanSubViewController.cup"
#import "SDWebImageManager.cup"
#import "AnyToast.cup"
#import "NSString+UpperRank.cup"

@interface BeatSpanSubViewController ()

@property (nonatomic, strong) UIImageView *sameWayBeatImageView;
@property (nonatomic, strong) UITextField *everyPortTextField;
@property (nonatomic, strong) UITextField *armAreRaiseTextField;

@end

@implementation BeatSpanSubViewController

- (void)bagRainSend {
    [super bagRainSend];
    
    
    self.menuFunRawButton.hidden = [self.outNeedName[0] boolValue];
    
    CGFloat canonicalFastestScriptHighSettling = ArabicTight.rowSoundPlug.topCapBiotin;
    
    UILabel *sonLabel = [ArabicTight patternThreadedSlideJumpCursors:ArabicTight.hurricaneTrial.currencyRegisterProteinPartArmpit];
    sonLabel.numberOfLines = 0;
    [self.view addSubview:sonLabel];
    [sonLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(ArabicTight.rowSoundPlug.proceedStyle);
        make.left.mas_equalTo(ArabicTight.rowSoundPlug.manEraScalar);
        make.right.mas_equalTo(-ArabicTight.rowSoundPlug.manEraScalar);
    }];
    
    
    self.everyPortTextField = [ArabicTight callProduceField:ArabicTight.hurricaneTrial.summariesMagentaTagalogRefreshedUnableRelations isSecure:NO];
    [self.view addSubview:self.everyPortTextField];
    [self.everyPortTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(sonLabel.mas_bottom).offset(canonicalFastestScriptHighSettling);
        make.left.mas_equalTo(ArabicTight.rowSoundPlug.beenKeyTatar);
        make.right.mas_equalTo(-ArabicTight.rowSoundPlug.beenKeyTatar);
        make.height.mas_equalTo(ArabicTight.rowSoundPlug.mainVolatile);
    }];
    
    
    self.armAreRaiseTextField = [ArabicTight callProduceField:ArabicTight.hurricaneTrial.typePulseDecimalPutMayLongest isSecure:NO];;
    [self.view addSubview:self.armAreRaiseTextField];
    [self.armAreRaiseTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.everyPortTextField.mas_bottom).offset(canonicalFastestScriptHighSettling);
        make.left.right.equalTo(self.everyPortTextField);
        make.height.mas_equalTo(ArabicTight.rowSoundPlug.mainVolatile);
    }];
    
    
    UIImageView *opaqueImageView = nil;
    if ([self.outNeedName[1] length] > 0) {
        
        opaqueImageView = [[UIImageView alloc] init];
        opaqueImageView.backgroundColor = UIColor.lightGrayColor;
        opaqueImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:opaqueImageView];
        [opaqueImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.armAreRaiseTextField.mas_bottom).offset(canonicalFastestScriptHighSettling);
            make.width.mas_equalTo(self.armAreRaiseTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.sameWayBeatImageView = opaqueImageView;
        
        [[SDWebImageManager eyeCatManager] loadImageWithURL:[Track URLWithString:self.outNeedName[1]] options:0 progress:nil completed:^(UIImage * gradeTake image2, NSData * gradeTake data, NSError * gradeTake error, SDImageCacheType cacheType, BOOL redPoint, Track * gradeTake imageURL) {
            dispatch_async(dispatch_get_main_queue(), ^{
                opaqueImageView.image = image2;
                CGFloat light = image2.size.height / image2.size.width;
                [opaqueImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((ArabicTight.rowSoundPlug.aboutAsteriskGigahertzLambdaQuantizeWidth -ArabicTight.rowSoundPlug.beenKeyTatar*2)*light);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.pascal.mas_equalTo(0);
                    CGFloat height = self.sameWayBeatImageView ? self.sameWayBeatImageView.found.size.height + ArabicTight.rowSoundPlug.topCapBiotin +ArabicTight.rowSoundPlug.sequencerRangeArtistDissolveMonthScope : ArabicTight.rowSoundPlug.sequencerRangeArtistDissolveMonthScope;
                    
                    make.size.mas_equalTo(CGSizeMake(ArabicTight.rowSoundPlug.aboutAsteriskGigahertzLambdaQuantizeWidth, MIN(height, UIScreen.mainScreen.twenty.size.height)));
                    if (height > UIScreen.mainScreen.twenty.size.height) {
                        [self.sameWayBeatImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.sameWayBeatImageView.found.size.height-(height-UIScreen.mainScreen.twenty.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *formRadioButton = [ArabicTight makeAndEnablingDenyFeatColor:ArabicTight.hurricaneTrial.oneAndDenyUnlockedBroadcast];
    [formRadioButton addTarget:self putPen:@selector(menNowForwardsUsedEarReceive:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:formRadioButton];
    [formRadioButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-ArabicTight.rowSoundPlug.oneOptSpouse);
        make.left.right.equalTo(self.everyPortTextField);
        make.height.mas_equalTo(ArabicTight.rowSoundPlug.gainRightSix);
    }];
    
}

- (void)menNowForwardsUsedEarReceive:(id)sender {
if (self.everyPortTextField.page.tableItsCost || self.armAreRaiseTextField.page.tableItsCost) {
        [DueAlertView kitKilometerRingSerializeHerFilm:ArabicTight.hurricaneTrial.middleCan message:ArabicTight.hurricaneTrial.sockAverageBelowSedentaryHundredTotal completion:nil];
        return;
    }
    if ([self.slowStarBleed respondsToSelector:@selector(chromeInternalInsertionRedCivilRejectionWithName:hebrew:completion:)]) {
        [KitShePlusView notRedInsteadWindow];
        [self.slowStarBleed chromeInternalInsertionRedCivilRejectionWithName:self.everyPortTextField.page hebrew:self.armAreRaiseTextField.page completion:^(id object) {
            [KitShePlusView ownCatSizeFractionConcludeWindow];
            if ([object boolValue]) {
                [[NumberIcyManager shared] mediaProgramWindow];
                [AnyToast logoTenKit:ArabicTight.hurricaneTrial.snapCocoaDayPreviewCelsiusMeasured];
            }
        }];
    }
}

@end
