






#import "NearLemmaViewController.h"
#import "LowMountCallEnclosingViolationHandler.h"

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

@end

@implementation NearLemmaViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.dueLexiconButton.hidden = YES;
    self.whileSkinButton.hidden = YES;
    [self loveUnwindingView];
}

- (void)loveUnwindingView
{
    WKUserContentController *signSlabFitBig = [[WKUserContentController alloc] init];
    WKUserScript *readCoptic = [[WKUserScript alloc] initWithSource:DueIcyFetch.itsPosterIcy.loadForbidCatSeparatedPlace injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [signSlabFitBig addUserScript:readCoptic];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *manHandLow = [[WKPreferences alloc]init];
    manHandLow.javaScriptCanOpenWindowsAutomatically = YES;
    manHandLow.minimumFontSize = 40.0;
    manHandLow.javaScriptEnabled = YES;
    config.preferences = manHandLow;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = signSlabFitBig;
    
    self.whoEraPause = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.whoEraPause.backgroundColor = UIColor.clearColor;
    self.whoEraPause.scrollView.backgroundColor = UIColor.clearColor;
    self.whoEraPause.navigationDelegate = self;
    self.whoEraPause.opaque = YES;
    self.whoEraPause.scrollView.bounces = NO;
    self.whoEraPause.scrollView.showsVerticalScrollIndicator = NO;
    self.whoEraPause.scrollView.showsHorizontalScrollIndicator = NO;
    self.whoEraPause.UIDelegate = self;
    [self.view addSubview:self.whoEraPause];
    self.whoEraPause.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    LowMountCallEnclosingViolationHandler *sideList = [[LowMountCallEnclosingViolationHandler alloc] initWithDelegate:self];
    LowMountCallEnclosingViolationHandler *penFlash = [[LowMountCallEnclosingViolationHandler alloc] initWithDelegate:self];
    
    [self.whoEraPause.configuration.userContentController addScriptMessageHandler:sideList name:DueIcyFetch.itsPosterIcy.exporterGeneratePoloNodeHall];
    [self.whoEraPause.configuration.userContentController addScriptMessageHandler:penFlash name:DueIcyFetch.itsPosterIcy.inheritedUtilityHostInitialTheWrapperUbiquity];
}

- (void)setBankViewSex:(NSString *)bankViewSex {
    _bankViewSex = bankViewSex;
    NSURL *url = [NSURL URLWithString:bankViewSex];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[DueIcyFetch packageFinalMarginSpineExceptionToken] forHTTPHeaderField:DueIcyFetch.itsPosterIcy.changingPotassiumIndicatedInferConnect];
    [self.whoEraPause loadRequest:request];
}

- (void)tradPackInteriorSecurelyLacrosseSwitchWebpage:(NSURL *)URL {
    if ([self.sinHyphensOpt respondsToSelector:@selector(hourCutView:tenCapsSixAction:own:)]) {
        [self.sinHyphensOpt hourCutView:self.whoEraPause tenCapsSixAction:URL.host own: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:DueIcyFetch.itsPosterIcy.preserve]) {
        [self tradPackInteriorSecurelyLacrosseSwitchWebpage: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:DueIcyFetch.itsPosterIcy.connectedIodineSignOrangeRadiansAnalysis completionHandler:nil];
    
    [webView evaluateJavaScript:DueIcyFetch.itsPosterIcy.iodineDocumentsNoiseBoxZoneRun completionHandler:nil];
    [webView evaluateJavaScript:DueIcyFetch.itsPosterIcy.scriptsEqualAppearsInverseScripts completionHandler:nil];
    
    [BinaryBankView candidateReviewEnsureLowAdjustView:self.view];
    while (self.whoEraPause.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.sinHyphensOpt respondsToSelector:@selector(hourCutView:tenCapsSixAction:own:)]) {
        [self.sinHyphensOpt hourCutView:self.whoEraPause tenCapsSixAction:message.name own:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [SinAlertView pubPromisedSmartWaySettlingDecrypted:@"" message:message completion:^(NSInteger nowKinIndex) {
        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(DueIcyFetch.itsPosterIcy.barCollector);
}


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

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

@end
