From 9c576f13cb92ed5c0ed4126ccfd2978322e2f1c0 Mon Sep 17 00:00:00 2001
From: Daniela Rus Morales <danirus@eml.cc>
Date: Thu, 28 Nov 2024 10:55:11 +0100
Subject: [PATCH 1/4] Add READTHEDOCS to context

---
 sphinx_nefertiti/__init__.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sphinx_nefertiti/__init__.py b/sphinx_nefertiti/__init__.py
index 736011e..9abe6c1 100644
--- a/sphinx_nefertiti/__init__.py
+++ b/sphinx_nefertiti/__init__.py
@@ -1,6 +1,7 @@
 """sphinx-nefertiti theme"""
 
 import json
+import os
 import shutil
 from pathlib import Path
 
@@ -74,6 +75,8 @@ def update_context(app, pagename, templatename, context, doctree):
     context["footer_links"] = app.footer_links
     context["show_colorset_choices"] = app.show_colorset_choices
     context["all_colorsets"] = colorsets.all_colorsets
+    if os.environ.get("READTHEDOCS", None) == "True":
+        context["READTHEDOCS"] = True
 
 
 def setup(app):

From 24aefb68ff1f6cf7bd22a1a116dfc9b1b175a863 Mon Sep 17 00:00:00 2001
From: Daniela Rus Morales <danirus@eml.cc>
Date: Thu, 28 Nov 2024 11:58:14 +0100
Subject: [PATCH 2/4] RTD: versions no longer available in context

---
 docs/source/conf.py                           | 28 +++++----
 js/src/versions.js                            |  4 +-
 sphinx_nefertiti/__init__.py                  |  8 +--
 sphinx_nefertiti/docsver.py                   |  3 +
 .../static/sphinx-nefertiti.min.js            |  4 +-
 .../static/sphinx-nefertiti.min.js.map        |  2 +-
 sphinx_nefertiti/version-dropdown.html        | 60 ++++---------------
 tests/test_sample_projects.py                 |  4 +-
 8 files changed, 43 insertions(+), 70 deletions(-)

diff --git a/docs/source/conf.py b/docs/source/conf.py
index 453f176..8f84c36 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -5,13 +5,13 @@
 import sphinx_nefertiti
 
 
-on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
-if on_rtd:
-    html_theme_path = [sphinx_nefertiti.get_html_theme_path()]
-else:
-    # Add `sphinx_nefertiti` to the python path.
-    PRJ_PATH = Path(__file__).parents[2]
-    sys.path.insert(0, str(PRJ_PATH))
+# on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+# if on_rtd:
+#     html_theme_path = [sphinx_nefertiti.get_html_theme_path()]
+# else:
+#     # Add `sphinx_nefertiti` to the python path.
+#     PRJ_PATH = Path(__file__).parents[2]
+#     sys.path.insert(0, str(PRJ_PATH))
 
 
 # -- Project information -----------------------------------------------------
@@ -29,10 +29,15 @@
 # The X.Y.Z number.
 release = ".".join(_ver_list[:3])
 
-release_pattern_url = "https://sphinx-nefertiti.readthedocs.io/{release}/"
+docs_fmt_url = "https://sphinx-nefertiti.readthedocs.io/{release}/"
 
 releases = [
+    "latest",
     release,
+    "0.4.2",
+    "0.3.7",
+    "0.2.3",
+    "0.1.13",
 ]
 
 # -- General configuration ---------------------------------------------------
@@ -45,7 +50,7 @@
     'sphinx_design',
     'sphinx_copybutton',
     'sphinx_colorschemed_images',
-    'sphinx_nefertiti'
+    'sphinx_nefertiti',
 ]
 
 myst_enable_extensions = [
@@ -92,10 +97,9 @@
     "repository_url": "https://github.com/danirus/sphinx-nefertiti",
     "repository_name": "sphinx-nefertiti",
 
-    "current_version": f"v{release}",
+    "current_version": "latest",
     "versions": [
-        ("v%s" % item, release_pattern_url.format(release=item))
-        for item in releases
+        (item, docs_fmt_url.format(release=item)) for item in releases
     ],
 
     # "header_links_in_2nd_row": False,
diff --git a/js/src/versions.js b/js/src/versions.js
index 36001e9..d1c9a74 100644
--- a/js/src/versions.js
+++ b/js/src/versions.js
@@ -9,7 +9,7 @@ function _getCurrentVersion() {
       return version_elem.dataset?.snfttVersion;
     };
   }
