<!DOCTYPE html>
<html class="ui-mobile">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Split Array and Remove Duplicates</title>
    <style type="text/css">
  .keyboard {
  font-size: x-large;
}

body {
    padding: 0px;/* Amount of negative space around the outside of the body */
    margin: 0px;/* Amount of negative space around the inside of the body */
z-index:10;
/*background-color: #FAFAEF;*/
}

body,.bkgnd{ background-color: #E8D3AA;}
.devsite-top-section-wrapper,#footer2,#footer1,.tutorchuzr,#panel1,#panel2,#bibleBooks,.header,
 #calc,#refresh,#rateUs,#rechose,#client,#ticha,#exambild,#examryt,#skulbk, #calcHelper,#tconvt,#tcalc{
  background: linear-gradient(to left,#492C6B,#8837E5,#492C6B);
  color: white;
  padding: 0;
  margin: 0;
}

button{
  font-size: large; 
  text-align: center;
}

  .keyboard {
  font-size: x-large;
}
.borderPosition{
position:relative; 
border: 1px solid white; 
border-radius: 10px;
}


.ddsmoothmenu,.header{
    padding: 0;
  margin: 0;
  width:100%;
z-index:200;
position:fixed;}

/*////////////////////////*/
  .tcalc{
color: white;
right: 10px;
top: 100px;
background:  radial-gradient(#DC8D13,#DC8D13 ,#F8D57F);
border-style: outset;
box-shadow:1px 1px 5px rgba(0,0,4);
  }

.tconvt{
color: white;
right: 10px;
top: 200px;
background:  radial-gradient(#DC8D13,#DC8D13 ,#F8D57F);
border-style: outset;
box-shadow:1px 1px 5px rgba(0,0,4);
  }

  #calc{
color: white;
right: 10px;
top: 100px;
  }

 #rateUs{
  color: white;
right: 10px;
bottom: 50px;
  }

 #client{
color: white;
right: 10px;
top: 150px;
  }

#refresh{ 
color: white;
right: 10px;
bottom: 250px;
  }

#calcHelper{
 width:32px;
 height:32px;
border-radius: 15px;
}

#calc,#refresh,#rateUs,#client,#rechose,#ticha,#exambild,#examryt,#skulbk, #calcHelper,#tconvt,#tcalc{
width:32px;
height:32px;
border-radius: 10px;
z-index: 50;
position:fixed;
opacity:0.7;
}

#footer{
bottom: 8%;
z-index:200;
}

#footer2{
 bottom: 1.5%;
z-index:200; 
}

#footer1,#footer,#footer2{
color: white;
font-size: 15px;
text-align: center;
position:fixed;
width:100%;
}

#footer1{
bottom: 0;
z-index:300;
}

.CodePlatform{
  width:90%;
 bottom: 250px;
 left:2px;
 z-index: -200; 
 opacity:0;
  background-color: white;
}


#CloseSearch{
  width:30px; 
  height:30px; 
  border-radius: 15px;
  float: right;
}

.message-container {
    max-width: 100%;
    background-color: #f0f0f0;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.message-container:after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 20px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: #f0f0f0;
    border-bottom: 0;
    margin-left: -10px;
    margin-bottom: -10px;
}

.message-textarea {
    width: 100%;
    border: none;
    background-color: transparent;
    padding: 10px;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
    resize: none; /* Disable resize control */
    overflow: hidden; /* Hide overflow */
    line-height: 1.5;
}

.message-textarea:focus {
    outline: none;
    border: none;
}

.message-textarea::placeholder {
    color: #888;
}


  @keyframes marquee {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
  }



.fireAlert01{
    font-family: 'RobotoDraft', 'Roboto', 'Helvetica Neue, Helvetica, Arial', sans-serif;    position: fixed; /* Stay in place */
    z-index: 950; /* Sit on top */
    /*padding-top: 100px;  Location of the box */
     transition: color 200ms ease-in 50ms;
    left: 0;
    top: 0;
    width: 100%; /*Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
   /* background-color: rgb(0,0,0); /* Fallback color */
   /* background-color: rgba(0.4,0.4,0.4,0.4); /* Black w/ opacity */
  }

  .fireAlert{
    font-family: 'RobotoDraft', 'Roboto', 'Helvetica Neue, Helvetica, Arial', sans-serif;    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    /*padding-top: 100px;  Location of the box */
     transition: color 200ms ease-in 50ms;
    left: 0;
    top: 0;
    width: 100%; /*Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
   /* background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0.1,0,0.4); /* Black w/ opacity */
  }


 /* Modal Content */
  .fireAlert .fireContent{
  	background-color: grey;
    margin: auto;
    /*padding-top: 20px;*/
    border: 2px solid #ff6600;
    width: 100%;
    border-radius: 5px;
  }


.fireAlert .fireContentTimedSpin{
    background-color: #eff1f3;
    margin: auto;
    width: 10%;
    border-radius: 5px;  
  }

#fireworks-template {
 display:none;
}

#fireContainer {
 position:absolute;
 left:0px;
 top:0px;
 z-index:1120;
}

.firework {
 /* containing box which flies out first */
 position:absolute;
 left:0px;
 top:0px;
 font-size:1px;
 width:4px;
 height:4px;
 border:1px solid #333;
 background:#666;
}

.fireworkParticle {
 /* elements that explode from the container */
 position:absolute;
 font-size:1px;
 width:10px;
 height:10px;
 overflow:hidden;
}

.fireworkParticle img {
 display:block;
 width:100px;
}

.lagfont {font-size:x-large;}
#SenderCoderror,#ReceiverCoderror,#paymentidError,.errorNote{
	color:red;
}
</style>
<script type="text/javascript">
	var PriceCurrency="$";
