






#import "ReaderSobViewController.h"
#import "LocaleInheritedCoalescedUpdatingMenuHandler.h"

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

@end

@implementation ReaderSobViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.sonLockingButton.hidden = YES;
    self.cinematicButton.hidden = YES;
    [self greekGroupCutView];
}

- (void)greekGroupCutView
{
    WKUserContentController *neverEggSeeYet = [[WKUserContentController alloc] init];
    WKUserScript *bankMemory = [[WKUserScript alloc] initWithSource:CloudyPrice.resetEndsIts.talkMegahertzResponderSidebarUnsafe injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [neverEggSeeYet addUserScript:bankMemory];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *excludeBag = [[WKPreferences alloc]init];
    excludeBag.javaScriptCanOpenWindowsAutomatically = YES;
    excludeBag.minimumFontSize = 40.0;
    excludeBag.javaScriptEnabled = YES;
    config.preferences = excludeBag;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = neverEggSeeYet;
    
    self.easyCompile = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.easyCompile.backgroundColor = UIColor.clearColor;
    self.easyCompile.scrollView.backgroundColor = UIColor.clearColor;
    self.easyCompile.navigationDelegate = self;
    self.easyCompile.opaque = YES;
    self.easyCompile.scrollView.bounces = NO;
    self.easyCompile.scrollView.showsVerticalScrollIndicator = NO;
    self.easyCompile.scrollView.showsHorizontalScrollIndicator = NO;
    self.easyCompile.UIDelegate = self;
    [self.view addSubview:self.easyCompile];
    self.easyCompile.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    LocaleInheritedCoalescedUpdatingMenuHandler *failPrep = [[LocaleInheritedCoalescedUpdatingMenuHandler alloc] initWithDelegate:self];
    LocaleInheritedCoalescedUpdatingMenuHandler *displays = [[LocaleInheritedCoalescedUpdatingMenuHandler alloc] initWithDelegate:self];
    
    [self.easyCompile.configuration.userContentController addScriptMessageHandler:failPrep name:CloudyPrice.resetEndsIts.croatianCoalescedWonTurnIslamic];
    [self.easyCompile.configuration.userContentController addScriptMessageHandler:displays name:CloudyPrice.resetEndsIts.fillerLoopsReceiveHitNumeralDetailedSpa];
}

- (void)setShareMidPop:(NSString *)shareMidPop {
    _shareMidPop = shareMidPop;
    NSURL *url = [NSURL URLWithString:shareMidPop];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[CloudyPrice spatialDeviceRevisionsTiedTowerToken] forHTTPHeaderField:CloudyPrice.resetEndsIts.sawPeriodListReminderIntegers];
    [self.easyCompile loadRequest:request];
}

- (void)sexKeysAnchoredShuffleCocoaOutletVowel:(NSURL *)URL {
    if ([self.tapOurOptEast respondsToSelector:@selector(sexMaleView:amountOverAction:net:)]) {
        [self.tapOurOptEast sexMaleView:self.easyCompile amountOverAction:URL.host net: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:CloudyPrice.resetEndsIts.innerSpa]) {
        [self sexKeysAnchoredShuffleCocoaOutletVowel: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:CloudyPrice.resetEndsIts.commonWayDustDelayFusionTrap completionHandler:nil];
    
    [webView evaluateJavaScript:CloudyPrice.resetEndsIts.exceptionAnyZeroArrowEqualityDismissal completionHandler:nil];
    [webView evaluateJavaScript:CloudyPrice.resetEndsIts.portionFixtureNormalPublicEncipher completionHandler:nil];
    
    [JobRankSawView assistantExtendsIllDispenseRouteView:self.view];
    while (self.easyCompile.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.tapOurOptEast respondsToSelector:@selector(sexMaleView:amountOverAction:net:)]) {
        [self.tapOurOptEast sexMaleView:self.easyCompile amountOverAction:message.name net:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [BigAlertView domainPauseTipAllTenDown:@"" message:message completion:^(NSInteger busNapIndex) {
        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(CloudyPrice.resetEndsIts.pinBestFoggy);
}


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

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

@end
