File size: 7,516 Bytes
e4526f9
 
 
2be8380
e4526f9
 
 
2be8380
e4526f9
 
 
 
2be8380
 
 
 
 
 
 
 
 
e4526f9
5331e6f
 
 
 
 
 
 
2be8380
 
 
 
 
 
 
7d0fa43
 
 
 
 
6b6a2d7
5d959d0
 
6b6a2d7
5d959d0
2be8380
 
 
 
 
 
 
 
 
e4526f9
2be8380
 
 
e4526f9
2be8380
 
e4526f9
2be8380
 
e4526f9
2be8380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e4526f9
2be8380
 
 
 
 
 
e4526f9
 
2be8380
e4526f9
2be8380
 
 
 
e4526f9
2be8380
e4526f9
7d0fa43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2be8380
 
 
 
 
 
 
 
 
 
 
 
 
e4526f9
 
2be8380
 
e4526f9
 
 
 
2be8380
 
 
 
e4526f9
 
2be8380
 
e4526f9
 
2be8380
e4526f9
8e2a32f
e4526f9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>NyayaSetu — Indian Legal Research</title>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="/static/style.css">
</head>
<body>

<div class="app-layout">

  <!-- ── SIDEBAR ── -->
  <aside class="sidebar" id="sidebar">
    <div class="sidebar-brand">
      <div class="brand-mark"></div>
      <div class="brand-text">
        <span class="brand-name">NyayaSetu</span>
        <span class="brand-sub">Legal Research</span>
      </div>
      <button class="sidebar-toggle" onclick="toggleSidebar()" title="Toggle sidebar">
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
          <line x1="3" y1="6" x2="21" y2="6"></line>
          <line x1="3" y1="12" x2="21" y2="12"></line>
          <line x1="3" y1="18" x2="21" y2="18"></line>
        </svg>
      </button>
    </div>

    <button class="new-chat-btn" onclick="newChat()">
      <span class="new-chat-icon"></span>
      New Research Session
    </button>

    <button class="analytics-btn" onclick="showAnalytics()">
      <span class="analytics-icon">📊</span>
      System Analytics
    </button>

    <button class="analytics-btn" onclick="window.location.href='/court/ui'">
      <span class="analytics-icon">⚖️</span>
      Moot Court
    </button>

    <div class="sidebar-section-label">SESSIONS</div>
    <div id="sessions-list" class="sessions-list">
      <div class="sessions-empty">No sessions yet</div>
    </div>

    <div class="sidebar-footer">
      <div class="footer-disclaimer">
        <span class="disclaimer-icon"></span>
        <span>Not legal advice. Consult a qualified advocate.</span>
      </div>
      <div class="footer-meta">
        Supreme Court of India · 1950–2024<br>
        443,598 judgment chunks indexed
      </div>
    </div>
  </aside>

  <!-- ── MAIN ── -->
  <div class="main-wrapper">

    <!-- Top bar -->
    <header class="topbar">
      <div class="topbar-left">
        <span class="topbar-title" id="topbar-title">New Research Session</span>
      </div>
      <div class="topbar-right">
        <div class="status-pill" id="status-pill">
          <span class="status-dot"></span>
          <span id="status-text">Ready</span>
        </div>
      </div>
    </header>

    <!-- ── WELCOME SCREEN ── -->
    <div id="screen-welcome" class="screen screen-welcome active">
      <div class="welcome-inner">
        <div class="welcome-emblem"></div>
        <h1 class="welcome-heading">Ask Indian Law</h1>
        <p class="welcome-body">
          Search across 26,688 Supreme Court judgments.<br>
          Every answer is cited. Every source is traceable.
        </p>
        <div class="suggestion-grid">
          <button class="suggestion-pill" onclick="usesuggestion(this)">What are fundamental rights under the Constitution?</button>
          <button class="suggestion-pill" onclick="usesuggestion(this)">What is the right to privacy under Article 21?</button>
          <button class="suggestion-pill" onclick="usesuggestion(this)">How does the Supreme Court define bail in non-bailable offences?</button>
          <button class="suggestion-pill" onclick="usesuggestion(this)">What is the basic structure doctrine?</button>
          <button class="suggestion-pill" onclick="usesuggestion(this)">What does Article 15 prohibit?</button>
          <button class="suggestion-pill" onclick="usesuggestion(this)">How is freedom of speech limited under Article 19?</button>
        </div>
      </div>
    </div>

    <!-- ── CHAT SCREEN ── -->
    <div id="screen-chat" class="screen screen-chat">
      <div id="messages-container" class="messages-container">
        <div id="messages-list" class="messages-list"></div>
      </div>
    </div>

    <!-- ── ANALYTICS SCREEN ── -->
    <div id="screen-analytics" class="screen screen-analytics">
      <div class="analytics-inner">
        <div class="analytics-header">
          <h2>System Analytics</h2>
          <p>Live metrics from inference logs</p>
        </div>
        
        <div class="analytics-grid">
          <div class="stat-card">
            <div class="stat-value" id="stat-total"></div>
            <div class="stat-label">Total Queries</div>
          </div>
          <div class="stat-card">
            <div class="stat-value" id="stat-verified"></div>
            <div class="stat-label">Verified Rate</div>
          </div>
          <div class="stat-card">
            <div class="stat-value" id="stat-latency"></div>
            <div class="stat-label">Avg Latency</div>
          </div>
          <div class="stat-card">
            <div class="stat-value" id="stat-ood"></div>
            <div class="stat-label">Out-of-Domain Rate</div>
          </div>
          <div class="stat-card">
            <div class="stat-value" id="stat-sources"></div>
            <div class="stat-label">Avg Sources / Query</div>
          </div>
        </div>

        <div class="analytics-charts">
          <div class="chart-card">
            <h3>Stage Distribution</h3>
            <div id="chart-stages" class="chart-container"></div>
          </div>
          <div class="chart-card">
            <h3>Entity Types Extracted</h3>
            <div id="chart-entities" class="chart-container"></div>
          </div>
          <div class="chart-card">
            <h3>Recent Query Latencies (ms)</h3>
            <div id="chart-latency" class="chart-container"></div>
          </div>
        </div>

        <div class="analytics-footer">
          <button class="refresh-btn" onclick="loadAnalytics()">↻ Refresh</button>
          <span class="analytics-note">Data from current session logs. Resets on container restart.</span>
        </div>
      </div>
    </div>

    <!-- ── SOURCES PANEL ── -->
    <div id="sources-panel" class="sources-panel">
      <div class="sources-panel-header">
        <span class="sources-panel-title">Sources</span>
        <button class="sources-panel-close" onclick="closeSourcesPanel()"></button>
      </div>
      <div id="sources-panel-body" class="sources-panel-body"></div>
    </div>
    <div id="sources-overlay" class="sources-overlay" onclick="closeSourcesPanel()"></div>

    <!-- ── INPUT ── -->
    <div class="input-zone">
      <div class="input-box">
        <textarea
          id="query-input"
          class="query-textarea"
          placeholder="Ask a question about Indian law…"
          rows="1"
          maxlength="1000"
        ></textarea>
        <button id="send-btn" class="send-btn" onclick="submitQuery()">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
            <line x1="22" y1="2" x2="11" y2="13"></line>
            <polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
          </svg>
        </button>
      </div>
      <p class="input-disclaimer">NyayaSetu is not a substitute for professional legal advice.</p>
    </div>

  </div>
</div>

<script src="/static/app.js?v=2"></script>
</body>
</html>