






#import "DeepBigPinViewController.h"
#import "ChunkyGetManager.h"
#import "MostSwapView.h"
#import "UIColor+RawColor.h"
#import "UIDevice+CupDevice.h"
#import "UIImage+OptImage.h"
#import "ZoomingPinConfig.h"

@interface DeepBigPinViewController ()

@property (nonatomic, strong) UIView * silentView;
@property (nonatomic, strong) UIImageView * midView;

@end

@implementation DeepBigPinViewController

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = BinTopLemma.serialOccurFlatImpactPenSocial ? [UIColor collapsesCompositeAndRenamingWorldDecrypted:BinTopLemma.serialOccurFlatImpactPenSocial]:UIColor.whiteColor;

    self.gaspUnsaved = self.boldInfoTip;
    [MostSwapView warnSpace];
    
    self.silentView = [UIView new];
    self.silentView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:self.silentView];
    
    self.midView = [[UIImageView alloc] initWithImage:[UIImage chinaRecursiveAuditPartPintName:BinTopLemma.drainCatFair.plateSugarLossySquareFadeTall]];;
    [self.view addSubview:self.midView];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(butIconSetup) name:BinTopLemma.drainCatFair.tertiarySlashPerfusionRowWakeHundreds object:nil];
}

- (void)butIconSetup {
    [self.overlapRows reload];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self droppedTeaspoonsSystemClickPicker];
}

//- (void)viewDidAppear:(BOOL)animated {


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([BinTopLemma playRelationTextCountryFitName] && ZoomingPinConfig.shared.flippedYellowMetricWonMenstrual.ignoreDigit.whoReverses) {
        [MostSwapView cellShare];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)leftInternalSize {
    if ([UIDevice energy]) {
        return CGSizeMake(BinTopLemma.endRowsCarrierNetSaw, BinTopLemma.endRowsCarrierNetSaw);
    }
    UIWindow *recycleWindow = [[ChunkyGetManager shared] identicalDogWindow];
    UIEdgeInsets safe = recycleWindow.safeAreaInsets;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        if (![UIDevice hasNotch]) {
            return CGSizeMake(UIScreen.mainScreen.bounds.size.width, BinTopLemma.endRowsCarrierNetSaw);
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, BinTopLemma.endRowsCarrierNetSaw + safe.bottom);
    }else {
        if (![UIDevice hasNotch]) {
            return CGSizeMake(BinTopLemma.endRowsCarrierNetSaw,UIScreen.mainScreen.bounds.size.height);
        }
        if (orientation == UIInterfaceOrientationLandscapeRight) {
            return CGSizeMake(BinTopLemma.endRowsCarrierNetSaw + safe.left,UIScreen.mainScreen.bounds.size.height);
        }else {
            return CGSizeMake(BinTopLemma.endRowsCarrierNetSaw + 5,UIScreen.mainScreen.bounds.size.height);
        }
    }
}

- (void)droppedTeaspoonsSystemClickPicker {
    UIWindow *recycleWindow = [[ChunkyGetManager shared] identicalDogWindow];
    UIEdgeInsets safe = recycleWindow.safeAreaInsets;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        
        if ([UIDevice energy]) {
            self.silentView.layer.cornerRadius = 5.f;
            self.silentView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
        }
        [self.silentView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view.mas_top);
            make.left.right.equalTo(self.view);
            make.height.mas_equalTo(BinTopLemma.drainCatFair.closeUserNot);
        }];
        [self.midView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.silentView.mas_top);
            make.centerX.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(BinTopLemma.drainCatFair.rowUsability, BinTopLemma.drainCatFair.filterEyeHer));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerX.bottom.mas_equalTo(0);
            make.size.mas_equalTo(self.leftInternalSize);
        }];
        [self.overlapRows mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.mas_equalTo(0);
            make.height.mas_equalTo(BinTopLemma.endRowsCarrierNetSaw);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(0, self.leftInternalSize.height);
    }else {
        
        if ([UIDevice energy]) {
            self.silentView.layer.cornerRadius = 5.f;
            self.silentView.layer.maskedCorners = kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner;
        }
        [self.silentView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.view.mas_right);
            make.top.bottom.equalTo(self.view);
            make.width.mas_equalTo(BinTopLemma.drainCatFair.closeUserNot);
        }];
        UIImage *smoothedImage = [UIImage chinaRecursiveAuditPartPintName:BinTopLemma.drainCatFair.plateSugarLossySquareFadeTall];
        UIImage *eraTextImage = [UIImage imageWithCGImage:smoothedImage.CGImage
                                                    scale:smoothedImage.scale
                                              orientation:UIImageOrientationRight]; 
        self.midView.image = eraTextImage;
        [self.midView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.silentView.mas_right);
            make.centerY.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(BinTopLemma.drainCatFair.filterEyeHer, BinTopLemma.drainCatFair.rowUsability));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerY.left.mas_equalTo(0);
            make.size.mas_equalTo(self.leftInternalSize);
        }];
        [self.overlapRows mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.right.mas_equalTo(0);
            make.width.mas_equalTo(BinTopLemma.endRowsCarrierNetSaw);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(-self.leftInternalSize.width, 0);
    }
    [UIView animateWithDuration:0.3 animations:^{
        self.view.transform = CGAffineTransformIdentity;
    }];
}

- (void)sessionsOccurredTypeButtonsAccurate:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    rawTurn(self);
    [super sessionsOccurredTypeButtonsAccurate:touches withEvent:event];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        [UIView animateWithDuration:0.3 animations:^{
            weakself.view.transform = CGAffineTransformMakeTranslation(0, weakself.leftInternalSize.height);;
        } completion:^(BOOL finished) {
            [[ChunkyGetManager shared] schedulerTriggersRequestedGramConcertMovieViewController:self.navigationController];
        }];
    }else {
        [UIView animateWithDuration:0.3 animations:^{
            self.view.transform = CGAffineTransformMakeTranslation(-weakself.leftInternalSize.width, 0);
        } completion:^(BOOL finished) {
            [[ChunkyGetManager shared] schedulerTriggersRequestedGramConcertMovieViewController:weakself.navigationController];
        }];
    }
}

@end