-  return "";
+  return globalThis.def_ver || "";
 }
 
 export function updateVersion() {
@@ -42,7 +42,7 @@ export function feedVersionsMenu() {
   // Use the variable 'docs_versions' loaded as a script in layout.html.
   // The file docs_versions.js is produced by versions.py when building
   // the site (make html).
-  for (const item of docs_versions) {
+  for (const item of globalThis.docs_versions) {
     const li = document.createElement("li");
     const anchor = document.createElement("a");
     anchor.classList.add(
diff --git a/sphinx_nefertiti/__init__.py b/sphinx_nefertiti/__init__.py
index 9abe6c1..c571ca6 100644
--- a/sphinx_nefertiti/__init__.py
+++ b/sphinx_nefertiti/__init__.py
@@ -1,7 +1,6 @@
 """sphinx-nefertiti theme"""
 
 import json
-import os
 import shutil
 from pathlib import Path
 
@@ -63,7 +62,10 @@ def initialize_theme(app):
     docs_versions_script = "docs-versions.js"
     docs_versions_path = dest_dir / docs_versions_script
     with docs_versions_path.open("w") as f:
-        f.write("const docs_versions = " + json.dumps(app.all_docs_versions))
+        versions_value = json.dumps(app.all_docs_versions)
+        f.write(f"window.docs_versions = {versions_value};\n")
+        if docsver_provider.current_version is not None:
+            f.write(f"window.def_ver = '{docsver_provider.current_version}';")
     app.add_js_file(docs_versions_script)
     app.add_js_file("sphinx-nefertiti.min.js")
     app.add_js_file("bootstrap.bundle.min.js")
@@ -75,8 +77,6 @@ def update_context(app, pagename, templatename, context, doctree):
     context["footer_links"] = app.footer_links
     context["show_colorset_choices"] = app.show_colorset_choices
     context["all_colorsets"] = colorsets.all_colorsets
-    if os.environ.get("READTHEDOCS", None) == "True":
-        context["READTHEDOCS"] = True
 
 
 def setup(app):
diff --git a/sphinx_nefertiti/docsver.py b/sphinx_nefertiti/docsver.py
index 037a7ef..28fb03b 100644
--- a/sphinx_nefertiti/docsver.py
+++ b/sphinx_nefertiti/docsver.py
@@ -1,5 +1,6 @@
 class DocsVersionProvider:
     def __init__(self, app):
+        self.current_version = None
         theme_user_prefs = app.config.html_theme_options
 
         self._index = -1
@@ -8,6 +9,8 @@ def __init__(self, app):
         if "versions" not in theme_user_prefs:
             return
 
+        self.current_version = theme_user_prefs.get("current_version", None)
+
         for name, url in theme_user_prefs["versions"]:
             self._assets.append({"name": name, "url": url})
 
diff --git a/sphinx_nefertiti/static/sphinx-nefertiti.min.js b/sphinx_nefertiti/static/sphinx-nefertiti.min.js
index 4509fca..4d1c498 100644
--- a/sphinx_nefertiti/static/sphinx-nefertiti.min.js
+++ b/sphinx_nefertiti/static/sphinx-nefertiti.min.js
@@ -1,7 +1,7 @@
 function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,s,"next",e)}function s(e){asyncGeneratorStep(a,n,o,i,s,"throw",e)}i(void 0)}))}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _createForOfIteratorHelperLoose$1(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$1(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _regeneratorRuntime(){_regeneratorRuntime=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var a=t&&t.prototype instanceof g?t:g,i=Object.create(a.prototype),s=new T(n||[]);return o(i,"_invoke",{value:A(e,r,s)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",v="executing",h="completed",m={};function g(){}function y(){}function _(){}var b={};l(b,i,(function(){return this}));var L=Object.getPrototypeOf,w=L&&L(L(H([])));w&&w!==r&&n.call(w,i)&&(b=w);var S=_.prototype=g.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,a,i,s){var c=d(e[o],e,a);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(u).then((function(e){l.value=e,i(l)}),(function(e){return r("throw",e,i,s)}))}s(c.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function A(t,r,n){var o=f;return function(a,i){if(o===v)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var c=I(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?h:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=_,o(S,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:y,configurable:!0}),y.displayName=l(_,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},x(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new E(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},x(S),l(S,c,"Generator"),l(S,i,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function _taggedTemplateLiteralLoose(e,t){return t||(t=e.slice(0)),e.raw=t,e}function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:t+""}function _unsupportedIterableToArray$1(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray$1(e,t):void 0}}var BACK_TO_TOP_BUTTON_ID="back-to-top",BACK_TO_TOP_DIV_ID="back-to-top-container",NAVBAR_ID="snftt-nav-bar",DEFAULT_NAVBAR_HEIGHT=60,BackToTop=function(){var e=this;this._scrollHandler=function(t){var r=window.pageYOffset||document.documentElement.scrollTop;r>e.prev_offset||r<=e.navbar_height?e.btn.classList.add("d-none"):r<e.prev_offset&&r>e.navbar_height&&e.btn.classList.remove("d-none"),e.prev_offset=r<=0?0:r},this._scrollToTopHandler=function(e){e.preventDefault(),document.documentElement.scrollTop=0},this.init=function(){window.addEventListener("scroll",e._scrollHandler,!1),e.btn.addEventListener("click",e._scrollToTopHandler,!1)},this.btn=document.getElementById(BACK_TO_TOP_BUTTON_ID),this.prev_offset=0;var t=document.getElementById(NAVBAR_ID);this.navbar_height=t.offsetHeight||DEFAULT_NAVBAR_HEIGHT,document.getElementById(BACK_TO_TOP_DIV_ID).style.top=this.navbar_height+16+"px"},FIGURE_IMG_SELECTOR="#content figure";function fixFigureStyle(){for(var e,t=_createForOfIteratorHelperLoose$1(document.querySelectorAll(FIGURE_IMG_SELECTOR));!(e=t()).done;){var r=e.value,n=r.querySelector("img");if(n&&n.style&&(n.style.width||n.style.height)){var o=n.width;r.style.width=o+"px";var a=r.querySelector("figcaption");a&&(a.style.width=o+"px"),n.style.width&&(n.style.width="")}}}
 /*!
-  * sphinx-colorschemed-images v0.2.0 (https://github.com/danirus/sphinx-colorschemed-images).
+  * sphinx-colorschemed-images v0.2.2 (https://github.com/danirus/sphinx-colorschemed-images).
   * Copyright 2024 Daniela Rus Morales.
   * Licensed under MIT (https://github.com/danirus/sphinx-colorschemed-images/blob/main/LICENSE).
-  */function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _createForOfIteratorHelperLoose(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}var SphinxColorschemeImageHandler=function(e){var t=this;void 0===e&&(e={}),this.activate=function(e){for(var t,r="data-alt-src-color-scheme-"+e,n=function(){var e=t.value,n=new Image,o=e.getAttribute(r);n.src=o,n.addEventListener("load",(function(){e.src=n.src})),n.addEventListener("error",(function(){console.error("Could not replace image "+e.src+" with "+o+".")})),n.complete&&(e.src=n.src);var a=e.closest("figure");if(null!=a){var i=a.querySelector("a");i.getAttribute("href")!==o&&(i.href=o)}else"A"==e.parentElement.tagName&&e.parentElement.getAttribute("href")!==o&&(e.parentElement.href=e.getAttribute(r))},o=_createForOfIteratorHelperLoose(document.querySelectorAll("img["+r+"]"));!(t=o()).done;)n()},this._schemes=[],this._mediaqs=[],this._auto=!e.hasOwnProperty("auto")||!0===e.auto;var r=document.querySelector('meta[name="color-scheme"]'),n=null==r?"":r.content;if(n.length>0)for(var o,a=_createForOfIteratorHelperLoose(n.split(" "));!(o=a()).done;){var i=o.value;this._schemes.push(i.trim())}else this._schemes=["light","dark"];for(var s,c=function(){var e=s.value,r=globalThis.matchMedia("(prefers-color-scheme: "+e+")");r.matches&&t.activate(e),!0===t._auto&&(r.addEventListener("change",(function(r){r.matches&&t.activate(e)})),t._mediaqs.push(r))},l=_createForOfIteratorHelperLoose(this._schemes);!(s=l()).done;)c()},CSchemeHandler=function(){function e(){var e=this;this.stored=localStorage.getItem("snftt-color-scheme")||"default",this._cshdl=new SphinxColorschemeImageHandler({auto:!1});for(var t=function(){var t=n[r],o=globalThis.matchMedia("(prefers-color-scheme: "+t+")");o.matches&&"default"==e.stored&&(e.apply(t),e.updateDropdown(e.stored),e._cshdl.activate(t)),o.addEventListener("change",(function(r){r.matches&&(e.apply(t),e._cshdl.activate(t))}))},r=0,n=["dark","light"];r<n.length;r++)t();"default"!=this.stored&&(this.apply(this.stored),this.updateDropdown(this.stored),this._cshdl.activate(this.stored))}var t=e.prototype;return t.registerClickEvents=function(){for(var e,t=this,r=function(){var r=e.value;r.addEventListener("click",(function(e){e.preventDefault(),t.stored=r.dataset.snfttLuz,localStorage.setItem("snftt-color-scheme",t.stored),t.apply(t.stored),t.updateDropdown(t.stored,!0),t._cshdl.activate(t.preferred)}))},n=_createForOfIteratorHelperLoose$1(document.querySelectorAll("[data-snftt-luz]"));!(e=n()).done;)r()},t.apply=function(e){switch(e){case"default":return document.documentElement.classList.remove("light"),document.documentElement.classList.remove("dark"),void document.documentElement.classList.add(this.preferred);case"dark":return document.documentElement.classList.remove("light"),void document.documentElement.classList.add("dark");case"light":return document.documentElement.classList.remove("dark"),void document.documentElement.classList.add("light")}},t.updateDropdown=function(e,t){void 0===t&&(t=!1);for(var r,n="data-snftt-luz",o=document.querySelector("#snftt-luz"),a=document.querySelector("["+n+"-icon-active]"),i=document.querySelector("["+n+'="'+e+'"]'),s=document.querySelector("["+n+'-icon="'+e+'"]'),c=_createForOfIteratorHelperLoose$1(document.querySelectorAll("["+n+"]"));!(r=c()).done;){var l=r.value;l.classList.remove("active","current"),l.setAttribute("aria-pressed","false")}null!=i&&(i.classList.add("active","current"),i.setAttribute("aria-pressed","true")),null==a||a.setAttribute("class",s.classList.value),t&&o.focus()},_createClass(e,[{key:"preferred",get:function(){return["light","dark"].includes(this.stored)?this.stored:globalThis.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}}])}(),TEMPLATE_SELECTOR="[data-toggle-item-template]";function loadRefList(){var e=[],t=localStorage.getItem("toc-expanded");return null!=t&&t.trim().length&&(e=t.split(",")),e}var MenuHandler=function(){var e=this;this._removeRef=function(t){var r=e.refs.indexOf(t);r>-1&&(e.refs.splice(r,1),localStorage.setItem("toc-expanded",e.refs.join(",")))},this._expandRefs=function(){for(var t,r=_createForOfIteratorHelperLoose$1(e.refs);!(t=r()).done;){var n=t.value,o=e.toc.querySelector("li[data-snftt-ref='"+n+"']");null!=o?o.classList.contains("expand")||(o.classList.toggle("expand"),e._updateItem(o)):e._removeRef(n)}},this._expandOrFoldAll=function(t){void 0===t&&(t=!0);for(var r,n=_createForOfIteratorHelperLoose$1(e.toc?e.toc.querySelectorAll("a.reference"):[]);!(r=n()).done;){var o=r.value;if(o.nextElementSibling){var a=o.parentElement;t?a.classList.add("expand"):a.classList.remove("expand"),e._updateItem(a,!1)}}},this._updateItem=function(t,r){void 0===r&&(r=!0);var n=t.querySelector("i");t.classList.contains("expand")?(n.classList.remove("bi-caret-right"),n.classList.add("bi-caret-down"),r&&!e.refs.includes(t.dataset.snfttRef)&&(e.refs.push(t.dataset.snfttRef),localStorage.setItem("toc-expanded",e.refs.join(",")))):(n.classList.remove("bi-caret-down"),n.classList.add("bi-caret-right"),r&&e.refs.includes(t.dataset.snfttRef)&&e._removeRef(t.dataset.snfttRef))},this._clickHandler=function(t){var r=t.currentTarget,n=null==r?void 0:r.parentElement;n.classList.toggle("expand"),e._updateItem(n)},this._keyupHandler=function(t){var r=e.toc.querySelectorAll("ul"),n=e.toc.querySelectorAll("a.reference");if(0===e.filter.value.length){for(var o,a=_createForOfIteratorHelperLoose$1(n);!(o=a()).done;){var i;null==(i=o.value.parentElement)||i.classList.remove("d-none")}for(var s,c=_createForOfIteratorHelperLoose$1(r);!(s=c()).done;)s.value.classList.remove("d-none");return e._expandOrFoldAll(!1),void e._expandRefs()}for(var l,u=_createForOfIteratorHelperLoose$1(n);!(l=u()).done;){var d;null==(d=l.value.parentElement)||d.classList.add("d-none")}for(var f,p=_createForOfIteratorHelperLoose$1(r);!(f=p()).done;)f.value.classList.add("d-none");e._expandOrFoldAll(!0);for(var v,h=new RegExp(e.filter.value,"i"),m=_createForOfIteratorHelperLoose$1(n);!(v=m()).done;){var g,y=v.value;if(h.test(y.textContent))for(var _=y,b=null==(g=_)?void 0:g.parentElement;_;){var L,w;_.classList.remove("d-none"),"UL"===(b=_.parentElement).nodeName&&(null==(w=b)||w.classList.remove("d-none")),_=null==(L=b)?void 0:L.closest("li")}}},this.init=function(){var t=0;e.toc=document.querySelector(".toc"),e.filter=e.toc.querySelector("input[name='filter']"),e.refs=loadRefList();var r=e.toc?e.toc.querySelectorAll("a.reference"):[],n=document.querySelector(TEMPLATE_SELECTOR),o=null==n?void 0:n.content.firstElementChild;if(null==o)return-1;e.filter.addEventListener("keyup",e._keyupHandler);for(var a,i=_createForOfIteratorHelperLoose$1(r);!(a=i()).done;){var s=a.value;if(s.nextElementSibling){var c=o.cloneNode(!0);c.addEventListener("click",e._clickHandler,!0),s.before(c);var l=s.parentElement;l.dataset.snfttRef=s.href,l&&l.classList.contains("current")&&(l.classList.toggle("current"),l.classList.toggle("expand"),e._updateItem(l)),t++}}return e._expandRefs(),t},this.toc,this.refs,this.filter};function _addActiveCssClass(e){if(e.classList.add("active"),e.ariaCurrent=!0,e.classList.contains("dropdown-item")){var t=e.closest("li.nav-item.dropdown");if(!t)return;var r=t.querySelector("a.nav-link.dropdown-toggle");if(!r)return;r&&(r.classList.add("active"),r.ariaCurrent=!0)}}function selectActiveHeaderLink(){for(var e,t=URL.parse(window.location.href),r=_createForOfIteratorHelperLoose$1(document.querySelectorAll(".snftt-hl"));!(e=r()).done;){var n=e.value;n.classList.remove("active"),n.ariaCurrent=!1}for(var o,a=".snftt-hl[href='#']",i=_createForOfIteratorHelperLoose$1(document.querySelectorAll(a));!(o=i()).done;){var s=o.value;s.classList.contains("dropdown-toggle")||_addActiveCssClass(s)}var c=0;a=".nftt-header-links-large .snftt-hl[data-snftt-hl-regexps]";for(var l,u=_createForOfIteratorHelperLoose$1(document.querySelectorAll(a));!(l=u()).done;)for(var d,f=l.value,p=_createForOfIteratorHelperLoose$1(f.dataset.snfttHlRegexps.split("&&"));!(d=p()).done;){var v=d.value;if(new RegExp(v).test(t.pathname)){c=f.dataset.snfttHlId;break}}if(0!=c){a=".snftt-hl[data-snftt-hl-id='"+c+"']";for(var h,m=_createForOfIteratorHelperLoose$1(document.querySelectorAll(a));!(h=m()).done;)_addActiveCssClass(h.value)}}function formatNumber(e){var t=document.documentElement.lang||"en";return e.toLocaleString(t,{maximumFractionDigits:2,notation:"compact",compactDisplay:"short"})}function readFromGitHub(e,t){return _readFromGitHub.apply(this,arguments)}function _readFromGitHub(){return(_readFromGitHub=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,a,i,s,c,l,u;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="",o="",a="",i="https://api.github.com/repos/"+t+"/"+r,e.next=6,fetch(i);case 6:if(200===(s=e.sent).status){e.next=9;break}throw new Error("Rate limit reached.");case 9:return e.next=11,s.json();case 11:return c=e.sent,o=formatNumber(c.stargazers_count),localStorage.setItem(t+":"+r+":stars",o),a=formatNumber(c.forks_count),localStorage.setItem(t+":"+r+":forks",a),e.next=18,fetch(i+"/releases/latest");case 18:if(200===(l=e.sent).status){e.next=21;break}throw new Error("Rate limit reached.");case 21:return e.next=23,l.json();case 23:if(u=e.sent,n=u.tag_name,localStorage.setItem(t+":"+r+":tag",n),""===n||""==o||""==a){e.next=28;break}return e.abrupt("return",{tag:n,stars:o,forks:a});case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function readFromGitLab(e,t){return _readFromGitLab.apply(this,arguments)}function _readFromGitLab(){return(_readFromGitLab=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,a,i,s;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="",o="",a="https://"+t+"/api/v4/projects/"+encodeURIComponent(r),e.next=5,fetch(a);case 5:if(200===(i=e.sent).status){e.next=8;break}throw new Error("Rate limit reached.");case 8:return e.next=10,i.json();case 10:if(s=e.sent,n=formatNumber(s.star_count),localStorage.setItem(t+":"+r+":stars",n),o=formatNumber(s.forks_count),localStorage.setItem(t+":"+r+":forks",o),""==n||""==o){e.next=17;break}return e.abrupt("return",{tag:"",stars:n,forks:o});case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ls=localStorage,qs_repo_url="[data-snftt-repo-url]",qs_repo_facts="[data-snftt-repo-metrics]",qs_repo_tag="[data-snftt-repo-tag]",qs_repo_stars="[data-snftt-repo-stars]",qs_repo_forks="[data-snftt-repo-forks]";function _updateFactsComponent(e){var t=0,r=document.querySelector(qs_repo_facts),n=document.querySelector(qs_repo_tag),o=document.querySelector(qs_repo_stars),a=document.querySelector(qs_repo_forks);return null!=e.tag&&e.tag.length>0?(n.textContent=e.tag,t++):(n.parentElement.classList.remove("d-flex"),n.parentElement.classList.add("d-none")),null!=e.stars&&e.stars.length>0?(o.textContent=e.stars,t++):(o.parentElement.classList.remove("d-flex"),o.parentElement.classList.add("d-none")),null!=e.forks&&e.forks.length>0?(a.textContent=e.forks,t++):(a.parentElement.classList.remove("d-flex"),a.parentElement.classList.add("d-none")),r.classList.add("ready"),t}function _readFromLocalStorage(e,t){var r=ls.getItem(e+":"+t+":tag"),n=ls.getItem(e+":"+t+":stars"),o=ls.getItem(e+":"+t+":forks");return n&&o?{tag:r,stars:n,forks:o}:{tag:"",stars:"",forks:""}}function _getRepoMetrics(e,t,r){return _getRepoMetrics2.apply(this,arguments)}function _getRepoMetrics2(){return(_getRepoMetrics2=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var o,a,i,s;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=ls.getItem(r+":"+n+":lastaccess"))&&(i=Date.now(),(s=new Date).setTime(Number.parseInt(a)+6e4),s.getTime()>i&&(o=_readFromLocalStorage(r,n))),o){e.next=21;break}e.prev=3,e.t0=t,e.next="github"===e.t0?7:"gitlab"===e.t0?11:15;break;case 7:return e.next=9,readFromGitHub(r,n);case 9:return o=e.sent,e.abrupt("break",15);case 11:return e.next=13,readFromGitLab(r,n);case 13:return o=e.sent,e.abrupt("break",15);case 15:localStorage.setItem(r+":"+n+":lastaccess",""+Date.now()),e.next=21;break;case 18:e.prev=18,e.t1=e.catch(3),o=_readFromLocalStorage(r,n);case 21:return e.abrupt("return",o);case 22:case"end":return e.stop()}}),e,null,[[3,18]])})))).apply(this,arguments)}function updateRepoMetrics(){return _updateRepoMetrics.apply(this,arguments)}function _updateRepoMetrics(){return(_updateRepoMetrics=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o,a,i,s,c,l,u;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.querySelector(qs_repo_url),r=t?t.dataset.snfttRepoUrl:"",!(n=r.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i))){e.next=10;break}return o=n[1],a=n[2],e.next=7,_getRepoMetrics("github",o,a);case 7:if(!(i=e.sent)){e.next=10;break}return e.abrupt("return",_updateFactsComponent(i));case 10:if(!(s=r.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i))){e.next=18;break}return c=s[1],l=s[2],e.next=15,_getRepoMetrics("gitlab",c,l);case 15:if(!(u=e.sent)){e.next=18;break}return e.abrupt("return",_updateFactsComponent(u));case 18:return e.abrupt("return",-1);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _templateObject,TocObserver=function(){var e=this;this._sectionsObservationHandler=function(t){t.map((function(t){var r=t.target,n=e.toc.querySelector("a[href='#"+r.id+"']"),o=null==n?void 0:n.parentElement;!0===t.isIntersecting?null==o||o.classList.add("active"):null==o||o.classList.remove("active")}))},this._initializeSectionsObserver=function(t){e.section_observer=new IntersectionObserver(e._sectionsObservationHandler,{root:void 0,rootMargin:t,threshold:[0,.25,.5,.75,1]});for(var r,n=_createForOfIteratorHelperLoose$1(e.doc.querySelectorAll(":scope section"));!(r=n()).done;){var o=r.value;e.section_observer.observe(o)}},this.init=function(){var t;if(e.doc=document.querySelector(".nftt-content"),e.toc=document.querySelector("#TableOfContents"),null==e.doc||null==e.toc)return-1;var r="-"+((null==(t=document.querySelector("header"))?void 0:t.offsetHeight)||0)+"px 0px 0px 0px",n=e.doc.querySelector("section a.headerlink"),o=e.toc.querySelector("a.reference[href='#']");null!=n&&null!=o&&o.setAttribute("href",n.getAttribute("href"));for(var a,i=_createForOfIteratorHelperLoose$1(e.toc.querySelectorAll("a.reference"));!(a=i()).done;)a.value.classList.remove("active");return e._initializeSectionsObserver(r),0},this.doc,this.toc,this.section_observer};function resizeAsides(){var e,t="",r=document.querySelector(".nftt-content"),n=document.querySelector(".nftt-sidebar"),o=document.getElementById("back-to-top-container"),a=document.querySelector(".nftt-toc"),i=null==(e=document.querySelector("header"))?void 0:e.offsetHeight;return 0==window.matchMedia("(min-width: 1200px)").matches?(null==n||n.setAttribute("style",""),null==a||a.setAttribute("style",""),""):(null!=r&&(t=(r.clientHeight>document.body.clientHeight?"height: calc(100vh - "+(i+40)+"px)":"height: "+r.clientHeight+"px")+"; top: "+(i+40)+"px;",null==n||n.setAttribute("style",t),null==a||a.setAttribute("style",t),null==o||o.setAttribute("style","top: "+(i+20)+"px")),t)}function updateScrollPaddingTop(){var e,t=-1,r=document.querySelector("html"),n=null==(e=r.querySelector("header"))?void 0:e.offsetHeight;return null!=n&&(t=n+24,r.setAttribute("style","scroll-padding-top: "+t+"px")),t}var qs_version_url="[data-snftt-version-url]";function _getCurrentVersion(){for(var e,t=_createForOfIteratorHelperLoose$1(document.querySelectorAll(qs_version_url));!(e=t()).done;){var r,n,o=e.value,a=null==(r=o.dataset)?void 0:r.snfttVersionUrl;if(a=a.replace("?",String.raw(_templateObject||(_templateObject=_taggedTemplateLiteralLoose(["?"],["\\?"])))),new RegExp(a).test(window.location.href))return null==(n=o.dataset)?void 0:n.snfttVersion}return""}function updateVersion(){for(var e,t=_getCurrentVersion(),r=document.querySelector("[data-snftt-version-active]"),n='[data-snftt-version="'+t+'"]',o=document.querySelector(n),a=_createForOfIteratorHelperLoose$1(document.querySelectorAll("[data-snftt-version]"));!(e=a()).done;){var i=e.value;i.classList.remove("active","current"),i.setAttribute("aria-pressed","false")}null!=o&&(o.classList.add("active","current"),o.setAttribute("aria-pressed","true"),null!=r&&(r.textContent=o.dataset.snfttVersion))}function feedVersionsMenu(){var e=document.getElementById("versions-dropdown-menu");if(!e)return console.log("Did not find the versions dropdown menu."),!1;for(var t,r=_createForOfIteratorHelperLoose$1(docs_versions);!(t=r()).done;){var n=t.value,o=document.createElement("li"),a=document.createElement("a");a.classList.add("dropdown-item","d-flex","align-items-center","justify-content-between"),a.setAttribute("aria-pressed","false"),a.setAttribute("href",n.url),a.dataset.snfttVersionUrl=n.url,a.dataset.snfttVersion=n.name;var i=document.createElement("span");i.classList.add("small","ms-2"),i.textContent=n.name;var s=document.createElement("i");s.classList.add("bi","bi-check","ms-auto"),a.append(i),a.append(s),o.append(a),e.append(o)}return!0}function agentHas(e){return navigator.userAgent.toLowerCase().search(e.toLowerCase())>-1}function isFirefox(){return agentHas("Firefox")||agentHas("FxiOS")||agentHas("Focus")}function isSafari(){return(!!window.ApplePaySetupFeature||!!window.safari)&&agentHas("Safari")&&!agentHas("Chrome")&&!agentHas("CriOS")}function runWhenDOMContentLoaded(e){"loading"!=document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",(function(){"complete"==document.readyState&&e()}))}function loadSphinxNefertiti(){if(fixFigureStyle(),-1==(new MenuHandler).init()&&(console.log("Could not find the <template data-toggle-item-template>."),console.log("Therefore left side nested menu entries will not be visible.")),updateScrollPaddingTop(),resizeAsides(),new ResizeObserver((function(e){var t,r=null==(t=document.querySelector("header"))?void 0:t.offsetHeight;document.body.style.paddingTop=r+4+"px",updateScrollPaddingTop(),resizeAsides()})).observe(document.body),window.addEventListener("resize",[updateScrollPaddingTop,resizeAsides]),(new CSchemeHandler).registerClickEvents(),feedVersionsMenu(),updateVersion(),-1==updateRepoMetrics()&&console.log("Could not find an element with [data-snftt-repo-url]"),(new TocObserver).init(),isSafari()||isFirefox()){var e,t=document.head;isSafari()?e=".nftt-toc nav ul ul {   padding-left: 0.8rem;}":isFirefox()&&(e=".nftt-toc nav ul ul {   padding-left: 0.55rem;}");var r=document.createElement("style");r.append(document.createTextNode(e)),t.append(r)}for(var n,o=_createForOfIteratorHelperLoose$1(document.querySelectorAll("input.task-list-item-checkbox"));!(n=o()).done;){var a=n.value;a.setAttribute("title","Is task done? "+a.checked)}for(var i,s=_createForOfIteratorHelperLoose$1(document.querySelectorAll("table.docutils"));!(i=s()).done;){var c=i.value,l=document.createElement("div");l.classList.add("nftt-table"),c.before(l),l.append(c)}for(var u=0,d=[["div.versionadded","versionadded","versionadded-title-only"],["div.versionchanged","versionchanged","versionchanged-title-only"],["div.deprecated","deprecated","deprecated-title-only"],["div.versionremoved","versionremoved","versionremoved-title-only"]];u<d.length;u++)for(var f,p=d[u],v=p[0],h=p[1],m=p[2],g=_createForOfIteratorHelperLoose$1(document.querySelectorAll(v));!(f=g()).done;){var y=f.value;1==y.querySelector("p").childNodes.length&&y.classList.replace(h,m)}(new BackToTop).init(),selectActiveHeaderLink();var _=document.querySelector(".nftt-sidebar a.current");if(_){var b=_.closest(".toc li");b&&b.scrollIntoView({behavior:"smooth",block:"end"})}}runWhenDOMContentLoaded(loadSphinxNefertiti);
+  */function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _createForOfIteratorHelperLoose(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}var SphinxColorschemeImageHandler=function(e){var t=this;void 0===e&&(e={}),this.activate=function(e){for(var t,r="data-alt-src-color-scheme-"+e,n=function(){var e=t.value,n=new Image,o=e.getAttribute(r);n.src=o,n.addEventListener("load",(function(){e.src=n.src})),n.addEventListener("error",(function(){console.error("Could not replace image "+e.src+" with "+o+".")})),n.complete&&(e.src=n.src);var a=e.closest("figure");if(null!=a){var i=a.querySelector("a");i.getAttribute("href")!==o&&(i.href=o)}else"A"==e.parentElement.tagName&&e.parentElement.getAttribute("href")!==o&&(e.parentElement.href=e.getAttribute(r))},o=_createForOfIteratorHelperLoose(document.querySelectorAll("img["+r+"]"));!(t=o()).done;)n()},this._schemes=[],this._mediaqs=[],this._auto=!e.hasOwnProperty("auto")||!0===e.auto;var r=document.querySelector('meta[name="color-scheme"]'),n=null==r?"":r.content;if(n.length>0)for(var o,a=_createForOfIteratorHelperLoose(n.split(" "));!(o=a()).done;){var i=o.value;this._schemes.push(i.trim())}else this._schemes=["light","dark"];for(var s,c=function(){var e=s.value,r=globalThis.matchMedia("(prefers-color-scheme: "+e+")");r.matches&&t.activate(e),!0===t._auto&&(r.addEventListener("change",(function(r){r.matches&&t.activate(e)})),t._mediaqs.push(r))},l=_createForOfIteratorHelperLoose(this._schemes);!(s=l()).done;)c()},CSchemeHandler=function(){function e(){var e=this;this.stored=localStorage.getItem("snftt-color-scheme")||"default",this._cshdl=new SphinxColorschemeImageHandler({auto:!1});for(var t=function(){var t=n[r],o=globalThis.matchMedia("(prefers-color-scheme: "+t+")");o.matches&&"default"==e.stored&&(e.apply(t),e.updateDropdown(e.stored),e._cshdl.activate(t)),o.addEventListener("change",(function(r){r.matches&&(e.apply(t),e._cshdl.activate(t))}))},r=0,n=["dark","light"];r<n.length;r++)t();"default"!=this.stored&&(this.apply(this.stored),this.updateDropdown(this.stored),this._cshdl.activate(this.stored))}var t=e.prototype;return t.registerClickEvents=function(){for(var e,t=this,r=function(){var r=e.value;r.addEventListener("click",(function(e){e.preventDefault(),t.stored=r.dataset.snfttLuz,localStorage.setItem("snftt-color-scheme",t.stored),t.apply(t.stored),t.updateDropdown(t.stored,!0),t._cshdl.activate(t.preferred)}))},n=_createForOfIteratorHelperLoose$1(document.querySelectorAll("[data-snftt-luz]"));!(e=n()).done;)r()},t.apply=function(e){switch(e){case"default":return document.documentElement.classList.remove("light"),document.documentElement.classList.remove("dark"),void document.documentElement.classList.add(this.preferred);case"dark":return document.documentElement.classList.remove("light"),void document.documentElement.classList.add("dark");case"light":return document.documentElement.classList.remove("dark"),void document.documentElement.classList.add("light")}},t.updateDropdown=function(e,t){void 0===t&&(t=!1);for(var r,n="data-snftt-luz",o=document.querySelector("#snftt-luz"),a=document.querySelector("["+n+"-icon-active]"),i=document.querySelector("["+n+'="'+e+'"]'),s=document.querySelector("["+n+'-icon="'+e+'"]'),c=_createForOfIteratorHelperLoose$1(document.querySelectorAll("["+n+"]"));!(r=c()).done;){var l=r.value;l.classList.remove("active","current"),l.setAttribute("aria-pressed","false")}null!=i&&(i.classList.add("active","current"),i.setAttribute("aria-pressed","true")),null==a||a.setAttribute("class",s.classList.value),t&&o.focus()},_createClass(e,[{key:"preferred",get:function(){return["light","dark"].includes(this.stored)?this.stored:globalThis.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}}])}(),TEMPLATE_SELECTOR="[data-toggle-item-template]";function loadRefList(){var e=[],t=localStorage.getItem("toc-expanded");return null!=t&&t.trim().length&&(e=t.split(",")),e}var MenuHandler=function(){var e=this;this._removeRef=function(t){var r=e.refs.indexOf(t);r>-1&&(e.refs.splice(r,1),localStorage.setItem("toc-expanded",e.refs.join(",")))},this._expandRefs=function(){for(var t,r=_createForOfIteratorHelperLoose$1(e.refs);!(t=r()).done;){var n=t.value,o=e.toc.querySelector("li[data-snftt-ref='"+n+"']");null!=o?o.classList.contains("expand")||(o.classList.toggle("expand"),e._updateItem(o)):e._removeRef(n)}},this._expandOrFoldAll=function(t){void 0===t&&(t=!0);for(var r,n=_createForOfIteratorHelperLoose$1(e.toc?e.toc.querySelectorAll("a.reference"):[]);!(r=n()).done;){var o=r.value;if(o.nextElementSibling){var a=o.parentElement;t?a.classList.add("expand"):a.classList.remove("expand"),e._updateItem(a,!1)}}},this._updateItem=function(t,r){void 0===r&&(r=!0);var n=t.querySelector("i");t.classList.contains("expand")?(n.classList.remove("bi-caret-right"),n.classList.add("bi-caret-down"),r&&!e.refs.includes(t.dataset.snfttRef)&&(e.refs.push(t.dataset.snfttRef),localStorage.setItem("toc-expanded",e.refs.join(",")))):(n.classList.remove("bi-caret-down"),n.classList.add("bi-caret-right"),r&&e.refs.includes(t.dataset.snfttRef)&&e._removeRef(t.dataset.snfttRef))},this._clickHandler=function(t){var r=t.currentTarget,n=null==r?void 0:r.parentElement;n.classList.toggle("expand"),e._updateItem(n)},this._keyupHandler=function(t){var r=e.toc.querySelectorAll("ul"),n=e.toc.querySelectorAll("a.reference");if(0===e.filter.value.length){for(var o,a=_createForOfIteratorHelperLoose$1(n);!(o=a()).done;){var i;null==(i=o.value.parentElement)||i.classList.remove("d-none")}for(var s,c=_createForOfIteratorHelperLoose$1(r);!(s=c()).done;)s.value.classList.remove("d-none");return e._expandOrFoldAll(!1),void e._expandRefs()}for(var l,u=_createForOfIteratorHelperLoose$1(n);!(l=u()).done;){var d;null==(d=l.value.parentElement)||d.classList.add("d-none")}for(var f,p=_createForOfIteratorHelperLoose$1(r);!(f=p()).done;)f.value.classList.add("d-none");e._expandOrFoldAll(!0);for(var v,h=new RegExp(e.filter.value,"i"),m=_createForOfIteratorHelperLoose$1(n);!(v=m()).done;){var g,y=v.value;if(h.test(y.textContent))for(var _=y,b=null==(g=_)?void 0:g.parentElement;_;){var L,w;_.classList.remove("d-none"),"UL"===(b=_.parentElement).nodeName&&(null==(w=b)||w.classList.remove("d-none")),_=null==(L=b)?void 0:L.closest("li")}}},this.init=function(){var t=0;e.toc=document.querySelector(".toc"),e.filter=e.toc.querySelector("input[name='filter']"),e.refs=loadRefList();var r=e.toc?e.toc.querySelectorAll("a.reference"):[],n=document.querySelector(TEMPLATE_SELECTOR),o=null==n?void 0:n.content.firstElementChild;if(null==o)return-1;e.filter.addEventListener("keyup",e._keyupHandler);for(var a,i=_createForOfIteratorHelperLoose$1(r);!(a=i()).done;){var s=a.value;if(s.nextElementSibling){var c=o.cloneNode(!0);c.addEventListener("click",e._clickHandler,!0),s.before(c);var l=s.parentElement;l.dataset.snfttRef=s.href,l&&l.classList.contains("current")&&(l.classList.toggle("current"),l.classList.toggle("expand"),e._updateItem(l)),t++}}return e._expandRefs(),t},this.toc,this.refs,this.filter};function _addActiveCssClass(e){if(e.classList.add("active"),e.ariaCurrent=!0,e.classList.contains("dropdown-item")){var t=e.closest("li.nav-item.dropdown");if(!t)return;var r=t.querySelector("a.nav-link.dropdown-toggle");if(!r)return;r&&(r.classList.add("active"),r.ariaCurrent=!0)}}function selectActiveHeaderLink(){for(var e,t=URL.parse(window.location.href),r=_createForOfIteratorHelperLoose$1(document.querySelectorAll(".snftt-hl"));!(e=r()).done;){var n=e.value;n.classList.remove("active"),n.ariaCurrent=!1}for(var o,a=".snftt-hl[href='#']",i=_createForOfIteratorHelperLoose$1(document.querySelectorAll(a));!(o=i()).done;){var s=o.value;s.classList.contains("dropdown-toggle")||_addActiveCssClass(s)}var c=0;a=".nftt-header-links-large .snftt-hl[data-snftt-hl-regexps]";for(var l,u=_createForOfIteratorHelperLoose$1(document.querySelectorAll(a));!(l=u()).done;)for(var d,f=l.value,p=_createForOfIteratorHelperLoose$1(f.dataset.snfttHlRegexps.split("&&"));!(d=p()).done;){var v=d.value;if(new RegExp(v).test(t.pathname)){c=f.dataset.snfttHlId;break}}if(0!=c){a=".snftt-hl[data-snftt-hl-id='"+c+"']";for(var h,m=_createForOfIteratorHelperLoose$1(document.querySelectorAll(a));!(h=m()).done;)_addActiveCssClass(h.value)}}function formatNumber(e){var t=document.documentElement.lang||"en";return e.toLocaleString(t,{maximumFractionDigits:2,notation:"compact",compactDisplay:"short"})}function readFromGitHub(e,t){return _readFromGitHub.apply(this,arguments)}function _readFromGitHub(){return(_readFromGitHub=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,a,i,s,c,l,u;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="",o="",a="",i="https://api.github.com/repos/"+t+"/"+r,e.next=6,fetch(i);case 6:if(200===(s=e.sent).status){e.next=9;break}throw new Error("Rate limit reached.");case 9:return e.next=11,s.json();case 11:return c=e.sent,o=formatNumber(c.stargazers_count),localStorage.setItem(t+":"+r+":stars",o),a=formatNumber(c.forks_count),localStorage.setItem(t+":"+r+":forks",a),e.next=18,fetch(i+"/releases/latest");case 18:if(200===(l=e.sent).status){e.next=21;break}throw new Error("Rate limit reached.");case 21:return e.next=23,l.json();case 23:if(u=e.sent,n=u.tag_name,localStorage.setItem(t+":"+r+":tag",n),""===n||""==o||""==a){e.next=28;break}return e.abrupt("return",{tag:n,stars:o,forks:a});case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function readFromGitLab(e,t){return _readFromGitLab.apply(this,arguments)}function _readFromGitLab(){return(_readFromGitLab=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,a,i,s;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="",o="",a="https://"+t+"/api/v4/projects/"+encodeURIComponent(r),e.next=5,fetch(a);case 5:if(200===(i=e.sent).status){e.next=8;break}throw new Error("Rate limit reached.");case 8:return e.next=10,i.json();case 10:if(s=e.sent,n=formatNumber(s.star_count),localStorage.setItem(t+":"+r+":stars",n),o=formatNumber(s.forks_count),localStorage.setItem(t+":"+r+":forks",o),""==n||""==o){e.next=17;break}return e.abrupt("return",{tag:"",stars:n,forks:o});case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ls=localStorage,qs_repo_url="[data-snftt-repo-url]",qs_repo_facts="[data-snftt-repo-metrics]",qs_repo_tag="[data-snftt-repo-tag]",qs_repo_stars="[data-snftt-repo-stars]",qs_repo_forks="[data-snftt-repo-forks]";function _updateFactsComponent(e){var t=0,r=document.querySelector(qs_repo_facts),n=document.querySelector(qs_repo_tag),o=document.querySelector(qs_repo_stars),a=document.querySelector(qs_repo_forks);return null!=e.tag&&e.tag.length>0?(n.textContent=e.tag,t++):(n.parentElement.classList.remove("d-flex"),n.parentElement.classList.add("d-none")),null!=e.stars&&e.stars.length>0?(o.textContent=e.stars,t++):(o.parentElement.classList.remove("d-flex"),o.parentElement.classList.add("d-none")),null!=e.forks&&e.forks.length>0?(a.textContent=e.forks,t++):(a.parentElement.classList.remove("d-flex"),a.parentElement.classList.add("d-none")),r.classList.add("ready"),t}function _readFromLocalStorage(e,t){var r=ls.getItem(e+":"+t+":tag"),n=ls.getItem(e+":"+t+":stars"),o=ls.getItem(e+":"+t+":forks");return n&&o?{tag:r,stars:n,forks:o}:{tag:"",stars:"",forks:""}}function _getRepoMetrics(e,t,r){return _getRepoMetrics2.apply(this,arguments)}function _getRepoMetrics2(){return(_getRepoMetrics2=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var o,a,i,s;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=ls.getItem(r+":"+n+":lastaccess"))&&(i=Date.now(),(s=new Date).setTime(Number.parseInt(a)+6e4),s.getTime()>i&&(o=_readFromLocalStorage(r,n))),o){e.next=21;break}e.prev=3,e.t0=t,e.next="github"===e.t0?7:"gitlab"===e.t0?11:15;break;case 7:return e.next=9,readFromGitHub(r,n);case 9:return o=e.sent,e.abrupt("break",15);case 11:return e.next=13,readFromGitLab(r,n);case 13:return o=e.sent,e.abrupt("break",15);case 15:localStorage.setItem(r+":"+n+":lastaccess",""+Date.now()),e.next=21;break;case 18:e.prev=18,e.t1=e.catch(3),o=_readFromLocalStorage(r,n);case 21:return e.abrupt("return",o);case 22:case"end":return e.stop()}}),e,null,[[3,18]])})))).apply(this,arguments)}function updateRepoMetrics(){return _updateRepoMetrics.apply(this,arguments)}function _updateRepoMetrics(){return(_updateRepoMetrics=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,o,a,i,s,c,l,u;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.querySelector(qs_repo_url),r=t?t.dataset.snfttRepoUrl:"",!(n=r.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i))){e.next=10;break}return o=n[1],a=n[2],e.next=7,_getRepoMetrics("github",o,a);case 7:if(!(i=e.sent)){e.next=10;break}return e.abrupt("return",_updateFactsComponent(i));case 10:if(!(s=r.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i))){e.next=18;break}return c=s[1],l=s[2],e.next=15,_getRepoMetrics("gitlab",c,l);case 15:if(!(u=e.sent)){e.next=18;break}return e.abrupt("return",_updateFactsComponent(u));case 18:return e.abrupt("return",-1);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _templateObject,TocObserver=function(){var e=this;this._sectionsObservationHandler=function(t){t.map((function(t){var r=t.target,n=e.toc.querySelector("a[href='#"+r.id+"']"),o=null==n?void 0:n.parentElement;!0===t.isIntersecting?null==o||o.classList.add("active"):null==o||o.classList.remove("active")}))},this._initializeSectionsObserver=function(t){e.section_observer=new IntersectionObserver(e._sectionsObservationHandler,{root:void 0,rootMargin:t,threshold:[0,.25,.5,.75,1]});for(var r,n=_createForOfIteratorHelperLoose$1(e.doc.querySelectorAll(":scope section"));!(r=n()).done;){var o=r.value;e.section_observer.observe(o)}},this.init=function(){var t;if(e.doc=document.querySelector(".nftt-content"),e.toc=document.querySelector("#TableOfContents"),null==e.doc||null==e.toc)return-1;var r="-"+((null==(t=document.querySelector("header"))?void 0:t.offsetHeight)||0)+"px 0px 0px 0px",n=e.doc.querySelector("section a.headerlink"),o=e.toc.querySelector("a.reference[href='#']");null!=n&&null!=o&&o.setAttribute("href",n.getAttribute("href"));for(var a,i=_createForOfIteratorHelperLoose$1(e.toc.querySelectorAll("a.reference"));!(a=i()).done;)a.value.classList.remove("active");return e._initializeSectionsObserver(r),0},this.doc,this.toc,this.section_observer};function resizeAsides(){var e,t="",r=document.querySelector(".nftt-content"),n=document.querySelector(".nftt-sidebar"),o=document.getElementById("back-to-top-container"),a=document.querySelector(".nftt-toc"),i=null==(e=document.querySelector("header"))?void 0:e.offsetHeight;return 0==window.matchMedia("(min-width: 1200px)").matches?(null==n||n.setAttribute("style",""),null==a||a.setAttribute("style",""),""):(null!=r&&(t=(r.clientHeight>document.body.clientHeight?"height: calc(100vh - "+(i+40)+"px)":"height: "+r.clientHeight+"px")+"; top: "+(i+40)+"px;",null==n||n.setAttribute("style",t),null==a||a.setAttribute("style",t),null==o||o.setAttribute("style","top: "+(i+20)+"px")),t)}function updateScrollPaddingTop(){var e,t=-1,r=document.querySelector("html"),n=null==(e=r.querySelector("header"))?void 0:e.offsetHeight;return null!=n&&(t=n+24,r.setAttribute("style","scroll-padding-top: "+t+"px")),t}var qs_version_url="[data-snftt-version-url]";function _getCurrentVersion(){for(var e,t=_createForOfIteratorHelperLoose$1(document.querySelectorAll(qs_version_url));!(e=t()).done;){var r,n,o=e.value,a=null==(r=o.dataset)?void 0:r.snfttVersionUrl;if(a=a.replace("?",String.raw(_templateObject||(_templateObject=_taggedTemplateLiteralLoose(["?"],["\\?"])))),new RegExp(a).test(window.location.href))return null==(n=o.dataset)?void 0:n.snfttVersion}return globalThis.def_ver||""}function updateVersion(){for(var e,t=_getCurrentVersion(),r=document.querySelector("[data-snftt-version-active]"),n='[data-snftt-version="'+t+'"]',o=document.querySelector(n),a=_createForOfIteratorHelperLoose$1(document.querySelectorAll("[data-snftt-version]"));!(e=a()).done;){var i=e.value;i.classList.remove("active","current"),i.setAttribute("aria-pressed","false")}null!=o&&(o.classList.add("active","current"),o.setAttribute("aria-pressed","true"),null!=r&&(r.textContent=o.dataset.snfttVersion))}function feedVersionsMenu(){var e=document.getElementById("versions-dropdown-menu");if(!e)return console.log("Did not find the versions dropdown menu."),!1;for(var t,r=_createForOfIteratorHelperLoose$1(globalThis.docs_versions);!(t=r()).done;){var n=t.value,o=document.createElement("li"),a=document.createElement("a");a.classList.add("dropdown-item","d-flex","align-items-center","justify-content-between"),a.setAttribute("aria-pressed","false"),a.setAttribute("href",n.url),a.dataset.snfttVersionUrl=n.url,a.dataset.snfttVersion=n.name;var i=document.createElement("span");i.classList.add("small","ms-2"),i.textContent=n.name;var s=document.createElement("i");s.classList.add("bi","bi-check","ms-auto"),a.append(i),a.append(s),o.append(a),e.append(o)}return!0}function agentHas(e){return navigator.userAgent.toLowerCase().search(e.toLowerCase())>-1}function isFirefox(){return agentHas("Firefox")||agentHas("FxiOS")||agentHas("Focus")}function isSafari(){return(!!window.ApplePaySetupFeature||!!window.safari)&&agentHas("Safari")&&!agentHas("Chrome")&&!agentHas("CriOS")}function runWhenDOMContentLoaded(e){"loading"!=document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",(function(){"complete"==document.readyState&&e()}))}function loadSphinxNefertiti(){if(fixFigureStyle(),-1==(new MenuHandler).init()&&(console.log("Could not find the <template data-toggle-item-template>."),console.log("Therefore left side nested menu entries will not be visible.")),updateScrollPaddingTop(),resizeAsides(),new ResizeObserver((function(e){var t,r=null==(t=document.querySelector("header"))?void 0:t.offsetHeight;document.body.style.paddingTop=r+4+"px",updateScrollPaddingTop(),resizeAsides()})).observe(document.body),window.addEventListener("resize",[updateScrollPaddingTop,resizeAsides]),(new CSchemeHandler).registerClickEvents(),feedVersionsMenu(),updateVersion(),-1==updateRepoMetrics()&&console.log("Could not find an element with [data-snftt-repo-url]"),(new TocObserver).init(),isSafari()||isFirefox()){var e,t=document.head;isSafari()?e=".nftt-toc nav ul ul {   padding-left: 0.8rem;}":isFirefox()&&(e=".nftt-toc nav ul ul {   padding-left: 0.55rem;}");var r=document.createElement("style");r.append(document.createTextNode(e)),t.append(r)}for(var n,o=_createForOfIteratorHelperLoose$1(document.querySelectorAll("input.task-list-item-checkbox"));!(n=o()).done;){var a=n.value;a.setAttribute("title","Is task done? "+a.checked)}for(var i,s=_createForOfIteratorHelperLoose$1(document.querySelectorAll("table.docutils"));!(i=s()).done;){var c=i.value,l=document.createElement("div");l.classList.add("nftt-table"),c.before(l),l.append(c)}for(var u=0,d=[["div.versionadded","versionadded","versionadded-title-only"],["div.versionchanged","versionchanged","versionchanged-title-only"],["div.deprecated","deprecated","deprecated-title-only"],["div.versionremoved","versionremoved","versionremoved-title-only"]];u<d.length;u++)for(var f,p=d[u],v=p[0],h=p[1],m=p[2],g=_createForOfIteratorHelperLoose$1(document.querySelectorAll(v));!(f=g()).done;){var y=f.value;1==y.querySelector("p").childNodes.length&&y.classList.replace(h,m)}(new BackToTop).init(),selectActiveHeaderLink();var _=document.querySelector(".nftt-sidebar a.current");if(_){var b=_.closest(".toc li");b&&b.scrollIntoView({behavior:"smooth",block:"end"})}}runWhenDOMContentLoaded(loadSphinxNefertiti);
 //# sourceMappingURL=sphinx-nefertiti.min.js.map
\ No newline at end of file
diff --git a/sphinx_nefertiti/static/sphinx-nefertiti.min.js.map b/sphinx_nefertiti/static/sphinx-nefertiti.min.js.map
index f3901e4..e969edd 100644
--- a/sphinx_nefertiti/static/sphinx-nefertiti.min.js.map
+++ b/sphinx_nefertiti/static/sphinx-nefertiti.min.js.map
@@ -1 +1 @@
-{"version":3,"names":["BACK_TO_TOP_BUTTON_ID","BACK_TO_TOP_DIV_ID","NAVBAR_ID","DEFAULT_NAVBAR_HEIGHT","BackToTop","_this","this","_scrollHandler","event","y_offset","window","pageYOffset","document","documentElement","scrollTop","prev_offset","navbar_height","btn","classList","add","remove","_scrollToTopHandler","preventDefault","init","addEventListener","getElementById","navbar","offsetHeight","style","top","FIGURE_IMG_SELECTOR","fixFigureStyle","_step","_iterator","_createForOfIteratorHelperLoose","querySelectorAll","done","figure","value","img","querySelector","width","height","elem_width","figcaption","_arrayLikeToArray","r","a","length","e","n","Array","t","Symbol","iterator","call","next","bind","isArray","_unsupportedIterableToArray","o","TypeError","toString","slice","constructor","name","from","test","SphinxColorschemeImageHandler","options","activate","scheme","data_att","_loop","new_img","Image","new_src","getAttribute","src","console","error","complete","closest","undefined","anchor","href","parentElement","tagName","_schemes","_mediaqs","_auto","hasOwnProperty","meta_prop","meta_schemes","content","_step2","_iterator2","split","item","push","trim","_step3","_loop2","q","globalThis","matchMedia","matches","_iterator3","CSchemeHandler","stored","localStorage","getItem","_cshdl","auto","_arr","_i","apply","updateDropdown","_proto","prototype","registerClickEvents","_this2","dataset","snfttLuz","setItem","preferred","option","cscheme","focus","prefix","selector","sel_icon","luz_item","luz_icon","element","setAttribute","_createClass","key","get","includes","TEMPLATE_SELECTOR","loadRefList","refs","toc_expanded_stored","MenuHandler","_removeRef","ref","pos","indexOf","splice","join","_expandRefs","li_item","toc","contains","toggle","_updateItem","_expandOrFoldAll","expand","link","nextElementSibling","update_refs","icon","snfttRef","_clickHandler","expand_button","currentTarget","_keyupHandler","uls","links","filter","_link$parentElement","_step4","_iterator4","_step5","_iterator5","_link$parentElement2","_step6","_iterator6","_step7","filter_re","RegExp","_iterator7","_li_item","textContent","parent","_parent2","_parent","nodeName","num_expandable_menus","tmpl","tmpl_button","firstElementChild","_step8","_iterator8","cloneNode","before","_addActiveCssClass","elem","ariaCurrent","selectActiveHeaderLink","curl","URL","parse","location","qs","hl_id","snfttHlRegexps","re_str","pathname","snfttHlId","formatNumber","num","def_locale","lang","toLocaleString","maximumFractionDigits","notation","compactDisplay","readFromGitHub","_x","_x2","_readFromGitHub","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","user","repo","tag","stars","forks","url","response1","data1","response2","data2","wrap","_context","prev","fetch","sent","status","Error","json","stargazers_count","forks_count","tag_name","abrupt","stop","readFromGitLab","_readFromGitLab","base","project","response","data","encodeURIComponent","star_count","ls","qs_repo_url","qs_repo_facts","qs_repo_tag","qs_repo_stars","qs_repo_forks","_updateFactsComponent","metrics","num_updated_facts","facts_element","tag_element","stars_element","forks_element","_readFromLocalStorage","p1","p2","_getRepoMetrics","_x3","_getRepoMetrics2","host","last_access","now","ts","Date","setTime","Number","parseInt","getTime","t0","t1","updateRepoMetrics","_updateRepoMetrics","_callee2","repo_url_element","github_match","gitlab_match","slug","_metrics","_context2","snfttRepoUrl","match","TocObserver","_sectionsObservationHandler","entries","map","sec","target","id","isIntersecting","_initializeSectionsObserver","root_margin","section_observer","IntersectionObserver","root","rootMargin","threshold","doc","observe","_document$querySelect","document_1a","toc_1a","resizeAsides","nftt_content","nftt_sidebar","backtotop_div","nftt_toc","header_h","clientHeight","body","updateScrollPaddingTop","_element$querySelecto","scroll_padding_top","qs_version_url","_getCurrentVersion","_version_elem$dataset","_version_elem$dataset2","version_elem","version_url","snfttVersionUrl","replace","String","raw","_templateObject","_taggedTemplateLiteralLoose","snfttVersion","updateVersion","version","version_active","qs_version_item","version_item","feedVersionsMenu","vermenu","log","docs_versions","li","createElement","span","i","append","agentHas","keyword","navigator","userAgent","toLowerCase","search","isFirefox","isSafari","ApplePaySetupFeature","safari","runWhenDOMContentLoaded","cb","readyState","attachEvent","loadSphinxNefertiti","ResizeObserver","paddingTop","css_content","head","createTextNode","checked","table","wrapper","_vchanges_selectors","lst","src_class","tgt_class","div","childNodes","sidebar_elem","scrollIntoView","behavior","block"],"sources":["../../js/src/backtotop.js","../../js/src/figures.js","../../node_modules/sphinx-colorschemed-images/dist/js/sphinx-colorschemed-images.esm.js","../../js/src/cschemes.js","../../js/src/menu.js","../../js/src/navbar.js","../../js/src/utils.js","../../js/src/github.js","../../js/src/gitlab.js","../../js/src/repometrics.js","../../js/src/pagetoc.js","../../js/src/tocresize.js","../../js/src/versions.js","../../js/src/index.js"],"sourcesContent":["const BACK_TO_TOP_BUTTON_ID = \"back-to-top\";\nconst BACK_TO_TOP_DIV_ID = \"back-to-top-container\";\n\n// Uses the element ID of the navbar, to find out its height and\n// put the back-to-top button below the navbar, 16px below it.\nconst NAVBAR_ID = \"snftt-nav-bar\";\n\n// If it can't find out the navigation bar height, use the\n// following default instead.\nconst DEFAULT_NAVBAR_HEIGHT = 60;  // pixels.\n\n\nexport class BackToTop {\n  constructor() {\n    this.btn = document.getElementById(BACK_TO_TOP_BUTTON_ID);\n    this.prev_offset = 0;\n    const navbar = document.getElementById(NAVBAR_ID);\n    this.navbar_height = navbar.offsetHeight || DEFAULT_NAVBAR_HEIGHT;\n    const btt_div = document.getElementById(BACK_TO_TOP_DIV_ID);\n    btt_div.style.top = `${this.navbar_height + 16}px`;\n  }\n\n  _scrollHandler = (event) => {\n    var y_offset = window.pageYOffset || document.documentElement.scrollTop;\n\n    if (y_offset > this.prev_offset || y_offset <= this.navbar_height) {\n      this.btn.classList.add(\"d-none\");\n    } else if (y_offset < this.prev_offset && y_offset > this.navbar_height) {\n      this.btn.classList.remove(\"d-none\");\n    }\n\n    this.prev_offset = y_offset <= 0 ? 0 : y_offset;\n  }\n\n  _scrollToTopHandler = (event) => {\n    event.preventDefault();\n    document.documentElement.scrollTop = 0;\n  }\n\n  init = () => {\n    window.addEventListener(\"scroll\", this._scrollHandler, false);\n    this.btn.addEventListener(\"click\", this._scrollToTopHandler, false);\n  }\n}\n","// --------------------------------------------------------\n// Selector to use with document.querySelector(SELECTOR),\n// that represents the HTML template element containing the\n// button to expand/fold the toc tree.\n//\nconst FIGURE_IMG_SELECTOR = \"#content figure\";\n\nexport function fixFigureStyle() {\n  const figures = document.querySelectorAll(FIGURE_IMG_SELECTOR);\n  for(const figure of figures) {\n    const img = figure.querySelector(\"img\");\n    if (img && img.style && (img.style.width || img.style.height)) {\n      const elem_width = img.width;\n      figure.style['width'] = `${elem_width}px`;\n      const figcaption = figure.querySelector(\"figcaption\");\n      if (figcaption) {\n        figcaption.style['width'] = `${elem_width}px`;\n      }\n      if (img.style.width) {\n        img.style.width = \"\";\n      }\n    }\n  }\n}\n","/*!\n  * sphinx-colorschemed-images v0.2.0 (https://github.com/danirus/sphinx-colorschemed-images).\n  * Copyright 2024 Daniela Rus Morales.\n  * Licensed under MIT (https://github.com/danirus/sphinx-colorschemed-images/blob/main/LICENSE).\n  */\nfunction _arrayLikeToArray(r, a) {\n  (null == a || a > r.length) && (a = r.length);\n  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n  return n;\n}\nfunction _createForOfIteratorHelperLoose(r, e) {\n  var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n  if (t) return (t = t.call(r)).next.bind(t);\n  if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {\n    t && (r = t);\n    var o = 0;\n    return function () {\n      return o >= r.length ? {\n        done: !0\n      } : {\n        done: !1,\n        value: r[o++]\n      };\n    };\n  }\n  throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _unsupportedIterableToArray(r, a) {\n  if (r) {\n    if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n    var t = {}.toString.call(r).slice(8, -1);\n    return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n  }\n}\n\nvar SphinxColorschemeImageHandler = function SphinxColorschemeImageHandler(options) {\n  var _this = this;\n  if (options === void 0) {\n    options = {};\n  }\n  this.activate = function (scheme) {\n    var data_att = \"data-alt-src-color-scheme-\" + scheme;\n    var images = document.querySelectorAll(\"img[\" + data_att + \"]\");\n    var _loop = function _loop() {\n      var img = _step.value;\n      var new_img = new Image();\n      var new_src = img.getAttribute(data_att);\n      new_img.src = new_src;\n      new_img.addEventListener('load', function () {\n        img.src = new_img.src;\n      });\n      new_img.addEventListener('error', function () {\n        console.error(\"Could not replace image \" + img.src + \" with \" + new_src + \".\");\n      });\n      if (new_img.complete) {\n        img.src = new_img.src;\n      }\n\n      // Check whether the image is inside a <figure>.\n      var figure = img.closest('figure');\n      if (figure != undefined) {\n        var anchor = figure.querySelector('a');\n        if (anchor.getAttribute('href') !== new_src) {\n          anchor.href = new_src;\n        }\n      } else if (img.parentElement.tagName == \"A\" && img.parentElement.getAttribute(\"href\") !== new_src) {\n        var parent = img.parentElement;\n        parent.href = img.getAttribute(data_att);\n      }\n    };\n    for (var _iterator = _createForOfIteratorHelperLoose(images), _step; !(_step = _iterator()).done;) {\n      _loop();\n    }\n  };\n  this._schemes = [];\n  this._mediaqs = [];\n\n  // If options are not given or if it is given with a key 'auto'\n  // and a boolean value true, then the instance created will add\n  // an event listener for changes on prefers-color-scheme to\n  // update images accordingly.\n  this._auto = options.hasOwnProperty('auto') ? options['auto'] === true : true;\n  var meta_prop = document.querySelector('meta[name=\"color-scheme\"]');\n  var meta_schemes = meta_prop == undefined ? \"\" : meta_prop.content;\n  if (meta_schemes.length > 0) {\n    var schemes = meta_schemes.split(\" \");\n    for (var _iterator2 = _createForOfIteratorHelperLoose(schemes), _step2; !(_step2 = _iterator2()).done;) {\n      var item = _step2.value;\n      this._schemes.push(item.trim());\n    }\n  } else {\n    this._schemes = ['light', 'dark'];\n  }\n  var _loop2 = function _loop2() {\n    var scheme = _step3.value;\n    var q = globalThis.matchMedia(\"(prefers-color-scheme: \" + scheme + \")\");\n    if (q.matches) {\n      _this.activate(scheme);\n    }\n    if (_this._auto === true) {\n      q.addEventListener('change', function (e) {\n        if (e.matches) {\n          _this.activate(scheme);\n        }\n      });\n      _this._mediaqs.push(q);\n    }\n  };\n  for (var _iterator3 = _createForOfIteratorHelperLoose(this._schemes), _step3; !(_step3 = _iterator3()).done;) {\n    _loop2();\n  }\n};\n\nexport { SphinxColorschemeImageHandler };\n//# sourceMappingURL=sphinx-colorschemed-images.esm.js.map\n","import { SphinxColorschemeImageHandler } from \"sphinx-colorschemed-images\";\n\nexport class CSchemeHandler {\n  constructor() {\n    this.stored = localStorage.getItem('snftt-color-scheme') || \"default\";\n    this._cshdl = new SphinxColorschemeImageHandler({auto: false});\n    for (const scheme of ['dark', 'light']) {\n      const q = globalThis.matchMedia(`(prefers-color-scheme: ${scheme})`);\n      if (q.matches && this.stored == 'default') {\n        this.apply(scheme);\n        this.updateDropdown(this.stored);\n        this._cshdl.activate(scheme);\n      }\n      q.addEventListener('change', e => {\n        if (e.matches) {\n          this.apply(scheme);\n          this._cshdl.activate(scheme);\n        }\n      });\n    }\n    if (this.stored != \"default\") {\n      this.apply(this.stored);\n      this.updateDropdown(this.stored);\n      this._cshdl.activate(this.stored);\n    }\n  }\n\n  registerClickEvents() {\n    for (const item of document.querySelectorAll('[data-snftt-luz]')) {\n      item.addEventListener('click', (event) => {\n        event.preventDefault();\n        this.stored = item.dataset.snfttLuz;\n        localStorage.setItem('snftt-color-scheme', this.stored);\n        this.apply(this.stored);\n        this.updateDropdown(this.stored, true);\n        this._cshdl.activate(this.preferred);\n      });\n    };\n  }\n\n  get preferred() {\n    if ([\"light\", \"dark\"].includes(this.stored)) {\n      return this.stored;\n    }\n    const q = globalThis.matchMedia('(prefers-color-scheme: dark)');\n    return q.matches ? 'dark' : 'light';\n  }\n\n  apply(option) {\n    switch(option) {\n      case \"default\": {\n        document.documentElement.classList.remove(\"light\");\n        document.documentElement.classList.remove(\"dark\");\n        document.documentElement.classList.add(this.preferred);\n        return;\n      }\n      case \"dark\": {\n        document.documentElement.classList.remove('light');\n        document.documentElement.classList.add('dark');\n        return;\n      }\n      case \"light\": {\n        document.documentElement.classList.remove('dark');\n        document.documentElement.classList.add('light');\n        return;\n      }\n    }\n  }\n\n  updateDropdown(cscheme, focus = false) {\n    const prefix = \"data-snftt-luz\";\n    const selector = document.querySelector(\"#snftt-luz\");\n    const sel_icon = document.querySelector(`[${prefix}-icon-active]`);\n    const luz_item = document.querySelector(`[${prefix}=\"${cscheme}\"]`);\n    const luz_icon = document.querySelector(`[${prefix}-icon=\"${cscheme}\"]`);\n\n    const elements = document.querySelectorAll(`[${prefix}]`);\n    for (const element of elements) {\n      element.classList.remove('active', 'current');\n      element.setAttribute('aria-pressed', 'false');\n    };\n\n    if (luz_item != undefined) {\n      luz_item.classList.add('active', 'current');\n      luz_item.setAttribute('aria-pressed', 'true');\n    }\n\n    sel_icon?.setAttribute('class', luz_icon.classList.value);\n\n    if (focus) {\n      selector.focus();\n    }\n  }\n}\n","// --------------------------------------------------------\n// Selector to use with document.querySelector(SELECTOR),\n// that represents the HTML template element containing the\n// button to expand/fold the toc tree.\n//\nconst TEMPLATE_SELECTOR = \"[data-toggle-item-template]\";\n\nfunction loadRefList() {\n  let refs = [];\n  const toc_expanded_stored = localStorage.getItem(\"toc-expanded\");\n  if (toc_expanded_stored?.trim().length) {\n    refs = toc_expanded_stored.split(\",\");\n  }\n\n  return refs;\n}\n\nexport class MenuHandler {\n  constructor() {\n    this.toc;\n    this.refs;\n    this.filter;\n  }\n\n  _removeRef = (ref) => {\n    const pos = this.refs.indexOf(ref);\n    if (pos > -1) {\n      this.refs.splice(pos, 1);\n      localStorage.setItem(\"toc-expanded\", this.refs.join(\",\"));\n    }\n  }\n\n  _expandRefs = () => {\n    for (const ref of this.refs) {\n      const li_item = this.toc.querySelector(`li[data-snftt-ref='${ref}']`);\n      if (li_item == undefined) {\n        this._removeRef(ref);\n        continue;\n      }\n      if (!li_item.classList.contains(\"expand\")) {\n        li_item.classList.toggle(\"expand\");\n        this._updateItem(li_item);\n      }\n    }\n  }\n\n  _expandOrFoldAll = (expand=true) => {\n    const links = this.toc ? this.toc.querySelectorAll(\"a.reference\") : [];\n    for (const link of links) {\n      if (link.nextElementSibling) {\n        const li_item = link.parentElement;\n        if (expand) {\n          li_item.classList.add(\"expand\");\n        } else {\n          li_item.classList.remove(\"expand\");\n        }\n        this._updateItem(li_item, false);\n      }\n    }\n  }\n\n  _updateItem = (li_item, update_refs=true) => {\n    const icon = li_item.querySelector(\"i\");\n\n    if (li_item.classList.contains(\"expand\")) {\n      icon.classList.remove(\"bi-caret-right\");\n      icon.classList.add(\"bi-caret-down\");\n      if (update_refs && !this.refs.includes(li_item.dataset.snfttRef)) {\n        this.refs.push(li_item.dataset.snfttRef);\n        localStorage.setItem(\"toc-expanded\", this.refs.join(\",\"));\n      }\n    } else {\n      icon.classList.remove(\"bi-caret-down\");\n      icon.classList.add(\"bi-caret-right\");\n      if (update_refs && this.refs.includes(li_item.dataset.snfttRef)) {\n        this._removeRef(li_item.dataset.snfttRef);\n      }\n    }\n  }\n\n  _clickHandler = (event) => {\n    const expand_button = event.currentTarget;\n    const element = expand_button?.parentElement;\n    element.classList.toggle(\"expand\");\n    this._updateItem(element);\n  }\n\n  _keyupHandler = (event) => {\n    const uls = this.toc.querySelectorAll(\"ul\");\n    const links = this.toc.querySelectorAll(\"a.reference\");\n\n    // Stop filtering -> remove d-none from all li and ul elements.\n    if (this.filter.value.length === 0) {\n      for (const link of links) {\n        link.parentElement?.classList.remove(\"d-none\");\n      }\n      for (const ul of uls) {\n        ul.classList.remove(\"d-none\");\n      }\n      this._expandOrFoldAll(false);  // Passing false means fold.\n      this._expandRefs();\n      return;\n    }\n\n    // 1st. hide all li elements in the toc.\n    for (const link of links) {\n      link.parentElement?.classList.add(\"d-none\");\n    }\n    for (const ul of uls) {\n      ul.classList.add(\"d-none\");\n    }\n\n\n    this._expandOrFoldAll(true);\n\n    // 2nd. show li elements whose anchor matches the filter.\n    const filter_re = new RegExp(this.filter.value, 'i');\n    for (const link of links) {\n      if (!filter_re.test(link.textContent))\n        continue;\n\n      let li_item = link;\n      let parent = li_item?.parentElement;\n\n      while (li_item) {  // Loop to make visible parent elements up the toc.\n        li_item.classList.remove(\"d-none\");\n        parent = li_item.parentElement;\n        if (parent.nodeName === \"UL\") {\n          parent?.classList.remove(\"d-none\");\n        }\n        li_item = parent?.closest(\"li\");\n      }\n    }\n  }\n\n  init = () => {\n    let num_expandable_menus = 0;\n    this.toc = document.querySelector(\".toc\");\n    this.filter = this.toc.querySelector(\"input[name='filter']\");\n    this.refs = loadRefList();\n\n    const links = this.toc ? this.toc.querySelectorAll(\"a.reference\") : [];\n\n    const tmpl = document.querySelector(TEMPLATE_SELECTOR);\n    const tmpl_button = tmpl?.content.firstElementChild;\n\n    if (tmpl_button == undefined)\n      return -1;\n\n    this.filter.addEventListener('keyup', this._keyupHandler);\n\n    for (const link of links) {\n      if (link.nextElementSibling) {\n        const expand_button = tmpl_button.cloneNode(true);\n        expand_button.addEventListener('click', this._clickHandler, true);\n        link.before(expand_button);\n\n        // Maybe there is already a LI item displayed with the\n        // \"current\" class added. In such a case update the\n        // icon to display a dash symbol instead of a plus.\n        const li_item = link.parentElement;\n        li_item.dataset.snfttRef = link.href;\n        if (li_item && li_item.classList.contains(\"current\")) {\n          li_item.classList.toggle(\"current\");\n          li_item.classList.toggle(\"expand\");\n          this._updateItem(li_item);\n        }\n\n        num_expandable_menus++;\n      }\n    }\n\n    // Expand items that where expanded before,\n    // and saved in localStorage.\n    this._expandRefs();\n\n    return num_expandable_menus;\n  }\n}\n","function _addActiveCssClass(elem) {\n  elem.classList.add(\"active\");\n  elem.ariaCurrent=true;\n  if (elem.classList.contains(\"dropdown-item\")) {\n    const parent = elem.closest(\"li.nav-item.dropdown\");\n    if (!parent) return;\n\n    const anchor = parent.querySelector(\"a.nav-link.dropdown-toggle\")\n    if (!anchor) return;\n\n    if (anchor) {\n      anchor.classList.add(\"active\");\n      anchor.ariaCurrent = true;\n    }\n  }\n}\n\nexport function selectActiveHeaderLink() {\n  const curl = URL.parse(window.location.href);\n\n  for (const elem of document.querySelectorAll(\".snftt-hl\")) {\n    elem.classList.remove(\"active\");\n    elem.ariaCurrent = false;\n  }\n\n  // Activate the current link:\n  let qs = `.snftt-hl[href='#']`;\n  for (const elem of document.querySelectorAll(qs)) {\n    if (!elem.classList.contains(\"dropdown-toggle\")) {\n      _addActiveCssClass(elem);\n    }\n  }\n\n  // Find header-link element (.snftt-hl) with regexps, and\n  // check whether the current pathname matches the regexp.\n  let hl_id = 0;  // Not found.\n  qs = \".nftt-header-links-large .snftt-hl[data-snftt-hl-regexps]\"\n  for (const elem of document.querySelectorAll(qs)) {\n    const regexps = elem.dataset.snfttHlRegexps.split(\"&&\");\n    for (const re_str of regexps) {\n      const re = new RegExp(re_str);\n      if (re.test(curl.pathname)) {\n        // The first regexp that returns true is considered valid. Leave\n        // the loop and select the two elements with the same hl-id.\n        hl_id = elem.dataset.snfttHlId;\n        break;\n      }\n    }\n  }\n\n  if (hl_id == 0)\n    return;\n\n  qs = `.snftt-hl[data-snftt-hl-id='${hl_id}']`;\n  for (const elem of document.querySelectorAll(qs)) {\n    _addActiveCssClass(elem);\n  }\n}\n","export function formatNumber(num) {\n  const def_locale = document.documentElement.lang || \"en\";\n  return num.toLocaleString(def_locale, {\n    maximumFractionDigits: 2,\n    notation: 'compact',\n    compactDisplay: 'short'\n  });\n}\n","import { formatNumber } from \"./utils.js\";\n\nexport async function readFromGitHub(user, repo) {\n  let tag = \"\";\n  let stars = \"\";\n  let forks = \"\";\n  const url = `https://api.github.com/repos/${user}/${repo}`;\n\n  const response1 = await fetch(url);\n  if (response1.status !== 200) {\n    throw new Error(\"Rate limit reached.\");\n  }\n  const data1 = await response1.json();\n\n  stars = formatNumber(data1.stargazers_count);\n  localStorage.setItem(`${user}:${repo}:stars`, stars);\n  forks = formatNumber(data1.forks_count);\n  localStorage.setItem(`${user}:${repo}:forks`, forks);\n\n  const response2 = await fetch(`${url}/releases/latest`);\n  if (response2.status !== 200) {\n    throw new Error(\"Rate limit reached.\");\n  }\n  const data2 = await response2.json();\n  tag = data2.tag_name;\n  localStorage.setItem(`${user}:${repo}:tag`, tag);\n\n  if (tag !== \"\" && stars != \"\" && forks != \"\") {\n    return {tag, stars, forks};\n  }\n}\n","import { formatNumber } from \"./utils.js\";\n\nexport async function readFromGitLab(base, project) {\n  let stars = \"\";\n  let forks = \"\";\n  const url = `https://${base}/api/v4/projects/${encodeURIComponent(project)}`;\n  const response = await fetch(url);\n  if (response.status !== 200) {\n    throw new Error(\"Rate limit reached.\");\n  }\n  const data = await response.json();\n  stars = formatNumber(data.star_count);\n  localStorage.setItem(`${base}:${project}:stars`, stars);\n  forks = formatNumber(data.forks_count);\n  localStorage.setItem(`${base}:${project}:forks`, forks);\n\n  if (stars != \"\" && forks != \"\") {\n    return {tag: \"\", stars, forks};\n  }\n}\n","import { readFromGitHub } from \"./github.js\";\nimport { readFromGitLab } from \"./gitlab.js\";\n\n\nconst ls = localStorage;  // Aliasing localStorage.\n\nconst qs_repo_url = \"[data-snftt-repo-url]\";\nconst qs_repo_facts = \"[data-snftt-repo-metrics]\";\nconst qs_repo_tag = \"[data-snftt-repo-tag]\";\nconst qs_repo_stars = \"[data-snftt-repo-stars]\";\nconst qs_repo_forks = \"[data-snftt-repo-forks]\";\n\n\nfunction _updateFactsComponent(metrics) {\n  let num_updated_facts = 0;\n  const facts_element = document.querySelector(qs_repo_facts);\n  const tag_element = document.querySelector(qs_repo_tag);\n  const stars_element = document.querySelector(qs_repo_stars);\n  const forks_element = document.querySelector(qs_repo_forks);\n\n  if (metrics.tag != undefined && metrics.tag.length > 0) {\n    tag_element.textContent = metrics.tag;\n    num_updated_facts++;\n  } else {\n    tag_element.parentElement.classList.remove(\"d-flex\");\n    tag_element.parentElement.classList.add(\"d-none\");\n  }\n\n  if (metrics.stars != undefined && metrics.stars.length > 0) {\n    stars_element.textContent = metrics.stars;\n    num_updated_facts++;\n  } else {\n    stars_element.parentElement.classList.remove(\"d-flex\");\n    stars_element.parentElement.classList.add(\"d-none\");\n  }\n\n  if (metrics.forks != undefined && metrics.forks.length > 0) {\n    forks_element.textContent = metrics.forks;\n    num_updated_facts++;\n  } else {\n    forks_element.parentElement.classList.remove(\"d-flex\");\n    forks_element.parentElement.classList.add(\"d-none\");\n  }\n\n  facts_element.classList.add(\"ready\");\n  return num_updated_facts;\n}\n\n\nfunction _readFromLocalStorage(p1, p2) {\n  const tag = ls.getItem(`${p1}:${p2}:tag`);\n  const stars = ls.getItem(`${p1}:${p2}:stars`);\n  const forks = ls.getItem(`${p1}:${p2}:forks`);\n  if (!stars || !forks) {\n    return {tag: \"\", stars: \"\", forks: \"\"};\n  }\n  return {tag, stars, forks};\n}\n\n\nexport async function _getRepoMetrics(host, p1, p2) {\n  let metrics;\n  const last_access = ls.getItem(`${p1}:${p2}:lastaccess`);\n\n  if (last_access) {\n    const now = Date.now();\n    const ts = new Date();\n    ts.setTime(Number.parseInt(last_access) + 60_000);\n    if (ts.getTime() > now) {\n      // Now is still under last_access + 60 secs.\n      // Go get metrics from localStorage...\n      metrics = _readFromLocalStorage(p1, p2);\n    }\n  }\n\n  if (!metrics) {\n    try {\n      switch (host) {\n        case \"github\": {\n          metrics = await readFromGitHub(p1, p2);\n          break;\n        }\n        case \"gitlab\": {\n          metrics = await readFromGitLab(p1, p2);\n          break;\n        }\n      }\n      localStorage.setItem(`${p1}:${p2}:lastaccess`, `${Date.now()}`);\n    } catch {\n      metrics = _readFromLocalStorage(p1, p2);\n    }\n  }\n\n  return metrics;\n}\n\n\nexport async function updateRepoMetrics() {\n  const repo_url_element = document.querySelector(qs_repo_url);\n  const url = repo_url_element ? repo_url_element.dataset.snfttRepoUrl : \"\";\n\n  /* Try to match GitHub repository */\n  let github_match = url.match(/^.+github\\.com\\/([^/]+)\\/?([^/]+)?/i);\n  if (github_match) {\n    const [, user, repo] = github_match;\n    const metrics = await _getRepoMetrics(\"github\", user, repo);\n    if (metrics) {\n      return _updateFactsComponent(metrics);\n    }\n  }\n\n  /* Try to match GitLab repository */\n  let gitlab_match = url.match(/^.+?([^/]*gitlab[^/]+)\\/(.+?)\\/?$/i)\n  if (gitlab_match) {\n    const [, base, slug] = gitlab_match;\n    const metrics = await _getRepoMetrics(\"gitlab\", base, slug);\n    if (metrics) {\n      return _updateFactsComponent(metrics);\n    }\n  }\n\n  return -1;\n}\n","export class TocObserver {\n  constructor() {\n    this.doc;\n    this.toc;\n    this.section_observer;\n  }\n\n  _sectionsObservationHandler = (entries) => {\n    entries.map(item => {\n      const sec = item.target;\n      const target = this.toc.querySelector(`a[href='#${sec.id}']`);\n      const parent = target?.parentElement;\n      if (item.isIntersecting === true) {\n        parent?.classList.add(\"active\");\n      } else {\n        parent?.classList.remove(\"active\");\n      }\n    });\n  }\n\n  _initializeSectionsObserver = (root_margin) => {\n    this.section_observer = new IntersectionObserver(\n      this._sectionsObservationHandler,\n      {\n        root: undefined,\n        rootMargin: root_margin,\n        threshold: [0, 0.25, 0.5, 0.75, 1],\n      }\n    );\n\n    for (const element of this.doc.querySelectorAll(\":scope section\")) {\n      this.section_observer.observe(element);\n    }\n  }\n\n  init = () => {\n    this.doc = document.querySelector(\".nftt-content\");\n    this.toc = document.querySelector(\"#TableOfContents\");\n    if (this.doc == undefined || this.toc == undefined) {\n      return -1;\n    }\n\n    const header_h = document.querySelector(\"header\")?.offsetHeight;\n    const root_margin = `-${header_h || 0}px 0px 0px 0px`;\n\n    // The first link in the Toc does not point to the first\n    // header. Fix that situation by reading what is the actual href\n    // of the first header with class=\"headerlink\", and then update\n    // the first link in the toc.\n    const document_1a = this.doc.querySelector(\"section a.headerlink\");\n    const toc_1a = this.toc.querySelector(\"a.reference[href='#']\");\n    if (document_1a != undefined && toc_1a != undefined) {\n      toc_1a.setAttribute(\"href\", document_1a.getAttribute(\"href\"));\n    }\n\n    // Sphinx returns anchors in the toc with the class \"internal\"\n    // and \"reference\". Also, it returns the first anchor with the\n    // class \"active\", which is not correct, as I want the\n    // IntersectionObserver to handle what is the section\n    // active in each moment. Therefore, I remove here\n    // the \"active\" class from all anchors in the toc.\n    const anchors = this.toc.querySelectorAll(\"a.reference\");\n    for (const anchor of anchors) {\n      anchor.classList.remove(\"active\");\n    }\n\n    this._initializeSectionsObserver(root_margin);\n    return 0;\n  }\n}\n","export function resizeAsides() {\n  let style = \"\";\n  let height = \"\";\n  let top = \"\";\n\n  const nftt_content = document.querySelector(\".nftt-content\");\n  const nftt_sidebar = document.querySelector(\".nftt-sidebar\");\n  const backtotop_div = document.getElementById(\"back-to-top-container\");\n  const nftt_toc = document.querySelector(\".nftt-toc\");\n  const header_h = document.querySelector(\"header\")?.offsetHeight;\n\n  // If min-width is not >= 1200px, don't do anything.\n  if (window.matchMedia('(min-width: 1200px)').matches == false) {\n    nftt_sidebar?.setAttribute(\"style\", \"\");\n    nftt_toc?.setAttribute(\"style\", \"\");\n    return \"\";\n  }\n\n  if (nftt_content != undefined) {\n    height = nftt_content.clientHeight > document.body.clientHeight\n      ? `height: calc(100vh - ${header_h + 40}px)`\n      : `height: ${nftt_content.clientHeight}px`;\n    top = `top: ${header_h + 40}px`;\n\n    style = `${height}; ${top};`\n    nftt_sidebar?.setAttribute(\"style\", style);\n    nftt_toc?.setAttribute(\"style\", style);\n    backtotop_div?.setAttribute(\"style\", `top: ${header_h + 20}px`);\n  }\n\n  return style;\n}\n\n\nexport function updateScrollPaddingTop() {\n  let scroll_padding_top = -1;\n  const element = document.querySelector(\"html\");\n  const header_h = element.querySelector(\"header\")?.offsetHeight;\n  if (header_h != undefined) {\n    scroll_padding_top = header_h + 24;\n    element.setAttribute(\n      \"style\", `scroll-padding-top: ${scroll_padding_top}px`\n    );\n  }\n  return scroll_padding_top;\n}\n","const qs_version_url = \"[data-snftt-version-url]\";\n\nfunction _getCurrentVersion() {\n  const all_version_elems = document.querySelectorAll(qs_version_url);\n  for (const version_elem of all_version_elems) {\n    let version_url = version_elem.dataset?.snfttVersionUrl;\n    version_url = version_url.replace(\"?\", String.raw`\\?`);\n    if (new RegExp(version_url).test(window.location.href)) {\n      return version_elem.dataset?.snfttVersion;\n    };\n  }\n  return \"\";\n}\n\nexport function updateVersion() {\n  const version = _getCurrentVersion();\n  const qs_version_active = \"[data-snftt-version-active]\";\n  const version_active = document.querySelector(qs_version_active);\n  const qs_version_item = `[data-snftt-version=\"${version}\"]`;\n  const version_item = document.querySelector(qs_version_item);\n\n  for (const element of document.querySelectorAll('[data-snftt-version]')) {\n    element.classList.remove('active', 'current');\n    element.setAttribute('aria-pressed', 'false');\n  }\n\n  if (version_item != undefined) {\n    version_item.classList.add('active', 'current');\n    version_item.setAttribute('aria-pressed', 'true');\n    if (version_active != undefined) {\n      version_active.textContent = version_item.dataset.snfttVersion;\n    }\n  }\n}\n\nexport function feedVersionsMenu() {\n  const vermenu = document.getElementById(\"versions-dropdown-menu\");\n  if (!vermenu) {\n    console.log(\"Did not find the versions dropdown menu.\");\n    return false;\n  }\n  // Use the variable 'docs_versions' loaded as a script in layout.html.\n  // The file docs_versions.js is produced by versions.py when building\n  // the site (make html).\n  for (const item of docs_versions) {\n    const li = document.createElement(\"li\");\n    const anchor = document.createElement(\"a\");\n    anchor.classList.add(\n      \"dropdown-item\", \"d-flex\", \"align-items-center\",\n      \"justify-content-between\"\n    );\n    anchor.setAttribute(\"aria-pressed\", \"false\");\n    anchor.setAttribute(\"href\", item.url);\n    anchor.dataset.snfttVersionUrl = item.url;\n    anchor.dataset.snfttVersion = item.name;\n    const span = document.createElement(\"span\");\n    span.classList.add(\"small\", \"ms-2\");\n    span.textContent = item.name;\n    const i = document.createElement(\"i\");\n    i.classList.add(\"bi\", \"bi-check\", \"ms-auto\");\n    anchor.append(span);\n    anchor.append(i);\n    li.append(anchor);\n    vermenu.append(li);\n  }\n\n  return true;\n}\n","import { BackToTop } from \"./backtotop.js\";\nimport { fixFigureStyle } from \"./figures.js\";\nimport { CSchemeHandler } from \"./cschemes.js\";\nimport { MenuHandler } from \"./menu.js\";\nimport { selectActiveHeaderLink } from \"./navbar.js\";\nimport { updateRepoMetrics } from \"./repometrics.js\";\nimport { TocObserver } from \"./pagetoc.js\";\nimport { resizeAsides, updateScrollPaddingTop } from \"./tocresize.js\";\nimport { feedVersionsMenu, updateVersion } from \"./versions.js\";\n\n\nfunction agentHas(keyword) {\n  return navigator.userAgent.toLowerCase().search(keyword.toLowerCase()) > -1;\n}\n\nfunction isFirefox() {\n  return agentHas(\"Firefox\") || agentHas(\"FxiOS\") || agentHas(\"Focus\");\n}\n\nfunction isSafari() {\n  return (\n    !!window.ApplePaySetupFeature\n    || !!window.safari\n  ) && agentHas(\"Safari\") && !agentHas(\"Chrome\") && !agentHas(\"CriOS\");\n}\n\nfunction runWhenDOMContentLoaded(cb) {\n  if (document.readyState != 'loading') {\n    cb();\n  } else if (document.addEventListener) {\n    document.addEventListener('DOMContentLoaded', cb);\n  } else {\n    document.attachEvent('onreadystatechange', function() {\n      if (document.readyState == 'complete') cb();\n    });\n  }\n}\n\nfunction loadSphinxNefertiti() {\n  // docutils figures that receive specific dimension styling\n  // (basically: width or height) apply the styling to the <img> element\n  // instead of to the <figure>. That makes the <figcaption> to have\n  // a width wider than the image. The fixFigureStyle function\n  // moves the style when it contains a specific value for the\n  // \"width\" dimension.\n  fixFigureStyle();\n\n  const menu_handler = new MenuHandler();\n  if (menu_handler.init() == -1) {\n    console.log(\"Could not find the <template data-toggle-item-template>.\");\n    console.log(\"Therefore left side nested menu entries will not be visible.\")\n  };\n\n  // --------------------------------------------------\n  // On every page load, adjust height of nftt-sidebar\n  // and nftt-toc, based on height of nftt-content.\n  //\n  updateScrollPaddingTop();\n  resizeAsides(); // Resize just after DOM content is loaded.\n\n  // And register the function for every height change of the body.\n  const body_observer = new ResizeObserver(entries => {\n    const header_h = document.querySelector(\"header\")?.offsetHeight;\n    document.body.style.paddingTop = `${header_h + 4}px`;\n\n    updateScrollPaddingTop();\n    resizeAsides();\n  });\n  body_observer.observe(document.body);\n  window.addEventListener(\"resize\", [updateScrollPaddingTop, resizeAsides,]);\n\n  // The CSchemeHandler controls the selection of the 3 possible\n  // options (light, dark, default) and the switching between\n  // them.\n  const cscheme_handler = new CSchemeHandler();\n  cscheme_handler.registerClickEvents();\n\n  // Feed the versions dropdown element.\n  feedVersionsMenu();\n\n  // The updateVersion function controls the display of the version\n  // in the header, adding the CSS class \"current\" to display the\n  // tick symbol near the version selected.\n  updateVersion();\n\n  // The function updateRepoMetrics updates the details related to the\n  // repository in the header.\n  if(updateRepoMetrics() == -1) {\n    console.log(\"Could not find an element with [data-snftt-repo-url]\");\n  };\n\n  // Create the table of contents out of the content\n  // of the nftt-content.\n  const toc_observer = new TocObserver();\n  toc_observer.init();\n\n  if (isSafari() || isFirefox()) {\n    let css_content;\n    const head = document.head;\n\n    if (isSafari()) {\n      css_content = (\n        \".nftt-toc nav ul ul {\" +\n        \"   padding-left: 0.8rem;\" +\n        \"}\"\n      );\n    } else if (isFirefox()) {\n      css_content = (\n        \".nftt-toc nav ul ul {\" +\n        \"   padding-left: 0.55rem;\" +\n        \"}\"\n      );\n    }\n\n    const style = document.createElement(\"style\");\n    style.append(document.createTextNode(css_content));\n    head.append(style);\n  }\n\n  // Fix accessibility in each input element\n  // with class 'task-list-item-checkbox'.\n  const task_list_elems_qs = \"input.task-list-item-checkbox\";\n  const task_list_elems = document.querySelectorAll(task_list_elems_qs);\n  for (const element of task_list_elems) {\n    // Add a title to each input element.\n    element.setAttribute('title', `Is task done? ${element.checked}`);\n  }\n\n  // Wrap tables with responsive container.\n  const tables = document.querySelectorAll('table.docutils');\n  for (const table of tables) {\n    const wrapper = document.createElement(\"div\");\n    wrapper.classList.add(\"nftt-table\");\n    table.before(wrapper);\n    wrapper.append(table);\n  }\n\n  // Fix admonitions-like blocks used in Sphinx to display version\n  // changes. Such directives are: versionadded, versionchanged,\n  // deprecated, and versionremoved.\n  const vchanges_selectors = [\n    [\"div.versionadded\", \"versionadded\", \"versionadded-title-only\"],\n    [\"div.versionchanged\", \"versionchanged\", \"versionchanged-title-only\"],\n    [\"div.deprecated\", \"deprecated\", \"deprecated-title-only\"],\n    [\"div.versionremoved\", \"versionremoved\", \"versionremoved-title-only\"],\n  ];\n  for (const lst of vchanges_selectors) {\n    const [ selector, src_class, tgt_class ] = lst;\n    const elems = document.querySelectorAll(selector);\n\n    for (const div of elems) {\n      // The 'p' contained in the div might contain just a <span>, or\n      // a <span> and a text node. The 2nd case is when the versionadded\n      // directive receives additional text, right below the directive.\n      // If the directive only gets the version number, without\n      // additional text below, then I the selector should\n      // change to .versionadded-title-only, so that it\n      // does not display an empty block below.\n\n      if (div.querySelector(\"p\").childNodes.length == 1) {\n        div.classList.replace(src_class, tgt_class);\n      }\n    }\n  }\n\n  const back_to_top = new BackToTop();\n  back_to_top.init();\n\n  // In case there were Header Links (.snftt-hl) add the class\n  // 'active' to the one corresponding to the current URL.\n  selectActiveHeaderLink();\n\n  // Scroll the item from the left sidebar into view:\n  const sidebar_elem = document.querySelector(\".nftt-sidebar a.current\");\n  if (sidebar_elem) {\n    const parent = sidebar_elem.closest(\".toc li\");\n    if (parent) {\n      parent.scrollIntoView({behavior: \"smooth\", block: \"end\"});\n    }\n  }\n}\n\nrunWhenDOMContentLoaded(loadSphinxNefertiti);\n"],"mappings":"y3QAAA,IAAMA,sBAAwB,cACxBC,mBAAqB,wBAIrBC,UAA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Aa,QAAO,iBAAmBD,EAAQoP,QACzD,CAIA,IADA,IAC0B3R,EAA1BC,EAAA9D,kCADetB,SAASuB,iBAAiB,qBACf4D,EAAAC,KAAA5D,MAAE,KAAjBuV,EAAK5R,EAAAzD,MACRsV,EAAUhX,SAASsV,cAAc,OACvC0B,EAAQ1W,UAAUC,IAAI,cACtBwW,EAAMvL,OAAOwL,GACbA,EAAQvB,OAAOsB,EACjB,CAWA,IANA,IAMAxQ,EAAA,EAAA0Q,EAN2B,CACzB,CAAC,mBAAoB,eAAgB,2BACrC,CAAC,qBAAsB,iBAAkB,6BACzC,CAAC,iBAAkB,aAAc,yBACjC,CAAC,qBAAsB,iBAAkB,8BAEP1Q,EAAA0Q,EAAA7U,OAAAmE,IAIlC,IAJG,IAIoBd,EAJdyR,EAAGD,EAAA1Q,GACJe,EAAmC4P,EAAG,GAA5BC,EAAyBD,EAAG,GAAjBE,EAAcF,EAAG,GAG9CnR,EAAAzE,kCAFctB,SAASuB,iBAAiB+F,MAEjB7B,EAAAM,KAAAvE,MAAE,KAAd6V,EAAG5R,EAAA/D,MASoC,GAA5C2V,EAAIzV,cAAc,KAAK0V,WAAWlV,QACpCiV,EAAI/W,UAAUgU,QAAQ6C,EAAWC,EAErC,EAGkB,IAAI5X,WACZmB,OAIZiL,yBAGA,IAAM2L,EAAevX,SAAS4B,cAAc,2BAC5C,GAAI2V,EAAc,CAChB,IAAM1M,EAAS0M,EAAajT,QAAQ,WAChCuG,GACFA,EAAO2M,eAAe,CAACC,SAAU,SAAUC,MAAO,OAEtD,CACF,CAEAtB,wBAAwBI","ignoreList":[]}
\ No newline at end of file
+{"version":3,"names":["BACK_TO_TOP_BUTTON_ID","BACK_TO_TOP_DIV_ID","NAVBAR_ID","DEFAULT_NAVBAR_HEIGHT","BackToTop","_this","this","_scrollHandler","event","y_offset","window","pageYOffset","document","documentElement","scrollTop","prev_offset","navbar_height","btn","classList","add","remove","_scrollToTopHandler","preventDefault","init","addEventListener","getElementById","navbar","offsetHeight","style","top","FIGURE_IMG_SELECTOR","fixFigureStyle","_step","_iterator","_createForOfIteratorHelperLoose","querySelectorAll","done","figure","value","img","querySelector","width","height","elem_width","figcaption","_arrayLikeToArray","r","a","length","e","n","Array","t","Symbol","iterator","call","next","bind","isArray","_unsupportedIterableToArray","o","TypeError","toString","slice","constructor","name","from","test","SphinxColorschemeImageHandler","options","activate","scheme","data_att","_loop","new_img","Image","new_src","getAttribute","src","console","error","complete","closest","undefined","anchor","href","parentElement","tagName","_schemes","_mediaqs","_auto","hasOwnProperty","meta_prop","meta_schemes","content","_step2","_iterator2","split","item","push","trim","_step3","_loop2","q","globalThis","matchMedia","matches","_iterator3","CSchemeHandler","stored","localStorage","getItem","_cshdl","auto","_arr","_i","apply","updateDropdown","_proto","prototype","registerClickEvents","_this2","dataset","snfttLuz","setItem","preferred","option","cscheme","focus","prefix","selector","sel_icon","luz_item","luz_icon","element","setAttribute","_createClass","key","get","includes","TEMPLATE_SELECTOR","loadRefList","refs","toc_expanded_stored","MenuHandler","_removeRef","ref","pos","indexOf","splice","join","_expandRefs","li_item","toc","contains","toggle","_updateItem","_expandOrFoldAll","expand","link","nextElementSibling","update_refs","icon","snfttRef","_clickHandler","expand_button","currentTarget","_keyupHandler","uls","links","filter","_link$parentElement","_step4","_iterator4","_step5","_iterator5","_link$parentElement2","_step6","_iterator6","_step7","filter_re","RegExp","_iterator7","_li_item","textContent","parent","_parent2","_parent","nodeName","num_expandable_menus","tmpl","tmpl_button","firstElementChild","_step8","_iterator8","cloneNode","before","_addActiveCssClass","elem","ariaCurrent","selectActiveHeaderLink","curl","URL","parse","location","qs","hl_id","snfttHlRegexps","re_str","pathname","snfttHlId","formatNumber","num","def_locale","lang","toLocaleString","maximumFractionDigits","notation","compactDisplay","readFromGitHub","_x","_x2","_readFromGitHub","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","user","repo","tag","stars","forks","url","response1","data1","response2","data2","wrap","_context","prev","fetch","sent","status","Error","json","stargazers_count","forks_count","tag_name","abrupt","stop","readFromGitLab","_readFromGitLab","base","project","response","data","encodeURIComponent","star_count","ls","qs_repo_url","qs_repo_facts","qs_repo_tag","qs_repo_stars","qs_repo_forks","_updateFactsComponent","metrics","num_updated_facts","facts_element","tag_element","stars_element","forks_element","_readFromLocalStorage","p1","p2","_getRepoMetrics","_x3","_getRepoMetrics2","host","last_access","now","ts","Date","setTime","Number","parseInt","getTime","t0","t1","updateRepoMetrics","_updateRepoMetrics","_callee2","repo_url_element","github_match","gitlab_match","slug","_metrics","_context2","snfttRepoUrl","match","TocObserver","_sectionsObservationHandler","entries","map","sec","target","id","isIntersecting","_initializeSectionsObserver","root_margin","section_observer","IntersectionObserver","root","rootMargin","threshold","doc","observe","_document$querySelect","document_1a","toc_1a","resizeAsides","nftt_content","nftt_sidebar","backtotop_div","nftt_toc","header_h","clientHeight","body","updateScrollPaddingTop","_element$querySelecto","scroll_padding_top","qs_version_url","_getCurrentVersion","_version_elem$dataset","_version_elem$dataset2","version_elem","version_url","snfttVersionUrl","replace","String","raw","_templateObject","_taggedTemplateLiteralLoose","snfttVersion","def_ver","updateVersion","version","version_active","qs_version_item","version_item","feedVersionsMenu","vermenu","log","docs_versions","li","createElement","span","i","append","agentHas","keyword","navigator","userAgent","toLowerCase","search","isFirefox","isSafari","ApplePaySetupFeature","safari","runWhenDOMContentLoaded","cb","readyState","attachEvent","loadSphinxNefertiti","ResizeObserver","paddingTop","css_content","head","createTextNode","checked","table","wrapper","_vchanges_selectors","lst","src_class","tgt_class","div","childNodes","sidebar_elem","scrollIntoView","behavior","block"],"sources":["../../js/src/backtotop.js","../../js/src/figures.js","../../node_modules/sphinx-colorschemed-images/dist/js/sphinx-colorschemed-images.esm.js","../../js/src/cschemes.js","../../js/src/menu.js","../../js/src/navbar.js","../../js/src/utils.js","../../js/src/github.js","../../js/src/gitlab.js","../../js/src/repometrics.js","../../js/src/pagetoc.js","../../js/src/tocresize.js","../../js/src/versions.js","../../js/src/index.js"],"sourcesContent":["const BACK_TO_TOP_BUTTON_ID = \"back-to-top\";\nconst BACK_TO_TOP_DIV_ID = \"back-to-top-container\";\n\n// Uses the element ID of the navbar, to find out its height and\n// put the back-to-top button below the navbar, 16px below it.\nconst NAVBAR_ID = \"snftt-nav-bar\";\n\n// If it can't find out the navigation bar height, use the\n// following default instead.\nconst DEFAULT_NAVBAR_HEIGHT = 60;  // pixels.\n\n\nexport class BackToTop {\n  constructor() {\n    this.btn = document.getElementById(BACK_TO_TOP_BUTTON_ID);\n    this.prev_offset = 0;\n    const navbar = document.getElementById(NAVBAR_ID);\n    this.navbar_height = navbar.offsetHeight || DEFAULT_NAVBAR_HEIGHT;\n    const btt_div = document.getElementById(BACK_TO_TOP_DIV_ID);\n    btt_div.style.top = `${this.navbar_height + 16}px`;\n  }\n\n  _scrollHandler = (event) => {\n    var y_offset = window.pageYOffset || document.documentElement.scrollTop;\n\n    if (y_offset > this.prev_offset || y_offset <= this.navbar_height) {\n      this.btn.classList.add(\"d-none\");\n    } else if (y_offset < this.prev_offset && y_offset > this.navbar_height) {\n      this.btn.classList.remove(\"d-none\");\n    }\n\n    this.prev_offset = y_offset <= 0 ? 0 : y_offset;\n  }\n\n  _scrollToTopHandler = (event) => {\n    event.preventDefault();\n    document.documentElement.scrollTop = 0;\n  }\n\n  init = () => {\n    window.addEventListener(\"scroll\", this._scrollHandler, false);\n    this.btn.addEventListener(\"click\", this._scrollToTopHandler, false);\n  }\n}\n","// --------------------------------------------------------\n// Selector to use with document.querySelector(SELECTOR),\n// that represents the HTML template element containing the\n// button to expand/fold the toc tree.\n//\nconst FIGURE_IMG_SELECTOR = \"#content figure\";\n\nexport function fixFigureStyle() {\n  const figures = document.querySelectorAll(FIGURE_IMG_SELECTOR);\n  for(const figure of figures) {\n    const img = figure.querySelector(\"img\");\n    if (img && img.style && (img.style.width || img.style.height)) {\n      const elem_width = img.width;\n      figure.style['width'] = `${elem_width}px`;\n      const figcaption = figure.querySelector(\"figcaption\");\n      if (figcaption) {\n        figcaption.style['width'] = `${elem_width}px`;\n      }\n      if (img.style.width) {\n        img.style.width = \"\";\n      }\n    }\n  }\n}\n","/*!\n  * sphinx-colorschemed-images v0.2.2 (https://github.com/danirus/sphinx-colorschemed-images).\n  * Copyright 2024 Daniela Rus Morales.\n  * Licensed under MIT (https://github.com/danirus/sphinx-colorschemed-images/blob/main/LICENSE).\n  */\nfunction _arrayLikeToArray(r, a) {\n  (null == a || a > r.length) && (a = r.length);\n  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n  return n;\n}\nfunction _createForOfIteratorHelperLoose(r, e) {\n  var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n  if (t) return (t = t.call(r)).next.bind(t);\n  if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {\n    t && (r = t);\n    var o = 0;\n    return function () {\n      return o >= r.length ? {\n        done: !0\n      } : {\n        done: !1,\n        value: r[o++]\n      };\n    };\n  }\n  throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _unsupportedIterableToArray(r, a) {\n  if (r) {\n    if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n    var t = {}.toString.call(r).slice(8, -1);\n    return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n  }\n}\n\nvar SphinxColorschemeImageHandler = function SphinxColorschemeImageHandler(options) {\n  var _this = this;\n  if (options === void 0) {\n    options = {};\n  }\n  this.activate = function (scheme) {\n    var data_att = \"data-alt-src-color-scheme-\" + scheme;\n    var images = document.querySelectorAll(\"img[\" + data_att + \"]\");\n    var _loop = function _loop() {\n      var img = _step.value;\n      var new_img = new Image();\n      var new_src = img.getAttribute(data_att);\n      new_img.src = new_src;\n      new_img.addEventListener('load', function () {\n        img.src = new_img.src;\n      });\n      new_img.addEventListener('error', function () {\n        console.error(\"Could not replace image \" + img.src + \" with \" + new_src + \".\");\n      });\n      if (new_img.complete) {\n        img.src = new_img.src;\n      }\n\n      // Check whether the image is inside a <figure>.\n      var figure = img.closest('figure');\n      if (figure != undefined) {\n        var anchor = figure.querySelector('a');\n        if (anchor.getAttribute('href') !== new_src) {\n          anchor.href = new_src;\n        }\n      } else if (img.parentElement.tagName == \"A\" && img.parentElement.getAttribute(\"href\") !== new_src) {\n        var parent = img.parentElement;\n        parent.href = img.getAttribute(data_att);\n      }\n    };\n    for (var _iterator = _createForOfIteratorHelperLoose(images), _step; !(_step = _iterator()).done;) {\n      _loop();\n    }\n  };\n  this._schemes = [];\n  this._mediaqs = [];\n\n  // If options are not given or if it is given with a key 'auto'\n  // and a boolean value true, then the instance created will add\n  // an event listener for changes on prefers-color-scheme to\n  // update images accordingly.\n  this._auto = options.hasOwnProperty('auto') ? options['auto'] === true : true;\n  var meta_prop = document.querySelector('meta[name=\"color-scheme\"]');\n  var meta_schemes = meta_prop == undefined ? \"\" : meta_prop.content;\n  if (meta_schemes.length > 0) {\n    var schemes = meta_schemes.split(\" \");\n    for (var _iterator2 = _createForOfIteratorHelperLoose(schemes), _step2; !(_step2 = _iterator2()).done;) {\n      var item = _step2.value;\n      this._schemes.push(item.trim());\n    }\n  } else {\n    this._schemes = ['light', 'dark'];\n  }\n  var _loop2 = function _loop2() {\n    var scheme = _step3.value;\n    var q = globalThis.matchMedia(\"(prefers-color-scheme: \" + scheme + \")\");\n    if (q.matches) {\n      _this.activate(scheme);\n    }\n    if (_this._auto === true) {\n      q.addEventListener('change', function (e) {\n        if (e.matches) {\n          _this.activate(scheme);\n        }\n      });\n      _this._mediaqs.push(q);\n    }\n  };\n  for (var _iterator3 = _createForOfIteratorHelperLoose(this._schemes), _step3; !(_step3 = _iterator3()).done;) {\n    _loop2();\n  }\n};\n\nexport { SphinxColorschemeImageHandler };\n//# sourceMappingURL=sphinx-colorschemed-images.esm.js.map\n","import { SphinxColorschemeImageHandler } from \"sphinx-colorschemed-images\";\n\nexport class CSchemeHandler {\n  constructor() {\n    this.stored = localStorage.getItem('snftt-color-scheme') || \"default\";\n    this._cshdl = new SphinxColorschemeImageHandler({auto: false});\n    for (const scheme of ['dark', 'light']) {\n      const q = globalThis.matchMedia(`(prefers-color-scheme: ${scheme})`);\n      if (q.matches && this.stored == 'default') {\n        this.apply(scheme);\n        this.updateDropdown(this.stored);\n        this._cshdl.activate(scheme);\n      }\n      q.addEventListener('change', e => {\n        if (e.matches) {\n          this.apply(scheme);\n          this._cshdl.activate(scheme);\n        }\n      });\n    }\n    if (this.stored != \"default\") {\n      this.apply(this.stored);\n      this.updateDropdown(this.stored);\n      this._cshdl.activate(this.stored);\n    }\n  }\n\n  registerClickEvents() {\n    for (const item of document.querySelectorAll('[data-snftt-luz]')) {\n      item.addEventListener('click', (event) => {\n        event.preventDefault();\n        this.stored = item.dataset.snfttLuz;\n        localStorage.setItem('snftt-color-scheme', this.stored);\n        this.apply(this.stored);\n        this.updateDropdown(this.stored, true);\n        this._cshdl.activate(this.preferred);\n      });\n    };\n  }\n\n  get preferred() {\n    if ([\"light\", \"dark\"].includes(this.stored)) {\n      return this.stored;\n    }\n    const q = globalThis.matchMedia('(prefers-color-scheme: dark)');\n    return q.matches ? 'dark' : 'light';\n  }\n\n  apply(option) {\n    switch(option) {\n      case \"default\": {\n        document.documentElement.classList.remove(\"light\");\n        document.documentElement.classList.remove(\"dark\");\n        document.documentElement.classList.add(this.preferred);\n        return;\n      }\n      case \"dark\": {\n        document.documentElement.classList.remove('light');\n        document.documentElement.classList.add('dark');\n        return;\n      }\n      case \"light\": {\n        document.documentElement.classList.remove('dark');\n        document.documentElement.classList.add('light');\n        return;\n      }\n    }\n  }\n\n  updateDropdown(cscheme, focus = false) {\n    const prefix = \"data-snftt-luz\";\n    const selector = document.querySelector(\"#snftt-luz\");\n    const sel_icon = document.querySelector(`[${prefix}-icon-active]`);\n    const luz_item = document.querySelector(`[${prefix}=\"${cscheme}\"]`);\n    const luz_icon = document.querySelector(`[${prefix}-icon=\"${cscheme}\"]`);\n\n    const elements = document.querySelectorAll(`[${prefix}]`);\n    for (const element of elements) {\n      element.classList.remove('active', 'current');\n      element.setAttribute('aria-pressed', 'false');\n    };\n\n    if (luz_item != undefined) {\n      luz_item.classList.add('active', 'current');\n      luz_item.setAttribute('aria-pressed', 'true');\n    }\n\n    sel_icon?.setAttribute('class', luz_icon.classList.value);\n\n    if (focus) {\n      selector.focus();\n    }\n  }\n}\n","// --------------------------------------------------------\n// Selector to use with document.querySelector(SELECTOR),\n// that represents the HTML template element containing the\n// button to expand/fold the toc tree.\n//\nconst TEMPLATE_SELECTOR = \"[data-toggle-item-template]\";\n\nfunction loadRefList() {\n  let refs = [];\n  const toc_expanded_stored = localStorage.getItem(\"toc-expanded\");\n  if (toc_expanded_stored?.trim().length) {\n    refs = toc_expanded_stored.split(\",\");\n  }\n\n  return refs;\n}\n\nexport class MenuHandler {\n  constructor() {\n    this.toc;\n    this.refs;\n    this.filter;\n  }\n\n  _removeRef = (ref) => {\n    const pos = this.refs.indexOf(ref);\n    if (pos > -1) {\n      this.refs.splice(pos, 1);\n      localStorage.setItem(\"toc-expanded\", this.refs.join(\",\"));\n    }\n  }\n\n  _expandRefs = () => {\n    for (const ref of this.refs) {\n      const li_item = this.toc.querySelector(`li[data-snftt-ref='${ref}']`);\n      if (li_item == undefined) {\n        this._removeRef(ref);\n        continue;\n      }\n      if (!li_item.classList.contains(\"expand\")) {\n        li_item.classList.toggle(\"expand\");\n        this._updateItem(li_item);\n      }\n    }\n  }\n\n  _expandOrFoldAll = (expand=true) => {\n    const links = this.toc ? this.toc.querySelectorAll(\"a.reference\") : [];\n    for (const link of links) {\n      if (link.nextElementSibling) {\n        const li_item = link.parentElement;\n        if (expand) {\n          li_item.classList.add(\"expand\");\n        } else {\n          li_item.classList.remove(\"expand\");\n        }\n        this._updateItem(li_item, false);\n      }\n    }\n  }\n\n  _updateItem = (li_item, update_refs=true) => {\n    const icon = li_item.querySelector(\"i\");\n\n    if (li_item.classList.contains(\"expand\")) {\n      icon.classList.remove(\"bi-caret-right\");\n      icon.classList.add(\"bi-caret-down\");\n      if (update_refs && !this.refs.includes(li_item.dataset.snfttRef)) {\n        this.refs.push(li_item.dataset.snfttRef);\n        localStorage.setItem(\"toc-expanded\", this.refs.join(\",\"));\n      }\n    } else {\n      icon.classList.remove(\"bi-caret-down\");\n      icon.classList.add(\"bi-caret-right\");\n      if (update_refs && this.refs.includes(li_item.dataset.snfttRef)) {\n        this._removeRef(li_item.dataset.snfttRef);\n      }\n    }\n  }\n\n  _clickHandler = (event) => {\n    const expand_button = event.currentTarget;\n    const element = expand_button?.parentElement;\n    element.classList.toggle(\"expand\");\n    this._updateItem(element);\n  }\n\n  _keyupHandler = (event) => {\n    const uls = this.toc.querySelectorAll(\"ul\");\n    const links = this.toc.querySelectorAll(\"a.reference\");\n\n    // Stop filtering -> remove d-none from all li and ul elements.\n    if (this.filter.value.length === 0) {\n      for (const link of links) {\n        link.parentElement?.classList.remove(\"d-none\");\n      }\n      for (const ul of uls) {\n        ul.classList.remove(\"d-none\");\n      }\n      this._expandOrFoldAll(false);  // Passing false means fold.\n      this._expandRefs();\n      return;\n    }\n\n    // 1st. hide all li elements in the toc.\n    for (const link of links) {\n      link.parentElement?.classList.add(\"d-none\");\n    }\n    for (const ul of uls) {\n      ul.classList.add(\"d-none\");\n    }\n\n\n    this._expandOrFoldAll(true);\n\n    // 2nd. show li elements whose anchor matches the filter.\n    const filter_re = new RegExp(this.filter.value, 'i');\n    for (const link of links) {\n      if (!filter_re.test(link.textContent))\n        continue;\n\n      let li_item = link;\n      let parent = li_item?.parentElement;\n\n      while (li_item) {  // Loop to make visible parent elements up the toc.\n        li_item.classList.remove(\"d-none\");\n        parent = li_item.parentElement;\n        if (parent.nodeName === \"UL\") {\n          parent?.classList.remove(\"d-none\");\n        }\n        li_item = parent?.closest(\"li\");\n      }\n    }\n  }\n\n  init = () => {\n    let num_expandable_menus = 0;\n    this.toc = document.querySelector(\".toc\");\n    this.filter = this.toc.querySelector(\"input[name='filter']\");\n    this.refs = loadRefList();\n\n    const links = this.toc ? this.toc.querySelectorAll(\"a.reference\") : [];\n\n    const tmpl = document.querySelector(TEMPLATE_SELECTOR);\n    const tmpl_button = tmpl?.content.firstElementChild;\n\n    if (tmpl_button == undefined)\n      return -1;\n\n    this.filter.addEventListener('keyup', this._keyupHandler);\n\n    for (const link of links) {\n      if (link.nextElementSibling) {\n        const expand_button = tmpl_button.cloneNode(true);\n        expand_button.addEventListener('click', this._clickHandler, true);\n        link.before(expand_button);\n\n        // Maybe there is already a LI item displayed with the\n        // \"current\" class added. In such a case update the\n        // icon to display a dash symbol instead of a plus.\n        const li_item = link.parentElement;\n        li_item.dataset.snfttRef = link.href;\n        if (li_item && li_item.classList.contains(\"current\")) {\n          li_item.classList.toggle(\"current\");\n          li_item.classList.toggle(\"expand\");\n          this._updateItem(li_item);\n        }\n\n        num_expandable_menus++;\n      }\n    }\n\n    // Expand items that where expanded before,\n    // and saved in localStorage.\n    this._expandRefs();\n\n    return num_expandable_menus;\n  }\n}\n","function _addActiveCssClass(elem) {\n  elem.classList.add(\"active\");\n  elem.ariaCurrent=true;\n  if (elem.classList.contains(\"dropdown-item\")) {\n    const parent = elem.closest(\"li.nav-item.dropdown\");\n    if (!parent) return;\n\n    const anchor = parent.querySelector(\"a.nav-link.dropdown-toggle\")\n    if (!anchor) return;\n\n    if (anchor) {\n      anchor.classList.add(\"active\");\n      anchor.ariaCurrent = true;\n    }\n  }\n}\n\nexport function selectActiveHeaderLink() {\n  const curl = URL.parse(window.location.href);\n\n  for (const elem of document.querySelectorAll(\".snftt-hl\")) {\n    elem.classList.remove(\"active\");\n    elem.ariaCurrent = false;\n  }\n\n  // Activate the current link:\n  let qs = `.snftt-hl[href='#']`;\n  for (const elem of document.querySelectorAll(qs)) {\n    if (!elem.classList.contains(\"dropdown-toggle\")) {\n      _addActiveCssClass(elem);\n    }\n  }\n\n  // Find header-link element (.snftt-hl) with regexps, and\n  // check whether the current pathname matches the regexp.\n  let hl_id = 0;  // Not found.\n  qs = \".nftt-header-links-large .snftt-hl[data-snftt-hl-regexps]\"\n  for (const elem of document.querySelectorAll(qs)) {\n    const regexps = elem.dataset.snfttHlRegexps.split(\"&&\");\n    for (const re_str of regexps) {\n      const re = new RegExp(re_str);\n      if (re.test(curl.pathname)) {\n        // The first regexp that returns true is considered valid. Leave\n        // the loop and select the two elements with the same hl-id.\n        hl_id = elem.dataset.snfttHlId;\n        break;\n      }\n    }\n  }\n\n  if (hl_id == 0)\n    return;\n\n  qs = `.snftt-hl[data-snftt-hl-id='${hl_id}']`;\n  for (const elem of document.querySelectorAll(qs)) {\n    _addActiveCssClass(elem);\n  }\n}\n","export function formatNumber(num) {\n  const def_locale = document.documentElement.lang || \"en\";\n  return num.toLocaleString(def_locale, {\n    maximumFractionDigits: 2,\n    notation: 'compact',\n    compactDisplay: 'short'\n  });\n}\n","import { formatNumber } from \"./utils.js\";\n\nexport async function readFromGitHub(user, repo) {\n  let tag = \"\";\n  let stars = \"\";\n  let forks = \"\";\n  const url = `https://api.github.com/repos/${user}/${repo}`;\n\n  const response1 = await fetch(url);\n  if (response1.status !== 200) {\n    throw new Error(\"Rate limit reached.\");\n  }\n  const data1 = await response1.json();\n\n  stars = formatNumber(data1.stargazers_count);\n  localStorage.setItem(`${user}:${repo}:stars`, stars);\n  forks = formatNumber(data1.forks_count);\n  localStorage.setItem(`${user}:${repo}:forks`, forks);\n\n  const response2 = await fetch(`${url}/releases/latest`);\n  if (response2.status !== 200) {\n    throw new Error(\"Rate limit reached.\");\n  }\n  const data2 = await response2.json();\n  tag = data2.tag_name;\n  localStorage.setItem(`${user}:${repo}:tag`, tag);\n\n  if (tag !== \"\" && stars != \"\" && forks != \"\") {\n    return {tag, stars, forks};\n  }\n}\n","import { formatNumber } from \"./utils.js\";\n\nexport async function readFromGitLab(base, project) {\n  let stars = \"\";\n  let forks = \"\";\n  const url = `https://${base}/api/v4/projects/${encodeURIComponent(project)}`;\n  const response = await fetch(url);\n  if (response.status !== 200) {\n    throw new Error(\"Rate limit reached.\");\n  }\n  const data = await response.json();\n  stars = formatNumber(data.star_count);\n  localStorage.setItem(`${base}:${project}:stars`, stars);\n  forks = formatNumber(data.forks_count);\n  localStorage.setItem(`${base}:${project}:forks`, forks);\n\n  if (stars != \"\" && forks != \"\") {\n    return {tag: \"\", stars, forks};\n  }\n}\n","import { readFromGitHub } from \"./github.js\";\nimport { readFromGitLab } from \"./gitlab.js\";\n\n\nconst ls = localStorage;  // Aliasing localStorage.\n\nconst qs_repo_url = \"[data-snftt-repo-url]\";\nconst qs_repo_facts = \"[data-snftt-repo-metrics]\";\nconst qs_repo_tag = \"[data-snftt-repo-tag]\";\nconst qs_repo_stars = \"[data-snftt-repo-stars]\";\nconst qs_repo_forks = \"[data-snftt-repo-forks]\";\n\n\nfunction _updateFactsComponent(metrics) {\n  let num_updated_facts = 0;\n  const facts_element = document.querySelector(qs_repo_facts);\n  const tag_element = document.querySelector(qs_repo_tag);\n  const stars_element = document.querySelector(qs_repo_stars);\n  const forks_element = document.querySelector(qs_repo_forks);\n\n  if (metrics.tag != undefined && metrics.tag.length > 0) {\n    tag_element.textContent = metrics.tag;\n    num_updated_facts++;\n  } else {\n    tag_element.parentElement.classList.remove(\"d-flex\");\n    tag_element.parentElement.classList.add(\"d-none\");\n  }\n\n  if (metrics.stars != undefined && metrics.stars.length > 0) {\n    stars_element.textContent = metrics.stars;\n    num_updated_facts++;\n  } else {\n    stars_element.parentElement.classList.remove(\"d-flex\");\n    stars_element.parentElement.classList.add(\"d-none\");\n  }\n\n  if (metrics.forks != undefined && metrics.forks.length > 0) {\n    forks_element.textContent = metrics.forks;\n    num_updated_facts++;\n  } else {\n    forks_element.parentElement.classList.remove(\"d-flex\");\n    forks_element.parentElement.classList.add(\"d-none\");\n  }\n\n  facts_element.classList.add(\"ready\");\n  return num_updated_facts;\n}\n\n\nfunction _readFromLocalStorage(p1, p2) {\n  const tag = ls.getItem(`${p1}:${p2}:tag`);\n  const stars = ls.getItem(`${p1}:${p2}:stars`);\n  const forks = ls.getItem(`${p1}:${p2}:forks`);\n  if (!stars || !forks) {\n    return {tag: \"\", stars: \"\", forks: \"\"};\n  }\n  return {tag, stars, forks};\n}\n\n\nexport async function _getRepoMetrics(host, p1, p2) {\n  let metrics;\n  const last_access = ls.getItem(`${p1}:${p2}:lastaccess`);\n\n  if (last_access) {\n    const now = Date.now();\n    const ts = new Date();\n    ts.setTime(Number.parseInt(last_access) + 60_000);\n    if (ts.getTime() > now) {\n      // Now is still under last_access + 60 secs.\n      // Go get metrics from localStorage...\n      metrics = _readFromLocalStorage(p1, p2);\n    }\n  }\n\n  if (!metrics) {\n    try {\n      switch (host) {\n        case \"github\": {\n          metrics = await readFromGitHub(p1, p2);\n          break;\n        }\n        case \"gitlab\": {\n          metrics = await readFromGitLab(p1, p2);\n          break;\n        }\n      }\n      localStorage.setItem(`${p1}:${p2}:lastaccess`, `${Date.now()}`);\n    } catch {\n      metrics = _readFromLocalStorage(p1, p2);\n    }\n  }\n\n  return metrics;\n}\n\n\nexport async function updateRepoMetrics() {\n  const repo_url_element = document.querySelector(qs_repo_url);\n  const url = repo_url_element ? repo_url_element.dataset.snfttRepoUrl : \"\";\n\n  /* Try to match GitHub repository */\n  let github_match = url.match(/^.+github\\.com\\/([^/]+)\\/?([^/]+)?/i);\n  if (github_match) {\n    const [, user, repo] = github_match;\n    const metrics = await _getRepoMetrics(\"github\", user, repo);\n    if (metrics) {\n      return _updateFactsComponent(metrics);\n    }\n  }\n\n  /* Try to match GitLab repository */\n  let gitlab_match = url.match(/^.+?([^/]*gitlab[^/]+)\\/(.+?)\\/?$/i)\n  if (gitlab_match) {\n    const [, base, slug] = gitlab_match;\n    const metrics = await _getRepoMetrics(\"gitlab\", base, slug);\n    if (metrics) {\n      return _updateFactsComponent(metrics);\n    }\n  }\n\n  return -1;\n}\n","export class TocObserver {\n  constructor() {\n    this.doc;\n    this.toc;\n    this.section_observer;\n  }\n\n  _sectionsObservationHandler = (entries) => {\n    entries.map(item => {\n      const sec = item.target;\n      const target = this.toc.querySelector(`a[href='#${sec.id}']`);\n      const parent = target?.parentElement;\n      if (item.isIntersecting === true) {\n        parent?.classList.add(\"active\");\n      } else {\n        parent?.classList.remove(\"active\");\n      }\n    });\n  }\n\n  _initializeSectionsObserver = (root_margin) => {\n    this.section_observer = new IntersectionObserver(\n      this._sectionsObservationHandler,\n      {\n        root: undefined,\n        rootMargin: root_margin,\n        threshold: [0, 0.25, 0.5, 0.75, 1],\n      }\n    );\n\n    for (const element of this.doc.querySelectorAll(\":scope section\")) {\n      this.section_observer.observe(element);\n    }\n  }\n\n  init = () => {\n    this.doc = document.querySelector(\".nftt-content\");\n    this.toc = document.querySelector(\"#TableOfContents\");\n    if (this.doc == undefined || this.toc == undefined) {\n      return -1;\n    }\n\n    const header_h = document.querySelector(\"header\")?.offsetHeight;\n    const root_margin = `-${header_h || 0}px 0px 0px 0px`;\n\n    // The first link in the Toc does not point to the first\n    // header. Fix that situation by reading what is the actual href\n    // of the first header with class=\"headerlink\", and then update\n    // the first link in the toc.\n    const document_1a = this.doc.querySelector(\"section a.headerlink\");\n    const toc_1a = this.toc.querySelector(\"a.reference[href='#']\");\n    if (document_1a != undefined && toc_1a != undefined) {\n      toc_1a.setAttribute(\"href\", document_1a.getAttribute(\"href\"));\n    }\n\n    // Sphinx returns anchors in the toc with the class \"internal\"\n    // and \"reference\". Also, it returns the first anchor with the\n    // class \"active\", which is not correct, as I want the\n    // IntersectionObserver to handle what is the section\n    // active in each moment. Therefore, I remove here\n    // the \"active\" class from all anchors in the toc.\n    const anchors = this.toc.querySelectorAll(\"a.reference\");\n    for (const anchor of anchors) {\n      anchor.classList.remove(\"active\");\n    }\n\n    this._initializeSectionsObserver(root_margin);\n    return 0;\n  }\n}\n","export function resizeAsides() {\n  let style = \"\";\n  let height = \"\";\n  let top = \"\";\n\n  const nftt_content = document.querySelector(\".nftt-content\");\n  const nftt_sidebar = document.querySelector(\".nftt-sidebar\");\n  const backtotop_div = document.getElementById(\"back-to-top-container\");\n  const nftt_toc = document.querySelector(\".nftt-toc\");\n  const header_h = document.querySelector(\"header\")?.offsetHeight;\n\n  // If min-width is not >= 1200px, don't do anything.\n  if (window.matchMedia('(min-width: 1200px)').matches == false) {\n    nftt_sidebar?.setAttribute(\"style\", \"\");\n    nftt_toc?.setAttribute(\"style\", \"\");\n    return \"\";\n  }\n\n  if (nftt_content != undefined) {\n    height = nftt_content.clientHeight > document.body.clientHeight\n      ? `height: calc(100vh - ${header_h + 40}px)`\n      : `height: ${nftt_content.clientHeight}px`;\n    top = `top: ${header_h + 40}px`;\n\n    style = `${height}; ${top};`\n    nftt_sidebar?.setAttribute(\"style\", style);\n    nftt_toc?.setAttribute(\"style\", style);\n    backtotop_div?.setAttribute(\"style\", `top: ${header_h + 20}px`);\n  }\n\n  return style;\n}\n\n\nexport function updateScrollPaddingTop() {\n  let scroll_padding_top = -1;\n  const element = document.querySelector(\"html\");\n  const header_h = element.querySelector(\"header\")?.offsetHeight;\n  if (header_h != undefined) {\n    scroll_padding_top = header_h + 24;\n    element.setAttribute(\n      \"style\", `scroll-padding-top: ${scroll_padding_top}px`\n    );\n  }\n  return scroll_padding_top;\n}\n","const qs_version_url = \"[data-snftt-version-url]\";\n\nfunction _getCurrentVersion() {\n  const all_version_elems = document.querySelectorAll(qs_version_url);\n  for (const version_elem of all_version_elems) {\n    let version_url = version_elem.dataset?.snfttVersionUrl;\n    version_url = version_url.replace(\"?\", String.raw`\\?`);\n    if (new RegExp(version_url).test(window.location.href)) {\n      return version_elem.dataset?.snfttVersion;\n    };\n  }\n  return globalThis.def_ver || \"\";\n}\n\nexport function updateVersion() {\n  const version = _getCurrentVersion();\n  const qs_version_active = \"[data-snftt-version-active]\";\n  const version_active = document.querySelector(qs_version_active);\n  const qs_version_item = `[data-snftt-version=\"${version}\"]`;\n  const version_item = document.querySelector(qs_version_item);\n\n  for (const element of document.querySelectorAll('[data-snftt-version]')) {\n    element.classList.remove('active', 'current');\n    element.setAttribute('aria-pressed', 'false');\n  }\n\n  if (version_item != undefined) {\n    version_item.classList.add('active', 'current');\n    version_item.setAttribute('aria-pressed', 'true');\n    if (version_active != undefined) {\n      version_active.textContent = version_item.dataset.snfttVersion;\n    }\n  }\n}\n\nexport function feedVersionsMenu() {\n  const vermenu = document.getElementById(\"versions-dropdown-menu\");\n  if (!vermenu) {\n    console.log(\"Did not find the versions dropdown menu.\");\n    return false;\n  }\n  // Use the variable 'docs_versions' loaded as a script in layout.html.\n  // The file docs_versions.js is produced by versions.py when building\n  // the site (make html).\n  for (const item of globalThis.docs_versions) {\n    const li = document.createElement(\"li\");\n    const anchor = document.createElement(\"a\");\n    anchor.classList.add(\n      \"dropdown-item\", \"d-flex\", \"align-items-center\",\n      \"justify-content-between\"\n    );\n    anchor.setAttribute(\"aria-pressed\", \"false\");\n    anchor.setAttribute(\"href\", item.url);\n    anchor.dataset.snfttVersionUrl = item.url;\n    anchor.dataset.snfttVersion = item.name;\n    const span = document.createElement(\"span\");\n    span.classList.add(\"small\", \"ms-2\");\n    span.textContent = item.name;\n    const i = document.createElement(\"i\");\n    i.classList.add(\"bi\", \"bi-check\", \"ms-auto\");\n    anchor.append(span);\n    anchor.append(i);\n    li.append(anchor);\n    vermenu.append(li);\n  }\n\n  return true;\n}\n","import { BackToTop } from \"./backtotop.js\";\nimport { fixFigureStyle } from \"./figures.js\";\nimport { CSchemeHandler } from \"./cschemes.js\";\nimport { MenuHandler } from \"./menu.js\";\nimport { selectActiveHeaderLink } from \"./navbar.js\";\nimport { updateRepoMetrics } from \"./repometrics.js\";\nimport { TocObserver } from \"./pagetoc.js\";\nimport { resizeAsides, updateScrollPaddingTop } from \"./tocresize.js\";\nimport { feedVersionsMenu, updateVersion } from \"./versions.js\";\n\n\nfunction agentHas(keyword) {\n  return navigator.userAgent.toLowerCase().search(keyword.toLowerCase()) > -1;\n}\n\nfunction isFirefox() {\n  return agentHas(\"Firefox\") || agentHas(\"FxiOS\") || agentHas(\"Focus\");\n}\n\nfunction isSafari() {\n  return (\n    !!window.ApplePaySetupFeature\n    || !!window.safari\n  ) && agentHas(\"Safari\") && !agentHas(\"Chrome\") && !agentHas(\"CriOS\");\n}\n\nfunction runWhenDOMContentLoaded(cb) {\n  if (document.readyState != 'loading') {\n    cb();\n  } else if (document.addEventListener) {\n    document.addEventListener('DOMContentLoaded', cb);\n  } else {\n    document.attachEvent('onreadystatechange', function() {\n      if (document.readyState == 'complete') cb();\n    });\n  }\n}\n\nfunction loadSphinxNefertiti() {\n  // docutils figures that receive specific dimension styling\n  // (basically: width or height) apply the styling to the <img> element\n  // instead of to the <figure>. That makes the <figcaption> to have\n  // a width wider than the image. The fixFigureStyle function\n  // moves the style when it contains a specific value for the\n  // \"width\" dimension.\n  fixFigureStyle();\n\n  const menu_handler = new MenuHandler();\n  if (menu_handler.init() == -1) {\n    console.log(\"Could not find the <template data-toggle-item-template>.\");\n    console.log(\"Therefore left side nested menu entries will not be visible.\")\n  };\n\n  // --------------------------------------------------\n  // On every page load, adjust height of nftt-sidebar\n  // and nftt-toc, based on height of nftt-content.\n  //\n  updateScrollPaddingTop();\n  resizeAsides(); // Resize just after DOM content is loaded.\n\n  // And register the function for every height change of the body.\n  const body_observer = new ResizeObserver(entries => {\n    const header_h = document.querySelector(\"header\")?.offsetHeight;\n    document.body.style.paddingTop = `${header_h + 4}px`;\n\n    updateScrollPaddingTop();\n    resizeAsides();\n  });\n  body_observer.observe(document.body);\n  window.addEventListener(\"resize\", [updateScrollPaddingTop, resizeAsides,]);\n\n  // The CSchemeHandler controls the selection of the 3 possible\n  // options (light, dark, default) and the switching between\n  // them.\n  const cscheme_handler = new CSchemeHandler();\n  cscheme_handler.registerClickEvents();\n\n  // Feed the versions dropdown element.\n  feedVersionsMenu();\n\n  // The updateVersion function controls the display of the version\n  // in the header, adding the CSS class \"current\" to display the\n  // tick symbol near the version selected.\n  updateVersion();\n\n  // The function updateRepoMetrics updates the details related to the\n  // repository in the header.\n  if(updateRepoMetrics() == -1) {\n    console.log(\"Could not find an element with [data-snftt-repo-url]\");\n  };\n\n  // Create the table of contents out of the content\n  // of the nftt-content.\n  const toc_observer = new TocObserver();\n  toc_observer.init();\n\n  if (isSafari() || isFirefox()) {\n    let css_content;\n    const head = document.head;\n\n    if (isSafari()) {\n      css_content = (\n        \".nftt-toc nav ul ul {\" +\n        \"   padding-left: 0.8rem;\" +\n        \"}\"\n      );\n    } else if (isFirefox()) {\n      css_content = (\n        \".nftt-toc nav ul ul {\" +\n        \"   padding-left: 0.55rem;\" +\n        \"}\"\n      );\n    }\n\n    const style = document.createElement(\"style\");\n    style.append(document.createTextNode(css_content));\n    head.append(style);\n  }\n\n  // Fix accessibility in each input element\n  // with class 'task-list-item-checkbox'.\n  const task_list_elems_qs = \"input.task-list-item-checkbox\";\n  const task_list_elems = document.querySelectorAll(task_list_elems_qs);\n  for (const element of task_list_elems) {\n    // Add a title to each input element.\n    element.setAttribute('title', `Is task done? ${element.checked}`);\n  }\n\n  // Wrap tables with responsive container.\n  const tables = document.querySelectorAll('table.docutils');\n  for (const table of tables) {\n    const wrapper = document.createElement(\"div\");\n    wrapper.classList.add(\"nftt-table\");\n    table.before(wrapper);\n    wrapper.append(table);\n  }\n\n  // Fix admonitions-like blocks used in Sphinx to display version\n  // changes. Such directives are: versionadded, versionchanged,\n  // deprecated, and versionremoved.\n  const vchanges_selectors = [\n    [\"div.versionadded\", \"versionadded\", \"versionadded-title-only\"],\n    [\"div.versionchanged\", \"versionchanged\", \"versionchanged-title-only\"],\n    [\"div.deprecated\", \"deprecated\", \"deprecated-title-only\"],\n    [\"div.versionremoved\", \"versionremoved\", \"versionremoved-title-only\"],\n  ];\n  for (const lst of vchanges_selectors) {\n    const [ selector, src_class, tgt_class ] = lst;\n    const elems = document.querySelectorAll(selector);\n\n    for (const div of elems) {\n      // The 'p' contained in the div might contain just a <span>, or\n      // a <span> and a text node. The 2nd case is when the versionadded\n      // directive receives additional text, right below the directive.\n      // If the directive only gets the version number, without\n      // additional text below, then I the selector should\n      // change to .versionadded-title-only, so that it\n      // does not display an empty block below.\n\n      if (div.querySelector(\"p\").childNodes.length == 1) {\n        div.classList.replace(src_class, tgt_class);\n      }\n    }\n  }\n\n  const back_to_top = new BackToTop();\n  back_to_top.init();\n\n  // In case there were Header Links (.snftt-hl) add the class\n  // 'active' to the one corresponding to the current URL.\n  selectActiveHeaderLink();\n\n  // Scroll the item from the left sidebar into view:\n  const sidebar_elem = document.querySelector(\".nftt-sidebar a.current\");\n  if (sidebar_elem) {\n    const parent = sidebar_elem.closest(\".toc li\");\n    if (parent) {\n      parent.scrollIntoView({behavior: \"smooth\", block: \"end\"});\n    }\n  }\n}\n\nrunWhenDOMContentLoaded(loadSphinxNefertiti);\n"],"mappings":"y3QAAA,IAAMA,sBAAwB,cACxBC,mBAAqB,wBAIrBC,UAAY,gBAIZC,sBAAwB,GAGjBC,UACX,WAAc,IAAAC,EAAAC,UASdC,eAAiB,SAACC,GAChB,IAAIC,EAAWC,OAAOC,aAAeC,SAASC,gBAAgBC,UAE1DL,EAAWJ,EAAKU,aAAeN,GAAYJ,EAAKW,cAClDX,EAAKY,IAAIC,UAAUC,IAAI,UACdV,EAAWJ,EAAKU,aAAeN,EAAWJ,EAAKW,eACxDX,EAAKY,IAAIC,UAAUE,OAAO,UAG5Bf,EAAKU,YAAcN,GAAY,EAAI,EAAIA,C,EACxCH,KAEDe,oBAAsB,SAACb,GACrBA,EAAMc,iBACNV,SAASC,gBAAgBC,UAAY,C,EACtCR,KAEDiB,KAAO,WACLb,OAAOc,iBAAiB,SAAUnB,EAAKE,gBAAgB,GACvDF,EAAKY,IAAIO,iBAAiB,QAASnB,EAAKgB,qBAAqB,E,EA3B7Df,KAAKW,IAAML,SAASa,eAAezB,uBACnCM,KAAKS,YAAc,EACnB,IAAMW,EAASd,SAASa,eAAevB,WACvCI,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FctB,SAASuB,iBAAiB+F,MAEjB7B,EAAAM,KAAAvE,MAAE,KAAd8V,EAAG7R,EAAA/D,MASoC,GAA5C4V,EAAI1V,cAAc,KAAK2V,WAAWnV,QACpCkV,EAAIhX,UAAUgU,QAAQ8C,EAAWC,EAErC,EAGkB,IAAI7X,WACZmB,OAIZiL,yBAGA,IAAM4L,EAAexX,SAAS4B,cAAc,2BAC5C,GAAI4V,EAAc,CAChB,IAAM3M,EAAS2M,EAAalT,QAAQ,WAChCuG,GACFA,EAAO4M,eAAe,CAACC,SAAU,SAAUC,MAAO,OAEtD,CACF,CAEAtB,wBAAwBI","ignoreList":[]}
\ No newline at end of file
diff --git a/sphinx_nefertiti/version-dropdown.html b/sphinx_nefertiti/version-dropdown.html
index 8813e33..a59098f 100644
--- a/sphinx_nefertiti/version-dropdown.html
+++ b/sphinx_nefertiti/version-dropdown.html
@@ -1,50 +1,16 @@
-<!-- version_dropdown.html -->
-{% if READTHEDOCS or theme_versions %}
-  {% if READTHEDOCS %}
-    <li class="nav-item dropdown">
-      <a class="nav-link d-flex py-2 px-0 px-xl-2 dropdown-toggle align-items-center" id="snftt-version" href="#" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Select version">
-        <span id="snftt-version-text" class="d-xl-none">{{ project|striptags|e }}</span>
-        <span class="ms-2" data-snftt-version-active="{{ current_version }}">v: {{ current_version }}</span>
-      </a>
-      <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="snftt-version-text">
-        <li>
-          <h6 class="dropdown-header">Versions</h6>
-        </li>
-        {% for slug, url in versions %}
-          <li>
-            <a class="dropdown-item d-flex align-items-center justify-content-between" aria-pressed="false" href="{{ url }}" data-snftt-version-url="{{ url }}" data-snftt-version="{{ slug }}">
-              <span class="ms-2">{{ slug }}</span>
-              <i class="bi bi-check ms-auto"></i>
-            </a>
-          </li>
-        {% endfor %}
-        <li><hr class="dropdown-divider"></li>
-        <li>
-          <h6 class="dropdown-header">On Read the Docs</h6>
-        </li>
-        <li>
-          <a class="dropdown-item d-flex align-items-center justify-content-between" aria-pressed="false" href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/?fromdocs={{ slug }}"><span class="ms-2">{{ _('Project Home') }}</span></a>
-        </li>
-        <li>
-          <a class="dropdown-item d-flex align-items-center justify-content-between" aria-pressed="false" href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}"><span class="ms-2">{{ _('Builds') }}</span></a>
-        </li>
-      </ul>
-    </li>
-  {% elif theme_versions %}
-    <li class="nav-item dropdown">
-      <a class="nav-link d-flex py-2 px-0 px-xl-2 dropdown-toggle align-items-center" id="snftt-version" href="#" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Select version">
-        <span id="snftt-version-text" class="d-xl-none">{{ project|striptags|e }}</span>
-        <span class="ms-2" data-snftt-version-active="{{ theme_current_version }}">{{ theme_current_version }}</span>
-      </a>
-      {# Feeding the elements takes place via the versions.js #}
-      <ul class="dropdown-menu dropdown-menu-end dropdown-limit-max-height" aria-labelledby="snftt-version-text" id="versions-dropdown-menu">
-        <li>
-          <h6 class="dropdown-header">{{ _('Versions') }}</h6>
-        </li>
-      </ul>
-    </li>
-  {% endif %}
-
+{% if theme_versions %}
+  <li class="nav-item dropdown">
+    <a class="nav-link d-flex py-2 px-0 px-xl-2 dropdown-toggle align-items-center" id="snftt-version" href="#" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Select version">
+      <span id="snftt-version-text" class="d-xl-none">{{ project|striptags|e }}</span>
+      <span class="ms-2" data-snftt-version-active="{{ theme_current_version }}">{{ theme_current_version }}</span>
+    </a>
+    {# Feeding the elements takes place via the versions.js #}
+    <ul class="dropdown-menu dropdown-menu-end dropdown-limit-max-height" aria-labelledby="snftt-version-text" id="versions-dropdown-menu">
+      <li>
+        <h6 class="dropdown-header">{{ _('Versions') }}</h6>
+      </li>
+    </ul>
+  </li>
   <li class="nav-item col-12 col-xl-auto h-100" aria-hidden="true">
     <div class="vr d-none d-xl-flex h-100 mx-xl-2 text-white"></div>
     <hr class="d-xl-none text-white-50">
diff --git a/tests/test_sample_projects.py b/tests/test_sample_projects.py
index 795a4fd..960004a 100644
--- a/tests/test_sample_projects.py
+++ b/tests/test_sample_projects.py
@@ -492,12 +492,12 @@ def test_prj2_current_version_and_versions(test_app):
     assert docs_versions_js.exists()
 
     expected = (
-        "const docs_versions = ["
+        "window.docs_versions = ["
         '{"name": "0.9.9", "url": "https://sphinx-nefertiti/0.9.9"}, '
         '{"name": "1.0.5", "url": "https://sphinx-nefertiti/1.0.5"}, '
         '{"name": "1.1.8", "url": "https://sphinx-nefertiti/1.1.8"}, '
         '{"name": "2.0.5", "url": "localhost:7998/"}'
-        "]"
+        "];\nwindow.def_ver = '2.0.5';"
     )
     f = docs_versions_js.open()
     content = f.read()

From 88a69a17227b2f49ff047129883b138c45797f7e Mon Sep 17 00:00:00 2001
From: Daniela Rus Morales <danirus@eml.cc>
Date: Thu, 28 Nov 2024 13:11:00 +0100
Subject: [PATCH 3/4] Include header-links in the quick-start guide

---
 docs/source/quick-start.rst                   | 125 ++++++++++++++----
 .../customization/version-dropdown.rst        |  11 +-
 2 files changed, 102 insertions(+), 34 deletions(-)

diff --git a/docs/source/quick-start.rst b/docs/source/quick-start.rst
index 2b9eb49..2e1fc53 100644
--- a/docs/source/quick-start.rst
+++ b/docs/source/quick-start.rst
@@ -44,11 +44,12 @@ Customize the theme
 The following features of Nefertiti for Sphinx can be customized:
 
 1. Fonts.
-2. Color set: blue, indigo, purple, pink, red, ...
-3. Pygments styles for light and dark color schemes.
-4. Repository name and URL to display it in the header.
-5. Project version dropdown selector.
-6. Footer links.
+2. Header links
+3. Color set: blue, indigo, purple, pink, red, ...
+4. Pygments styles for light and dark color schemes.
+5. Repository name and URL to display it in the header.
+6. Project version dropdown selector.
+7. Footer links.
 
 
 1. Fonts
@@ -83,8 +84,71 @@ Edit your ``conf.py`` file and add or modify your ``html_theme_options`` setting
         "doc_headers_font": "Georgia",
     }
 
-2. Color sets
-=============
+2. Header links
+===============
+
+Add links to the header of your Sphinx project using header links. They can be mere links or dropdown lists. The user will see an underline below the link whenever it corresponds to the page loaded in the browser.
+
+Header links can be displayed in a second row in the header.
+
+The following content will produced the header of the image below:
+
+.. code-block:: python
+
+    html_theme_options = {
+        # ... other options ...
+        "header_links_in_2nd_row": True,
+        "header_links": [
+            {
+                'text': 'Features',
+                'link': '/features.html',
+            },
+            {
+                "text": "Learn",
+                "dropdown": (
+                    {
+                        "text": "Learn",
+                        "link": "/learn/index.html",
+                    }, {
+                        "text": "Python Types Intro",
+                        "link": "/python-types.html",
+                    }, {
+                        "text": "Concurrency and async/await",
+                        "link": "/async.html",
+                    }, {
+                        "divider": True,
+                    }, {
+                        "text": "Tutorial - User Guide",
+                        "link": "/tutorial/index.html",
+                        "match": "^/tutorial/*",
+                    }, {
+                        "text": "Advanced User Guide",
+                        "link": "/advanced/index.html",
+                        "match": "^/advanced/*"
+                    }
+                )
+            },
+            {
+                'text': 'Release Notes',
+                'link': '/release-notes.html',
+            },
+            {
+                'text': 'Blog',
+                'link': 'https://example.com/blog',
+            },
+        ]
+    }
+
+.. cs_figure:: users-guide/customization/img/rhythm-header-in-2-rows.*
+    :alt: Header links can be displayed in the second row of the header.
+    :width: 90%
+    :align: center
+    :class: border-radius-2
+
+    Read more about customizing the header links in :ref:`header-links`.
+
+3. Colorsets
+============
 
 Another customizable feature of the theme is the color set. In the header of this documentation you can see a dropdown with a palette icon. The colors listed in the dropdown represent the available color sets. Try them to apply the selected color set to this documentation.
 
@@ -99,7 +163,7 @@ To customize the color set in your project add an entry ``style`` to the ``html_
 
 When ``style`` is not given the theme defaults to ``cyan``.
 
-3. Pygments styles
+4. Pygments styles
 ==================
 
 Pygments_ is the package that renders code blocks. Sphinx supports two settings related with pygments:
@@ -115,13 +179,13 @@ If your Sphinx project has code-blocks, try changing the pygments style settings
 
     html_theme_options = {
         # ... other options ...
-        'pygments_style': 'solarized-light',
+        'pygments_light_style': 'solarized-light',
         'pygments_dark_style': 'solarized-dark'
     }
 
 See more code blocks rendered with Pygments in the :ref:`code-blocks` document in Nefertiti User's Guide.
 
-4. Repository data
+5. Repository data
 ==================
 
 If your Sphinx project is about a source code product, and it resides in a Git repository, in GitHub or GitLab, Nefertiti can display information relative to your repository in the header.
@@ -136,7 +200,7 @@ Just add the ``repository_name`` and ``repository_url`` keys to your ``html_them
         "repository_url": "https://github.com/danirus/sphinx-nefertiti",
     }
 
