






#import "WonSmallSleepViewController.h"
#import "CanToast.h"
#import "PeriodInfo.h"

@interface WonSmallSleepViewController ()

@property (nonatomic, strong) UIImageView *sonBridgeView;
@property (nonatomic, strong) UIButton *mixEighteenButton;
@property (nonatomic, strong) UIView *searchMaxView;
@property (nonatomic, strong) UILabel *hashGoalLabel;
@property (nonatomic, strong) UITextField *ageHeadRouteTextField;
@property (nonatomic, strong) UITextField *sawWonSonTapsTextField;
@end

@implementation WonSmallSleepViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.declineRawButton.hidden = YES;
    
    if ([PeriodInfo rareClimbedMolarNinePerformsImage]) {
        self.sonBridgeView = [[UIImageView alloc] initWithImage:[PeriodInfo rareClimbedMolarNinePerformsImage]];
        [self.view addSubview:self.sonBridgeView];
        self.sonBridgeView.hidden = YES;
        [self.sonBridgeView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(PartialBest.mouseEarlier.waxElderLess);
            make.left.equalTo(self.nearHumanButton.mas_right);
            make.top.equalTo(self.view).offset(PartialBest.mouseEarlier.nameBrushDry);
        }];
    }
    
    self.searchMaxView = [PartialBest searchMaxView];
    self.searchMaxView.hidden = YES;
    [self.view addSubview:self.searchMaxView];
    [self.searchMaxView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([PeriodInfo rareClimbedMolarNinePerformsImage]) {
            make.centerY.equalTo(self.sonBridgeView);
            make.left.equalTo(self.sonBridgeView.mas_right).offset(PartialBest.mouseEarlier.stickyVideo);
        }else {
            make.top.equalTo(self.view).offset(PartialBest.mouseEarlier.nameBrushDry);
            make.left.equalTo(self.nearHumanButton.mas_right).offset(PartialBest.mouseEarlier.stickyVideo);
        }
        make.right.equalTo(self.declineRawButton.mas_left);
        make.height.mas_equalTo(PartialBest.mouseEarlier.waxElderLess);
    }];
    
    self.hashGoalLabel = [PartialBest repliesPointersUrgencyHungarianTabular:PartialBest.itsOneFlowEasy.insertionCategoryOccurredOrderingCentral];
    self.hashGoalLabel.numberOfLines = 0;
    [self.view addSubview:self.hashGoalLabel];
    [self.hashGoalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(PartialBest.mouseEarlier.factAdobeMix);
        make.left.mas_equalTo(PartialBest.mouseEarlier.countTenSelf);
        make.right.mas_equalTo(-PartialBest.mouseEarlier.countTenSelf);
    }];
    
    
    self.ageHeadRouteTextField = [PartialBest penPromotionShortcutDecigramsManagersAccount];
    self.ageHeadRouteTextField.enabled = NO;
    self.ageHeadRouteTextField.text = self.redoNineEgg[PartialBest.mouseEarlier.lowBreakItsName];
    [self mustBoundingCutFatMoodDarkView:self.ageHeadRouteTextField text:PartialBest.itsOneFlowEasy.dryTabBeenReturnQualifier];
    [self.view addSubview:self.ageHeadRouteTextField];
    [self.ageHeadRouteTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.hashGoalLabel.mas_bottom).offset(PartialBest.mouseEarlier.succeededRed);
        make.left.mas_equalTo(PartialBest.mouseEarlier.sameChinaHue);
        make.right.mas_equalTo(-PartialBest.mouseEarlier.sameChinaHue);
        make.height.mas_equalTo(PartialBest.mouseEarlier.meanEarYears);
    }];
    
    
    self.sawWonSonTapsTextField = [PartialBest penPromotionShortcutDecigramsManagersAccount];
    self.sawWonSonTapsTextField.enabled = NO;
    self.sawWonSonTapsTextField.text = self.redoNineEgg[PartialBest.mouseEarlier.twoGainAtomKey];
    [self mustBoundingCutFatMoodDarkView:self.sawWonSonTapsTextField text:PartialBest.itsOneFlowEasy.golfStaleMinMillionLock];
    [self.view addSubview:self.sawWonSonTapsTextField];
    [self.sawWonSonTapsTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.ageHeadRouteTextField.mas_bottom).offset(PartialBest.mouseEarlier.succeededRed);
        make.left.right.equalTo(self.ageHeadRouteTextField);
        make.height.mas_equalTo(PartialBest.mouseEarlier.meanEarYears);
    }];
    
    
    UIButton *wasMediumButton = [PartialBest textualEllipsisBankStopMonthColor:PartialBest.itsOneFlowEasy.errorLettishHurricaneScriptsGrouped];
    [wasMediumButton addTarget:self action:@selector(elementBengaliDrivenSlovakCoalesceAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:wasMediumButton];
    [wasMediumButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.sawWonSonTapsTextField.mas_bottom).offset(PartialBest.mouseEarlier.succeededRed);
        make.left.right.equalTo(self.sawWonSonTapsTextField);
        make.height.mas_equalTo(PartialBest.mouseEarlier.waxElderLess);
    }];
    
    
    self.mixEighteenButton = [PartialBest externSortRevokedWakeOverride:PartialBest.itsOneFlowEasy.solveRadialUserCoverageUndoneRectum];
    [self.mixEighteenButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.mixEighteenButton addTarget:self action:@selector(sixSiteLoveResponsesMandarinAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.mixEighteenButton];
    [self.mixEighteenButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(wasMediumButton.mas_bottom).offset(PartialBest.mouseEarlier.lockHisSent);
        make.centerX.equalTo(self.view);
    }];
}

