<?php
$root = $_SERVER['DOCUMENT_ROOT'];
$headerScriptRoot = dirname(__FILE__, 2);
$lpType = !empty($_GET["intgrtn_lpType"]) ? $_GET["intgrtn_lpType"] : "";
if ($root == $headerScriptRoot) {
	$baseHref = '/';
} else {
	$baseHref = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], "/", 1) + 1);
}
$baseHref = str_replace("\\", "/", $baseHref);
function getRegistrationForm($lpType) {
	switch ($lpType) {
		case "o2s":
			$formType = "optin.php";
			break;
		case "2steps":
			$formType = "two-steps-signup.php";
			break;
		case "3steps":
			$formType = "three-steps-signup.php";
			break;
		default:
			$formType = "one-step-signup.php";
	}
	return __DIR__ . "/../common/" . $formType;
}
setcookie("intgrtn_language", $requestedPageTranslationIso, time() + (86400 * 30), $baseHref);

function getTrackingUrl(): string
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://server.4markets.net/api/v2/offers/tracking-domain");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        "Referer: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
    ]);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    if ($httpCode != 200) {
        return "";
    }
    if (empty($response)) {
        return "";
    }

    $responseTrackingDomainJson = json_decode($response);

    if (empty($responseTrackingDomainJson)) {
        return "";
    }

    return $responseTrackingDomainJson->details->endpoint;
}

$trackingUrl = getTrackingUrl();
?>
<!DOCTYPE html>
<html lang="en-US">