-5. Version dropdown
+6. Version dropdown
 ===================
 
 If your project is available in different versions Nefertiti for Sphinx can display a dropdown in the header to switch between them.
@@ -149,11 +213,11 @@ If you host different versions in different URLs, like:
     * - Version
       - URL
     * - v2.9.9
-      - https://sample-project.readthedocs.io/en/latest/
+      - https://sample-project.org/latest/
     * - v2.8.5
-      - https://sample-project.readthedocs.io/en/2.8.5/
+      - https://sample-project.org/2.8.5/
     * - v2.7.2
-      - https://sample-project.readthedocs.io/en/2.7.2/
+      - https://sample-project.org/2.7.2/
 
 
 Enable the version dropdown by adding the ``versions`` key to your ``html_theme_options`` setting:
@@ -163,19 +227,17 @@ Enable the version dropdown by adding the ``versions`` key to your ``html_theme_
     html_theme_options = {
         # ... other options ...
         "versions": [
-            ("v2.9.9", "https://sample-project.readthedocs.io/en/latest/"),
-            ("v2.8.5", "https://sample-project.readthedocs.io/en/2.8.5/"),
-            ("v2.7.2", "https://sample-project.readthedocs.io/en/2.7.2/"),
+            ("v2.9.9", "https://sample-project.org/latest/"),
+            ("v2.8.5", "https://sample-project.org/2.8.5/"),
+            ("v2.7.2", "https://sample-project.org/2.7.2/"),
         ]
     }
 
