-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path_Layout.cshtml
More file actions
597 lines (566 loc) · 33.6 KB
/
_Layout.cshtml
File metadata and controls
597 lines (566 loc) · 33.6 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
@using EssentialCSharp.Web.Extensions
@using System.Globalization
@using EssentialCSharp.Web.Services
@using IntelliTect.Multitool
@using EssentialCSharp.Common
@using Microsoft.AspNetCore.Identity
@using EssentialCSharp.Web.Areas.Identity.Data
@using Microsoft.Extensions.Options
@inject ISiteMappingService _SiteMappings
@inject SignInManager<EssentialCSharpWebUser> SignInManager
@inject IOptions<CaptchaOptions> CaptchaOptions
@using Microsoft.AspNetCore.Components
@{
var prodMap = new ImportMapDefinition(
new Dictionary<string, string>
{
{ "vue", "https://cdn.jsdelivr.net/npm/vue@3.5.12/dist/vue.esm-browser.prod.js" },
{ "vue-window-size", "./lib/vue-window-size/composition-api/dist/index.js" },
{ "vuetify", "https://cdn.jsdelivr.net/npm/vuetify@3.9.2/dist/vuetify.esm.js" },
}, null, null);
var devMap = new ImportMapDefinition(
new Dictionary<string, string>
{
{ "vue", "https://cdn.jsdelivr.net/npm/vue@3.5.12/dist/vue.esm-browser.js" },
{ "vue-window-size", "./lib/vue-window-size/composition-api/dist/index.js" },
{ "vuetify", "https://cdn.jsdelivr.net/npm/vuetify@3.9.2/dist/vuetify.esm.js" },
}, null, null);
}
<!DOCTYPE html>
<html lang="en">
<head>
@{
const string imageUrl = "https://essentialcsharp.com/images/icon.png";
const string description = "Accelerate your development knowledge with C# expert Mark Michaelis' free, online comprehensive C# tutorial and reference that is updated through C# 11.0";
string title = $"Essential C#{(string.IsNullOrEmpty(ViewBag.PageTitle) ? string.Empty : $": {ViewBag.PageTitle}")}";
}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://essentialcsharp.com/" />
<meta property="og:image:secure_url" content="@imageUrl" />
<meta property="og:image" content="@imageUrl" />
<meta name="twitter:image" content="@imageUrl" />
<title id="page-title">@title</title>
<meta property="og:image:type" content="image/png" />
<meta name="description" property="og:description" content="@description" />
<meta name="twitter:description" content="@description" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@@IntelliTect" />
<meta property="og:image:width" content="500" />
<meta property="og:image:height" content="500" />
<meta name="twitter:title" property="og:title" content="@title" />
<!-- Vuetify CSS -->
<link href="https://cdn.jsdelivr.net/npm/vuetify@3.9.2/dist/vuetify.min.css" rel="stylesheet">
<!-- Material Design Icons -->
<link href="https://cdn.jsdelivr.net/npm/@@mdi/font@7.2.96/css/materialdesignicons.min.css" rel="stylesheet">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/styles.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/chat-widget.css" asp-append-version="true" />
<link rel="stylesheet" href="/lib/docsearch/style.css" />
@*Font Family*@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;0,900;1,400;1,500;1,700;1,900&display=auto" rel="stylesheet">
@*End Font Family*@
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
@*So that Safari can import modules*@
<script async src="/lib/es-module-shims/dist/es-module-shims.js"></script>
<environment include="Development">
<script type="importmap" asp-importmap="@devMap"></script>
</environment>
<environment exclude="Development">
<script type="importmap" asp-importmap="@prodMap"></script>
</environment>
<!-- Cookie Consent Manager - Load before analytics -->
<script src="~/js/consent-manager.js" asp-append-version="true"></script>
<!-- Microsoft Clarity - Will be activated based on consent -->
<script type="text/javascript">
(function (c, l, a, r, i, t, y) {
c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
})(window, document, "clarity", "script", "g4keetzd2o");
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<!-- Markdown and sanitization libraries -->
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.0.5/dist/purify.min.js"></script>
<!-- Google tag (gtag.js) - Will be activated based on consent -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-761B4BMK2R"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
// Initialize gtag but don't configure until consent is given
gtag('js', new Date());
// Configuration will be handled by consent manager
// Listen for consent manager initialization event
document.addEventListener('consentManagerReady', function(event) {
if (event.detail.hasAnalyticsConsent || !event.detail.requiresConsent) {
gtag('config', 'G-761B4BMK2R');
}
});
</script>
<style>
[v-cloak] {
display: none;
}
</style>
<!-- hCaptcha Script -->
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
@await RenderSectionAsync("HeadAppend", required: false)
</head>
<body>
<div id="app" class="vh-100">
<div>
<header class="header-background">
<div class="banner d-flex justify-content-between">
<div class="d-flex align-items-center menu-position">
<button class="menu-btn has-tooltip" v-on:click="toggleSidebar">
<i class="fa fa-bars fa-lg icon-light"></i>
<span class="tooltip-text sidebar-tooltip-text">
<b>Ctrl + M</b>
</span>
</button>
<div class="d-none d-lg-block">
<ul class="nav align-items-center">
<li class="nav-item d-none d-md-block">
<a class="@(string.IsNullOrEmpty(ViewBag.PageTitle) ? "active nav-link fs-4" : "nav-link fs-4")" href="/home">
Essential C#
</a>
</li>
<li class="nav-item">
<a class="@(ViewBag.PageTitle == "About" ? "active nav-link" : "nav-link")" href="/about">About</a>
</li>
<li class="nav-item">
<a class="@(ViewBag.PageTitle == "Coding Guidelines" ? "active nav-link" : "nav-link")" href="/guidelines">Guidelines</a>
</li>
<li class="nav-item">
<a class="@(ViewBag.PageTitle == "Announcements" ? "active nav-link" : "nav-link")" href="/announcements">Announcements</a>
</li>
</ul>
</div>
</div>
<a v-if="chapterParentPage" :href="chapterParentPage.href" class="page-menu menu-chapter-title text-light">
<span v-cloak>{{chapterParentPage.title}}</span>
</a>
<div class="page-menu menu-progress text-light" v-if="isContentPage">
<span v-cloak>{{percentComplete}}%</span>
</div>
<div class="d-flex align-items-center">
<div class="border-end pe-3 d-none d-md-block">
<a class="btn btn-primary btn-sm rounded-pill"
target="blank"
href="https://github.com/IntelliTect/EssentialCSharp.Web/discussions/new?category=feedback-and-ideas">
<span class="fa fa-solid fa-comment fa-lg text-light me-1"></span>
Feedback
</a>
</div>
<a class="d-md-none"
target="blank"
href="https://github.com/IntelliTect/EssentialCSharp.Web/discussions/new?category=feedback-and-ideas">
<span class="fa fa-solid fa-comment icon-light fa-lg"></span>
</a>
<partial name="_LoginPartial" />
</div>
</div>
</header>
<main :class="{ layout: true, 'has-sidebar': sidebarShown && !smallScreen }">
<div id="sidebarContainer" class="background-grey-lighten-2">
<Transition name="slide-fade">
<div v-cloak v-if="sidebarShown" :class="{sidebarSmall: smallScreen}" class="sidebar toc-padding" id="sidebar">
<div v-cloak class="toc-menu">
<div style="display:grid; width:100%; margin-bottom:.75rem;">
<button v-on:click="openSearch" type="button" class="DocSearch DocSearch-Button DocSearch-Style" aria-label="Search">
<span class="DocSearch-Button-Container">
<svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
<path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<span class="DocSearch-Button-Placeholder">Search</span>
</span>
<span class="DocSearch-Button-Keys">
<kbd class="DocSearch-Button-Key">
<svg width="15" height="15" class="DocSearch-Control-Key-Icon">
<path d="M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953" stroke-width="1.2" stroke="currentColor" fill="none" stroke-linecap="square"></path>
</svg>
</kbd>
<kbd class="DocSearch-Button-Key">K</kbd>
</span>
</button>
</div>
<div class="list-group list-group-flush d-md-none mb-3">
<a href="home" class="@(string.IsNullOrEmpty(ViewBag.PageTitle) ? "active list-group-item list-group-item-action" : "list-group-item list-group-item-action")">
<span class="fas fa-home me-2"></span>
<span class="fs-5">Home</span>
</a>
<a href="/About" class="@(ViewBag.PageTitle == "About" ? "active list-group-item list-group-item-action" : "list-group-item list-group-item-action")">
<span class="fas fa-book me-2"></span>
<span class="fs-5">About</span>
</a>
<a href="/Guidelines" class="@(ViewBag.PageTitle == "Coding Guidelines" ? "active list-group-item list-group-item-action" : "list-group-item list-group-item-action")">
<span class="fas fa-code me-2"></span>
<span class="fs-5">Guidelines</span>
</a>
<a href="/Announcements" class="@(ViewBag.PageTitle == "Announcements" ? "active list-group-item list-group-item-action" : "list-group-item list-group-item-action")">
<span class="fas fa-bullhorn me-2"></span>
<span class="fs-5">Announcements</span>
</a>
</div>
<div style="display: flex; align-items: center;">
<h5 style="margin-right: 8px;">
Contents
</h5>
<i class="fa-solid fa-filter" v-on:click="enableTocFilter = enableTocFilter === 'filter' ? 'none' : 'filter';"></i>
</div>
<div v-if="enableTocFilter === 'filter'" class="filter-input-container">
<input type="text" class="filter-input" v-model="searchQuery" placeholder="Search sections..." />
<button class="filter-btn">
<i class="fa fa-search icon-light"></i>
</button>
</div>
</div>
<div v-cloak v-if="sidebarTab == 'toc'" class="toc-tree" id="toc">
<ul class="tree">
<toc-tree v-for="item in filteredTocData" :item="item" :expanded-tocs="expandedTocs" :current-page="currentPage"></toc-tree>
</ul>
</div>
<div v-cloak>
<small>
Build: @if (ReleaseDateAttribute.GetReleaseDate() is DateTime date)
{
<b>@TimeZoneInfo.ConvertTimeFromUtc(date, TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time")).ToString("d MMM, yyyy h:mm:ss tt", CultureInfo.InvariantCulture)</b>
}
</small>
</div>
</div>
</Transition>
</div>
<div class="container my-5 pb-5">
<nav v-cloak class="turn-page">
<div class="turn-page-tooltip">
<a id="prev-btn" :href="previousPageUrl" v-if="previousPageUrl" class="arrow-btn"><i class="fa fa-solid fa-arrow-left icon-light arrow-icon"></i></a>
<span class="turn-page-tooltip-text tooltip-right">
<b>Previous Page</b>
<br />
( or use the <i class="fa-solid fa-square-caret-left"></i> key)
</span>
</div>
<div class="turn-page-tooltip">
<a id="next-btn" :href="nextPageUrl" v-if="nextPageUrl" class="arrow-btn"><i class="fa fa-solid fa-arrow-right icon-light arrow-icon"></i></a>
<span class="turn-page-tooltip-text tooltip-left">
<b>Next Page</b>
<br />
( or use the <i class="fa-solid fa-square-caret-right"></i> key)
</span>
</div>
</nav>
@RenderBody()
</div>
</main>
<div v-cloak v-if="snackbarMessage" id="snackbar" class="show" :style="{ color: snackbarColor }">
{{ snackbarMessage }}
</div>
<!-- AI Chat Widget - Hide on Identity pages to avoid confusing states during login/logout -->
@if (!Context.Request.Path.StartsWithSegments("/Identity"))
{
<div class="chat-widget">
<!-- Chat Trigger Button -->
<button
class="chat-button elevation-6"
v-on:click="openChatDialog"
:class="{ 'chat-button--active': showChatDialog }"
:aria-expanded="showChatDialog"
:aria-label="isAuthenticated ? 'Open AI Chat Assistant' : 'Login required for AI Chat'"
:title="isAuthenticated ? 'Chat with AI Assistant about C# programming' : 'Login required to use chat'"
type="button"
>
<i class="mdi mdi-robot" aria-hidden="true"></i>
<span class="chat-button-text" v-if="!smallScreen">AI Chat</span>
</button>
<!-- Chat Dialog Modal -->
<div
v-if="showChatDialog"
class="chat-overlay"
v-on:click.self="closeChatDialog"
role="dialog"
aria-labelledby="chat-dialog-title"
aria-modal="true"
tabindex="-1"
v-cloak
>
<div class="chat-card elevation-12">
<!-- Header -->
<div class="chat-header">
<h2 id="chat-dialog-title" class="chat-title">
<i class="mdi mdi-robot me-2" aria-hidden="true"></i>
AI Assistant
</h2>
<div class="chat-header-actions">
<!-- Vuetify Menu -->
<v-menu>
<template v-slot:activator="{ props }">
<v-btn
icon="mdi-dots-vertical"
variant="text"
size="small"
v-bind="props"
aria-label="Chat options menu"
title="Chat options">
</v-btn>
</template>
<v-list>
<v-list-item
@@click="clearChatHistory"
:disabled="chatMessages.length === 0"
prepend-icon="mdi-delete-outline">
<v-list-item-title>Clear History</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<!-- Close Button -->
<button
class="chat-close-button"
v-on:click="closeChatDialog"
aria-label="Close chat dialog"
title="Close chat"
type="button"
>
<i class="mdi mdi-close" aria-hidden="true"></i>
</button>
</div>
</div>
<!-- Messages Area -->
<div
class="chat-messages"
ref="chatMessagesEl"
role="log"
aria-live="polite"
aria-label="Chat conversation"
>
<!-- Welcome message for authenticated users -->
<div v-if="chatMessages.length === 0 && isAuthenticated" class="welcome-message">
<i class="mdi mdi-chat-outline" aria-hidden="true"></i>
<p>Hi! I'm your AI assistant. Ask me anything about C# programming!</p>
</div>
<!-- Login required message for unauthenticated users -->
<div v-if="!isAuthenticated" class="login-required-message">
<i class="mdi mdi-lock-outline" aria-hidden="true"></i>
<h3>Login Required</h3>
<p>Please log in to chat with the AI assistant about C# programming.</p>
<a
href="/Identity/Account/Login"
class="btn btn-primary mt-3"
aria-label="Go to login page"
>
<i class="mdi mdi-login me-2" aria-hidden="true"></i>
Login
</a>
</div>
<!-- Chat messages -->
<div
v-for="(message, index) in chatMessages"
:key="index"
v-show="isAuthenticated || message.role === 'error'"
>
<!-- Error messages with special styling -->
<div v-if="message.role === 'error'"
:class="getErrorMessageClass(message.errorType)">
<i :class="getErrorIconClass(message.errorType)"></i>
<div class="message-text">
<h4 v-if="message.errorType === 'rate-limit'">Rate Limit Reached</h4>
<h4 v-else-if="message.errorType === 'auth-error'">Authentication Required</h4>
<h4 v-else-if="message.errorType === 'captcha-error'">Verification Required</h4>
<h4 v-else-if="message.errorType === 'validation-error'">Invalid Input</h4>
<h4 v-else>Error</h4>
<p v-html="formatMessage(message.content)"></p>
<div v-if="message.errorType === 'rate-limit'" class="retry-info">
Please wait before sending another message
</div>
</div>
</div>
<!-- Regular messages (only show when authenticated) -->
<div v-else-if="isAuthenticated"
class="message-wrapper"
:class="message.role">
<div class="message-bubble" :class="message.role">
<div class="message-content" v-html="formatMessage(message.content)"></div>
</div>
</div>
</div>
<!-- Typing indicator (only show when authenticated) -->
<div v-if="isTyping && isAuthenticated" class="message-wrapper assistant">
<div class="message-bubble assistant">
<div class="typing-indicator">
<span class="typing-text">AI is thinking</span>
<div class="typing-dots" aria-hidden="true">
<span></span>
<span></span>
<span></span>
</div>
</div>
</div>
</div>
</div>
<!-- Input Area - Only show if authenticated -->
<div v-if="isAuthenticated" class="chat-footer">
<form v-on:submit.prevent="sendChatMessage" class="chat-form">
<div class="input-wrapper">
<label for="chat-input" class="visually-hidden">
Enter your message about C# programming
</label>
<input
id="chat-input"
v-model="chatInput"
ref="chatInputField"
class="chat-input"
placeholder="Ask me about C#..."
:disabled="isTyping || !isAuthenticated"
autocomplete="off"
aria-describedby="chat-input-help"
maxlength="500"
>
<button
type="submit"
class="send-button"
:disabled="isTyping || !chatInput.trim() || !isAuthenticated"
aria-label="Send message"
title="Send message"
>
<i class="mdi mdi-send" aria-hidden="true"></i>
</button>
</div>
<div id="chat-input-help" class="visually-hidden">
Type your question and press Enter or click send. Maximum 500 characters.
</div>
</form>
</div>
</div>
</div>
</div>
}
<!-- Captcha Modal - Blocking Dialog -->
<div
v-if="showCaptcha"
class="captcha-modal-overlay"
role="dialog"
aria-labelledby="captcha-dialog-title"
aria-modal="true"
tabindex="-1"
v-cloak
>
<div class="captcha-modal-card elevation-16">
<!-- Header -->
<div class="captcha-modal-header">
<h3 id="captcha-dialog-title" class="captcha-modal-title">
<i class="mdi mdi-shield-check me-2" aria-hidden="true"></i>
Security Verification Required
</h3>
</div>
<!-- Content -->
<div class="captcha-modal-content">
<p class="captcha-explanation">
To continue chatting, please complete the security verification below.
This helps us prevent abuse and ensures a better experience for everyone.
</p>
<!-- hCaptcha Widget -->
<div class="captcha-widget-container">
<div
id="hcaptcha-modal"
class="h-captcha"
:data-sitekey="captchaSiteKey"
data-callback="onCaptchaSuccess"
data-expired-callback="onCaptchaExpired"
data-error-callback="onCaptchaError"
></div>
</div>
<p class="captcha-help-text">
Having trouble? Make sure JavaScript is enabled and try refreshing the page.
</p>
</div>
</div>
</div>
</div>
<footer class="border-top footer">
<div class="row">
<div class="col-12 col-md-4 me-auto p-2">
© IntelliTect 2005-@DateTime.Now.Year
</div>
<div class="col-12 col-md-auto align-self-end p-2">
<a target="_blank" rel="noreferrer noopener" href="https://intellitect.com/about/privacy-policy/">Privacy</a>
</div>
<div class="col-12 col-md-auto align-self-end p-2">
<a href="javascript:void(0)" onclick="openConsentPreferences()">Cookie Preferences</a>
</div>
<div class="col-12 col-md-auto align-self-end p-2"><a asp-route="TermsOfService">Terms Of Service</a></div>
</div>
</footer>
</div>
<div id="docsearch" style="display: none;"></div>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/algoliaDocSearch.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
<script>
@{
var tocData = _SiteMappings.GetTocData();
var percentComplete = _SiteMappings.SiteMappings.FindPercentComplete((string) ViewBag.CurrentPageKey);
}
PERCENT_COMPLETE = @Json.Serialize(percentComplete);
PREVIOUS_PAGE = @Json.Serialize(ViewBag.PreviousPage)
NEXT_PAGE = @Json.Serialize(ViewBag.NextPage)
TOC_DATA = @Json.Serialize(tocData)
REFERRAL_ID = @Json.Serialize(ViewBag.ReferralId)
IS_AUTHENTICATED = @Json.Serialize(SignInManager.IsSignedIn(User));
HCAPTCHA_SITE_KEY = @Json.Serialize(CaptchaOptions.Value.SiteKey);
</script>
@* Recursive vue component template for rendering the table of contents. *@
<template id="toc-tree">
<li v-if="item.items.length">
<details :open="expandedTocs.has(item.key)"
v-on:toggle="!$event.target.open ? expandedTocs.delete(item.key) : expandedTocs.add(item.key)">
<summary :class="{
'toc-content' : item.level==0,
'nested' : item.level>
0,
'current-section': currentPage.some(p => p.key == item.key),
}" :href="item.href">{{item.title}}
</summary>
<ul>
<li :class="{
['indent-level-' + (item.level+1)]: true,
'current-li' : currentPage.some(p=>
p.key == item.key) && !currentPage.some(p => p.level > item.level),
}" >
<a class="section-link" :class="{
['indent-level-' + (item.level+1)]: true,
'current-section' : currentPage.some(p=>
p.key == item.key) && !currentPage.some(p => p.level > item.level),
}" :href="item.href"> Introduction
</a>
</li>
<toc-tree v-for="childItem in item.items" :item="childItem" :expanded-tocs="expandedTocs" :current-page="currentPage"></toc-tree>
</ul>
<hr class="divider" v-if="item.level === 0" />
</details>
</li>
<li v-else :class="{
['indent-level-' + (item.level+1)]: true,
'current-li' : currentPage.some(p=>
p.key == item.key) && !currentPage.some(p => p.level > item.level),
}" >
<a class="section-link" :class="{
['indent-level-' + (item.level)]: true,
'current-section' : currentPage.some(p=>
p.key == item.key),
}" :href="item.href"> {{item.title}}
</a>
</li>
</template>
<script src="~/js/site.js" type="module" asp-append-version="true"></script>
</body>
</html>