<html><head><base href="/"><title>WaffleAuth Documentation</title><style>
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    background: #f5f5f5;
    font-size: 16px;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    color: #2c3e50;
    margin-top: 2em;
    margin-bottom: 1em;
}

.code-block {
    background: #f6f8fa;
    color: #24292e;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #3498db;
    font-family: 'Consolas', monospace;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.4;
}

/* Syntax highlighting */
.keyword { color: #d73a49; }
.string { color: #032f62; }
.comment { color: #6a737d; }
.type { color: #6f42c1; }
.function { color: #005cc5; }
.number { color: #005cc5; }
.boolean { color: #d73a49; }

.method {
    margin: 30px 0;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.parameter {
    margin: 15px 0;
    padding-left: 20px;
}

.note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 25px 0;
    border-radius: 4px;
}

.step {
    background: #e7f5ff;
    border-left: 4px solid #339af0;
    padding: 20px;
    margin: 25px 0;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

th, td {
    padding: 15px;
    text-align: left;
    border: 1px solid #e1e4e8;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

td {
    background: white;
}

code {
    font-family: 'Consolas', monospace;
    background: #f6f8fa;
    padding: 2px 5px;
    border-radius: 3px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #ffffff;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    transition: background 0.2s ease;
    max-width: 320px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.download-btn:hover {
    background: #f8f9fa;
}

.download-icon {
    width: 24px;
    height: 24px;
    background: #5865f2;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.download-text {
    display: flex;
    flex-direction: column;
}

.download-filename {
    font-size: 16px;
    margin-bottom: 4px;
    color: #2c3e50;
}

.download-size {
    font-size: 12px;
    color: #6c757d;
}

/* Dark mode styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e1e1e1;
}

body.dark-mode .container {
    background: #2d2d2d;
}

body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3 {
    color: #ffffff;
}

body.dark-mode .code-block {
    background: #363636;
    color: #e1e1e1;
    border-left-color: #0066cc;
}

/* Dark mode syntax highlighting */
body.dark-mode .keyword { color: #ff7b72; }
body.dark-mode .string { color: #a5d6ff; }
body.dark-mode .comment { color: #8b949e; }
body.dark-mode .type { color: #d2a8ff; }
body.dark-mode .function { color: #79c0ff; }
body.dark-mode .number { color: #79c0ff; }
body.dark-mode .boolean { color: #ff7b72; }

body.dark-mode .method {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .note {
    background: #2d2d2d;
    border-left-color: #ffc107;
    color: #e1e1e1;
}

body.dark-mode .step {
    background: #2d2d2d;
    border-left-color: #339af0;
    color: #e1e1e1;
}

body.dark-mode table th {
    background: #363636;
    color: #ffffff;
    border-color: #404040;
}

body.dark-mode table td {
    background: #2d2d2d;
    border-color: #404040;
    color: #e1e1e1;
}

body.dark-mode code {
    background: #363636;
    color: #e1e1e1;
}

body.dark-mode .download-btn {
    background: #2d2d2d;
    border-color: #404040;
    color: #e1e1e1;
}

body.dark-mode .download-btn:hover {
    background: #363636;
}

body.dark-mode .download-filename {
    color: #e1e1e1;
}

body.dark-mode .download-size {
    color: #999;
}

body.dark-mode .theme-toggle {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .theme-toggle svg {
    fill: #ffffff;
}

body.dark-mode a {
    color: #58a6ff;
}

body.dark-mode ::-webkit-scrollbar {
    background-color: #1a1a1a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background-color: #404040;
}

body.dark-mode ::-webkit-scrollbar-track {
    background-color: #2d2d2d;
}

body.dark-mode ul,
body.dark-mode ol {
    color: #e1e1e1;
}

body.dark-mode strong {
    color: #ffffff;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 2px solid #e1e4e8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.font-controls {
    display: none;
}

.font-btn {
    display: none;
}
</style></head><body>
<div class="container">
    <h1>WaffleAuth Documentation</h1>
    
    <h2>Getting Started</h2>
    <p>WaffleAuth is a license authentication system that provides functionality for generating and validating license keys.</p>

    <a href="https://auth.waffledev.com/WaffleAuth.dll" class="download-btn" download>
        <div class="download-text">
            <span class="download-filename">WaffleAuth.dll</span>
            <span class="download-size">Library File</span>
        </div>
        <div class="download-icon">
            <svg viewBox="0 0 24 24">
                <path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>
            </svg>
        </div>
    </a>
    
    <a href="https://auth.waffledev.com/WaffleHWID.exe" class="download-btn" download>
        <div class="download-text">
            <span class="download-filename">WaffleHWID.exe</span>
            <span class="download-size">HWID Generator</span>
        </div>
        <div class="download-icon">
            <svg viewBox="0 0 24 24">
                <path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>
            </svg>
        </div>
    </a>

    <div class="note">
        <strong>Important:</strong> Before using WaffleAuth, you need to configure your own Firebase/Firestore credentials and endpoints.
    </div>

    <h2>Initial Setup</h2>
    <p>Initialize WaffleAuth with the following configuration methods:</p>
    
    <div class="method">
        <h3>Required Configuration Methods</h3>
        <div class="code-block"><span class="type">WaffleAuthFuncs</span>.<span class="function">SetURL</span>(<span class="string">&quot;YOUR_FIRESTORE_URL&quot;</span>);
<span class="type">WaffleAuthFuncs</span>.<span class="function">SetAPIKey</span>(<span class="string">&quot;YOUR_API_KEY&quot;</span>);
<span class="type">WaffleAuthFuncs</span>.<span class="function">SetEndPoint</span>(<span class="string">&quot;YOUR_ENDPOINT_URL&quot;</span>);
<span class="type">WaffleAuthFuncs</span>.<span class="function">SetDuration</span>(<span class="number">1</span>);
<span class="type">WaffleAuthFuncs</span>.<span class="function">SetInitials</span>(<span class="string">&quot;LA&quot;</span>);
<span class="type">WaffleAuthFuncs</span>.<span class="function">MessageBoxes</span>(<span class="boolean">true</span>);</div>
    </div>

    <table>
        <tr>
            <th>Method</th>
            <th>Description</th>
            <th>Parameter Type</th>
        </tr>
        <tr>
            <td><code>SetURL()</code></td>
            <td>Sets the Firestore database URL</td>
            <td>string</td>
        </tr>
        <tr>
            <td><code>SetAPIKey()</code></td>
            <td>Sets the API key for authentication</td>
            <td>string</td>
        </tr>
        <tr>
            <td><code>SetEndPoint()</code></td>
            <td>Sets the endpoint URL for queries</td>
            <td>string</td>
        </tr>
        <tr>
            <td><code>SetDuration()</code></td>
            <td>Sets the duration value in hours</td>
            <td>int</td>
        </tr>
        <tr>
            <td><code>SetInitials()</code></td>
            <td>Sets the initials for key generation</td>
            <td>string</td>
        </tr>
        <tr>
            <td><code>MessageBoxes()</code></td>
            <td>Enables/disables message boxes</td>
            <td>bool</td>
        </tr>
        <tr>
            <td><code>Initialize()</code></td>
            <td>Loads saved keys and validates them</td>
            <td>bool</td>
        </tr>
    </table>

    <div class="method">
        <h3>Initialize and Load Saved Keys</h3>
        <p>After setting up the configuration, initialize WaffleAuth to load and validate any saved keys:</p>
        <div class="code-block"><span class="type">bool</span> isValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">Initialize</span>();

<span class="keyword">if</span> (isValid)
{
    <span class="comment">// Load main application window</span>
    <span class="comment">// Start program features</span>
    <span class="comment">// Navigate to main menu</span>
}
<span class="keyword">else</span>
{
    <span class="keyword">return</span>;
}</div>

        <div class="parameter">
            <p>Returns:</p>
            <ul>
                <li><code>bool</code>: True if saved keys are valid, false otherwise</li>
            </ul>
        </div>
    </div>

    <h2>Firebase Configuration</h2>
    <div class="step">
        <h3>Step 1: Create Firebase Project</h3>
        <p>1. Go to the Firebase Console and create a new project</p>
        <p>2. In the project settings, create a new Web App to get your API key and project configuration</p>
        <p>3. Enable Firestore Database from the Firebase Console</p>
    </div>

    <div class="step">
        <h3>Step 2: Get Required URLs and Keys</h3>
        <p>After creating your Firebase project and enabling Firestore, you&apos;ll need:</p>
        <ul>
            <li>Firestore URL Format: <code>https://firestore.googleapis.com/v1/projects/YOUR_PROJECT_ID/databases/(default)/documents/licenses</code></li>
            <li>Web API Key: Found in your Firebase project settings under the Web App configuration</li>
            <li>Endpoint URL Format: <code>https://firestore.googleapis.com/v1/projects/YOUR_PROJECT_ID/databases/(default)/documents:runQuery?key=</code></li>
        </ul>
    </div>

    <h2>License Key Format &amp; Premium Keys</h2>

    <div class="method">
        <h3>Standard Key Format</h3>
        <p>Each license key in the Firestore database follows this structure:</p>
        <div class="code-block">{
    <span class="string">&quot;createdAt&quot;</span>: <span class="string">&quot;December 20, 2024 at 4:42:23 PM UTC+1&quot;</span>, <span class="comment">// timestamp</span>
    <span class="string">&quot;expiresAt&quot;</span>: <span class="string">&quot;December 20, 2024 at 5:42:23 PM UTC+1&quot;</span>, <span class="comment">// timestamp</span>
    <span class="string">&quot;hwid&quot;</span>: <span class="string">&quot;751466F8F0542C9A&quot;</span>,                 <span class="comment">// string</span>
    <span class="string">&quot;key&quot;</span>: <span class="string">&quot;LA-48a7ebadbda84b67&quot;</span>                <span class="comment">// string</span>
}</div>
    </div>

    <div class="step">
        <h3>Creating Premium Keys</h3>
        <p>To create premium keys with custom durations or properties:</p>
        <ol>
            <li>Have the user download and run WaffleHWID.exe to generate their HWID</li>
            <li>Get the HWID from the user that was generated by WaffleHWID.exe</li>
            <li>Go to your Firestore database console</li>
            <li>Manually add a new document to the &apos;licenses&apos; collection</li>
            <li>Set up the document with the format shown above</li>
            <li>Use the HWID provided by the user in the &apos;hwid&apos; field of the document</li>
        </ol>
    </div>

    <div class="note">
        <strong>Note:</strong> When creating premium keys, ensure you maintain the exact document structure. Premium keys require the user&apos;s HWID which can only be generated using WaffleHWID.exe to maintain security and prevent key sharing.
    </div>

    <h2>Key Functions</h2>

    <div class="method">
        <h3>Generate License Key</h3>
        <p>To generate a new license key:</p>
        <div class="code-block"><span class="type">string</span> generatedKey = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">GenerateKeyAsync</span>();</div>
    </div>

    <div class="method">
        <h3>Validate License Key</h3>
        <p>To check if a license key is valid:</p>
        <div class="code-block"><span class="type">bool</span> isKeyValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">CheckKey</span>(keyString);</div>
    </div>

    <div class="method">
        <h3>Generate Earning/Adlink Key</h3>
        <p>To generate a new license key with an associated earning URL (e.g., ad links):</p>
        <div class="code-block"><span class="type">string</span> generatedKey = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">GenerateEarningKeyAsync</span>(<span class="string">&quot;https://youtube.com&quot;</span>, <span class="number">1</span>);</div>
        <div class="parameter">
            <p>Parameters:</p>
            <ul>
                <li><code>url</code> (string): The URL that users need to visit to earn the key</li>
                <li><code>duration</code> (int): Required time in hours that the user must stay on the URL page to earn their key</li>
            </ul>
        </div>
    </div>

    <h2>Example Implementation</h2>
    <div class="code-block"><span class="keyword">using</span> WaffleAuth;

<span class="keyword">public partial class</span> <span class="type">Form1</span> : <span class="type">Form</span>
{
    <span class="keyword">public</span> <span class="function">Form1</span>()
    {
        <span class="comment">// Initialize WaffleAuth with your credentials</span>
        <span class="type">WaffleAuthFuncs</span>.<span class="function">SetURL</span>(<span class="string">&quot;YOUR_FIRESTORE_URL&quot;</span>);
        <span class="type">WaffleAuthFuncs</span>.<span class="function">SetAPIKey</span>(<span class="string">&quot;YOUR_API_KEY&quot;</span>);
        <span class="type">WaffleAuthFuncs</span>.<span class="function">SetEndPoint</span>(<span class="string">&quot;YOUR_ENDPOINT_URL&quot;</span>);
        <span class="type">WaffleAuthFuncs</span>.<span class="function">SetDuration</span>(<span class="number">1</span>);
        <span class="type">WaffleAuthFuncs</span>.<span class="function">SetInitials</span>(<span class="string">&quot;LA&quot;</span>);
        <span class="type">WaffleAuthFuncs</span>.<span class="function">MessageBoxes</span>(<span class="boolean">true</span>);
        <span class="type">bool</span> isValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">Initialize</span>();

        <span class="keyword">if</span> (!isValid)
        {
            <span class="type">Application</span>.<span class="function">Exit</span>();
        }
        <span class="function">InitializeComponent</span>();
    }

    <span class="keyword">private async void</span> <span class="function">GenerateKey_Click</span>(<span class="type">object</span> sender, <span class="type">EventArgs</span> e)
    {
        <span class="type">string</span> generatedKey = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">GenerateKeyAsync</span>();
        <span class="comment">// Display or use the generated key</span>
    }

    <span class="keyword">private async void</span> <span class="function">ValidateKey_Click</span>(<span class="type">object</span> sender, <span class="type">EventArgs</span> e)
    {
        <span class="type">bool</span> isKeyValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">CheckKey</span>(licenseKey);
        <span class="keyword">if</span> (!isKeyValid)
        {
            <span class="type">Application</span>.<span class="function">Exit</span>();
        }
    }

    <span class="keyword">private async void</span> <span class="function">GenerateEarningKey_Click</span>(<span class="type">object</span> sender, <span class="type">EventArgs</span> e)
    {
        <span class="type">string</span> earningKey = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">GenerateEarningKeyAsync</span>(<span class="string">&quot;https://youtube.com&quot;</span>, <span class="number">1</span>);
        <span class="comment">// Display or use the generated earning key</span>
    }
}</div>

    <div class="note">
        <h3>Security Note</h3>
        <p>Always keep your API keys and credentials secure and never expose them in client-side code or public repositories.</p>
    </div>
</div>

<button class="theme-toggle" aria-label="Toggle dark mode">
    <svg viewBox="0 0 24 24">
        <path d="M20 8.69V4h-4.69L12 0.69L8.69 4H4v4.69L0.69 12L4 15.31V20h4.69L12 23.31L15.31 20H20v-4.69L23.31 12L20 8.69zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6s6 2.69 6 6S15.31 18 12 18z"/>
    </svg>
</button>

<script>const themeToggle = document.querySelector('.theme-toggle');
const body = document.body;
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'dark') {}
themeToggle.addEventListener('click', () => {
  body.classList.toggle('dark-mode');
  localStorage.setItem('theme', body.classList.contains('dark-mode') ? 'dark' : 'light');
});</script>
</body></html>