<!doctype html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">

    <title>Download!</title>
    <link   href="/css/style2.css" rel="stylesheet">
    <link  href="/css/responsive1.css" rel="stylesheet" >
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <style>

 .ffff::-webkit-scrollbar-track
{
	-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
	background-color: #F5F5F5;
}

  .ffff::-webkit-scrollbar
{
	width: 0px;
	height: 4px;
	background-color: #F5F5F5;
}

  .ffff::-webkit-scrollbar-thumb
{
	background-color: #000000;
	border: 2px solid #555555;
}

////////////////////////////////////////////////////////////////

.ssss::-webkit-scrollbar-track
{
	-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
	background-color: #F5F5F5;
}

  .ssss::-webkit-scrollbar
{
	width: 0px;
	height: 0px;
	background-color: #F5F5F5;
}

  .ssss::-webkit-scrollbar-thumb
{
	background-color: #000000;
	border: 2px solid #555555;
}
    </style>
</head>

<body>
    <div class="header">
        <div class="box-content1" id="page2">
            <div class="header-wrapper"> </div>
            <div class="container">
                <div class="row">
                    <div class="col-lg-6 col-md-6 mt-5">
                        <img src="/images/header.bg.png" alt="" width="100%">
                    </div>
                    <div class="col-lg-4 col-md-6 menu mb-4">
                        <div class=" lock">
                            <img src="/images/6666 1.png" alt="">

                            <p class="mb-4">Enter the password that has <br> been shared with you</p>

                            <label for="exampleInputPassword1" id="lbl"></label>
                            <input type="password" class="form-control" placeholder="Password"
                                id="exampleInputPassword1">



                            <button type="button " class=" btn mb-5" id="box">View</button>

                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="box-content" id="page1" style="display: none ;">
            <div class="header-wrapper">
                <div class="row  pb-5">
                    <div class="logo"  id="check" style="margin-top: 15px !important;">
                        <a href="" id="originalFileName" class="h4" style="text-decoration: none; margin:9px 40px;color:#fff;">

                        </a>
                        <!--<img src="images/Group 113 (1).png" alt="" class="sem" onclick="download()">-->
                    </div>

                </div>
            </div>
            <div class="header-wrap">
                <div class="container">
                    <div class="row">
                        <div class=" jinu col-lg-8 col-md-6 mt-5 px-4 ffff" style="height:595px;overflow-y:scroll;overflow-x:scroll;" >
                            <img src="/images/Mask group (7).png" alt=""  id="prev" style="display:none;" >
                            <img src="/images/pagenofound.png" alt=""  id="noprev" >
                        </div>
                        <div class="col-lg-4 col-md-6 menu1 mt-5 pb-4 ssss" style="height:595px;overflow-y:scroll;overflow-x:scroll;">
                            <div class="box-1" >
                                <p id="notes">Lorem ipsum dolor sit amet ducimus consectetur adipisicing elit. Aspernatur suscipit
                                    magnam
                                    debitis,
                                    dolorum est ducimus est a aliquam quod? Eligendi tempore corrupti iure inventore
                                    iusto
                                    veritatis
                                    commodi
                                    iusto soluta autem vitae rem!</p>

                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>


    </div>

    <script >
console.log(`sitemap.xml`);

var id=`sitemap.xml`;
 $("#box").click(function(){

    var password =$('#exampleInputPassword1').val();
    if(password=='') {
         $('#lbl').text("Password required!").css({"color":"red"});
        return ;
    }
    var settings = {
    "url": "/verify_user/"+password+"/"+id.trim(),
    "method": "GET",
    "timeout": 0,
    };

    $.ajax(settings).done(function (response) {
      console.log(response.status);
             if(response.status){
                //alert("success!")
               if(response.url.trim()!=""){
                         $("#page1").show();
                         $("#page2").hide();
                         $('#notes').text(response.notes)
                         if(response.originalFileName.includes(".PNG") || response.originalFileName.includes(".png") || response.originalFileName.includes(".jpg")
                         || response.originalFileName.includes(".jpeg") || response.originalFileName.includes(".gif") || response.originalFileName.includes(".GIF")
                         || response.originalFileName.includes(".JPEG") || response.originalFileName.includes(".JPG")){
                            $('#prev').attr("src", location.origin+'/files/'+response.url);
                            $('#prev').show();
                            $('#noprev').hide();
                         }
                    if(response.originalFileName!=""){
                        $('#originalFileName').text(response.projectName);
                        //  $('#originalFileName').text(response.originalFileName);
                        $('#check').append('<a id="ddd" class="btn btn-light btn-lg" style="float:right;margin-right:12px;margin-top: -4px;"  href="'+location.origin+'/files/'+response.url+'"  download="'+response.originalFileName+'"><i class="fa fa-download" aria-hidden="true"></i>  Download</a>');
                    }else{
                        $('#originalFileName').text(response.url);
                        $('#check').append('<a id="ddd" class="btn btn-light btn-lg"  style="float:right;margin-right:12px;margin-top: -4px;" href="'+location.origin+'/files/'+response.url+'"   download><i class="fa fa-download" aria-hidden="true"></i>  Download</a>');
                    }
               }else{
                    $('#lbl').text("File not found!, It may be deleted.").css({"color":"red"});
               }
             }else{
                $('#lbl').text("Invalid password!").css({"color":"red"});
             }

    });
});

function download(){
    $('#ddd').click();
    alert("Download completed");
}
$(document).ready(function(){
 $("#exampleInputPassword1").keypress(function(event) {
            if (event.keyCode === 13) {
                $("#box").click();
            }
        });
})
</script>


    <!-- Optional JavaScript; choose one of the two! -->

    <!-- Option 1: Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
        crossorigin="anonymous"></script>

    <!-- Option 2: Separate Popper and Bootstrap JS -->
    <!--
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
    -->
</body>

</html>