clean-jsdoc-theme 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,55 +13,60 @@ name: "CodeQL"
13
13
 
14
14
  on:
15
15
  push:
16
- branches: [ master ]
16
+ branches: [ "master" ]
17
17
  pull_request:
18
18
  # The branches below must be a subset of the branches above
19
- branches: [ master ]
19
+ branches: [ "master" ]
20
20
  schedule:
21
- - cron: '39 21 * * 4'
21
+ - cron: '23 8 * * 1'
22
22
 
23
23
  jobs:
24
24
  analyze:
25
25
  name: Analyze
26
26
  runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
27
31
 
28
32
  strategy:
29
33
  fail-fast: false
30
34
  matrix:
31
35
  language: [ 'javascript' ]
32
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33
- # Learn more:
34
- # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
35
38
 
36
39
  steps:
37
40
  - name: Checkout repository
38
- uses: actions/checkout@v2
41
+ uses: actions/checkout@v3
39
42
 
40
43
  # Initializes the CodeQL tools for scanning.
41
44
  - name: Initialize CodeQL
42
- uses: github/codeql-action/init@v1
45
+ uses: github/codeql-action/init@v2
43
46
  with:
44
47
  languages: ${{ matrix.language }}
45
48
  # If you wish to specify custom queries, you can do so here or in a config file.
46
49
  # By default, queries listed here will override any specified in a config file.
47
50
  # Prefix the list here with "+" to use these queries and those in the config file.
48
- # queries: ./path/to/local/query, your-org/your-repo/queries@main
51
+
52
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53
+ # queries: security-extended,security-and-quality
49
54
 
55
+
50
56
  # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51
57
  # If this step fails, then you should remove it and run the build manually (see below)
52
58
  - name: Autobuild
53
- uses: github/codeql-action/autobuild@v1
59
+ uses: github/codeql-action/autobuild@v2
54
60
 
55
61
  # ℹ️ Command-line programs to run using the OS shell.
56
- # 📚 https://git.io/JvXDl
62
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
57
63
 
58
- # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59
- # and modify them (or add more) to build your code if your project
60
- # uses a compiled language
64
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
65
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
61
66
 
62
- #- run: |
63
- # make bootstrap
64
- # make release
67
+ # - run: |
68
+ # echo "Run, Build Application using script"
69
+ # ./location_of_script_within_repo/buildscript.sh
65
70
 
66
71
  - name: Perform CodeQL Analysis
67
- uses: github/codeql-action/analyze@v1
72
+ uses: github/codeql-action/analyze@v2
@@ -0,0 +1,16 @@
1
+ name: Greetings
2
+
3
+ on: [pull_request_target, issues]
4
+
5
+ jobs:
6
+ greeting:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ issues: write
10
+ pull-requests: write
11
+ steps:
12
+ - uses: actions/first-interaction@v1
13
+ with:
14
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
15
+ issue-message: "Wonderful, you have created your first issue for clean-jsdoc-theme."
16
+ pr-message: "That's Amazing! Thanks for creating your first PR for clean-jsdoc-theme."
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # clean-jsdoc-theme
2
2
 
