






#import "EventSinkViewController.h"
#import "UnlikelyWorkoutTheHashPrettyHandler.h"

@interface EventSinkViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>

@end

@implementation EventSinkViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.waistAfterButton.hidden = YES;
    self.formatIllButton.hidden = YES;
    [self subDecayBlinkView];
}

- (void)subDecayBlinkView
{
    WKUserContentController *lockItalicPeak = [[WKUserContentController alloc] init];
    WKUserScript *listMinTen = [[WKUserScript alloc] initWithSource:TopMergeNap.yetChromaUse.shoulderRecentSmileSubCentered injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [lockItalicPeak addUserScript:listMinTen];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *beaconsOpt = [[WKPreferences alloc]init];
    beaconsOpt.javaScriptCanOpenWindowsAutomatically = YES;
    beaconsOpt.minimumFontSize = 40.0;
    beaconsOpt.javaScriptEnabled = YES;
    config.preferences = beaconsOpt;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = lockItalicPeak;
    
    self.legalActive = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.legalActive.backgroundColor = UIColor.clearColor;
    self.legalActive.scrollView.backgroundColor = UIColor.clearColor;
    self.legalActive.navigationDelegate = self;
    self.legalActive.opaque = YES;
    self.legalActive.scrollView.bounces = NO;
    self.legalActive.scrollView.showsVerticalScrollIndicator = NO;
    self.legalActive.scrollView.showsHorizontalScrollIndicator = NO;
    self.legalActive.UIDelegate = self;
    [self.view addSubview:self.legalActive];
    self.legalActive.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    UnlikelyWorkoutTheHashPrettyHandler *milesPop = [[UnlikelyWorkoutTheHashPrettyHandler alloc] initWithDelegate:self];
    UnlikelyWorkoutTheHashPrettyHandler *fiveWeek = [[UnlikelyWorkoutTheHashPrettyHandler alloc] initWithDelegate:self];
    
    [self.legalActive.configuration.userContentController addScriptMessageHandler:milesPop name:TopMergeNap.yetChromaUse.semanticSonRoundPinkRedirect];
    [self.legalActive.configuration.userContentController addScriptMessageHandler:fiveWeek name:TopMergeNap.yetChromaUse.popYetMoodCompositeCarNanogramsDolby];
}

- (void)setButMixerFun:(NSString *)butMixerFun {
    _butMixerFun = butMixerFun;
    NSURL *url = [NSURL URLWithString:butMixerFun];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[TopMergeNap adaptorCutoffStampResumeKeyToken] forHTTPHeaderField:TopMergeNap.yetChromaUse.elementsFactorSubsetDescendDither];
    [self.legalActive loadRequest:request];
}

- (void)nicknameYouHeartSwimmingKinRussianRest:(NSURL *)URL {
    if ([self.slashesCredit respondsToSelector:@selector(earTurnView:hisPenJumpAction:her:)]) {
        [self.slashesCredit earTurnView:self.legalActive hisPenJumpAction:URL.host her:URL];
    }
}



- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
    decisionHandler(WKNavigationResponsePolicyAllow);
}


- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
    NSURL *URL = navigationAction.request.URL;
    
    if ([URL.scheme hasPrefix:TopMergeNap.yetChromaUse.sawThumb]) {
        [self nicknameYouHeartSwimmingKinRussianRest:URL];
        decisionHandler(WKNavigationActionPolicyCancel);
        return;
    }
    decisionHandler(WKNavigationActionPolicyAllow);
}


-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{

}


- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{
    

}


-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    
    [webView evaluateJavaScript:TopMergeNap.yetChromaUse.attitudeHundredMomentaryLookGigahertzDense completionHandler:nil];
    
    [webView evaluateJavaScript:TopMergeNap.yetChromaUse.attributeDefaultsTailFilteredFitnessHeap completionHandler:nil];
    [webView evaluateJavaScript:TopMergeNap.yetChromaUse.fixPrivilegeHowAutoPing completionHandler:nil];
    
    [BankBorderView fourDisplaySmoothUnionIndicatorView:self.view];
    while (self.legalActive.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.slashesCredit respondsToSelector:@selector(earTurnView:hisPenJumpAction:her:)]) {
        [self.slashesCredit earTurnView:self.legalActive hisPenJumpAction:message.name her:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [SubAlertView cardTransitPreparePoloOneSindhi:@"" message:message completion:^(NSInteger bagEggIndex) {
        completionHandler();
    }];
}



- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures{
    WKFrameInfo *frameInfo = navigationAction.targetFrame;
    if (![frameInfo isMainFrame]) {
        [webView loadRequest:navigationAction.request];
    }
    return nil;
}


- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * __nullable result))completionHandler{
    completionHandler(TopMergeNap.yetChromaUse.locationRest);
}


- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler{
    completionHandler(YES);
}

- (void)dealloc {
    self.legalActive.UIDelegate = nil;
    self.view = nil;
    [self.legalActive.configuration.userContentController removeAllUserScripts];
}

@end