- (void)mustBoundingCutFatMoodDarkView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(PartialBest.mouseEarlier.waxElderLess, PartialBest.mouseEarlier.meanEarYears)};
    UILabel *prepPolo = [[UILabel alloc] initWithFrame:frame];
    prepPolo.text = text;
    prepPolo.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = prepPolo;
}

- (void)sixSiteLoveResponsesMandarinAction:(UIButton *)sender {
    [[HelloFormManager shared] runLettersSevenAllocatorExclusionStreamViewController:self.navigationController];
}

- (void)elementBengaliDrivenSlovakCoalesceAction:(UIButton *)sender {
    sender.hidden = YES;
    self.hashGoalLabel.hidden = YES;
    self.searchMaxView.hidden = NO;
    self.sonBridgeView.hidden = NO;
    self.mixEighteenButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(PartialBest.mouseEarlier.noneGetLeadLiveEpsilonWidth, PartialBest.mouseEarlier.getCapMinimumTatarFilmEviction-PartialBest.mouseEarlier.barSceneEasy));
    }];
    [self.ageHeadRouteTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.searchMaxView.mas_bottom).offset(PartialBest.mouseEarlier.succeededRed);
    }];
    [self.view layoutIfNeeded];
    
    BOOL blood = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:PartialBest.mouseEarlier.coercionMusicMayCollationButHaveDismissed];
    if (!blood) {
        self.declineRawButton.hidden = NO;
        [TipAlertView tightRightPrefixedKilohertzDeletingUppercase:nil message:PartialBest.itsOneFlowEasy.musicalMoleWebpageHasEleven completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= PartialBest.mouseEarlier.canShadowFat;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:eyeCampaignMindSpanLeaseCoptic:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image eyeCampaignMindSpanLeaseCoptic:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[HelloFormManager shared] runLettersSevenAllocatorExclusionStreamViewController:self.navigationController];
        [CanToast endTemp:PartialBest.itsOneFlowEasy.solidAlwaysInternalThicknessChroma];
    }else {
        self.declineRawButton.hidden = NO;
        [TipAlertView tightRightPrefixedKilohertzDeletingUppercase:nil message:PartialBest.itsOneFlowEasy.musicalMoleWebpageHasEleven completion:nil];
    }
}

@end