-The ``versions`` key in your ``html_theme_options`` is ignored if you use readthedocs_ to host your project (the template ``version-dropdown.html`` renders differently depending on whether the project is hosted in readthedocs_ or not).
 
-
-6. Footer links
+7. Footer links
 ===============
 
-In addition to the copyright notice, configurable with the ``copyright`` Sphinx setting, you can add links that are important to your project, like a link to your company website or a link to your code repository. Footer links are added via the ``footer_links`` key in the ``html_theme_options``. This entry has to be a comma separated list of strings with the format: ``"<link title>|<URL>"``.
+In addition to the copyright notice, configurable with the ``copyright`` Sphinx setting, you can add links that are important to your project, like a link to your company website or a link to your code repository. Footer links are added via the ``footer_links`` key in the ``html_theme_options``. This entry has to be a list of dictionaries.
 
 As an example, the 4 links of the current Nefertiti for Sphinx documentation look like this in the ``html_theme_options`` setting:
 
@@ -183,12 +245,21 @@ As an example, the 4 links of the current Nefertiti for Sphinx documentation loo
 
     html_theme_options = {
         # ... other options ...
-        "footer_links": ",".join([
-            "Documentation|https://sphinx-nefertiti.readthedocs.com",
-            "Package|https://pypi.com/sphinx-nefertiti",
-            "Repository|https://github.com/danirus/sphinx-nefertiti",
-            "Issues|https://github.com/danirus/sphinx-nefertiti/issues",
-        ])
+        "footer_links": [
+            {
+                "text": "Documentation",
+                "link": "https://sphinx-nefertiti.readthedocs.com",
+            }, {
+                "text": "Package",
+                "link": "https://pypi.com/sphinx-nefertiti",
+            }, {
+                "text": "Repository",
+                "link": "https://github.com/danirus/sphinx-nefertiti",
+            }, {
+                "text": "Issues",
+                "link": "https://github.com/danirus/sphinx-nefertiti/issues",
+            }
+        ]
     }
 
 In addition you can remove the **Built with Sphinx and Nefertiti** notice by setting the ``show_powered_by`` key to ``False``. It is ``True`` by default:
