






#import "AuthorHerViewController.h"
#import "StableCautionCancelsFeatGroupHandler.h"

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

@end

@implementation AuthorHerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.busExtractButton.hidden = YES;
    self.forkChestButton.hidden = YES;
    [self axesButRunSixView];
}

- (void)axesButRunSixView
{
    WKUserContentController *eyeBayerWinSin = [[WKUserContentController alloc] init];
    WKUserScript *silentPick = [[WKUserScript alloc] initWithSource:SubBondFour.nodeFourteen.undefinedBusUsedInternetMute injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [eyeBayerWinSin addUserScript:silentPick];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *zoomArtPan = [[WKPreferences alloc]init];
    zoomArtPan.javaScriptCanOpenWindowsAutomatically = YES;
    zoomArtPan.minimumFontSize = 40.0;
    zoomArtPan.javaScriptEnabled = YES;
    config.preferences = zoomArtPan;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = eyeBayerWinSin;
    
    self.mustMusical = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.mustMusical.backgroundColor = UIColor.clearColor;
    self.mustMusical.scrollView.backgroundColor = UIColor.clearColor;
    self.mustMusical.navigationDelegate = self;
    self.mustMusical.opaque = YES;
    self.mustMusical.scrollView.bounces = NO;
    self.mustMusical.scrollView.showsVerticalScrollIndicator = NO;
    self.mustMusical.scrollView.showsHorizontalScrollIndicator = NO;
    self.mustMusical.UIDelegate = self;
    [self.view addSubview:self.mustMusical];
    self.mustMusical.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    StableCautionCancelsFeatGroupHandler *referent = [[StableCautionCancelsFeatGroupHandler alloc] initWithDelegate:self];
    StableCautionCancelsFeatGroupHandler *pubScore = [[StableCautionCancelsFeatGroupHandler alloc] initWithDelegate:self];
    
    [self.mustMusical.configuration.userContentController addScriptMessageHandler:referent name:SubBondFour.nodeFourteen.internetSwashesZoneOrnamentInverted];
    [self.mustMusical.configuration.userContentController addScriptMessageHandler:pubScore name:SubBondFour.nodeFourteen.tagDoubleProvidingFinalizeRowBuddyPack];
}

- (void)setNowWetUpper:(NSString *)nowWetUpper {
    _nowWetUpper = nowWetUpper;
    NSURL *url = [NSURL URLWithString:nowWetUpper];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[SubBondFour nepaliEighteenLikeSchemesDetachingToken] forHTTPHeaderField:SubBondFour.nodeFourteen.mirroredProposalGeometricBuildStrength];
    [self.mustMusical loadRequest:request];
}

- (void)shiftPencilSpeechToolBecomeFunctionsStone:(NSURL *)URL {
    if ([self.taskCharUnify respondsToSelector:@selector(rowsHisView:sunMuteYetAction:odd:)]) {
        [self.taskCharUnify rowsHisView:self.mustMusical sunMuteYetAction:URL.host odd: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:SubBondFour.nodeFourteen.drawSlow]) {
        [self shiftPencilSpeechToolBecomeFunctionsStone: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:SubBondFour.nodeFourteen.teaspoonsEstablishExpectingPolarStatementPrep completionHandler:nil];
    
    [webView evaluateJavaScript:SubBondFour.nodeFourteen.occlusionExistPressedReceiptNoteBlue completionHandler:nil];
    [webView evaluateJavaScript:SubBondFour.nodeFourteen.chunkyPinTeamGreenHelpers completionHandler:nil];
    
    [FitCalorieView greatOriginDenseAnswerIntegersView:self.view];
    while (self.mustMusical.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.taskCharUnify respondsToSelector:@selector(rowsHisView:sunMuteYetAction:odd:)]) {
        [self.taskCharUnify rowsHisView:self.mustMusical sunMuteYetAction:message.name odd:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [HerAlertView peakKilohertzRepeatsModerateCaretIntent:@"" message:message completion:^(NSInteger topSubIndex) {
        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(SubBondFour.nodeFourteen.guidePickFax);
}


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

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

@end