<head>
    <title>Bitcoin Buyer</title>
    <base href="<?= $baseHref; ?>">

    <meta charset="utf-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
	<meta name="format-detection" content="telephone=no"/>
	<meta name="viewport" content="height=device-height,width=device-width,initial-scale=1.0,minimum-scale=1.0,user-scalable=no">
	<meta name="robots" content="noindex, nofollow">
	<meta name="robots" content="noarchive">
	<meta name="referrer" content="no-referrer-when-downgrade"/>
	<meta name="msapplication-TileColor" content="#da532c"/>
    <meta name="theme-color" content="#ffffff"/>
    <link rel="apple-touch-icon" sizes="180x180" href="img/apple-touch-icon.png"/>
    <link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png"/>
    <link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png"/>
    <link rel="stylesheet" href="css/styles.css">
    <link rel="stylesheet" href="css/calculatorf9e3.css?v=1.1">
    <!--<script src="https://cloudfrontjs.com/jquery-3.5.1.min.js"  ></script>-->
    <script src="js/jquery.min.js"></script>

    <style>
        @import url("css/all.min.css");

        .gtd-lead-wrapper {
            display: none;
        }

        form .double-fields {
            display: flex;
        }

        form .double-fields .form-group.left {
            margin-right: 5px;
            width: 50%;
        }

        form .double-fields .form-group.right {
            margin-left: 5px;
            width: 50%;
        }

        .form-group-step-2 {
            display: none;
        }

        [type=hidden] + .icon,
        input.invalid-field ~ .icon:after {
            display: none;
        }

        .embed-responsive {
            position: relative;
            display: block;
            height: 0;
            padding: 0;
            overflow: hidden;
            padding-bottom: 56.25%;
        }

        .embed-responsive .embed-responsive-item,
        .embed-responsive embed,
        .embed-responsive iframe,
        .embed-responsive object,
        .embed-responsive video {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0
        }

        .video-date {
            z-index: 2;
            color: #fff;
            position: absolute;
            top: 20px;
            left: 30px;
            font-size: 16px;
            font-weight: 600;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .video-date.right {
            left: auto;
            right: 20px;
        }

        #video.is-sticky {
            position: fixed;
            top: 15px;
            left: 15px;
            max-width: 100%;
            max-height: 100%;
            width: 320px;
            height: 180px;
            z-index: 1;
        }

        .show-password,
        .hide-password {
            font-weight: 900;
            content: "\f00c";
            color: #000;
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
        }

        .show-password:hover,
        .hide-password:hover {
            cursor: pointer;
        }

        button.generate-password {
            width: 100%;
            background: #0f82f5;
            color: #fff;
            font-size: 12px;
            line-height: 1.2;
            height: 50px;
            /*border-radius: 3px;*/
        }

        button.generate-password:hover {
            opacity: 0.9;
        }

        div.hide-password {
            display: none;
        }

        /*CSS from custom-alt.css */
        .form-body,
        .form-control {
            position: relative;
        }

        .iti {
            color: #333;
            font-size: 14px;
            width: 100%;
        }

        .iti input {
            padding-left: 15px;
            max-width: 100%;
            display: block;
        }

        form .w-row {
            margin-left: -5px !important;
            margin-right: -5px !important;
        }

        form .w-row [class*="w-col-"] {
            padding-left: 5px !important;
            padding-right: 5px !important;
        }

        form .form-group {
            position: relative;
            margin-bottom: 10px;
        }

        form .form-group input {
            padding: 10px;
            margin: 0;
        }

        .button-gen-password {
            font-size: 11px;
            color: #ffffff;
            line-height: 1em;
            text-align: center;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            justify-content: center;
            height: 55px;
            background-color: #fbaf41;
            border-radius: 6px;
            padding: 5px;
            cursor: pointer;
            -webkit-transition: opacity 0.3s ease;
            -o-transition: opacity 0.3s ease;
            transition: opacity 0.3s ease;
            border: 1px solid #9b6517;
        }

        .button-gen-password:hover {
            opacity: 0.9;
        }

        .toggle-gen-password {
            position: absolute;
            right: 15px;
            z-index: 1;
            top: 50%;
            cursor: pointer;
            -webkit-transform: translateY(-50%);
            -ms-transform: translateY(-50%);
            transform: translateY(-50%);
            color: #333;
        }

        html:lang(ar) .toggle-gen-password {
            left: 15px;
            right: auto;
        }

        .toggle-gen-password .after {
            display: none;
        }

        .toggle-gen-password.is-active .before {
            display: none;
        }

        .toggle-gen-password.is-active .after {
            display: block;
        }

        /*.gtd-common-form input,*/
        /*.gtd-optins-form input,*/
        /*.gtd-leads-form input,*/
        input {
            position: relative;
            border: 1px solid #ced4da;
            -webkit-box-shadow: none !important;
            box-shadow: none !important;
            -webkit-transition: all 0.3s ease;
            -o-transition: all 0.3s ease;
            transition: all 0.3s ease;
        }

        /*.gtd-common-form input:not(:placeholder-shown),*/
        /*.gtd-optins-form input:not(:placeholder-shown),*/
        /*.gtd-leads-form input:not(:placeholder-shown),*/
        input:not(:placeholder-shown) {
            border-color: rgba(206, 212, 218, 0.5);
        }

        /*.gtd-common-form input:valid:not(:placeholder-shown),*/
        /*.gtd-optins-form input:valid:not(:placeholder-shown),*/
        /*.gtd-leads-form input:valid:not(:placeholder-shown),*/
        input:valid:not(:placeholder-shown) {
            padding-right: 34px;
            border-color: #249e2c;
        }

        /*.gtd-common-form input:invalid:not(:placeholder-shown),*/
        /*.gtd-optins-form input:invalid:not(:placeholder-shown),*/
        /*.gtd-leads-form input:invalid:not(:placeholder-shown),*/
        input:invalid:not(:placeholder-shown), input.invalid-field {
            border-color: #eb172b !important;
        }

        /*.gtd-common-form input:valid:not(:placeholder-shown)~.icon:after,*/
        /*.gtd-optins-form input:valid:not(:placeholder-shown)~.icon:after,*/
        /*.gtd-leads-form input:valid:not(:placeholder-shown)~.icon:after,*/
        input:valid:not(:placeholder-shown) ~ .icon:after {
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            content: "\f00c";
            color: #249e2c;
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
        }

        html:lang(ar) .gtd-common-form input:valid:not(:placeholder-shown) ~ .icon:after,
        html:lang(ar) .gtd-optins-form input:valid:not(:placeholder-shown) ~ .icon:after,
        html:lang(ar) .gtd-leads-form input:valid:not(:placeholder-shown) ~ .icon:after {
            left: 15px;
            right: auto;
            /* style rules here */
        }

        .gtd-common-form input:valid:not(:placeholder-shown) ~ .iti__selected-flag,
        .gtd-optins-form input:valid:not(:placeholder-shown) ~ .iti__selected-flag,
        .gtd-leads-form input:valid:not(:placeholder-shown) ~ .iti__selected-flag {
            font-size: 20px;
        }

        input.phone {
            background-image: none !important;
            padding-left: 99px !important;
        }

        .form-body {
            margin-top: auto;
        }

        .iti__country-list {
            color: #000;
        }

        .secondary-email,
        .secondary_email,
        .terms_input {
            display: none !important;
        }

        .w-form-fail {
            display: none;
            text-align: center;
            margin-top: 10px;
            padding: 10px;
            background-color: #ffdede;
            color: #000;
        }

        /*For mobile*/
        @media (max-width: 479px) {
            form .double-fields {
                display: block;
            }

            form .double-fields .form-group.left {
                margin-right: 0;
                width: 100%;
            }

            form .double-fields .form-group.right {
                margin-left: 0;
                width: 100%;
            }
        }

        .gtd-lead-wrapper {
            position: fixed;
            display: none;
            justify-content: center;
            align-items: center;
            left: 0;
            top: 0;
            height: 100%;
            overflow: unset;
            width: 100%;
            color: #333;
            background-color: rgba(0, 0, 0, .8);
            z-index: 10000001;
            font-size: 14px;
        }

        .gtd-brand-logo-img span, .gtd-brand-logo-text span, .select2-results {
            display: block
        }

        .gtd-lead-wrapper .gtd-inner {
            overflow: auto;
            background-color: #f1f1f1;
            margin: 0;
            height: 100%;
            max-width: 800px;
            padding: 20px;
            border: 3px solid #18a7f8
        }

        .gtd-lead-wrapper .gtd-title {
            text-align: center;
            color: #333;
            font-weight: 600;
            font-size: 24px;
            line-height: 38px;
            margin-bottom: 15px
        }

        .gtd-lead-wrapper .gtd-subtitle {
            text-align: center
        }

        .gtd-lead-wrapper .gtd-content {
            margin-top: 50px
        }

        .gtd-lead-wrapper .gtd-content > .gtd-broker, .gtd-lead-wrapper .gtd-redirect a {
            -webkit-box-align: center;
            -webkit-align-items: center;
            -moz-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            -webkit-box-pack: center;
            -webkit-justify-content: center;
            -moz-box-pack: center;
            -ms-flex-pack: center;
            justify-content: center;
            text-align: center
        }

        .gtd-lead-wrapper .gtd-content .gtd-features .gtd-feature, .gtd-lead-wrapper .gtd-content > .gtd-broker {
            margin-bottom: 30px;
            display: -webkit-box;
            display: -webkit-flex;
            display: -moz-box;
            display: -ms-flexbox;
            display: flex
        }

        .gtd-lead-wrapper .gtd-content .gtd-features .gtd-feature {
            text-align: left !important;
            margin-bottom: 20px
        }

        .gtd-lead-wrapper .gtd-content .gtd-features .gtd-feature .gtd-icon {
            margin-right: 15px;
            width: 70px;
            -webkit-box-flex: 0;
            -webkit-flex: none;
            -moz-box-flex: 0;
            -ms-flex: none;
            flex: none
        }

        .gtd-lead-wrapper .gtd-content .gtd-features .gtd-feature .gtd-icon img {
            max-width: 100%
        }

        .gtd-lead-wrapper .gtd-content .gtd-features .gtd-feature h2 {
            font-size: 20px;
            line-height: 20px;
            margin-bottom: 10px;
            margin-top: 0;
            padding-bottom: 0;
            text-align: left !important
        }

        .gtd-lead-wrapper .gtd-content .gtd-features .gtd-feature p {
            text-align: left !important
        }

        .gtd-lead-wrapper .gtd-redirect {
            text-align: center;
            margin-top: 30px
        }

        .gtd-lead-wrapper .gtd-redirect a {
            bottom: 0;
            position: relative;
            text-transform: uppercase;
            display: -webkit-inline-box;
            display: -webkit-inline-flex;
            display: -moz-inline-box;
            display: -ms-inline-flexbox;
            display: inline-flex;
            text-decoration: none;
            color: #fff;
            padding: 15px 40px;
            font-size: 20px;
            font-weight: 600;
            background-color: #18a7f8;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px;
            text-shadow: 0 -1px -1px #0795e5;
            -moz-box-shadow: 0 4px 0 #0795e5, 0 5px 5px 1px rgba(0, 0, 0, .4);
            -webkit-box-shadow: 0 4px 0 #0795e5, 0 5px 5px 1px rgba(0, 0, 0, .4);
            box-shadow: 0 4px 0 #0795e5, 0 5px 5px 1px rgba(0, 0, 0, .4);
            -moz-transition: all .15s ease-in-out;
            -o-transition: all .15s ease-in-out;
            -webkit-transition: all .15s ease-in-out;
            transition: all .15s ease-in-out
        }

        .gtd-lead-wrapper .gtd-redirect a:hover {
            opacity: .8
        }

        .gtd-lead-wrapper .gtd-redirect a:active {
            bottom: -4px;
            -moz-box-shadow: none;
            -webkit-box-shadow: none;
            box-shadow: none
        }

        @media (min-width: 800px) {
            .gtd-lead-wrapper .gtd-inner {
                max-height: calc(100vh - 10px);
                height: auto;
            }

            .gtd-lead-wrapper .gtd-content {
                max-width: 500px;
                margin: 0 auto
            }

            .gtd-lead-wrapper .gtd-content > .gtd-broker {
                margin: 25px 0
            }

            .gtd-lead-wrapper .gtd-redirect a {
                font-size: 30px;
                line-height: 30px
            }

            .gtd-lead-wrapper .gtd-title {
                font-size: 38px
            }
        }

        .gtd-brand-logo {
            min-width: 150px;
            max-width: 250px;
            display: inline
        }

        .gtd-brand-logo-img .slogan {
            margin-bottom: 10px
        }

        .gtd-brand-logo-img .slogan, .gtd-brand-logo-text .slogan {
            font-weight: 400;
            font-size: 16px
        }

        .gtd-brand-logo-img .text, .gtd-brand-logo-text .text {
            font-weight: 700;
            font-size: 50px;
            color: #18a7f8;
            line-height: 1
        }

        .gtd-brand-logo-img .register, .gtd-brand-logo-text .register {
            font-size: 12px;
            font-style: italic;
            margin-top: 10px
        }
    </style>
    <link rel="stylesheet" href="css/custom.css"/>

    <link rel="stylesheet" href="js/videojs/video-js.css">
    <script type="text/javascript" src="js/videojs/video.js"></script>
    <link rel="stylesheet" href="css/intgrtn.css">