3
- [![Stars](https://img.shields.io/github/stars/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme) [![Fork](https://img.shields.io/github/forks/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork) ![Version](https://img.shields.io/badge/version-4.0.0-005bff) [![Issues Open](https://img.shields.io/github/issues/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [![Contributors](https://img.shields.io/github/contributors/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [![Build Status](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme.svg?branch=production)](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [![license](https://img.shields.io/github/license/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE)
3
+ [![Stars](https://img.shields.io/github/stars/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme) [![Fork](https://img.shields.io/github/forks/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork) ![Version](https://img.shields.io/badge/version-4.0.2-005bff) [![Issues Open](https://img.shields.io/github/issues/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [![Contributors](https://img.shields.io/github/contributors/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [![Build Status](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme.svg?branch=production)](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [![license](https://img.shields.io/github/license/ankitskvmdam/clean-jsdoc-theme)](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE)
4
4
  <br>
5
5
 
6
6
  clean-jsdoc-theme is a beautifully crafted theme for JSDoc 3. It is a clean and fully responsive theme with loads of customisation features.
@@ -11,12 +11,14 @@ Some salient features:
11
11
  1. It has a premium-looking dark and light theme.
12
12
  1. It minifies all the output HTML files (this helps in saving a few KBs).
13
13
  1. It has search support. The search feature doesn't increase the size of output HTML files.
14
+ 1. It updates regularly.
15
+ 1. It is highly performant. Check lighthouse report [here](https://googlechrome.github.io/lighthouse/viewer/?psiurl=https%3A%2F%2Fankdev.me%2Fclean-jsdoc-theme%2Fv4%2Findex.html&strategy=desktop&category=performance&category=accessibility&category=best-practices&category=seo&category=pwa&utm_source=lh-chrome-ext).
14
16
 
15
17
  We know that no library is perfect. That's why we are open to hearing from the community about the theme. For any suggestions, questions or bugs, feel free to create an <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme/issues">issue</a>.
16
18
 
17
19
  ## Demo
18
20
 
19
- 1. To view this theme, visit [ankdev.me/clean-jsdoc-theme/v4](https://ankdev.me/clean-jsdoc-theme/v4).
21
+ 1. To view this theme, visit [https://ankdev.me/clean-jsdoc-theme/v4](https://ankdev.me/clean-jsdoc-theme/v4).
20
22
 
21
23
  1. If you want to see a demo repo to set up this theme, visit [https://github.com/ankitskvmdam/clean-jsdoc-theme-example](https://github.com/ankitskvmdam/clean-jsdoc-theme-example). This repo will guide you step by step on how to setup jsdoc and clean-jsdoc-theme in your existing repo.
22
24
 
@@ -421,12 +423,12 @@ npm run build
421
423
  ## Contributors
422
424
 
423
425
  <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors">
424
- <img src="https://contrib.rocks/image?repo=ankitskvmdam/clean-jsdoc-theme" />
426
+ <img src="https://contrib.rocks/image?repo=ankitskvmdam/clean-jsdoc-theme" alt="clean-jsdoc-contributors" />
425
427
  </a>
426
428
 
427
429
  ## Thanks
428
430
 
429
- Thanks to [fuse.js](https://fusejs.io/), [hljs](https://highlightjs.org/), and [tippy.js](https://tippyjs.bootcss.com/).
431
+ Thanks to [fuse.js](https://fusejs.io/), [hljs](https://highlightjs.org/),[tippy.js](https://tippyjs.bootcss.com/), and all awesome contributors.
430
432
 
431
433
  ## Contact
432
434
 
package/minify.js CHANGED
@@ -15,6 +15,10 @@ const uglifyFiles = [
15
15
  {
16
16
  src: path.join(scriptsPath, 'search.js'),
17
17
  dest: path.join(scriptsPath, 'search.min.js')
18
+ },
19
+ {
20
+ src: path.join(scriptsPath, 'third-party', 'hljs-original.js'),
21
+ dest: path.join(scriptsPath, 'third-party', 'hljs.js')
18
22
  }
19
23
  ];
20
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clean-jsdoc-theme",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "A beautifully crafted theme/template for JSDoc 3. This theme/template looks and feels like a premium theme/template. This is a fully mobile responsive theme and also fully customizable theme.",
5
5
  "main": "publish.js",
6
6
  "scripts": {
@@ -271,17 +271,17 @@ function hideTocOnSourcePage() {
271
271
  }
272
272
  }
273
273
 
274
- function getPreTopBar(id, lang) {
274
+ function getPreTopBar(id, lang = '') {
275
275
  // tooltip
276
276
  var tooltip = '<div class="tooltip" id="tooltip-' + id + '">Copied!</div>';
277
277
 
278
278
  // template of copy to clipboard icon container
279
279
  var copyToClipboard =
280
- '<div class="code-copy-icon-container" onclick="copyFunction(\'' +
280
+ '<button aria-label="copy code" class="icon-button" onclick="copyFunction(\'' +
281
281
  id +
282
- '\')"><div><svg class="sm-icon" alt="click to copy"><use xlink:href="#copy-icon"></use></svg>' +
282
+ '\')"><svg class="sm-icon" alt="click to copy"><use xlink:href="#copy-icon"></use></svg>' +
283
283
  tooltip +
284
- '<div></div>';
284
+ '</button>';
285
285
 
286
286
  var langNameDiv =
287
287
  '<div class="code-lang-name-container"><div class="code-lang-name">' +
@@ -321,7 +321,7 @@ function processAllPre() {
321
321
  targets.forEach(function(pre, idx) {
322
322
  var div = getPreDiv();
323
323
  var id = 'pre-id' + idx;
324
- var lang = pre.getAttribute('data-lang');
324
+ var lang = pre.getAttribute('data-lang') || '';
325
325
  var topBar = getPreTopBar(id, lang);
326
326
 
327
327
  div.innerHTML = topBar;
@@ -413,7 +413,7 @@ function fontSizeTooltip() {
413
413
 
414
414
  return `
415
415
  <div class="font-size-tooltip">
416
- <button class="icon-button ${
416
+ <button aria-label="decrease-font-size" class="icon-button ${
417
417
  fontSize >= MAX_FONT_SIZE ? 'disabled' : ''
418
418
  }" onclick="decrementFont(event)">
419
419
  <svg>
@@ -423,7 +423,7 @@ function fontSizeTooltip() {
423
423
  <div class="font-size-text" id="font-size-text">
424
424
  ${fontSize}
425
425
  </div>
426
- <button class="icon-button ${
426
+ <button aria-label="increase-font-size" class="icon-button ${
427
427
  fontSize <= MIN_FONT_SIZE ? 'disabled' : ''
428
428
  }" onclick="incrementFont(event)">
429
429
  <svg>
@@ -1,23 +1,23 @@
1
- var accordionLocalStorageKey="accordion-id",themeLocalStorageKey="theme",fontSizeLocalStorageKey="font-size",html=document.querySelector("html"),MAX_FONT_SIZE=30,MIN_FONT_SIZE=10,localStorage=window.localStorage;function getTheme(){return document.body.getAttribute("data-theme")}function updateTheme(e){var t=document.body,o=document.querySelectorAll(".theme-svg-use"),n="dark"===e?"light":"dark";t.setAttribute("data-theme",e),t.classList.remove("dark","light"),t.classList.add(e),o.forEach(function(e){e.setAttribute("xlink:href","#"+n+"-theme-icon")}),localStorage.setItem(themeLocalStorageKey,e)}function toggleTheme(){updateTheme("dark"===document.body.getAttribute("data-theme")?"light":"dark")}function setAccordionIdToLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));t[e]=e,localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function removeAccordionIdFromLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));delete t[e],localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function getAccordionIdsFromLocalStorage(){return JSON.parse(localStorage.getItem(accordionLocalStorageKey))||{}}function toggleAccordion(e){"false"===e.getAttribute("data-isopen")?(e.setAttribute("data-isopen","true"),setAccordionIdToLocalStorage(e.id)):(e.setAttribute("data-isopen","false"),removeAccordionIdFromLocalStorage(e.id))}function initAccordion(){void 0!==localStorage.getItem(accordionLocalStorageKey)&&null!==localStorage.getItem(accordionLocalStorageKey)||localStorage.setItem(accordionLocalStorageKey,"{}");var e=document.querySelectorAll(".sidebar-section-title"),t=getAccordionIdsFromLocalStorage();e.forEach(function(e){e.addEventListener("click",function(){toggleAccordion(e)}),e.id in t&&toggleAccordion(e)})}function isSourcePage(){return Boolean(document.querySelector("#source-page"))}function bringElementIntoView(e,t=!0){var o=document.querySelector(".navbar-container"),n=document.querySelector(".main-content"),i=e.getBoundingClientRect().top,c=16;o&&(c+=o.scrollHeight),n.scrollBy(0,i-c),t&&history.pushState(null,null,"#"+e.id)}function bringLinkToView(e){e.preventDefault(),e.stopPropagation();var e=e.currentTarget.getAttribute("href");!e||(e=document.getElementById(e.slice(1)))&&bringElementIntoView(e)}function bringIdToViewOnMount(){var e;isSourcePage()||""!==(e=window.location.hash)&&(e=document.getElementById(e.slice(1)))&&bringElementIntoView(e,!1)}function createAnchorElement(e){var t=document.createElement("a");return t.textContent="#",t.href="#"+e,t.classList.add("link-anchor"),t.onclick=bringLinkToView,t}function addAnchor(){var e=document.querySelector(".main-content").querySelector("section");[e.querySelectorAll("h1"),e.querySelectorAll("h2"),e.querySelectorAll("h3"),e.querySelectorAll("h4")].forEach(function(e){e.forEach(function(e){var t=createAnchorElement(e.id);e.classList.add("has-anchor"),e.append(t)})})}function copy(e){const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function showTooltip(e){var t=document.getElementById(e);t.classList.add("show-tooltip"),setTimeout(function(){t.classList.remove("show-tooltip")},3e3)}function copyFunction(e){var t=document.getElementById(e);copy((t.querySelector(".linenums")||t.querySelector("code")).innerText),showTooltip("tooltip-"+e)}function hideTocOnSourcePage(){isSourcePage()&&(document.querySelector(".toc-container").style.display="none")}function getPreTopBar(e,t){e='<div class="code-copy-icon-container" onclick="copyFunction(\''+e+'\')"><div><svg class="sm-icon" alt="click to copy"><use xlink:href="#copy-icon"></use></svg>'+('<div class="tooltip" id="tooltip-'+e+'">Copied!</div>')+"<div></div>";return'<div class="pre-top-bar-container">'+('<div class="code-lang-name-container"><div class="code-lang-name">'+t.toLocaleUpperCase()+"</div></div>")+e+"</div>"}function getPreDiv(){var e=document.createElement("div");return e.classList.add("pre-div"),e}function processAllPre(){var e=document.querySelectorAll("pre"),t=document.querySelector("#footer"),o=document.querySelector("#navbar"),t=t.getBoundingClientRect().height,o=o.getBoundingClientRect().height,i=window.innerHeight-o-t-250;e.forEach(function(e,t){var o=getPreDiv(),t="pre-id"+t,n=getPreTopBar(t,e.getAttribute("data-lang"));o.innerHTML=n,e.style.maxHeight=i+"px",e.id=t,e.parentNode.insertBefore(o,e),o.appendChild(e)})}function highlightAndBringLineIntoView(){var e=window.location.hash.replace("#line","");try{var t='[data-line-number="'+e+'"',o=document.querySelector(t);o.scrollIntoView(),o.parentNode.classList.add("selected")}catch(e){console.error(e)}}function getFontSize(){var e=16;try{e=Number.parseInt(html.style.fontSize.split("px")[0],10)}catch(e){console.log(e)}return e}function updateFontSize(e){html.style.fontSize=e+"px",localStorage.setItem(fontSizeLocalStorageKey,e);var t=document.querySelector("#font-size-text");t&&(t.innerHTML=e)}function incrementFont(e){var t=getFontSize();t<MAX_FONT_SIZE&&updateFontSize(t+1)}function decrementFont(e){var t=getFontSize();MIN_FONT_SIZE<t&&updateFontSize(t-1)}function fontSizeTooltip(){var e=getFontSize();return`
2
- <div class="font-size-tooltip">
3
- <button class="icon-button ${MAX_FONT_SIZE<=e?"disabled":""}" onclick="decrementFont(event)">
4
- <svg>
5
- <use xlink:href="#minus-icon"></use>
6
- </svg>
7
- </button>
8
- <div class="font-size-text" id="font-size-text">
9
- ${e}
10
- </div>
11
- <button class="icon-button ${e<=MIN_FONT_SIZE?"disabled":""}" onclick="incrementFont(event)">
12
- <svg>
13
- <use xlink:href="#add-icon"></use>
14
- </svg>
15
- </button>
16
- <button class="icon-button" onclick="updateFontSize(16)">
17
- <svg>
18
- <use xlink:href="#reset-icon"></use>
19
- </svg>
20
- </button>
21
- </div>
22
-
1
+ var accordionLocalStorageKey="accordion-id",themeLocalStorageKey="theme",fontSizeLocalStorageKey="font-size",html=document.querySelector("html"),MAX_FONT_SIZE=30,MIN_FONT_SIZE=10,localStorage=window.localStorage;function getTheme(){return document.body.getAttribute("data-theme")}function updateTheme(e){var t=document.body,o=document.querySelectorAll(".theme-svg-use"),n="dark"===e?"light":"dark";t.setAttribute("data-theme",e),t.classList.remove("dark","light"),t.classList.add(e),o.forEach(function(e){e.setAttribute("xlink:href","#"+n+"-theme-icon")}),localStorage.setItem(themeLocalStorageKey,e)}function toggleTheme(){updateTheme("dark"===document.body.getAttribute("data-theme")?"light":"dark")}function setAccordionIdToLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));t[e]=e,localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function removeAccordionIdFromLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));delete t[e],localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function getAccordionIdsFromLocalStorage(){return JSON.parse(localStorage.getItem(accordionLocalStorageKey))||{}}function toggleAccordion(e){"false"===e.getAttribute("data-isopen")?(e.setAttribute("data-isopen","true"),setAccordionIdToLocalStorage(e.id)):(e.setAttribute("data-isopen","false"),removeAccordionIdFromLocalStorage(e.id))}function initAccordion(){void 0!==localStorage.getItem(accordionLocalStorageKey)&&null!==localStorage.getItem(accordionLocalStorageKey)||localStorage.setItem(accordionLocalStorageKey,"{}");var e=document.querySelectorAll(".sidebar-section-title"),t=getAccordionIdsFromLocalStorage();e.forEach(function(e){e.addEventListener("click",function(){toggleAccordion(e)}),e.id in t&&toggleAccordion(e)})}function isSourcePage(){return Boolean(document.querySelector("#source-page"))}function bringElementIntoView(e,t=!0){var o=document.querySelector(".navbar-container"),n=document.querySelector(".main-content"),i=e.getBoundingClientRect().top,c=16;o&&(c+=o.scrollHeight),n.scrollBy(0,i-c),t&&history.pushState(null,null,"#"+e.id)}function bringLinkToView(e){e.preventDefault(),e.stopPropagation();var e=e.currentTarget.getAttribute("href");!e||(e=document.getElementById(e.slice(1)))&&bringElementIntoView(e)}function bringIdToViewOnMount(){var e;isSourcePage()||""!==(e=window.location.hash)&&(e=document.getElementById(e.slice(1)))&&bringElementIntoView(e,!1)}function createAnchorElement(e){var t=document.createElement("a");return t.textContent="#",t.href="#"+e,t.classList.add("link-anchor"),t.onclick=bringLinkToView,t}function addAnchor(){var e=document.querySelector(".main-content").querySelector("section");[e.querySelectorAll("h1"),e.querySelectorAll("h2"),e.querySelectorAll("h3"),e.querySelectorAll("h4")].forEach(function(e){e.forEach(function(e){var t=createAnchorElement(e.id);e.classList.add("has-anchor"),e.append(t)})})}function copy(e){const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function showTooltip(e){var t=document.getElementById(e);t.classList.add("show-tooltip"),setTimeout(function(){t.classList.remove("show-tooltip")},3e3)}function copyFunction(e){var t=document.getElementById(e);copy((t.querySelector(".linenums")||t.querySelector("code")).innerText),showTooltip("tooltip-"+e)}function hideTocOnSourcePage(){isSourcePage()&&(document.querySelector(".toc-container").style.display="none")}function getPreTopBar(e,t=""){e='<button aria-label="copy code" class="icon-button" onclick="copyFunction(\''+e+'\')"><svg class="sm-icon" alt="click to copy"><use xlink:href="#copy-icon"></use></svg>'+('<div class="tooltip" id="tooltip-'+e+'">Copied!</div>')+"</button>";return'<div class="pre-top-bar-container">'+('<div class="code-lang-name-container"><div class="code-lang-name">'+t.toLocaleUpperCase()+"</div></div>")+e+"</div>"}function getPreDiv(){var e=document.createElement("div");return e.classList.add("pre-div"),e}function processAllPre(){var e=document.querySelectorAll("pre"),t=document.querySelector("#footer"),o=document.querySelector("#navbar"),t=t.getBoundingClientRect().height,o=o.getBoundingClientRect().height,i=window.innerHeight-o-t-250;e.forEach(function(e,t){var o=getPreDiv(),t="pre-id"+t,n=getPreTopBar(t,e.getAttribute("data-lang")||"");o.innerHTML=n,e.style.maxHeight=i+"px",e.id=t,e.parentNode.insertBefore(o,e),o.appendChild(e)})}function highlightAndBringLineIntoView(){var e=window.location.hash.replace("#line","");try{var t='[data-line-number="'+e+'"',o=document.querySelector(t);o.scrollIntoView(),o.parentNode.classList.add("selected")}catch(e){console.error(e)}}function getFontSize(){var e=16;try{e=Number.parseInt(html.style.fontSize.split("px")[0],10)}catch(e){console.log(e)}return e}function updateFontSize(e){html.style.fontSize=e+"px",localStorage.setItem(fontSizeLocalStorageKey,e);var t=document.querySelector("#font-size-text");t&&(t.innerHTML=e)}function incrementFont(e){var t=getFontSize();t<MAX_FONT_SIZE&&updateFontSize(t+1)}function decrementFont(e){var t=getFontSize();MIN_FONT_SIZE<t&&updateFontSize(t-1)}function fontSizeTooltip(){var e=getFontSize();return`
2
+ <div class="font-size-tooltip">
3
+ <button aria-label="decrease-font-size" class="icon-button ${MAX_FONT_SIZE<=e?"disabled":""}" onclick="decrementFont(event)">
4
+ <svg>
5
+ <use xlink:href="#minus-icon"></use>
6
+ </svg>
7
+ </button>
8
+ <div class="font-size-text" id="font-size-text">
9
+ ${e}
10
+ </div>
11
+ <button aria-label="increase-font-size" class="icon-button ${e<=MIN_FONT_SIZE?"disabled":""}" onclick="incrementFont(event)">
12
+ <svg>
13
+ <use xlink:href="#add-icon"></use>
14
+ </svg>
15
+ </button>
16
+ <button class="icon-button" onclick="updateFontSize(16)">
17
+ <svg>
18
+ <use xlink:href="#reset-icon"></use>
19
+ </svg>
20
+ </button>
21
+ </div>
22
+
23
23
  `}function initTooltip(){tippy(".theme-toggle",{content:"Toggle Theme",delay:500}),tippy(".search-button",{content:"Search",delay:500}),tippy(".font-size",{content:"Change font size",delay:500}),tippy(".codepen-button",{content:"Open code in CodePen",placement:"left"}),tippy(".font-size",{content:fontSizeTooltip(),trigger:"click",interactive:!0,allowHTML:!0,placement:"left"})}function fixTable(){var e,t=document.querySelectorAll("table");if(!(900<window.innerWidth))for(e of t){if(e.classList.contains("hljs-ln"))return;var o=document.createElement("div");o.classList.add("table-div"),e.parentNode.insertBefore(o,e),o.appendChild(e)}}function onMobileMenuClick(e){var t=document.querySelector("#mobile-sidebar"),e=e.currentTarget,o=e.querySelector("use"),n="true"===e.getAttribute("data-isopen");t&&(n?(t.classList.remove("show"),e.setAttribute("data-isopen","false"),o.setAttribute("xlink:href","#menu-icon")):(t.classList.add("show"),e.setAttribute("data-isopen","true"),o.setAttribute("xlink:href","#close-icon")))}function initMobileMenu(){var e=document.querySelector("#mobile-menu");e&&e.addEventListener("click",onMobileMenuClick)}function onDomContentLoaded(){var e=document.querySelectorAll(".theme-toggle");initMobileMenu(),e&&e.forEach(function(e){e.addEventListener("click",toggleTheme)}),hljs.addPlugin({"after:highlightElement":function(e){e.el.parentNode.setAttribute("data-lang","code")}}),hljs.highlightAll(),hljs.initLineNumbersOnLoad({singleLine:!0}),initAccordion(),addAnchor(),processAllPre(),hideTocOnSourcePage(),setTimeout(function(){bringIdToViewOnMount(),isSourcePage()&&highlightAndBringLineIntoView()},1e3),initTooltip(),fixTable()}!function(){var e=getTheme(),t=localStorage.getItem(themeLocalStorageKey);t?e!==t&&updateTheme(t):localStorage.setItem(themeLocalStorageKey,e)}(),function(){var e,t=getFontSize(),o=localStorage.getItem(fontSizeLocalStorageKey);o?(e=Number.parseInt(o,10))!==t&&updateFontSize(e):localStorage.setItem(o,t)}(),window.addEventListener("DOMContentLoaded",onDomContentLoaded);