diff --git a/docs/source/users-guide/customization/version-dropdown.rst b/docs/source/users-guide/customization/version-dropdown.rst
index ff3e0bf..54b2967 100644
--- a/docs/source/users-guide/customization/version-dropdown.rst
+++ b/docs/source/users-guide/customization/version-dropdown.rst
@@ -5,9 +5,7 @@ Version dropdown
 
 If your Sphinx documentation is available for more than one version of your project, Nefertiti for Sphinx can display a dropdown in the header to switch between each of the documentation sites.
 
-If you use readthedocs_ to host your documentation and it serves multiple versions, Nefertiti will include them automatically in the Version dropdown. There is no need to add anything else.
-
-In any case, to see the version dropdown, whether in production or development, add the list of versions with their links to the ``conf.py`` file.
+To see the version dropdown, whether in production or development, add the list of versions with their links to the ``conf.py`` file.
 
 Theme options
 =============
@@ -26,7 +24,9 @@ Two theme options have to be provided in order to display the version dropdown:
     :width: 250
     :class: border-radius-2
 
-The ``current_version`` entry in ``html_theme_options`` represents the label displayed in the dropdown widget. In the right side image, the label ``3.13.0``.
+The ``current_version`` entry in ``html_theme_options`` represents the label displayed in the dropdown widget.
+
+The image in the right shows the label ``3.13.0`` as provided to the option ``current_version``.
 
 
 2. ``versions``