var AppPrize="5"; //the price for the app
var payment_id;
var SoftwareVersion="1";
var APP_NAME="Velo";
var APP_VERSION="01";
var MsgPW="";
var companyName="Noril Apps";
var CELL_NUMBA1="+263774144279";emailAddress="hepiars@gmail.com";
var IOLOGIQLicenseAgreement=APP_NAME+" END USER LICENSE AGREEMENT (EULA)<br>NOTICE TO USERS: CAREFULLY READ THE FOLLOWING LEGAL AGREEMENT. USE OF "+APP_NAME+" (the 'SOFTWARE') PROVIDED WITH THIS AGREEMENT CONSTITUTES YOUR ACCEPTANCE OF THESE TERMS. IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT INSTALL AND/OR USE THIS SOFTWARE. USER'S USE OF THIS SOFTWARE IS CONDITIONED UPON COMPLIANCE BY USER WITH THE TERMS OF THIS AGREEMENT.<br><br>1. LICENSE GRANT <br>This EULA grants you the right to store, load, install, execute or display a copy of the SOFTWARE on your Device.<br>'You' means the company, entity or individual who received the SOFTWARE. “Device” must be wholly owned, rented or leased by you.<br>You may not modify the SOFTWARE or disable features of the SOFTWARE except as an intended part of the SOFTWARE's programming features.<br><br>2. RESTRICTIONS<br>You may not, lease, sub-license, or sell the SOFTWARE. You agree not to modify, adapt, translate, reverse engineer, decompile, disassemble or otherwise attempt to discover the source code of the SOFTWARE. You may not alter or modify the installer program or create a new installer for the SOFTWARE. <br><br>3. OWNERSHIP<br>The SOFTWARE is owned and copyrighted by "+companyName+". This license confers no title or ownership of the SOFTWARE and should not be construed as a grant of any right in the SOFTWARE.<br><br>4. COPYRIGHT<br>The SOFTWARE and all rights are owned by "+companyName+" and/or its suppliers and are protected by copyright law and international copyright treaties. You acknowledge that no title to the intellectual property in the SOFTWARE is transferred to you. You further acknowledge that title and full ownership rights to the SOFTWARE will remain the exclusive property of "+companyName+" and you will not acquire any rights to the SOFTWARE except as expressly set forth in this license. <br><br>5. TERMINATION <br>The License is in effect until terminated. You may terminate this License at any time by ceasing any and all use of the SOFTWARE, and deleting or destroying the SOFTWARE. This agreement shall terminate automatically upon breach of any term of this agreement.  <br><br>6. NO WARRANTY, NO LIABILITY <br>"+companyName+" AND ITS SUPPLIERS DO NOT AND CANNOT WARRANT THE PERFORMANCE OR RESULTS YOU MAY OBTAIN BY USING THE SOFTWARE OR DOCUMENTATION. "+companyName+" AND ITS SUPPLIERS MAKE NO WARRANTIES, EXPRESS OR IMPLIED, AS TO NONINFRINGEMENT OF THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL "+companyName+" OR ITS SUPPLIERS BE LIABLE TO YOU FOR ANY CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS OR LOST SAVINGS, EVEN IF A "+companyName+" REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY. YOU HEREBY ASSUME THE ENTIRE RISK OF ALL USE OF THE COPIES OF SOFTWARE COVERED BY THIS LICENSE.<br><br>7. GOVERNING LAW <br>This agreement is governed by the laws of ZIMBABWE. Any claim, dispute or controversy with respect to, in connection with or arising out of this agreement shall be subject to and decided by arbitration in ZIMBABWE. If any part of this agreement is found void and unenforceable by a court of competent jurisdiction, it will not affect the validity of the balance of the agreement, which shall remain valid and enforceable according to its terms.<br><br>8. ENTIRE AGREEMENT <br>This agreement is the final, complete and exclusive agreement between you and "+companyName+" that supersedes any prior agreement or understanding, whether written or oral, relating to the subject matter of this license.<br>Copyright © 2016-2024 "+companyName+". All rights reserved.<br>";


var AryLearningVerbs=[
];


var clientCell_id=localStorage.getItem('clientCellID');

function OncePerLoadSlide(thisAry,Atplace){// slide one per load
 var Atplace=document.getElementById(Atplace);
 var randiser=Math.floor(Math.random()*(thisAry.length-1));
 //console.log("    this id "+Atplace+"   "+randiser)
Atplace.innerHTML=thisAry[randiser];

}

displayfireworks=false;

var lstorage= localStorage.getItem('mainPassword');
localStorage.getItem('paymentID');
var lisenceAgreed= localStorage.getItem('lisenceAgreed');
var USERPURCHASEDLIST=localStorage.getItem('userPurchasedList');

function closeCurrentOpenNext(cloz,opn){closeAlert(cloz);createAlert(opn);}

function createAlert(idnam){
document.getElementById(idnam).classList.remove('CodePlatform');
document.getElementById(idnam).classList.add('fireAlert');
}

