-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsidepanel.html
More file actions
618 lines (573 loc) · 34.7 KB
/
Copy pathsidepanel.html
File metadata and controls
618 lines (573 loc) · 34.7 KB
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Influencer DM Manager</title>
<link rel="stylesheet" href="css/sidepanel.css" />
</head>
<body>
<!-- ═══ Header ═══ -->
<header class="header">
<div class="header-brand">
<img src="icons/icon48.png" alt="" class="header-icon" />
<div class="header-text">
<h1>Influencer DM Manager</h1>
<span class="header-version">v11.6.0</span>
</div>
</div>
</header>
<!-- ═══ Platform Selector ═══ -->
<div class="platform-selector">
<button class="platform-btn active" data-platform="instagram">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>
IG
</button>
<button class="platform-btn" data-platform="threads">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.59 12c.025 3.083.718 5.496 2.057 7.164 1.432 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.96-.065-1.187.408-2.26 1.33-3.02.88-.724 2.104-1.138 3.548-1.198 1.064-.045 2.05.033 2.96.192-.09-.534-.27-.98-.539-1.328-.39-.502-1.01-.773-1.845-.808-1.27-.054-2.243.329-2.728.565l-.838-1.785c.236-.112 1.447-.66 3.27-.6 1.336.044 2.388.488 3.128 1.32.67.754 1.065 1.792 1.174 3.084.476.2.912.44 1.3.726 1.093.806 1.882 1.985 2.283 3.41.275.975.29 2.656-.79 4.5-1.2 2.044-3.503 3.2-6.49 3.26zm-1.25-7.6c-1.06.045-2.17.32-2.66.7-.42.33-.57.72-.54 1.15.04.59.36 1.02.9 1.37.6.39 1.36.55 2.16.51 1.1-.06 1.94-.46 2.5-1.15.44-.55.73-1.28.86-2.17-.93-.2-1.97-.32-3.04-.37l-.18-.04z"/></svg>
Threads
</button>
<button class="platform-btn" data-platform="linkedin">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>
LinkedIn
</button>
<button class="platform-btn" data-platform="x">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
X
</button>
</div>
<!-- ═══ Mode Tabs ═══ -->
<nav class="mode-tabs">
<button class="mode-tab active" data-mode="outreach">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13"/><path d="M22 2l-7 20-4-9-9-4 20-7z"/></svg>
Send DMs
</button>
<button class="mode-tab" data-mode="keyword">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
Comment Scanner
</button>
</nav>
<!-- ╔══════════════════════════════════════════╗ -->
<!-- ║ WELCOME CARD (first-time users) ║ -->
<!-- ╚══════════════════════════════════════════╝ -->
<div id="welcomeCard" class="welcome-card" style="display:none">
<button id="btnDismissWelcome" class="welcome-dismiss" title="Dismiss">×</button>
<div class="welcome-header">
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="var(--primary)" stroke-width="1.5"><path d="M22 2L11 13"/><path d="M22 2l-7 20-4-9-9-4 20-7z"/></svg>
<h2>Welcome! Here's how to get started</h2>
</div>
<div class="welcome-steps">
<div class="welcome-step" id="welcomeStep1">
<div class="welcome-step-num">1</div>
<div class="welcome-step-content">
<strong>Create a message template</strong>
<span>Write the DM you want to send. Use {{username}} to personalize it.</span>
</div>
</div>
<div class="welcome-step" id="welcomeStep2">
<div class="welcome-step-num">2</div>
<div class="welcome-step-content">
<strong>Add your target handles</strong>
<span>Paste usernames in the Outreach tab, or import from CSV.</span>
</div>
</div>
<div class="welcome-step" id="welcomeStep3">
<div class="welcome-step-num">3</div>
<div class="welcome-step-content">
<strong>Start sending</strong>
<span>Click "Start Outreach" and the extension handles the rest.</span>
</div>
</div>
</div>
</div>
<!-- ╔══════════════════════════════════════════╗ -->
<!-- ║ MODE 1: SEND DMs ║ -->
<!-- ╚══════════════════════════════════════════╝ -->
<div id="modeOutreach" class="mode-panel active">
<!-- Sub-tabs -->
<nav class="sub-tabs">
<button class="sub-tab active" data-subtab="bo-templates">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
Templates
</button>
<button class="sub-tab" data-subtab="bo-outreach">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13"/><path d="M22 2l-7 20-4-9-9-4 20-7z"/></svg>
Outreach
</button>
<button class="sub-tab" data-subtab="bo-history">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
History
<span id="historyBadge" class="history-badge" style="display:none">0</span>
</button>
<button class="sub-tab" data-subtab="bo-waitlist">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><line x1="19" y1="8" x2="19" y2="14"/><line x1="22" y1="11" x2="16" y2="11"/></svg>
Waitlist
<span id="waitlistBadge" class="waitlist-badge" style="display:none">0</span>
</button>
<button class="sub-tab" data-subtab="bo-dashboard">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/></svg>
Stats
</button>
</nav>
<!-- ─── Sub-tab: Dashboard ─── -->
<section id="bo-dashboard" class="sub-panel">
<div class="card">
<div class="card-header"><h2>Dashboard</h2></div>
<div class="card-body">
<div id="dashboardEmptyState" class="empty-state-rich" style="display:none">
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="var(--text-muted)" stroke-width="1.2"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
<p class="empty-state-title">No stats yet</p>
<p class="empty-state-desc">Your outreach analytics will appear here after you send your first DM.</p>
</div>
<div id="dashboardContent">
<div class="stats-grid">
<div class="stat-card">
<div class="stat-value" id="statDMsToday">0</div>
<div class="stat-label">DMs Today</div>
</div>
<div class="stat-card">
<div class="stat-value" id="statDMsWeek">0</div>
<div class="stat-label">This Week</div>
</div>
<div class="stat-card">
<div class="stat-value" id="statSuccessRate">0%</div>
<div class="stat-label">Success Rate</div>
</div>
<div class="stat-card">
<div class="stat-value" id="statWaitlist">0</div>
<div class="stat-label">Waitlisted</div>
</div>
</div>
<div class="chart-section">
<h3 class="chart-title">7-Day Activity</h3>
<div id="activityChart" class="bar-chart"></div>
</div>
<div class="chart-section">
<h3 class="chart-title">Outcome Breakdown</h3>
<div id="outcomeChart" class="horizontal-bars"></div>
</div>
<div class="chart-section">
<h3 class="chart-title">Current Session Health</h3>
<div id="sessionHealthDisplay" class="health-display">
<span class="health-status good">No active session</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- ─── Sub-tab: Outreach ─── -->
<section id="bo-outreach" class="sub-panel">
<div class="card">
<div class="card-header">
<h2>Outreach</h2>
<span class="card-subtitle">Paste handles and send DMs</span>
</div>
<div class="card-body">
<!-- Inline step indicator for outreach flow -->
<div class="outreach-flow-steps">
<div class="flow-step active" data-flow="1">
<div class="flow-step-dot">1</div>
<span>Paste handles</span>
</div>
<div class="flow-step-line"></div>
<div class="flow-step" data-flow="2">
<div class="flow-step-dot">2</div>
<span>Choose template</span>
</div>
<div class="flow-step-line"></div>
<div class="flow-step" data-flow="3">
<div class="flow-step-dot">3</div>
<span>Start</span>
</div>
</div>
<div class="field">
<label for="boHandles" id="boHandlesLabel">Instagram Handles</label>
<textarea id="boHandles" rows="4" placeholder="username1 username2 username3"></textarea>
<div class="csv-actions">
<span class="hint">One handle per line. @ prefix optional.</span>
<div class="csv-btns">
<button id="btnImportCSV" class="btn btn-sm btn-csv" title="Import from CSV">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
Import CSV
</button>
<button id="btnExportCSV" class="btn btn-sm btn-csv" title="Export handles to CSV">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Export CSV
</button>
</div>
</div>
<input type="file" id="csvFileInput" accept=".csv,.txt" style="display:none" />
</div>
<div class="field-row">
<div class="field field-half">
<label for="boDefaultTemplate">Default Template</label>
<select id="boDefaultTemplate">
<option value="">-- Select --</option>
</select>
<span id="noTemplateHint" class="hint hint-action" style="display:none">
No templates yet.
<a href="#" id="linkCreateTemplate" class="hint-link">Create one first</a>
</span>
</div>
<div class="field field-half">
<label for="boDelay">
Delay (sec)
<span class="info-tooltip" data-tip="Time between each DM. Lower values risk rate limiting.">?</span>
</label>
<input id="boDelay" type="number" min="10" max="300" value="60" />
<span id="boDelayWarning" class="delay-warning" style="display:none">Below 60s risks rate limiting or account ban.</span>
<span id="boLinkedinDelayHint" class="hint platform-hint linkedin-only" style="display:none">LinkedIn recommended: 90-120s. Max ~100 connections/day.</span>
<span id="boXDelayHint" class="hint platform-hint x-only" style="display:none">X recommended: 60-90s. DM limits vary by account age.</span>
</div>
</div>
<!-- Full Automation Toggle -->
<div class="field toggle-field">
<label class="toggle-label">
<input id="boAutoSend" type="checkbox" class="toggle-input" />
<span class="toggle-switch"></span>
<span class="toggle-text">Full Automation</span>
<span class="info-tooltip" data-tip="When enabled, DMs are sent immediately after parsing handles — no review step.">?</span>
</label>
<span class="hint" style="margin-left:46px">Skip review — follow & DM all handles automatically.</span>
</div>
<!-- Advanced Settings (collapsed by default) -->
<div class="collapsible-section">
<button class="collapsible-toggle" id="toggleAdvancedSettings">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
Advanced Settings
<svg class="collapsible-chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>
</button>
<div class="collapsible-content" id="advancedSettingsContent" style="display:none">
<!-- Behavior Settings -->
<div class="settings-section">
<label class="settings-title">
Behavior
</label>
<div class="settings-options">
<label class="settings-option">
<input type="checkbox" id="settingAlwaysFollow" checked />
<span>Always follow before sending DM</span>
</label>
<span class="hint" style="margin-left:22px">Follow even when Message button is already visible.</span>
<label class="settings-option" style="margin-top:6px">
<input type="checkbox" id="settingDMAfterFollow" checked />
<span>DM immediately after follow (public accounts)</span>
</label>
<span class="hint" style="margin-left:22px">For public accounts, send DM right after following. Uncheck to add to waitlist instead.</span>
<label class="settings-option" style="margin-top:6px">
<input type="checkbox" id="settingWaitlistPrivate" checked />
<span>Waitlist private accounts (Requested)</span>
</label>
<span class="hint" style="margin-left:22px">Private accounts go to waitlist. Uncheck to skip them entirely.</span>
<label class="settings-option" style="margin-top:6px">
<input type="checkbox" id="settingSkipPrivate" />
<span>Skip private profiles entirely</span>
</label>
<span class="hint" style="margin-left:22px">Detect private accounts before following and skip them — no follow request sent.</span>
<label class="settings-option" style="margin-top:6px">
<input type="checkbox" id="settingXReplyFallback" checked />
<span>X: Reply to tweet when DMs closed</span>
</label>
<span class="hint" style="margin-left:22px">If user's DMs are closed, reply to their latest tweet instead.</span>
<label class="settings-option" style="margin-top:6px">
<input type="checkbox" id="settingLinkedinConnectNote" checked />
<span>LinkedIn: Send connection note as message</span>
</label>
<span class="hint" style="margin-left:22px">Use your DM template as the connection note (max 300 chars).</span>
<span id="linkedinNoteLength" class="hint" style="margin-left:22px;display:none;color:var(--warning)">Note: 0/300 characters</span>
</div>
</div>
<!-- Follow-up Cadence -->
<div class="cadence-section">
<label class="cadence-title">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
Auto Follow-up Cadence
</label>
<div class="cadence-options">
<label class="cadence-option">
<input type="checkbox" id="cadence6h" class="cadence-check" value="6" />
<span class="cadence-label">6h</span>
</label>
<label class="cadence-option">
<input type="checkbox" id="cadence12h" class="cadence-check" value="12" />
<span class="cadence-label">12h</span>
</label>
<label class="cadence-option">
<input type="checkbox" id="cadence24h" class="cadence-check" value="24" />
<span class="cadence-label">24h</span>
</label>
</div>
<span class="hint">Select intervals to auto-send follow-up messages after initial DM.</span>
<div class="field" id="cadenceTemplateField" style="display:none; margin-top:8px">
<label for="cadenceTemplate">Follow-up Template</label>
<select id="cadenceTemplate">
<option value="">-- Select --</option>
</select>
</div>
</div>
</div>
</div>
<button id="btnParseHandles" class="btn btn-secondary btn-full" style="margin-top:8px">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>
Review Handles
</button>
<!-- Per-handle template assignment -->
<div id="boHandleAssignments" class="handle-assignments" style="display:none">
<div class="toolbar">
<span id="boHandleCount" class="badge">0 handles</span>
</div>
<div id="boHandleList" class="handle-list"></div>
</div>
<button id="btnStartOutreach" class="btn btn-primary btn-full" style="display:none">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13"/><path d="M22 2l-7 20-4-9-9-4 20-7z"/></svg>
Start Outreach
</button>
<!-- Outreach Progress (appears below Start Outreach after clicking) -->
<div id="boProgress" class="progress-card" style="display:none; margin-top:12px">
<div class="card-header">
<h2>Outreach Progress</h2>
<div id="boStatusBadge" class="status-badge running">Running</div>
</div>
<div class="card-body">
<div class="progress-bar"><div id="boProgressBar" class="progress-fill"></div></div>
<p id="boStatusText" class="summary-text">Preparing...</p>
<div id="boLiveLog" class="live-log"></div>
<div id="boActiveActions" class="btn-row">
<button id="btnPauseOutreach" class="btn btn-secondary">Pause</button>
<button id="btnBackFromOutreach" class="btn btn-secondary" style="display:none">Back</button>
</div>
<div id="boDoneActions" class="btn-row" style="display:none">
<button id="btnNewOutreach" class="btn btn-primary btn-full">+ New Outreach</button>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- ─── Sub-tab: History ─── -->
<section id="bo-history" class="sub-panel">
<div class="card">
<div class="card-header">
<h2>Send History</h2>
<span id="historyCount" class="count-badge">0</span>
</div>
<div class="card-body">
<p class="hint" style="margin-bottom:10px">All outreach activity. Status lights show progress per account.</p>
<div class="history-filters">
<button class="filter-btn active" data-filter="all">All</button>
<button class="filter-btn" data-filter="messaged">Messaged</button>
<button class="filter-btn" data-filter="followed">Followed</button>
<button class="filter-btn" data-filter="pending">Pending</button>
</div>
<div id="historyList" class="history-list"></div>
<div id="cadenceQueue" style="display:none; margin-top:14px">
<div class="cadence-queue-header">
<h3>Scheduled Follow-ups</h3>
<span id="cadenceQueueCount" class="count-badge">0</span>
</div>
<div id="cadenceQueueList" class="cadence-queue-list"></div>
</div>
<div class="btn-row" style="margin-top:10px">
<button id="btnExportHistory" class="btn btn-secondary">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Export History
</button>
<button id="btnClearHistory" class="btn btn-secondary">Clear History</button>
</div>
</div>
</div>
</section>
<!-- ─── Sub-tab: Waitlist ─── -->
<section id="bo-waitlist" class="sub-panel">
<div class="card">
<div class="card-header">
<h2>Waitlist</h2>
<span id="waitlistCount" class="count-badge">0</span>
</div>
<div class="card-body">
<p class="hint" style="margin-bottom:10px">Users awaiting follow-back. Re-check to send DMs once accepted.</p>
<div id="waitlistList" class="matched-list"></div>
<div class="btn-row" style="margin-top:10px">
<button id="btnRecheckWaitlist" class="btn btn-primary">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
Re-check & Send
</button>
<button id="btnClearWaitlist" class="btn btn-secondary">Clear All</button>
</div>
<div id="waitlistProgress" style="display:none; margin-top:12px">
<div class="progress-bar"><div id="waitlistProgressBar" class="progress-fill"></div></div>
<p id="waitlistStatusText" class="summary-text"></p>
<div id="waitlistLiveLog" class="live-log"></div>
</div>
</div>
</div>
</section>
<!-- ─── Sub-tab: Templates ─── -->
<section id="bo-templates" class="sub-panel active">
<div class="card">
<div class="card-header"><h2>Message Templates</h2></div>
<div class="card-body">
<p class="hint" style="margin-bottom:10px">Create DM templates. Use <code>{{username}}</code> to personalize each message.</p>
<div id="templatesList" class="templates-list"></div>
<!-- Starter template suggestion (shown when no templates exist) -->
<div id="starterTemplate" class="starter-template" style="display:none">
<div class="starter-template-header">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--primary)" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/></svg>
<span>Try this starter template:</span>
</div>
<div class="starter-template-body">
<div class="starter-template-name">Collaboration Invite</div>
<div class="starter-template-text">Hi {{username}}, I love your content! We'd love to explore a collaboration with you. Would you be open to a quick chat?</div>
</div>
<button id="btnUseStarter" class="btn btn-sm btn-primary">Use This Template</button>
</div>
<div class="template-add-form">
<div class="field">
<label for="newTemplateName">Template Name</label>
<input id="newTemplateName" type="text" placeholder="e.g., Collaboration Invite" />
</div>
<div class="field">
<label for="newTemplateBody">Message</label>
<textarea id="newTemplateBody" rows="3" placeholder="Hi {{username}}, we'd love to collaborate with you on..."></textarea>
</div>
<button id="btnAddTemplate" class="btn btn-primary btn-full">+ Add Template</button>
</div>
</div>
</div>
<!-- Nudge to Outreach tab (shown after first template is created) -->
<div id="templateNudge" class="nudge-card" style="display:none">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="var(--success)" stroke-width="2"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>
<span>Template created! Now go to <a href="#" id="linkGoToOutreach" class="hint-link">Outreach</a> to add handles and start sending.</span>
</div>
</section>
</div><!-- /modeOutreach -->
<!-- ╔══════════════════════════════════════════╗ -->
<!-- ║ MODE 2: COMMENT SCANNER ║ -->
<!-- ╚══════════════════════════════════════════╝ -->
<div id="modeKeyword" class="mode-panel">
<!-- Step Indicator -->
<div class="steps-bar">
<div class="step-dot active" data-step="1"><span>1</span><label>Configure</label></div>
<div class="step-line"></div>
<div class="step-dot" data-step="2"><span>2</span><label>Scan</label></div>
<div class="step-line"></div>
<div class="step-dot" data-step="3"><span>3</span><label>Review</label></div>
<div class="step-line"></div>
<div class="step-dot" data-step="4"><span>4</span><label>Send</label></div>
</div>
<section id="step1" class="step-panel active">
<div class="card">
<div class="card-header">
<h2>Campaign Setup</h2>
<span class="card-subtitle">Scan post comments for keywords, then DM matches</span>
</div>
<div class="card-body">
<div class="field">
<label for="postUrl" id="postUrlLabel">Instagram Post URL</label>
<input id="postUrl" type="url" placeholder="https://www.instagram.com/p/..." />
</div>
<div class="field">
<label for="keywords">Keywords to Match</label>
<input id="keywords" type="text" placeholder="photo, photos" />
<span class="hint">Comma-separated. Case-insensitive matching.</span>
</div>
<div class="field">
<label for="dmTemplate">DM Template</label>
<textarea id="dmTemplate" rows="3" placeholder="Hi {{username}}, thanks for your interest!"></textarea>
<span class="hint">Use {{username}} for personalization.</span>
</div>
<div class="field-row">
<div class="field field-half">
<label for="delaySeconds">Delay (sec)</label>
<input id="delaySeconds" type="number" min="10" max="300" value="60" />
<span id="delayWarning" class="delay-warning" style="display:none">Below 60s risks rate limiting or account ban.</span>
</div>
<div class="field field-half toggle-field">
<label class="toggle-label">
<input id="autoSend" type="checkbox" class="toggle-input" />
<span class="toggle-switch"></span>
<span class="toggle-text">Full Auto</span>
</label>
</div>
</div>
<button id="btnStartScan" class="btn btn-primary btn-full">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
Start Scanning
</button>
</div>
</div>
</section>
<section id="step2" class="step-panel">
<div class="card">
<div class="card-header"><h2>Scanning Comments</h2></div>
<div class="card-body">
<div class="progress-bar"><div id="scanProgressBar" class="progress-fill"></div></div>
<div id="scanLiveLog" class="live-log"></div>
<button id="btnCancelScan" class="btn btn-secondary btn-full">Cancel</button>
</div>
</div>
</section>
<section id="step3" class="step-panel">
<div class="card">
<div class="card-header"><h2>Matched Commenters</h2></div>
<div class="card-body">
<p id="matchSummary" class="summary-text"></p>
<div class="toolbar">
<button id="btnSelectAll" class="btn btn-sm">Select All</button>
<button id="btnDeselectAll" class="btn btn-sm">Deselect All</button>
<span id="selectedCount" class="badge">0 selected</span>
</div>
<div id="matchedList" class="matched-list"></div>
<div class="field" style="margin-top:12px">
<label>DM Preview</label>
<div id="dmPreview" class="dm-preview"></div>
</div>
<div class="btn-row">
<button id="btnBackToConfig" class="btn btn-secondary">Back</button>
<button id="btnStartDMs" class="btn btn-primary" disabled>Send DMs</button>
</div>
</div>
</div>
</section>
<section id="step4" class="step-panel">
<div class="card">
<div class="card-header"><h2>Sending DMs</h2></div>
<div class="card-body">
<div class="progress-bar"><div id="dmProgressBar" class="progress-fill"></div></div>
<p id="dmStatusText" class="summary-text">Preparing...</p>
<div id="dmLiveLog" class="live-log"></div>
<div id="dmActiveActions" class="btn-row">
<button id="btnPauseDMs" class="btn btn-secondary">Pause</button>
<button id="btnBackToConfigFromDM" class="btn btn-secondary" style="display:none">Back to Config</button>
</div>
<div id="dmDoneActions" class="btn-row" style="display:none">
<button id="btnNewCampaign" class="btn btn-primary btn-full">+ New Campaign</button>
</div>
</div>
</div>
</section>
<section id="pendingSection" class="pending-section" style="display:none">
<div class="card">
<div class="pending-header" id="pendingToggle">
<h2>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><line x1="19" y1="8" x2="19" y2="14"/><line x1="22" y1="11" x2="16" y2="11"/></svg>
Pending Follows
<span id="pendingBadge" class="pending-badge">0</span>
</h2>
<svg class="chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>
</div>
<div id="pendingBody" class="pending-body" style="display:none">
<p class="hint" style="margin-bottom:8px">These users had no Message button. Retry once they follow you back.</p>
<div id="pendingList" class="matched-list"></div>
<div class="btn-row" style="margin-top:8px">
<button id="btnRetryPending" class="btn btn-primary">Retry DMs</button>
<button id="btnClearPending" class="btn btn-secondary">Clear</button>
</div>
</div>
</div>
</section>
</div><!-- /modeKeyword -->
<script src="js/sidepanel.js"></script>
</body>
</html>