@@ -88,6 +88,3 @@ Save the previous changes and rebuild your Sphinx site:
     $ python -m http.server -d build/html
 
 Visit http://localhost:8000 to take a look at the changes.
-
-
-.. _readthedocs: https://readthedocs.org

From 3e149948db1f90f2451a71b59e5105777af7fa8e Mon Sep 17 00:00:00 2001
From: Daniela Rus Morales <danirus@eml.cc>
Date: Thu, 28 Nov 2024 13:15:55 +0100
Subject: [PATCH 4/4] Update version numbers

---
 ChangeLog.md                 | 6 ++++++
 package.json                 | 2 +-
 sphinx_nefertiti/__init__.py | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index f23dd8e..3b2b134 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,11 @@
 # Change Log
 
+## [0.5.3] - 2024-11-28
+
+- ReadTheDocs no longer provides versions in the context of the template.
+- Update quick-start and version-dropdown documents.
+- Update `versions.js` to display the `current_version` given in `conf.py`.
+
 ## [0.5.2] - 2024-11-26
 
 - Increase contrast for body-bg, pre-border-color, and border-color for the light color scheme, in all colorsets.
diff --git a/package.json b/package.json
index ee5be5e..59f9804 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "sphinx-nefertiti",
-  "version": "0.5.2",
+  "version": "0.5.3",
   "private": true,
   "description": "Nefertiti is a theme for the Sphinx Documentation Generator.",
   "engines": {
diff --git a/sphinx_nefertiti/__init__.py b/sphinx_nefertiti/__init__.py
index c571ca6..fc95b98 100644
--- a/sphinx_nefertiti/__init__.py
+++ b/sphinx_nefertiti/__init__.py
@@ -6,7 +6,7 @@
 
 from sphinx_nefertiti import colorsets, docsver, fonts, links, pygments
 
-__version__ = "0.5.2"
+__version__ = "0.5.3"
 
 pages_wo_index = ["genindex", "search"]