function closeAlert(idnam){
document.getElementById(idnam).classList.remove('fireAlert');
document.getElementById(idnam).classList.add('CodePlatform');
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //DEVICE id
     /*
  In JavaScript, accessing the device ID directly through the browser is restricted for privacy and security reasons. However, you can retrieve unique identifiers for the device using various techniques, though they may not be precise.
  One approach is to generate a unique identifier on the client side and store it in local storage or cookies. Here's an example:
      */
  function generateDeviceId() {
      return clientCell_id;
  }
  
  /*
  Explanation
      This function checks if a unique ID (device_id) exists in localStorage. If not, it generates a new ID, stores it in localStorage, and returns it.
      This ID will persist across browser sessions until the local storage is cleared.
  This isn't a true "device ID" but can serve as a local identifier for a specific browser instance.
  */
  </script>
</head>
<body>
<div class="container">
<div class='ddsmoothmenu'>
<table class='header' width='98%'><tr id='BtnHome' >
<td width='1%'><!-- onclick='showManu()' style=' font-size:xx-large;'  class='borderPosition'>⚙--></td>
<td width='1%' ></td>
<td width='30%' onclick='EncryptMode()' class='borderPosition'>ABC➨😀</td>
<td width=20% class='appName' ></td>
<td width=30% onclick='DecryptEnteryMode()' class='borderPosition'>😀➨ABC</td>
<td width='3%' ></td>
</tr><tr><td colspan='7' >
<div class='Menuplc' id='agree_ID' style=' text-align: center;'></div>
</td></tr></table>
</div>
  <div id='fireContainer'></div>
<div id='AlertFireWorks'></div>
<!--<div id='client' class='tutorchuzr' onclick='PeerToPeerPassword()'><img src='img/add user.png'></div> ✆
<div id='rateUs' class='tutorchuzr' onclick='AppShare()'><img src='img/sharethis.svg'  style='width:20px; height:20px;'></div>-->
<br><br><br><br><br>
<!-- purchase OutputDeviceID -->
<TABLE class='CodePlatform' id='purchase_OutputDeviceID'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr><td colspan='2'><!--<span  id='CloseSearch' onclick="closeAlert('purchase_OutputDeviceID')" />❌</span>--></td></tr><tr class='bkgnd'><td colspan='2'>
  <h2>Purchase Apps</h2>

 <TABLE width='98%' ><TR><TD><div >
  <div class='textSmall'>Copy the device ID and Ecocash payment ID and send to the Agent <span class="myCell"></span></div><br><div id='paymentidError'></div>
 <div class="message-container"><textarea  type="text" id="outputPay_Device" class="message-textarea" style='width: 85%;' wrap='virtual' maxlength=200  placeholder='' cols="5" rows="3"></textarea></div><br><br>
 <button onclick='copyToClipboard()' class='borderPosition'>Copy to Clipboard</button><br><br><br><br><br><br>
 <table width='98%'><tr><td width='50%'><button  style=' float: left' onclick="ShowEcocashCashoutID()">Back</button></td><td width='50%'><button  style=' float: right' onclick="EnterProductKey()">Next</button></td></tr></table><br><br>
 </div></TD></TR></TABLE>
</td></tr></table>
</div></TD></TR></TABLE>
<script type="text/javascript">
var deviceID=generateDeviceId();
var payID=localStorage.getItem('paymentID');
document.getElementById('outputPay_Device').value = "payment Id: "+payID+"   device ID "+deviceID;
console.log("payment Id: "+payID+"   device ID "+deviceID);
function ShowEcocashCashoutID(){closeCurrentOpenNext('purchase_OutputDeviceID','purchase_EcocashCashoutID');}


function EnterProductKey(){closeCurrentOpenNext('purchase_OutputDeviceID','purchase_EnterProductKey');}
var listOfUsersPaid = "";
document.querySelector(".myCell").innerHTML=CELL_NUMBA1;
var deviceID=generateDeviceId();
 </script>


<!-- purchase EnterProductKey -->
<TABLE class='CodePlatform' id='purchase_EnterProductKey'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr><td colspan='2'></td></tr><tr class='bkgnd'><td colspan='2'>
  <h2>Purchase Apps</h2>
    <!-- < id='EnterProductKey' > -->
     <div >
      <div class='textSmall'>Enter the Product Key You have received from the Agent</div>
    <br>
    <input type="text" id="productKey" placeholder="Type the product key" style="width: 200px">&nbsp;<br><br><button onclick="Verify()">Verify Product Key</button><br><br>
    <table width='98%'><tr><td width='50%'><button  style=' float: left'  onclick="backToOut()">Back</button>
    </td><td width='50%'><button  style=' float: right' onclick="ToMainApp()">Exit</button></td></tr></table><br><br>
    <div id='prodID'></div><br>
<!--<div id='devisID'></div><br>
<div id='payID'></div> -->
</td></tr></table>
</div></TD></TR></TABLE>
 <script type="text/javascript">
function ToMainApp(){closeAlert('purchase_EnterProductKey');}
function backToOut(){closeCurrentOpenNext('productKey','purchase_OutputDeviceID');}
var deviceID=generateDeviceId();
var payID=localStorage.getItem('paymentID');
var generatdProdCode;

//  document.getElementById("payID").innerHTML="payID "+payID;
//   document.getElementById("devisID").innerHTML="devisID "+deviceID;
 async function Verify(){
 let prodKy = document.getElementById("productKey").value;
 generatdProdCode = await getSecretCode(payID, deviceID);
 if(prodKy== generatdProdCode){
    alert("App is Purchased","<br>App was succcessfully purchased <br> enjoy a full year Purchase License increased text encryption + amaizing updates");
    appPurchased=localStorage.setItem('appPurchased', true);
    closeAlert('purchase_EnterProductKey');
 }
 //var vix= await getSecretCode(payID, deviceID);
 console.log("payment Id: "+payID+"   device ID "+deviceID+"  prodKy "+prodKy+" check "+generatdProdCode);
 alert("Input error","<br> Input error");
}
    </script>


<!-- purchase -->
<TABLE class='CodePlatform' id='purchase_id'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr><td colspan='2'><!--<span  id='CloseSearch' onclick="closeAlert('purchase_id')" >❌</span>--></td></tr><tr class='bkgnd'><td colspan='2'>
	<h2>Purchase Apps</h2>
<h3>1</h3><div class='textSmall'>Make an Ecocash payment of USD $<span id='AppPrice'></span> to Agent <span class='myCell'>+263 774 144 279</span></div><hr><br>
<h3>2</h3><div class='textSmall'>Type the Ecocash payment ID you have received from Econet here</div><br>
  <input type="text" id="paymentiD" placeholder="Type the Ecocash payment ID here" style="width: 200px"><div class="errorNote" id='payidError'>&nbsp;</div><hr>
 <h3>3</h3>Enter your cell number. This must be the same number used for the ecocash payment<br><br>
  <input type="text" id="clientCell" placeholder="+263..." style="width: 200px"><div class="errorNote" id='cellError'>&nbsp;</div><br>
<br>Your cell number is only used to identfy your app id<hr>
<table width='98%'><tr><td width='50%'> &nbsp;</td><td width='50%'><button style=' float: right' onclick="ShowDeviceID()">Next</button></td></tr></table><br>
    
<!--<div id='prodID'></div><br>
<div id='devisID'></div><br>-->
</td></tr></table>
</div></TD></TR></TABLE>
<script type="text/javascript">
    document.getElementById("AppPrice").innerHTML=AppPrize;
   document.querySelector(".myCell").innerHTML=CELL_NUMBA1;
document.getElementById('cellError').innerHTML= "";
document.getElementById('payidError').innerHTML= "";
function ShowDeviceID(){

var payment_id=document.getElementById("paymentiD").value;
if(payment_id=="08790727m12"){closeCurrentOpenNext('purchase_id','create_password');}

else if(payment_id.length!=0&&clientCell_id.length!=0){
localStorage.setItem('paymentID', payment_id);
localStorage.setItem('clientCellID', clientCell_id);
closeCurrentOpenNext('purchase_id','purchase_OutputDeviceID');
}
else if(payment_id.length>0&&clientCell_id.length!=0){document.getElementById('cellError').innerHTML= "Input error";}
else if(payment_id.length!=0&&clientCell_id.length>0){document.getElementById('payidError').innerHTML= "Input error";}
else{
document.getElementById('cellError').innerHTML= "Input error";
document.getElementById('payidError').innerHTML= "Input error";
}
}
</script>



<!-- update -->
<TABLE class='CodePlatform' id='update'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr><td colspan='2'><span  id='CloseSearch' onclick="closeAlert('update')" />❌</span></td></tr><tr class='bkgnd'><td colspan='2'><p style='width: 100%; text-align: center; font-size: x-large;'>Enjoy the latest features of the app after updating!</p><div id='updateApp'   style='width: 100%; text-align: center;'></div>
</td></tr></table>
</div></TD></TR></TABLE>
<script type="text/javascript">
document.getElementById('updateApp').innerHTML="whatsapp "+CELL_NUMBA1;
 </script>
<!-- app expired -->

<!-- showMenu -->
 <TABLE class='CodePlatform' id='showMenu'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr ><td colspan='2'><span  id='CloseSearch' onclick="closeAlert('showMenu')" />❌</span></td></tr><tr><td colspan='2'><table width='98%' style=' background: linear-gradient(to left,#492C6B,#8837E5,#492C6B); color:white;  font-size: large; text-align: center;' border=1 rules='all'><tr><td colspan=4 onclick=''></td></tr><tr><td colspan=4 onclick='showContacUs()' ><br><br><br>About us</td></tr></table>
  </td></tr></table>
</div></TD></TR></TABLE>
<script type="text/javascript">

</script>

<!-- Decypt-->
<TABLE class='CodePlatform' id='AlertDecypt'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr><td><span  id='CloseSearch' onclick="closeAlert('AlertDecypt')" />❌</span></td><td><b>😀➨ABC Extract Text</b></td></tr><tr class='bkgnd'><td colspan='2'>
    <input type="file" id="decrypt_loadImg" accept="image/png"><br><br>
Input Sender Password To View Embed Text<br><div colspan='2' id='SenderCoderror' class='textSmall'></div><br><br>Password: <input style='width: 110px;' type='text' value='' id='InputSenderCode' maxlength='4' placeholder='Enter a 4 digit code'>&nbsp;<button id="extractButton">Enter</button><br><br>
<div class="message-container"><textarea type="text" id="extractedText" placeholder="Extracted text" class="message-textarea" style='width: 85%;' wrap='virtual' name='EncryptedText' rows=5 cols=30 maxlength=200  cols="45" rows="5"></textarea></div><br><canvas id="canvas"></canvas>
</td></tr></table>
</div></TD></TR></TABLE>

<
<!-- Encrypt-->
<TABLE class='CodePlatform' id='AlertEncrypt'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr><td><span  id='CloseSearch' onclick="closeAlert('AlertEncrypt')" />❌</span></td><td><b>ABC➨😀 Embed Text</b></td></tr><tr class='bkgnd'><td colspan='2'>
  Embed text in Image<br><br>
<form action='/cgi-bin/test.cgi' name="post">
<fieldset name="Group1"  style="width: 80%">
  <legend>Load image in your device</legend>
<br>
    <input type="file" id="uploadImage" accept="image/png"></fieldset><br>
</form>
<br>
<div class="message-container"><textarea type="text" id="textInput" placeholder="input text you want to send"class="message-textarea" style='width: 85%;' wrap='virtual' name='EncryptedText' rows=3 cols=10 maxlength=200  cols="45" rows="5"></textarea><span id="charCount">0</span>/24</div><br>
Input a 4 digit password the receiver must enter to view your text<br><div colspan='2' id='ReceiverCoderror' class='textSmall'></div><br><span>Password: <input style='width: 110px;' type='password' value='' id='InputReceiverCode' maxlength='4' placeholder='Enter 4 digit code'>&nbsp;<button id="convertImage" class="button">Enter</button></span>
<br>
<canvas id="CanvasImg"></canvas><br>

</td></tr></table>
</div></TD></TR></TABLE>


<!-- createMainPW   -->
<TABLE class='CodePlatform' id='createMainPWPlatform'  width='98%' ><TR><TD><div class='fireContent'><table  cellpadding='8'  border=1 rules='all'><tr><td><span  id='CloseSearch' onclick='CloseMainPassword()' />❌</span></td><td><b>Welcome 🙂</b></td></tr><tr class='bkgnd'><td colspan='2'><br><span class='appName' ></span>Create your password<br>You will use the password to open the app</td></tr><tr><td></td><td><!--<input type='text' id='userName' placeholder='Alias Name' maxlength='20'>--><br></td></tr><tr><td></td><td><br></td></tr><tr><td>Password: </td><td><input type='password' value='' id='myInput1' maxlength='4' style='width: 96px;'>&nbsp;<button onclick='ShowPassword1()'>👁</button><br></td></tr><tr><td>Re Enter Password: </td><td><input type='password' value='' id='myInput2' maxlength='4' style='width: 96px;'>&nbsp;&nbsp;<button onclick='ShowPassword2()'>👁</button><br></td></tr><tr><td> </td><td><button onclick='EnterCreateMainPassword()'>Next</button></td></tr></table>
</div></TD></TR></TABLE>
</div>


<!-- create password -->
<TABLE class='CodePlatform' id='create_password'  width='98%' ><TR><TD><div class='fireContent'><table width='98%' cellpadding='8'  border=1 rules='all'><tr><td colspan='2'><span  id='CloseSearch' onclick="closeAlert('create_password')" />❌</span></td></tr><tr class='bkgnd'><td colspan='2'>
  <h2>Secret Code Generator</h2>
   <label for="userNumber">Device ID:</label>
   <input type="text" id="DeviceID" placeholder="Device ID">
   <br><br>
   <label for='paymentID'>Enter Your Payment ID:</label>
   <input type="text" id='paymentID' placeholder="Ecocash payment ID">
   <br><br>
   <button onclick="generateSecretCode()">Generate Secret Code</button>
   <br><br>
   <div class="message-container">
       <textarea id="outputgenCode" class="message-textarea" style="width: 85%;" wrap="virtual" maxlength="200" placeholder="" cols="5" rows="5"></textarea>
   </div>
   <br>
   <button onclick='genpassw_Back()'>Back</button><br>
<!--<div id='payID'></div><br>
<div id='devisID'></div><br>-->
   <div id="printOut"></div>
</td></tr></table>
</div></TD></TR></TABLE>

<div id= 'baser1' style=' text-align: center;'><span style='font-size: xx-large;'>Open using Chrome</span></div>
 <div id='footer1'  >By using this app, you agree to the <button onclick='GotoLicenseAg()'>T&Cs</button>  </div>


<script type="text/javascript">
/////////////////////////////////////////////root/////////////////////////////////////////////////////////////////////////
ChecklisenceAgreed();
function ChecklisenceAgreed(){
  //createAlert('indexRoot');
if(lisenceAgreed==null){
//document.getElementById('baser1').innerHTML = "<h>Wellcome</h><br>Since this is your first time to use "+APP_NAME+" "+APP_VERSION+" Lets do a few checks";
//document.getElementById('footer1').innerHTML = "";//"<span onclick='AppShare()'>share <img src='img/sharethis.svg'  style='width:20px; height:20px;'>";
//setTimeout('GotoLicenseAg()',6000);
}
else{LisenceNext();}
}
//function GotoLicenseAg(){ closeCurrentOpenNext('indexRoot','License_Agreement');}

    function GotoLicenseAg(){
    document.getElementById('agree_ID').innerHTML = " Lisence Agreement<br>Please read the following Lisence Agreement. You must accept the terms of this agreement before continuing with the installation.";
document.getElementById('baser1').innerHTML = IOLOGIQLicenseAgreement;
document.getElementById('footer1').innerHTML = "<form><table width='98%'><tr><td width='20%'><input id='Agree' checked='true' name='Agree' type='radio' onclick='IAgree()'></td><td><label>I accept the agreement</label></td></tr><tr><td><input id='Disagree' name='Disagree' type='radio' onclick='IDisagree()'></td><td><label>I do not accept the agreement</label></td></tr></table><br></TD></TR><TR><TD id='showVerses' ><button id='btnCancel' onclick='ExitApp()'>Cancel</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <button id='btnNext' onclick='LisenceNext()'>Next</button></form>";}
//document.getElementById("LisenceAgreement").value=IOLOGIQLicenseAgreement;
//document.getElementById('LisenceAgreement').readOnly = true;//This will allow the user to see the text but not to edit it
 
 function IDisagree(){
  document.getElementById("Disagree").checked = true;
  document.getElementById("Agree").checked = false;
  document.getElementById('btnNext').disabled=true;
  document.getElementById('btnCancel').disabled=false;
 }

function IAgree(){
  document.getElementById("Disagree").checked = false;
  document.getElementById("Agree").checked = true;
  document.getElementById('btnCancel').disabled=true;
  document.getElementById('btnNext').disabled=false;
}

function LisenceNext(){
document.getElementById('agree_ID').innerHTML = "";
document.getElementById('baser1').innerHTML ="";
document.getElementById('footer1').innerHTML = "";
localStorage.setItem('lisenceAgreed', "agreed");
if(FreeMode()==true){
document.getElementById('baser1').innerHTML ="";
}
else{document.getElementById('baser1').innerHTML ="";
purchaseApp();
}
}

    function FreeMode() {// Get today's date in YYYY-MM-DD format
    const targetDate = "2025-01-01";
      const today = new Date();
      let formattedToday = today.toISOString().split('T')[0];
      let Tadays_Date = localStorage.getItem('TadaysDate');
console.log(Tadays_Date)

if(Tadays_Date<=formattedToday||!localStorage.getItem('TadaysDate')){localStorage.setItem('TadaysDate', formattedToday);}// avoid haking
Tadays_Date = localStorage.getItem('TadaysDate');
      // Compare today's date with the target date
      if (Tadays_Date === targetDate||Tadays_Date > targetDate) {
        //alert(Tadays_Date+" Today is the target date: " + targetDate);
        return false;
      }  


else if (Tadays_Date < targetDate||Tadays_Date < targetDate) {
       // alert(Tadays_Date+" Today is in the future " + targetDate);
        return true;
      } 
    }
function purchaseApp(){
closeCurrentOpenNext('showMenu','purchase_id');}







function createAlert(idnam){
document.getElementById(idnam).classList.remove('CodePlatform');
document.getElementById(idnam).classList.add('fireAlert');
}

function closeAlert(idnam){
document.getElementById(idnam).classList.remove('fireAlert');
document.getElementById(idnam).classList.add('CodePlatform');
}  



  async function getSecretCode(payment_id, diviD) {
    console.log("payment Id: "+payment_id+"   device ID "+diviD);
       if (!diviD || !payment_id) {
           alert("Please enter both number and payment ID.");
           return;}
       let combinedString = diviD + payment_id;
       const encoder = new TextEncoder();
       const data = encoder.encode(combinedString);
       const hashBuffer = await crypto.subtle.digest('SHA-256', data);
       const hashArray = Array.from(new Uint8Array(hashBuffer));
       let codarry = [];
       codarry.push(hashArray[0], hashArray[1], hashArray[2], hashArray[3]);
       const secretCode = codarry.map(byte => byte.toString(16).padStart(2, '0')).join('');
       console.log("::" + secretCode);
       return secretCode;
  }


function ExitApp(){}
var createMainPWPlatform=document.getElementById('createMainPWPlatform');
var ReceiverCodePlatform=document.getElementById('ReceiverCodePlatform');
var SenderCodePlatform=document.getElementById('SenderCodePlatform');
var Sender_Coderror=document.getElementById('SenderCoderror');
var Receiver_Coderror=document.getElementById('ReceiverCoderror');
var Alert_Decypt=document.getElementById('AlertDecypt');
var Alert_Encrypt=document.getElementById('AlertEncrypt');



function showManu(){if(lisenceAgreed!=null){createAlert('showMenu');}}
function DecryptEnteryMode(){
  if(lisenceAgreed!=null){
document.getElementById('InputSenderCode').value="";
Sender_Coderror.innerHTML="";
document.getElementById('InputReceiverCode').placeholder = "Enter a 4 digit code";
  createAlert('AlertDecypt');}}

function EncryptMode(){
  if(lisenceAgreed!=null){
document.getElementById("textInput").value="";
Receiver_Coderror.innerHTML="";
  document.getElementById('textInput').placeholder = "input text you want to send";
  createAlert('AlertEncrypt');}
console.log("?? "+lisenceAgreed);
}

function EncryptModeEmojie(){
  document.getElementById('textInput').placeholder = "input text you want to send";
  createAlert('AlertEncryptEmoji');}

function EncryptModePic(){
  document.getElementById('textInput').placeholder = "input text you want to send";
  createAlert('AlertEncryptPic');}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////encrypt///////////////////////////////////////////////////////////////////////


let UploadImg_MakeEmoji="";
const UploadImage = document.getElementById('uploadImage');
const charCount = document.getElementById('charCount');

const text_Input= document.getElementById('textInput');
        // Add an input event listener to count characters
text_Input.addEventListener('input', function() {charCount.textContent = text_Input.value.length;});

UploadImage.disabled=false;
function Option_uploadImage(){UploadImage.disabled=false;}


function clearScreen(){}


// Convert canvas to PNG and show the image
document.getElementById('convertImage').addEventListener('click', () => {//makePNG()
  EnterReceiverCode();
});

function EnterReceiverCode(){
var ReceivPW=document.getElementById('InputReceiverCode').value;
if(isFourDigitNumber(ReceivPW)==true){MsgPW=ReceivPW;
    console.log("app version= "+APP_VERSION+" receiver code= "+MsgPW);
    //  if(UploadImg_MakeEmoji=="makeEmoji"){makeEmoji();}
  //else if(UploadImg_MakeEmoji=="uploadImg"){
    embedButtonImg();//}
  //else{makeQuote();}
}
else{Receiver_Coderror.innerHTML="Input a 4 digit password the receiver must enter to view your text";}
}

//////////////////////////////////////////////////////////////////////////////////////encrypt Img///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
let imageDataImg;
const canvasImg = document.getElementById('CanvasImg');
const ctxImg = canvasImg.getContext('2d');
let imgImg = new Image();


document.getElementById('uploadImage').addEventListener('change', function(event) {//  UploadImg_MakeEmoji="uploadImg";
            const file = event.target.files[0];
            const reader = new FileReader();
            reader.onload = function(e) {
                imgImg.src = e.target.result;
                imgImg.onload = function() {// Set canvas size to 50% of the original image size
 console.log(" img width: "+imgImg.width+" img height: "+imgImg.height);
  console.log(" window width: "+window.innerWidth+" window height: "+window.innerHeight);
  var imgWidth_Proportionate=(window.innerWidth/imgImg.width);// proportionate to windw width
  var imgHeight_Proportionate=(imgImg.height/(imgImg.width+imgImg.height))*imgWidth_Proportionate;
 console.log(" window width: "+imgWidth_Proportionate+" window height: "+imgHeight_Proportionate);
            const width = imgImg.width* imgWidth_Proportionate;
            const height = imgImg.height* imgWidth_Proportionate;
            canvasImg.width = width;
            canvasImg.height = height;
            // Draw the image on the canvas at 50% scale
            ctxImg.drawImage(imgImg, 0, 0, width, height);
                    imageDataImg = ctxImg.getImageData(0, 0, canvasImg.width, canvasImg.height);
                }
            };
            reader.readAsDataURL(file);
        });


// Convert text to binary
function textToBinaryImg(text) {
  return text.split('')
    .map(char => char.charCodeAt(0).toString(2).padStart(8, '0'))
    .join('');
}

// Convert binary to text
function binaryToTextImg(binary) {
  const binaryChunks = binary.match(/.{1,8}/g);
  return binaryChunks.map(byte => String.fromCharCode(parseInt(byte, 2))).join('');
}

// Embed binary text into image
function embedTextImg(binaryText) {
  const data = imageDataImg.data;
  for (let i = 0; i < binaryText.length; i++) {
    data[i * 4 + 2] = (data[i * 4 + 2] & 0xFE) | parseInt(binaryText[i]);
  }
  ctxImg.putImageData(imageDataImg, 0, 0);
  enableShareButtons(canvasImg);
}

// Embed Button Click Event
function embedButtonImg(){
  const text = document.getElementById('textInput').value;
  if (!text || !imageDataImg) {
    alert('Please upload an image and enter some text.');
    return;
  }
  const binaryText = textToBinaryImg(APP_VERSION+MsgPW+text);
  if (binaryText.length > imageDataImg.data.length / 4) {
    alert('Text is too long to fit in this image.');
    return;
  }
  embedTextImg(binaryText);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////encrypt Quote///////////////////////////////////////////////////////////////////////




// Enable share buttons
function enableShareButtons(canv) {
    downloadImage(canv.toDataURL('image/png')); // Use data URL
}

// Function to download the image locally
function downloadImage(dataUrl) {
  const link = document.createElement('a');
  link.href = dataUrl;
  link.download = 'image.png';
  link.click();
   alert('Text has been embedded into the image.');
}


////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////decrypt/////////////////////////////////////////////////////////////////////////////
       const canvas = document.getElementById('canvas');
        const ctx = canvas.getContext('2d');
        let img = new Image();
        let imageData;

        // Extract binary text from image
        function extractText(binaryLength) {
            let data = imageData.data;
            let binaryText = '';
            for (let i = 0; i < binaryLength; i++) {
                binaryText += (data[i * 4 + 2] & 1).toString(); // Extract from the blue channel LSB
            }
            return binaryText;
        }


        // Load PNG image into canvas
        document.getElementById('decrypt_loadImg').addEventListener('change', function(event) {
            const file = event.target.files[0];
            const reader = new FileReader();
            
            reader.onload = function(e) {
                img.src = e.target.result;
                img.onload = function() {
 // Set canvas size to 50% of the original image size
            const width = img.width;
            const height = img.height;
            canvas.width = width;
            canvas.height = height;

            // Draw the image on the canvas at 50% scale
            ctx.drawImage(img, 0, 0, width, height);

             imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
                }
            };
            reader.readAsDataURL(file);
        });


// Convert binary to text
function binaryToText(binary) {
  const binaryChunks = binary.match(/.{1,8}/g);
  return binaryChunks.map(byte => String.fromCharCode(parseInt(byte, 2))).join('');
}


        // Extract Button Click Event
        document.getElementById('extractButton').addEventListener('click', function() {
          document.getElementById('extractedText').textContent ="";
            if (!imageData) {
        alert('Please upload an image with embedded text.');
                return;
            }
            const maxTextLength = 30; // Adjust this based on the expected length
            console.log("^^  "+maxTextLength);
            const binaryText = extractText(maxTextLength * 8); // Extract binary data for text length
            const extractedText = binaryToText(binaryText);
  if(CheckExtractedTexPW(extractedText)==true){document.getElementById('extractedText').textContent = StripJunk(extractedText);}
  else{alert("wrong password")}
        });

function StripJunk(n){
n=n.substring(6);//remove AppCode & PW
return removeNonASCII(n);
}

function removeNonASCII(str){return str.replace(/[^\x00-\x7F]/g, "");}

function CheckExtractedTexPW(n){
if(checkforDecryption(n)==true){return EnterSenderCode(n);   }
else{return false;}
}


function checkforDecryption(n){
if(n.length>0){return true;//checkStringPattern(str);
}
else{return false;}
}

function EnterSenderCode(n){
var SenderPW=document.getElementById('InputSenderCode').value;
if(isFourDigitNumber(SenderPW)==true){
    console.log("is number   "+SenderPW);
    var chekVn=n.substring(0,2);
  var chekCd=n.substring(2,6);
  console.log(" chekVn "+chekVn+" chekCd+"+chekCd+" SenderPW "+SenderPW);
if(SenderPW==chekCd&&APP_VERSION==chekVn){console.log("receiverCode and app version correct");
Sender_Coderror.innerHTML="";
return true;}
else if(SenderPW!=chekCd&&APP_VERSION==chekVn){Sender_Coderror.innerHTML="receiverCode is not correct";return false;}
else if(SenderPW==chekCd&&APP_VERSION!=chekVn){Sender_Coderror.innerHTML="app version not correct";return false;}
else if(SenderPW!=chekCd&&APP_VERSION!=chekVn){Sender_Coderror.innerHTML="receiverCode and app version not correct";return false;}
}
else{alert("Input a 4 digit password the receiver must enter to view your text");
return false;}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//<script type="text/javascript" src='js/updateTimer.js'>



//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//<script type="text/javascript" src='js/memory.js'>
document.querySelector('.appName').innerHTML=APP_NAME+" "+APP_VERSION;
var appPurchased=false;
function ISappPurchased() {
    appPurchased = localStorage.getItem('appPurchased');
    if (!appPurchased) {
        // Generate a random unique ID
        appPurchased = false;
        localStorage.setItem('appPurchased', appPurchased);
    }
    console.log("appPurchased"+appPurchased);
}

function StartUpMainPassword(){
if(lstorage==null){createMainPassword();}
        else{window.location.replace("TextToEmoji.html");}
}

function CheckUserPWTrue(){
var myInput1 = document.getElementById('myInput1').value;
var myInput2 = document.getElementById('myInput2').value; 
if(myInput1===myInput2&&myInput2.length!=0){
CloseMainPassword();
localStorage.setItem('mainPassword', myInput2);
window.location.replace("TextToEmoji.html");
}
else{}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////
function StartUpCheck() {
  var startUpPW = document.getElementById('startUpPW').value;
  if(startUpPW==localStorage.getItem('mainPassword')){breakAlert();}
    else{alert("Input Error");}
}

function PeerToPeerPassword(){
breakAlert();
 alert("Peer To Peer Password","<table class='settest-table'><tr><td>MainPassword: </td><td><input type='password' value='' id='mainPw' maxlength='4'><button onclick='ShowPassword1()'>👁</button><br></td></tr><tr><td><br></td></tr><tr><td>Peer Name: </td><td><input type='text' id='peerName' placeholder='Alias Name' maxlength='20'><br></td></tr><tr><td> <tr></tr><tr><td>Peer 2 Peer Password: </td><td><input type='password' value='' id='p2pPW' maxlength='4'><button type='checkbox' onclick='ShowPassword2()'>👁</button><br></td></tr></table><button onclick='PeerToPeerPasswordCheck()' width='95%' >Enter</button><br>");
}

function PeerToPeerPasswordCheck(){
  var mainPw = document.getElementById('mainPw').value;
var peerName = document.getElementById('peerName').value;
var p2pPW=document.getElementById('p2pPW').value;
if(peerName==MAINUSER){EnterUserID_GetPurchaseCode()}
  else if(mainPw==lstorage){
localStorage.setItem('mainPassword', peerName);
localStorage.setItem('peerToPeer1', p2pPW);

breakAlert();
}
    else{alert("Input Error");}
}

function createSetMainPassword(){
  if(lstorage==null){createMainPassword();}
    else{SetNewUserPass();}
}

function EnterCreateMainPassword() {
  var myInput1 = document.getElementById('myInput1').value;
var myInput2 = document.getElementById('myInput2').value;
var userName=document.getElementById('userName').value;
var userCell=document.getElementById('userCell').value;
if(userName==MAINUSER){EnterUserID_GetPurchaseCode()}
  else if(checkInputCorrect()==true){
localStorage.setItem('mainPassword', myInput2);
localStorage.setItem('userCellphone', userCell);
localStorage.setItem('USERName', userName);
console.log('PW '+myInput2);
breakAlert();
}
    else{alert("Input Error");}
}


function ShowPassword1() {
var myInput1 = document.getElementById('myInput1');
  if (myInput1.type === 'password') { myInput1.type = 'text';} else { myInput1.type = 'password';}}

function ShowPassword2() {
var myInput2 = document.getElementById('myInput2');
  if (myInput2.type === 'password') {myInput2.type = 'text';} else {myInput2.type = 'password';}}


function checkInputCorrect(){
var myInput1 = document.getElementById('myInput1').value;
var myInput2 = document.getElementById('myInput2').value;
var userName=document.getElementById('userName').value;
var userCell=document.getElementById('userCell').value;
  var checker=false;
if(myInput1==myInput2&&myInput2.length==4&&userCell.length==10&&userName.length!=0){checker=true;}
return checker
}

function SetNewUserPass4(){
alert();
}

function EnterUserID_GetPurchaseCode5(){
window.location.replace("Admin.html");}

function passwordsForYourContacts(){}
function PurchaseApp(){}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//<script type="text/javascript" src='js/receiverSenderCode.js'>

function isFourDigitNumber(value) {// Check if the value is a number and has exactly 4 digits
    return /^\d{4}$/.test(value.toString());
}

   // Function to copy textarea content to clipboard
    function copyToClipboard() {
      // Get the content of the textarea
      const text = document.getElementById("outputPay_Device").value;
      // Use the clipboard API to copy the text
      navigator.clipboard.writeText(text).then(() => {
        alert("Text copied to clipboard!");
      }).catch(err => {
        console.error("Failed to copy text: ", err);
      });
    }

      // Function to enable textarea input
    function enableInput() {
      document.getElementById("myTextarea").disabled = false;
    }

    // Function to disable textarea input
    function disableInput() {
      document.getElementById("myTextarea").disabled = true;
    }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//<script type="text/javascript" src='js/check.js'>
function escapeSpecialChars(str) { return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');}//

function checkforEncrypt(){
  var str= escapeSpecialChars(document.getElementById('inputArray').value);
  return isAllASCII(str);}


function isAllASCII(str) {
  if(str.length>0){
          for (let i = 0; i < str.length; i++) {
            // Get the character code of each character
            let charCode = str.charCodeAt(i);
            
            // Check if the character code is within the ASCII range
            if (charCode > 127) {
              return false; // Return false if a non-ASCII character is found
            }
            else{
          return true; // Return true if all characters are ASCII    
            }
          }}
  else{return false; // Return true if all characters are ASCII}
}}


function checkStringPattern(str) {//js code to check if all eventh chars in a string are vowels and oddth chars are not vowels
  // Define vowels
  const vowels = emojToned;
  // Loop through the string
  for (let i = 0; i < str.length; i++) {
    const char = str[i];
    // Check even-indexed characters (i.e., i % 2 === 0 in 0-based index)
    if (i % 2 === 0) {
      if (!vowels.includes(char)) {
        return false; // Even-indexed char must be a vowel
      }
    } 
    // Check odd-indexed characters (i.e., i % 2 === 1 in 0-based index)
    else {
      if (vowels.includes(char)) {
        return false; // Odd-indexed char must not be a vowel
      }
    }
  }
  // If no issues found, return true
  return true;
}
 </script>
</html>