Built static site
diff --git a/404.html b/404.html
index 704f659..783230c 100644
--- a/404.html
+++ b/404.html
@@ -11,7 +11,7 @@
       
       
       <link rel="shortcut icon" href="/assets/images/favicon.png">
-      <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-5.5.3">
+      <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-5.4.0">
     
     
       
@@ -19,9 +19,9 @@
       
     
     
-      <link rel="stylesheet" href="/assets/stylesheets/main.947af8d5.min.css">
+      <link rel="stylesheet" href="/assets/stylesheets/main.fe0cca5b.min.css">
       
-        <link rel="stylesheet" href="/assets/stylesheets/palette.7f672a1f.min.css">
+        <link rel="stylesheet" href="/assets/stylesheets/palette.a46bcfb3.min.css">
       
       
         
@@ -936,15 +936,15 @@
       
     </div>
     
-      <script src="/assets/javascripts/vendor.c3dc8c49.min.js"></script>
-      <script src="/assets/javascripts/bundle.f9edbbd5.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents"}</script>
+      <script src="/assets/javascripts/vendor.d710d30a.min.js"></script>
+      <script src="/assets/javascripts/bundle.b39636ac.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents"}</script>
       
       <script>
         app = initialize({
           base: "/",
           features: [],
           search: Object.assign({
-            worker: "/assets/javascripts/worker/search.8e2cddea.min.js"
+            worker: "/assets/javascripts/worker/search.a68abb33.min.js"
           }, typeof search !== "undefined" && search)
         })
       </script>
diff --git a/assets/javascripts/bundle.b39636ac.min.js b/assets/javascripts/bundle.b39636ac.min.js
new file mode 100644
index 0000000..e7f7c8c
--- /dev/null
+++ b/assets/javascripts/bundle.b39636ac.min.js
@@ -0,0 +1,2 @@
+!function(t,e){for(var n in e)t[n]=e[n]}(window,function(t){function e(e){for(var r,i,o=e[0],u=e[1],b=e[2],s=0,O=[];s<o.length;s++)i=o[s],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&O.push(c[i][0]),c[i]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);for(f&&f(e);O.length;)O.shift()();return a.push.apply(a,b||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],r=!0,o=1;o<n.length;o++){var u=n[o];0!==c[u]&&(r=!1)}r&&(a.splice(e--,1),t=i(i.s=n[0]))}return t}var r={},c={0:0},a=[];function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="";var o=window.webpackJsonp=window.webpackJsonp||[],u=o.push.bind(o);o.push=e,o=o.slice();for(var b=0;b<o.length;b++)e(o[b]);var f=u;return a.push([88,1]),n()}([,function(t,e,n){"use strict";n.d(e,"q",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return b})),n.d(e,"e",(function(){return f})),n.d(e,"a",(function(){return s})),n.d(e,"j",(function(){return O})),n.d(e,"k",(function(){return h})),n.d(e,"r",(function(){return v})),n.d(e,"s",(function(){return y})),n.d(e,"l",(function(){return g})),n.d(e,"t",(function(){return k})),n.d(e,"i",(function(){return A})),n.d(e,"u",(function(){return T})),n.d(e,"m",(function(){return _})),n.d(e,"h",(function(){return L})),n.d(e,"g",(function(){return M})),n.d(e,"v",(function(){return H})),n.d(e,"w",(function(){return P})),n.d(e,"n",(function(){return q})),n.d(e,"x",(function(){return N})),n.d(e,"y",(function(){return z})),n.d(e,"f",(function(){return V})),n.d(e,"o",(function(){return D})),n.d(e,"z",(function(){return B})),n.d(e,"A",(function(){return Q})),n.d(e,"B",(function(){return X})),n.d(e,"p",(function(){return W})),n.d(e,"C",(function(){return nt}));var r=n(80),c=n(95),a=n(96);function i(){var t=new r.a;return Object(c.a)(document,"DOMContentLoaded").pipe(Object(a.a)(document)).subscribe(t),t}function o(t,e){return void 0===e&&(e=document),e.querySelector(t)||void 0}function u(t,e){void 0===e&&(e=document);var n=o(t,e);if(void 0===n)throw new ReferenceError('Missing element: expected "'+t+'" to be present');return n}function b(){return document.activeElement instanceof HTMLElement?document.activeElement:void 0}function f(t,e){return void 0===e&&(e=document),Array.from(e.querySelectorAll(t))}function s(t){return document.createElement(t)}function O(t,e){t.replaceWith(e)}var l=n(97),j=n(9),d=n(94),p=n(89);function h(t,e){void 0===e&&(e=!0),e?t.focus():t.blur()}function v(t){return Object(l.a)(Object(c.a)(t,"focus"),Object(c.a)(t,"blur")).pipe(Object(j.a)((function(t){return"focus"===t.type})),Object(d.a)(t===b()),Object(p.a)(1))}function m(t){return{x:t.scrollLeft,y:t.scrollTop}}function y(t){return Object(l.a)(Object(c.a)(t,"scroll"),Object(c.a)(window,"resize")).pipe(Object(j.a)((function(){return m(t)})),Object(d.a)(m(t)),Object(p.a)(1))}function g(t){if(!(t instanceof HTMLInputElement))throw new Error("Not implemented");t.select()}var w=n(0),x=n(77),$=n(98);function k(t){return Object($.a)((function(e){new x.a((function(t){var n=Object(w.h)(t,1)[0].contentRect;return e({width:Math.round(n.width),height:Math.round(n.height)})})).observe(t)})).pipe(Object(d.a)(function(t){return{width:t.offsetWidth,height:t.offsetHeight}}(t)),Object(p.a)(1))}var S=n(99),C=n(113);function A(t){switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return!0;default:return t.isContentEditable}}function T(){return Object(c.a)(window,"keydown").pipe(Object(S.a)((function(t){return!(t.metaKey||t.ctrlKey)})),Object(j.a)((function(t){return{type:t.key,claim:function(){t.preventDefault(),t.stopPropagation()}}})),Object(C.a)())}var E=n(100);function _(t){location.href=t.href}function L(t,e){return void 0===e&&(e=location),t.host===e.host&&/^(?:\/[\w-]+)*(?:\/?|\.html)$/i.test(t.pathname)}function M(t,e){return void 0===e&&(e=location),t.pathname===e.pathname&&t.hash.length>0}function H(){return new E.a(new URL(location.href))}var R=n(117);function P(t,e){return e.location$.pipe(Object(R.a)(1),Object(j.a)((function(e){var n=e.href;return new URL(t,n).toString().replace(/\/$/,"")})),Object(p.a)(1))}function U(){return location.hash.substring(1)}function q(t){var e=s("a");e.href=t,e.addEventListener("click",(function(t){return t.stopPropagation()})),e.click()}function N(){return Object(c.a)(window,"hashchange").pipe(Object(j.a)(U),Object(d.a)(U()),Object(S.a)((function(t){return t.length>0})),Object(C.a)())}function z(t){var e=matchMedia(t);return Object($.a)((function(t){return e.addListener((function(){return t(e.matches)}))})).pipe(Object(d.a)(e.matches),Object(p.a)(1))}var I={drawer:u("[data-md-toggle=drawer]"),search:u("[data-md-toggle=search]")};function V(t){return I[t].checked}function D(t,e){I[t].checked!==e&&I[t].click()}function B(t){var e=I[t];return Object(c.a)(e,"change").pipe(Object(j.a)((function(){return e.checked})),Object(d.a)(e.checked))}var Y=n(62),F=n(90);function J(){return{x:Math.max(0,pageXOffset),y:Math.max(0,pageYOffset)}}function W(t){var e=t.x,n=t.y;window.scrollTo(e||0,n||0)}function K(){return{width:innerWidth,height:innerHeight}}function Q(){return Object(Y.a)([Object(l.a)(Object(c.a)(window,"scroll",{passive:!0}),Object(c.a)(window,"resize",{passive:!0})).pipe(Object(j.a)(J),Object(d.a)(J())),Object(c.a)(window,"resize",{passive:!0}).pipe(Object(j.a)(K),Object(d.a)(K()))]).pipe(Object(j.a)((function(t){var e=Object(w.h)(t,2);return{offset:e[0],size:e[1]}})),Object(p.a)(1))}function X(t,e){var n=e.header$,r=e.viewport$,c=r.pipe(Object(F.a)("size")),a=Object(Y.a)([c,n]).pipe(Object(j.a)((function(){return{x:t.offsetLeft,y:t.offsetTop}})));return Object(Y.a)([n,r,a]).pipe(Object(j.a)((function(t){var e=Object(w.h)(t,3),n=e[0].height,r=e[1],c=r.offset,a=r.size,i=e[2],o=i.x,u=i.y;return{offset:{x:c.x-o,y:c.y-u+n},size:a}})),Object(p.a)(1))}var Z=n(101),G=n(102),tt=n(82),et=n(103);function nt(t,e){var n=e.tx$,r=Object($.a)((function(e){return t.addEventListener("message",e)})).pipe(Object(Z.a)("data"));return n.pipe(Object(G.a)((function(){return r}),{leading:!0,trailing:!0}),Object(tt.a)((function(e){return t.postMessage(e)})),Object(et.a)(r),Object(C.a)())}},,,function(t,e,n){"use strict";function r(t){return"object"==typeof t&&"string"==typeof t.base&&"object"==typeof t.features&&"object"==typeof t.search}n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return O})),n.d(e,"f",(function(){return d})),n.d(e,"g",(function(){return p})),n.d(e,"e",(function(){return h})),n.d(e,"c",(function(){return v}));var c=n(0),a=n(81);function i(t){switch(t){case"svg":case"path":return document.createElementNS("http://www.w3.org/2000/svg",t);default:return document.createElement(t)}}function o(t,e,n){switch(e){case"xmlns":break;case"viewBox":case"d":"boolean"!=typeof n?t.setAttributeNS(null,e,n):n&&t.setAttributeNS(null,e,"");break;default:"boolean"!=typeof n?t.setAttribute(e,n):n&&t.setAttribute(e,"")}}function u(t,e){var n,r;if("string"==typeof e||"number"==typeof e)t.innerHTML+=e.toString();else if(e instanceof Node)t.appendChild(e);else if(Array.isArray(e))try{for(var a=Object(c.k)(e),i=a.next();!i.done;i=a.next()){u(t,i.value)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}function b(t,e){for(var n,r,b,f,s=[],O=2;O<arguments.length;O++)s[O-2]=arguments[O];var l=i(t);if(e)try{for(var j=Object(c.k)(Object(a.a)(e)),d=j.next();!d.done;d=j.next()){var p=d.value;o(l,p,e[p])}}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=j.return)&&r.call(j)}finally{if(n)throw n.error}}try{for(var h=Object(c.k)(s),v=h.next();!v.done;v=h.next()){var m=v.value;u(l,m)}}catch(t){b={error:t}}finally{try{v&&!v.done&&(f=h.return)&&f.call(h)}finally{if(b)throw b.error}}return l}var f=n(79),s=n(41);function O(t,e){return Object(f.a)((function(){var n=sessionStorage.getItem(t);if(n)return Object(s.a)(JSON.parse(n));var r=e();return r.subscribe((function(e){try{sessionStorage.setItem(t,JSON.stringify(e))}catch(t){}})),r}))}var l,j=n(1);function d(t,e){if(void 0===l){var n=Object(j.d)("#__lang");l=JSON.parse(n.textContent)}if(void 0===l[t])throw new ReferenceError("Invalid translation: "+t);return void 0!==e?l[t].replace("#",e):l[t]}function p(t,e){var n=e;if(t.length>n){for(;" "!==t[n]&&--n>0;);return t.substring(0,n)+"..."}return t}function h(t){return t>999?((t+1e-6)/1e3).toFixed(+((t-950)%1e3>99))+"k":t.toString()}function v(t){for(var e=0,n=0,r=t.length;n<r;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}},,,function(t,e,n){"use strict";var r=n(22);n.d(e,"setupComponents",(function(){return r.a})),n.d(e,"useComponent",(function(){return r.b}));var c=n(74);n.d(e,"mountHeader",(function(){return c.a}));var a=n(73);n.d(e,"mountHero",(function(){return a.a}));var i=n(72);n.d(e,"mountMain",(function(){return i.a}));var o=n(76);n.d(e,"mountNavigation",(function(){return o.a}));var u=n(71);n.d(e,"mountSearch",(function(){return u.a})),n.d(e,"mountSearchQuery",(function(){return u.b})),n.d(e,"mountSearchReset",(function(){return u.c})),n.d(e,"mountSearchResult",(function(){return u.d}));var b=n(30);n.o(b,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return b.mountTableOfContents})),n.o(b,"mountTabs")&&n.d(e,"mountTabs",(function(){return b.mountTabs}));var f=n(75);n.d(e,"mountTabs",(function(){return f.a}));var s=n(67);n.o(s,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return s.mountTableOfContents}))},,,,,,,,function(t,e,n){"use strict";n.d(e,"e",(function(){return O})),n.d(e,"f",(function(){return y})),n.d(e,"g",(function(){return R})),n.d(e,"h",(function(){return U})),n.d(e,"b",(function(){return q.b})),n.d(e,"i",(function(){return q.f})),n.d(e,"a",(function(){return q.a})),n.d(e,"c",(function(){return q.d})),n.d(e,"d",(function(){return q.e}));var r=n(61),c=n(105),a=n(98),i=n(113),o=n(82),u=n(96),b=n(1),f=n(31),s=n(4);function O(t){var e=t.document$,n=t.dialog$;if(!r.isSupported())return c.a;e.subscribe((function(){Object(b.e)("pre > code").forEach((function(t,e){var n=t.parentElement;n.id="__code_"+e,n.insertBefore(Object(f.a)(n.id),t)}))}));var O=Object(a.a)((function(t){new r(".md-clipboard").on("success",t)})).pipe(Object(i.a)());return O.pipe(Object(o.a)((function(t){return t.clearSelection()})),Object(u.a)(Object(s.f)("clipboard.copied"))).subscribe(n),O}var l=n(27),j=n(41),d=n(85),p=n(35),h=n(9),v=n(59),m=n(114);function y(t){var e=(void 0===t?{}:t).duration,n=new l.a,r=Object(b.a)("div");return r.classList.add("md-dialog","md-typeset"),n.pipe(Object(p.a)((function(t){return Object(j.a)(document.body).pipe(Object(h.a)((function(t){return t.appendChild(r)})),Object(v.b)(d.a),Object(m.a)(1),Object(o.a)((function(e){e.innerHTML=t,e.setAttribute("data-md-state","open")})),Object(m.a)(e||2e3),Object(o.a)((function(t){return t.removeAttribute("data-md-state")})),Object(m.a)(400),Object(o.a)((function(t){t.innerHTML="",t.remove()})))}))).subscribe(),n}var g=n(0),w=n(95),x=n(97),$=n(116),k=n(99),S=n(48),C=n(101),A=n(90),T=n(106),E=n(107),_=n(104),L=n(91),M=n(108),H=n(92);function R(t,e){var n=e.document$,r=e.viewport$,a=e.location$;"scrollRestoration"in history&&(history.scrollRestoration="manual"),Object(w.a)(window,"beforeunload").subscribe((function(){history.scrollRestoration="auto"}));var o=Object(b.c)('link[rel="shortcut icon"]');void 0!==o&&(o.href=o.href);var u=Object(w.a)(document.body,"click").pipe(Object(k.a)((function(t){return!(t.metaKey||t.ctrlKey)})),Object(p.a)((function(e){if(e.target instanceof HTMLElement){var n=e.target.closest("a");if(n&&!n.target&&Object(b.h)(n)&&t.includes(n.href))return Object(b.g)(n)||e.preventDefault(),Object(j.a)(n)}return c.a})),Object(h.a)((function(t){return{url:new URL(t.href)}})),Object(i.a)());u.subscribe((function(){Object(b.o)("search",!1)}));var f=u.pipe(Object(k.a)((function(t){var e=t.url;return!Object(b.g)(e)})),Object(i.a)()),s=Object(w.a)(window,"popstate").pipe(Object(k.a)((function(t){return null!==t.state})),Object(h.a)((function(t){return{url:new URL(location.href),offset:t.state}})),Object(i.a)());Object(x.a)(f,s).pipe(Object(S.a)((function(t,e){return t.url.href===e.url.href})),Object(C.a)("url")).subscribe(a);var O=a.pipe(Object(A.a)("pathname"),Object(T.a)(1),Object(p.a)((function(t){return Object($.a)({url:t.href,responseType:"text",withCredentials:!0}).pipe(Object(E.a)((function(){return Object(b.m)(t),c.a})))})));f.pipe(Object(_.a)(O)).subscribe((function(t){var e=t.url;history.pushState({},"",e.toString())}));var l=new DOMParser;O.pipe(Object(h.a)((function(t){var e=t.response;return l.parseFromString(e,"text/html")}))).subscribe(n);var d=Object(x.a)(f,s).pipe(Object(_.a)(n));d.subscribe((function(t){var e=t.url,n=t.offset;e.hash&&!n?Object(b.n)(e.hash):Object(b.p)(n||{y:0})})),d.pipe(Object(L.a)(n)).subscribe((function(t){var e,n,r=Object(g.h)(t,2)[1],c=r.title,a=r.head;document.dispatchEvent(new CustomEvent("DOMContentSwitch")),document.title=c;try{for(var i=Object(g.k)(['link[rel="canonical"]','meta[name="author"]','meta[name="description"]']),o=i.next();!o.done;o=i.next()){var u=o.value,f=Object(b.c)(u,a),s=Object(b.c)(u,document.head);void 0!==f&&void 0!==s&&Object(b.j)(s,f)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}})),r.pipe(Object(M.a)(250),Object(A.a)("offset")).subscribe((function(t){var e=t.offset;history.replaceState(e,"")})),Object(x.a)(u,s).pipe(Object(H.a)(2,1),Object(k.a)((function(t){var e=Object(g.h)(t,2),n=e[0],r=e[1];return n.url.pathname===r.url.pathname&&!Object(b.g)(r.url)})),Object(h.a)((function(t){return Object(g.h)(t,2)[1]}))).subscribe((function(t){var e=t.offset;Object(b.p)(e||{y:0})}))}var P=n(7);function U(){var t=Object(b.u)().pipe(Object(h.a)((function(t){return Object(g.a)({mode:Object(b.f)("search")?"search":"global"},t)})),Object(k.a)((function(t){if("global"===t.mode){var e=Object(b.b)();if(void 0!==e)return!Object(b.i)(e)}return!0})),Object(i.a)());return t.pipe(Object(k.a)((function(t){return"search"===t.mode})),Object(L.a)(Object(P.useComponent)("search-query"),Object(P.useComponent)("search-result"))).subscribe((function(t){var e=Object(g.h)(t,3),n=e[0],r=e[1],c=e[2],a=Object(b.b)();switch(n.type){case"Enter":a===r&&n.claim();break;case"Escape":case"Tab":Object(b.o)("search",!1),Object(b.k)(r,!1);break;case"ArrowUp":case"ArrowDown":if(void 0===a)Object(b.k)(r);else{var i=Object(g.i)([r],Object(b.e)("[href]",c)),o=Math.max(0,(Math.max(0,i.indexOf(a))+i.length+("ArrowUp"===n.type?-1:1))%i.length);Object(b.k)(i[o])}n.claim();break;default:r!==Object(b.b)()&&Object(b.k)(r)}})),t.pipe(Object(k.a)((function(t){return"global"===t.mode})),Object(L.a)(Object(P.useComponent)("search-query"))).subscribe((function(t){var e=Object(g.h)(t,2),n=e[0],r=e[1];switch(n.type){case"f":case"s":case"/":Object(b.k)(r),Object(b.l)(r),n.claim();break;case"p":case",":var c=Object(b.c)("[href][rel=prev]");void 0!==c&&c.click();break;case"n":case".":var a=Object(b.c)("[href][rel=next]");void 0!==a&&a.click()}})),t}var q=n(46)},,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return j}));var r,c=n(0),a=n(41),i=n(20),o=n(9),u=n(83),b=n(89),f=n(35),s=n(48),O=n(1);function l(t,e){var n=e.document$;r=n.pipe(Object(o.a)((function(e){return t.reduce((function(t,n){var r,a=Object(O.c)("[data-md-component="+n+"]",e);return Object(c.a)(Object(c.a)({},t),void 0!==a?((r={})[n]=a,r):{})}),{})})),Object(u.a)((function(e,n){var r,a;try{for(var i=Object(c.k)(t),o=i.next();!o.done;o=i.next()){var u=o.value;switch(u){case"announce":case"header-title":case"container":case"skip":u in e&&void 0!==e[u]&&(Object(O.j)(e[u],n[u]),e[u]=n[u]);break;default:void 0!==n[u]?e[u]=Object(O.c)("[data-md-component="+u+"]"):delete e[u]}}}catch(t){r={error:t}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return e})),Object(b.a)(1))}function j(t){return r.pipe(Object(f.a)((function(e){return void 0!==e[t]?Object(a.a)(e[t]):i.a})),Object(s.a)())}},,function(t,e,n){"use strict";function r(t,e){t.setAttribute("data-md-state",e?"blur":"")}function c(t){t.removeAttribute("data-md-state")}function a(t,e){t.classList.toggle("md-nav__link--active",e)}function i(t){t.classList.remove("md-nav__link--active")}n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}))},,,,,,function(t,e,n){"use strict";var r=n(64);n.o(r,"applySidebar")&&n.d(e,"applySidebar",(function(){return r.applySidebar})),n.o(r,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return r.mountTableOfContents})),n.o(r,"mountTabs")&&n.d(e,"mountTabs",(function(){return r.mountTabs})),n.o(r,"watchSidebar")&&n.d(e,"watchSidebar",(function(){return r.watchSidebar}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return m}));var r=n(4),c="md-clipboard md-icon";function a(t){return Object(r.b)("button",{class:c,title:Object(r.f)("clipboard.copy"),"data-clipboard-target":"#"+t+" > code"},Object(r.b)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.b)("path",{d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})))}var i=n(0),o="md-search-result__item",u="md-search-result__link",b="md-search-result__article md-search-result__article--document",f="md-search-result__article",s="md-search-result__title",O="md-search-result__teaser";function l(t){var e=t.article,n=t.sections,c=Object(r.b)("div",{class:"md-search-result__icon md-icon"},Object(r.b)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.b)("path",{d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H13C12.59,21.75 12.2,21.44 11.86,21.1C11.53,20.77 11.25,20.4 11,20H6V4H13V9H18V10.18C18.71,10.34 19.39,10.61 20,11V8L14,2M20.31,18.9C21.64,16.79 21,14 18.91,12.68C16.8,11.35 14,12 12.69,14.08C11.35,16.19 12,18.97 14.09,20.3C15.55,21.23 17.41,21.23 18.88,20.32L22,23.39L23.39,22L20.31,18.9M16.5,19A2.5,2.5 0 0,1 14,16.5A2.5,2.5 0 0,1 16.5,14A2.5,2.5 0 0,1 19,16.5A2.5,2.5 0 0,1 16.5,19Z"}))),a=Object(i.i)([e],n).map((function(t){var e=t.location,n=t.title,a=t.text;return Object(r.b)("a",{href:e,class:u,tabIndex:-1},Object(r.b)("article",{class:"parent"in t?f:b},!("parent"in t)&&c,Object(r.b)("h1",{class:s},n),a.length>0&&Object(r.b)("p",{class:O},Object(r.g)(a,320))))}));return Object(r.b)("li",{class:o},a)}var j="md-source__facts",d="md-source__fact";function p(t){var e=t.map((function(t){return Object(r.b)("li",{class:d},t)}));return Object(r.b)("ul",{class:j},e)}var h="md-typeset__scrollwrap",v="md-typeset__table";function m(t){return Object(r.b)("div",{class:h},Object(r.b)("div",{class:v},t))}},function(t,e,n){"use strict";function r(t,e){t.style.top=e+"px"}function c(t){t.style.top=""}function a(t,e){t.style.height=e+"px"}function i(t){t.style.height=""}n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}))},,,,,,,,,,,,,function(t,e,n){"use strict";var r=n(69);n.o(r,"applyAnchorList")&&n.d(e,"applyAnchorList",(function(){return r.applyAnchorList})),n.o(r,"watchAnchorList")&&n.d(e,"watchAnchorList",(function(){return r.watchAnchorList}));var c=n(70);n.d(e,"applyAnchorList",(function(){return c.a})),n.d(e,"watchAnchorList",(function(){return c.b}));n(24)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"f",(function(){return y})),n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return p})),n.d(e,"c",(function(){return h})),n.d(e,"e",(function(){return v}));var r=n(0),c=n(78);!function(){function t(t){var e=t.config,n=t.docs,a=t.pipeline,i=t.index;this.documents=function(t){var e,n,a=new Map;try{for(var i=Object(r.k)(t),o=i.next();!o.done;o=i.next()){var u=o.value,b=Object(r.h)(u.location.split("#"),2),f=b[0],s=b[1],O=u.location,l=u.title,j=c(u.text).replace(/\s+(?=[,.:;!?])/g,"").replace(/\s+/g," ");if(s){var d=a.get(f);d.linked?a.set(O,{location:O,title:l,text:j,parent:d}):(d.title=u.title,d.text=j,d.linked=!0)}else a.set(O,{location:O,title:l,text:j,linked:!1})}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return a}(n),this.highlight=function(t){var e=new RegExp(t.separator,"img"),n=function(t,e,n){return e+"<em>"+n+"</em>"};return function(c){c=c.replace(/[\s*+\-:~^]+/g," ").trim();var a=new RegExp("(^|"+t.separator+")("+c.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(e,"|")+")","img");return function(t){return Object(r.a)(Object(r.a)({},t),{title:t.title.replace(a,n),text:t.text.replace(a,n)})}}}(e),lunr.tokenizer.separator=new RegExp(e.separator),this.index=void 0===i?lunr((function(){var t,c,i,o,u,b,f;1===e.lang.length&&"en"!==e.lang[0]?this.use(lunr[e.lang[0]]):e.lang.length>1&&this.use((t=lunr).multiLanguage.apply(t,Object(r.i)(e.lang)));var s=function(t,e){var n=Object(r.h)([new Set(t),new Set(e)],2),c=n[0],a=n[1];return Object(r.i)(new Set(Object(r.i)(c).filter((function(t){return!a.has(t)}))))}(["trimmer","stopWordFilter","stemmer"],a);try{for(var O=Object(r.k)(e.lang.map((function(t){return"en"===t?lunr:lunr[t]}))),l=O.next();!l.done;l=O.next()){var j=l.value;try{for(var d=(o=void 0,Object(r.k)(s)),p=d.next();!p.done;p=d.next()){var h=p.value;this.pipeline.remove(j[h]),this.searchPipeline.remove(j[h])}}catch(t){o={error:t}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(o)throw o.error}}}}catch(t){c={error:t}}finally{try{l&&!l.done&&(i=O.return)&&i.call(O)}finally{if(c)throw c.error}}this.field("title",{boost:1e3}),this.field("text"),this.ref("location");try{for(var v=Object(r.k)(n),m=v.next();!m.done;m=v.next()){var y=m.value;this.add(y)}}catch(t){b={error:t}}finally{try{m&&!m.done&&(f=v.return)&&f.call(v)}finally{if(b)throw b.error}}})):lunr.Index.load("string"==typeof i?JSON.parse(i):i)}t.prototype.query=function(t){var e=this;if(t)try{var n=this.index.search(t).reduce((function(t,n){var c=e.documents.get(n.ref);if(void 0!==c)if("parent"in c){var a=c.parent.location;t.set(a,Object(r.i)(t.get(a)||[],[n]))}else{a=c.location;t.set(a,t.get(a)||[])}return t}),new Map),c=this.highlight(t);return Object(r.i)(n).map((function(t){var n=Object(r.h)(t,2),a=n[0],i=n[1];return{article:c(e.documents.get(a)),sections:i.map((function(t){return c(e.documents.get(t.ref))}))}}))}catch(e){console.warn("Invalid query: "+t+" – see https://bit.ly/2s3ChXG")}return[]}}();function a(t){return t.split(/"([^"]+)"/g).map((function(t,e){return 1&e?t.replace(/^\b|^(?![^\x00-\x7F]|$)|\s+/g," +"):t})).join("").replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g,"").trim().replace(/\s+|(?![^\x00-\x7F]|^)$|\b$/g,"* ")}var i,o=n(115),u=n(27),b=n(55),f=n(91),s=n(9),O=n(89),l=n(59),j=n(1),d=n(4);function p(t){return t.type===i.READY}function h(t){return t.type===i.QUERY}function v(t){return t.type===i.RESULT}function m(t){var e=t.config,n=t.docs,r=t.index;return 1===e.lang.length&&"en"===e.lang[0]&&(e.lang=[Object(d.f)("search.config.lang")]),"[\\s\\-]+"===e.separator&&(e.separator=Object(d.f)("search.config.separator")),{config:e,docs:n,index:r,pipeline:Object(d.f)("search.config.pipeline").split(/\s*,\s*/).filter(o.a)}}function y(t,e){var n=e.index$,c=e.base$,a=new Worker(t),o=new u.a,d=Object(j.C)(a,{tx$:o}).pipe(Object(f.a)(c),Object(s.a)((function(t){var e,n,c,a,i=Object(r.h)(t,2),o=i[0],u=i[1];if(v(o))try{for(var b=Object(r.k)(o.data),f=b.next();!f.done;f=b.next()){var s=f.value,O=s.article,l=s.sections;O.location=u+"/"+O.location;try{for(var j=(c=void 0,Object(r.k)(l)),d=j.next();!d.done;d=j.next()){var p=d.value;p.location=u+"/"+p.location}}catch(t){c={error:t}}finally{try{d&&!d.done&&(a=j.return)&&a.call(j)}finally{if(c)throw c.error}}}}catch(t){e={error:t}}finally{try{f&&!f.done&&(n=b.return)&&n.call(b)}finally{if(e)throw e.error}}return o})),Object(O.a)(1));return n.pipe(Object(s.a)((function(t){return{type:i.SETUP,data:m(t)}})),Object(l.b)(b.a)).subscribe(o.next.bind(o)),{tx$:o,rx$:d}}!function(t){t[t.SETUP=0]="SETUP",t[t.READY=1]="READY",t[t.QUERY=2]="QUERY",t[t.RESULT=3]="RESULT"}(i||(i={}))},,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";var r=n(65);n.o(r,"applySidebar")&&n.d(e,"applySidebar",(function(){return r.applySidebar})),n.o(r,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return r.mountTableOfContents})),n.o(r,"mountTabs")&&n.d(e,"mountTabs",(function(){return r.mountTabs})),n.o(r,"watchSidebar")&&n.d(e,"watchSidebar",(function(){return r.watchSidebar}));var c=n(66);n.d(e,"applySidebar",(function(){return c.a})),n.d(e,"watchSidebar",(function(){return c.b}));n(32)},function(t,e){},function(t,e,n){"use strict";n.d(e,"b",(function(){return j})),n.d(e,"a",(function(){return d}));var r=n(0),c=n(62),a=n(47),i=n(85),o=n(9),u=n(48),b=n(59),f=n(91),s=n(82),O=n(84),l=n(32);function j(t,e){var n=e.main$,a=e.viewport$,i=t.parentElement.offsetTop-t.parentElement.parentElement.offsetTop;return Object(c.a)([n,a]).pipe(Object(o.a)((function(t){var e=Object(r.h)(t,2),n=e[0],c=n.offset,a=n.height,o=e[1].offset.y;return{height:a=a+Math.min(i,Math.max(0,o-c))-i,lock:o>=c+i}})),Object(u.a)((function(t,e){return t.height===e.height&&t.lock===e.lock})))}function d(t,e){var n=e.header$;return Object(a.a)(Object(b.b)(i.a),Object(f.a)(n),Object(s.a)((function(e){var n=Object(r.h)(e,2),c=n[0],a=c.height,i=c.lock,o=n[1].height;Object(l.c)(t,a),i?Object(l.d)(t,o):Object(l.b)(t)})),Object(o.a)((function(t){return Object(r.h)(t,1)[0]})),Object(O.a)((function(){Object(l.b)(t),Object(l.a)(t)})))}},function(t,e,n){"use strict";var r=n(68);n.d(e,"mountTableOfContents",(function(){return r.a}));n(45)},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(0),c=n(47),a=n(62),i=n(41),o=n(35),u=n(9),b=n(1),f=n(30),s=n(45);function O(t){var e=t.header$,n=t.main$,O=t.viewport$,l=t.tablet$;return Object(c.a)(Object(o.a)((function(t){return l.pipe(Object(o.a)((function(c){if(c){var o=Object(b.e)(".md-nav__link",t),l=Object(f.watchSidebar)(t,{main$:n,viewport$:O}).pipe(Object(f.applySidebar)(t,{header$:e})),j=Object(s.watchAnchorList)(o,{header$:e,viewport$:O}).pipe(Object(s.applyAnchorList)(o));return Object(a.a)([l,j]).pipe(Object(u.a)((function(t){var e=Object(r.h)(t,2);return{sidebar:e[0],anchors:e[1]}})))}return Object(i.a)({})})))})))}},function(t,e){},function(t,e,n){"use strict";n.d(e,"b",(function(){return y})),n.d(e,"a",(function(){return g}));var r=n(0),c=n(93),a=n(62),i=n(47),o=n(85),u=n(9),b=n(90),f=n(35),s=n(83),O=n(48),l=n(94),j=n(92),d=n(59),p=n(82),h=n(84),v=n(1),m=n(24);function y(t,e){var n,i,o=e.header$,d=e.viewport$,p=new Map;try{for(var h=Object(r.k)(t),m=h.next();!m.done;m=h.next()){var y=m.value,g=decodeURIComponent(y.hash.substring(1)),w=Object(v.c)('[id="'+g+'"]');void 0!==w&&p.set(y,w)}}catch(t){n={error:t}}finally{try{m&&!m.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}var x=o.pipe(Object(u.a)((function(t){return 18+t.height})));return Object(v.t)(document.body).pipe(Object(b.a)("height"),Object(u.a)((function(){var t=[];return Object(r.i)(p).reduce((function(e,n){for(var a=Object(r.h)(n,2),i=a[0],o=a[1];t.length;){if(!(p.get(t[t.length-1]).tagName>=o.tagName))break;t.pop()}for(var u=o.offsetTop;!u&&o.parentElement;)u=(o=o.parentElement).offsetTop;return e.set(Object(c.a)(t=Object(r.i)(t,[i])),u)}),new Map)})),Object(f.a)((function(t){return Object(a.a)([x,d]).pipe(Object(s.a)((function(t,e){for(var n=Object(r.h)(t,2),c=n[0],a=n[1],i=Object(r.h)(e,2),o=i[0],u=i[1].offset.y;a.length;){if(!(Object(r.h)(a[0],2)[1]-o<u))break;c=Object(r.i)(c,[a.shift()])}for(;c.length;){if(!(Object(r.h)(c[c.length-1],2)[1]-o>=u))break;a=Object(r.i)([c.pop()],a)}return[c,a]}),[[],Object(r.i)(t)]),Object(O.a)((function(t,e){return t[0]===e[0]&&t[1]===e[1]})))}))).pipe(Object(u.a)((function(t){var e=Object(r.h)(t,2),n=e[0],c=e[1];return{prev:n.map((function(t){return Object(r.h)(t,1)[0]})),next:c.map((function(t){return Object(r.h)(t,1)[0]}))}})),Object(l.a)({prev:[],next:[]}),Object(j.a)(2,1),Object(u.a)((function(t){var e=Object(r.h)(t,2),n=e[0],c=e[1];return n.prev.length<c.prev.length?{prev:c.prev.slice(Math.max(0,n.prev.length-1),c.prev.length),next:[]}:{prev:c.prev.slice(-1),next:c.next.slice(0,c.next.length-n.next.length)}})))}function g(t){return Object(i.a)(Object(d.b)(o.a),Object(p.a)((function(t){var e,n,c=t.prev,a=t.next;try{for(var i=Object(r.k)(a),o=i.next();!o.done;o=i.next()){var u=Object(r.h)(o.value,1)[0];Object(m.a)(u),Object(m.b)(u)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.forEach((function(t,e){var n=Object(r.h)(t,1)[0];Object(m.c)(n,e===c.length-1),Object(m.d)(n,!0)}))})),Object(h.a)((function(){var e,n;try{for(var c=Object(r.k)(t),a=c.next();!a.done;a=c.next()){var i=a.value;Object(m.a)(i),Object(m.b)(i)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return j})),n.d(e,"b",(function(){return w})),n.d(e,"c",(function(){return S})),n.d(e,"d",(function(){return q}));var r=n(0),c=n(47),a=n(62),i=n(35),o=n(99),u=n(96),b=n(94),f=n(104),s=n(117),O=n(9),l=n(46);function j(t,e){var n=t.rx$,j=t.tx$,d=e.query$,p=e.reset$,h=e.result$;return Object(c.a)(Object(i.a)((function(){var t=n.pipe(Object(o.a)(l.d),Object(u.a)("ready"),Object(b.a)("waiting"));return j.pipe(Object(o.a)(l.c),Object(f.a)(t),Object(s.a)(1)).subscribe(j.next.bind(j)),Object(a.a)([t,d,h,p]).pipe(Object(O.a)((function(t){var e=Object(r.h)(t,3);return{status:e[0],query:e[1],result:e[2]}})))})))}var d=n(90),p=n(1),h=n(15),v=n(97),m=n(95),y=n(114),g=n(48);function w(t,e){var n=t.tx$;return void 0===e&&(e={}),Object(c.a)(Object(i.a)((function(t){var c=function(t,e){var n=(void 0===e?{}:e).transform||h.b,c=Object(v.a)(Object(m.a)(t,"keyup"),Object(m.a)(t,"focus").pipe(Object(y.a)(1))).pipe(Object(O.a)((function(){return n(t.value)})),Object(b.a)(n(t.value)),Object(g.a)()),i=Object(p.r)(t);return Object(a.a)([c,i]).pipe(Object(O.a)((function(t){var e=Object(r.h)(t,2);return{value:e[0],focus:e[1]}})))}(t,e);return c.pipe(Object(d.a)("value"),Object(O.a)((function(t){var e=t.value;return{type:h.a.QUERY,data:e}}))).subscribe(n.next.bind(n)),c.pipe(Object(d.a)("focus")).subscribe((function(t){var e=t.focus;e&&Object(p.o)("search",e)})),c})))}var x=n(103),$=n(82),k=n(22);function S(){return Object(c.a)(Object(i.a)((function(t){return function(t){return Object(m.a)(t,"click").pipe(Object(u.a)(void 0))}(t).pipe(Object(x.a)(Object(k.b)("search-query")),Object($.a)(p.k),Object(u.a)(void 0))})),Object(b.a)(void 0))}var C=n(115),A=n(101),T=n(85),E=n(91),_=n(59),L=n(83),M=n(84),H=n(31),R=n(4);function P(t,e){t.appendChild(e)}function U(t,e){var n=e.query$,a=e.ready$,o=e.fetch$,b=Object(p.d)(".md-search-result__list",t),f=Object(p.d)(".md-search-result__meta",t);return Object(c.a)(Object(E.a)(n,a),Object(O.a)((function(t){var e=Object(r.h)(t,2),n=e[0];return e[1].value?function(t,e){switch(e){case 0:t.textContent=Object(R.f)("search.result.none");break;case 1:t.textContent=Object(R.f)("search.result.one");break;default:t.textContent=Object(R.f)("search.result.other",e.toString())}}(f,n.length):function(t){t.textContent=Object(R.f)("search.result.placeholder")}(f),n})),Object(i.a)((function(e){return o.pipe(Object(_.b)(T.a),Object(L.a)((function(n){for(var r=t.parentElement;n<e.length&&(P(b,Object(H.b)(e[n++])),!(r.scrollHeight-r.offsetHeight>16)););return n}),0),Object(u.a)(e),Object(M.a)((function(){!function(t){t.innerHTML=""}(b)})))})))}function q(t,e){var n=t.rx$,r=e.query$;return Object(c.a)(Object(i.a)((function(t){var e=t.parentElement,c=n.pipe(Object(o.a)(h.c),Object(u.a)(!0)),a=Object(p.s)(e).pipe(Object(O.a)((function(t){return t.y>=e.scrollHeight-e.offsetHeight-16})),Object(g.a)(),Object(o.a)(C.a));return n.pipe(Object(o.a)(h.d),Object(A.a)("data"),U(t,{query$:r,ready$:c,fetch$:a}),Object(b.a)([]))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(27),c=n(47),a=n(35),i=n(90),o=n(82),u=n(22),b=n(0),f=n(62),s=n(85),O=n(101),l=n(48),j=n(89),d=n(9),p=n(59),h=n(84),v=n(1);function m(t){var e=t.header$,n=t.viewport$,m=new r.a;return Object(u.b)("header").pipe(Object(a.a)((function(t){return m.pipe(Object(i.a)("active"),(e=t,Object(c.a)(Object(p.b)(s.a),Object(o.a)((function(t){var n=t.active;!function(t,e){t.setAttribute("data-md-state",e?"shadow":"")}(e,n)})),Object(h.a)((function(){!function(t){t.removeAttribute("data-md-state")}(e)})))));var e}))).subscribe(),Object(c.a)(Object(a.a)((function(t){return function(t,e){var n=e.header$,r=e.viewport$,c=n.pipe(Object(O.a)("height"),Object(l.a)(),Object(j.a)(1)),o=c.pipe(Object(a.a)((function(){return Object(v.t)(t).pipe(Object(d.a)((function(e){var n=e.height;return{top:t.offsetTop,bottom:t.offsetTop+n}})))})),Object(i.a)("bottom"),Object(j.a)(1));return Object(f.a)([c,o,r]).pipe(Object(d.a)((function(t){var e=Object(b.h)(t,3),n=e[0],r=e[1],c=r.top,a=r.bottom,i=e[2],o=i.offset.y,u=i.size.height;return{offset:c-n,height:u=Math.max(0,u-Math.max(0,c-o,n)-Math.max(0,u+o-a)),active:c-n<=o}})),Object(l.a)((function(t,e){return t.offset===e.offset&&t.height===e.height&&t.active===e.active})))}(t,{header$:e,viewport$:n})})),Object(o.a)((function(t){return m.next(t)})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(47),c=n(35),a=n(9),i=n(90),o=n(1),u=n(85),b=n(59),f=n(82),s=n(84);function O(t){var e=t.header$,n=t.viewport$;return Object(r.a)(Object(c.a)((function(t){return Object(o.B)(t,{header$:e,viewport$:n}).pipe(Object(a.a)((function(t){return{hidden:t.offset.y>=20}})),Object(i.a)("hidden"),function(t){return Object(r.a)(Object(b.b)(u.a),Object(f.a)((function(e){var n=e.hidden;!function(t,e){t.setAttribute("data-md-state",e?"hidden":"")}(t,n)})),Object(s.a)((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}(t))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(0),c=n(47),a=n(62),i=n(35),o=n(9),u=n(99),b=n(91),f=n(48),s=n(94),O=n(89),l=n(1),j=n(22),d=n(41),p=n(85),h=n(59),v=n(82),m=n(84);function y(t){var e=t.document$,n=t.viewport$;return Object(c.a)(Object(i.a)((function(t){var y=function(t,e){return e.document$.pipe(Object(o.a)((function(){var e=getComputedStyle(t);return["sticky","-webkit-sticky"].includes(e.position)})),Object(f.a)(),Object(i.a)((function(e){return e?Object(l.t)(t).pipe(Object(o.a)((function(t){return{sticky:!0,height:t.height}}))):Object(d.a)({sticky:!1,height:0})})),Object(O.a)(1))}(t,{document$:e}),g=Object(j.b)("main").pipe(Object(o.a)((function(t){return Object(l.c)("h1, h2, h3, h4, h5, h6",t)})),Object(u.a)((function(t){return void 0!==t})),Object(b.a)(Object(j.b)("header-title")),Object(i.a)((function(t){var e=Object(r.h)(t,2),a=e[0],i=e[1];return Object(l.B)(a,{header$:y,viewport$:n}).pipe(Object(o.a)((function(t){return t.offset.y>=a.offsetHeight?"page":"site"})),Object(f.a)(),function(t){return Object(c.a)(Object(h.b)(p.a),Object(v.a)((function(e){!function(t,e){t.setAttribute("data-md-state",e?"active":"")}(t,"page"===e)})),Object(m.a)((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}(i))})),Object(s.a)("site"));return Object(a.a)([y,g]).pipe(Object(o.a)((function(t){var e=Object(r.h)(t,2),n=e[0],c=e[1];return Object(r.a)({type:c},n)})),Object(O.a)(1))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(47),c=n(41),a=n(35),i=n(9),o=n(90),u=n(1),b=n(85),f=n(59),s=n(82),O=n(84);function l(t){var e=t.header$,n=t.viewport$,l=t.screen$;return Object(r.a)(Object(a.a)((function(t){return l.pipe(Object(a.a)((function(a){return a?Object(u.B)(t,{header$:e,viewport$:n}).pipe(Object(i.a)((function(t){return{hidden:t.offset.y>=10}})),Object(o.a)("hidden"),function(t){return Object(r.a)(Object(f.b)(b.a),Object(s.a)((function(e){var n=e.hidden;!function(t,e){t.setAttribute("data-md-state",e?"hidden":"")}(t,n)})),Object(O.a)((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}(t)):Object(c.a)({hidden:!0})})))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(47),c=n(41),a=n(35),i=n(9),o=n(30);function u(t){var e=t.header$,n=t.main$,u=t.viewport$,b=t.screen$;return Object(r.a)(Object(a.a)((function(t){return b.pipe(Object(a.a)((function(r){return r?Object(o.watchSidebar)(t,{main$:n,viewport$:u}).pipe(Object(o.applySidebar)(t,{header$:e}),Object(i.a)((function(t){return{sidebar:t}}))):Object(c.a)({})})))})))}},,,,,,,,,,,,function(t,e,n){"use strict";n.r(e),n.d(e,"setScrollLock",(function(){return z})),n.d(e,"resetScrollLock",(function(){return I})),n.d(e,"initialize",(function(){return V}));var r=n(0),c=n(110),a=n(112),i=n(111),o=n(79),u=n(38),b=n(41),f=n(105),s=n(62),O=n(85),l=n(95),j=n(97),d=n(116),p=n(89),h=n(35),v=n(101),m=n(107),y=n(82),g=n(114),w=n(91),x=n(59),$=n(99),k=n(9),S=n(117),C=n(1),A=n(7),T=n(15),E=n(90);var _=n(115),L=n(103);var M=n(106);var H=n(109),R=n(96);function P(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}var U=n(31),q=n(4);function N(t){switch(Object(r.h)(t.match(/(git(?:hub|lab))/i)||[],1)[0].toLowerCase()){case"github":var e=Object(r.h)(t.match(/^.+github\.com\/([^\/]+)\/?([^\/]+)/i),3);return function(t,e){return Object(d.a)({url:void 0!==e?"https://api.github.com/repos/"+t+"/"+e:"https://api.github.com/users/"+t,responseType:"json"}).pipe(Object($.a)((function(t){return 200===t.status})),Object(v.a)("response"),Object(h.a)((function(t){if(void 0!==e){var n=t.stargazers_count,r=t.forks_count;return Object(b.a)([Object(q.e)(n||0)+" Stars",Object(q.e)(r||0)+" Forks"])}var c=t.public_repos;return Object(b.a)([Object(q.e)(c||0)+" Repositories"])})))}(e[1],e[2]);case"gitlab":var n=Object(r.h)(t.match(/^.+?([^\/]*gitlab[^\/]+)\/(.+?)\/?$/i),3);return function(t,e){return Object(d.a)({url:"https://"+t+"/api/v4/projects/"+encodeURIComponent(e),responseType:"json"}).pipe(Object($.a)((function(t){return 200===t.status})),Object(v.a)("response"),Object(k.a)((function(t){var e=t.star_count,n=t.forks_count;return[Object(q.e)(e)+" Stars",Object(q.e)(n)+" Forks"]})))}(n[1],n[2]);default:return f.a}}function z(t,e){t.setAttribute("data-md-state","lock"),t.style.top="-"+e+"px"}function I(t){var e=-1*parseInt(t.style.top,10);t.removeAttribute("data-md-state"),t.style.top="",e&&window.scrollTo(0,e)}function V(t){if(!Object(q.d)(t))throw new SyntaxError("Invalid configuration: "+JSON.stringify(t));var e=Object(C.q)(),n=Object(C.v)(),V=Object(C.w)(t.base,{location$:n}),D=Object(C.x)(),B=Object(C.A)(),Y=Object(C.y)("(min-width: 960px)"),F=Object(C.y)("(min-width: 1220px)");Object(A.setupComponents)(["announce","container","header","header-title","hero","main","navigation","search","search-query","search-reset","search-result","skip","tabs","toc"],{document$:e});var J=Object(T.h)();!function(t){var e=t.document$,n=t.viewport$,c=e.pipe(Object(k.a)((function(){return Object(C.e)("pre > code")}))),a=n.pipe(Object(E.a)("size"));Object(s.a)([c,a]).subscribe((function(t){var e,n,c=Object(r.h)(t,1)[0];try{for(var a=Object(r.k)(c),i=a.next();!i.done;i=a.next()){var o=i.value;o.scrollWidth>o.clientWidth?o.setAttribute("tabindex","0"):o.removeAttribute("tabindex")}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}}))}({document$:e,viewport$:B}),function(t){var e=t.document$,n=t.hash$,c=e.pipe(Object(k.a)((function(){return Object(C.e)("details")})));Object(j.a)(Object(C.y)("print").pipe(Object($.a)(_.a)),Object(l.a)(window,"beforeprint")).pipe(Object(L.a)(c)).subscribe((function(t){var e,n;try{for(var c=Object(r.k)(t),a=c.next();!a.done;a=c.next()){a.value.setAttribute("open","")}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})),n.pipe(Object(k.a)((function(t){return Object(C.c)('[id="'+t+'"]')})),Object($.a)((function(t){return void 0!==t})),Object(y.a)((function(t){var e=t.closest("details");e&&!e.open&&e.setAttribute("open","")}))).subscribe((function(t){return t.scrollIntoView()}))}({document$:e,hash$:D}),{document$:e}.document$.pipe(Object(M.a)(1),Object(w.a)(Object(A.useComponent)("container")),Object(k.a)((function(t){var e=Object(r.h)(t,2)[1];return Object(C.e)("script",e)}))).subscribe((function(t){var e,n;try{for(var c=Object(r.k)(t),a=c.next();!a.done;a=c.next()){var i=a.value;if(i.src||/(^|\/javascript)$/i.test(i.type)){var o=Object(C.a)("script"),u=i.src?"src":"textContent";o[u]=i[u],Object(C.j)(i,o)}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})),function(t){t.document$.pipe(Object(k.a)((function(){return Object(C.d)(".md-source[href]")})),Object(h.a)((function(t){var e=t.href;return Object(q.a)(""+Object(q.c)(e),(function(){return N(e)}))})),Object(m.a)((function(){return f.a}))).subscribe((function(t){var e,n;try{for(var c=Object(r.k)(Object(C.e)(".md-source__repository")),a=c.next();!a.done;a=c.next()){var i=a.value;i.hasAttribute("data-md-state")||(i.setAttribute("data-md-state","done"),i.appendChild(Object(U.c)(t)))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}}))}({document$:e}),function(t){var e=t.document$,n=Object(C.a)("table");e.pipe(Object(k.a)((function(){return Object(C.e)("table:not([class])")}))).subscribe((function(t){var e,c;try{for(var a=Object(r.k)(t),i=a.next();!i.done;i=a.next()){var o=i.value;Object(C.j)(o,n),Object(C.j)(n,Object(U.d)(o))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(c=a.return)&&c.call(a)}finally{if(e)throw e.error}}}))}({document$:e}),function(t){var e=t.document$.pipe(Object(k.a)((function(){return Object(C.e)("[data-md-scrollfix]")})),Object(p.a)(1));e.subscribe((function(t){var e,n;try{for(var c=Object(r.k)(t),a=c.next();!a.done;a=c.next()){a.value.removeAttribute("data-md-scrollfix")}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})),Object(H.a)(P,e,f.a).pipe(Object(h.a)((function(t){return j.a.apply(void 0,Object(r.i)(t.map((function(t){return Object(l.a)(t,"touchstart",{passive:!0}).pipe(Object(R.a)(t))}))))}))).subscribe((function(t){var e=t.scrollTop;0===e?t.scrollTop=1:e+t.offsetHeight===t.scrollHeight&&(t.scrollTop=e-1)}))}({document$:e});var W=Object(T.f)(),K=Object(T.e)({document$:e,dialog$:W}),Q=Object(A.useComponent)("header").pipe(Object(A.mountHeader)({document$:e,viewport$:B}),Object(p.a)(1)),X=Object(A.useComponent)("main").pipe(Object(A.mountMain)({header$:Q,viewport$:B}),Object(p.a)(1)),Z=Object(A.useComponent)("navigation").pipe(Object(A.mountNavigation)({header$:Q,main$:X,viewport$:B,screen$:F}),Object(p.a)(1)),G=Object(A.useComponent)("toc").pipe(Object(A.mountTableOfContents)({header$:Q,main$:X,viewport$:B,tablet$:Y}),Object(p.a)(1)),tt=Object(A.useComponent)("tabs").pipe(Object(A.mountTabs)({header$:Q,viewport$:B,screen$:F}),Object(p.a)(1)),et=Object(A.useComponent)("hero").pipe(Object(A.mountHero)({header$:Q,viewport$:B}),Object(p.a)(1)),nt=Object(o.a)((function(){var e=t.search&&t.search.index?t.search.index:void 0,n=void 0!==e?Object(u.a)(e):V.pipe(Object(h.a)((function(t){return Object(d.a)({url:t+"/search/search_index.json",responseType:"json",withCredentials:!0}).pipe(Object(v.a)("response"))})));return Object(b.a)(Object(T.i)(t.search.worker,{base$:V,index$:n}))})).pipe(Object(h.a)((function(e){var n=Object(A.useComponent)("search-query").pipe(Object(A.mountSearchQuery)(e,{transform:t.search.transform}),Object(p.a)(1)),r=Object(A.useComponent)("search-reset").pipe(Object(A.mountSearchReset)(),Object(p.a)(1)),c=Object(A.useComponent)("search-result").pipe(Object(A.mountSearchResult)(e,{query$:n}),Object(p.a)(1));return Object(A.useComponent)("search").pipe(Object(A.mountSearch)(e,{query$:n,reset$:r,result$:c}))})),Object(m.a)((function(){return Object(A.useComponent)("search").subscribe((function(t){return t.hidden=!0})),f.a})),Object(p.a)(1));D.pipe(Object(y.a)((function(){return Object(C.o)("search",!1)})),Object(g.a)(125)).subscribe((function(t){return Object(C.n)("#"+t)})),Object(s.a)([Object(C.z)("search"),Y]).pipe(Object(w.a)(B),Object(h.a)((function(t){var n=Object(r.h)(t,2),c=Object(r.h)(n[0],2),a=c[0],i=c[1],o=n[1].offset.y,u=a&&!i;return e.pipe(Object(g.a)(u?400:100),Object(x.b)(O.a),Object(y.a)((function(t){var e=t.body;return u?z(e,o):I(e)})))}))).subscribe(),Object(l.a)(document.body,"click").pipe(Object($.a)((function(t){return!(t.metaKey||t.ctrlKey)})),Object($.a)((function(t){if(t.target instanceof HTMLElement){var e=t.target.closest("a");if(e&&Object(C.h)(e))return!0}return!1}))).subscribe((function(){Object(C.o)("drawer",!1)})),t.features.includes("instant")&&"file:"!==location.protocol&&V.pipe(Object(h.a)((function(t){return Object(d.a)({url:t+"/sitemap.xml",responseType:"document",withCredentials:!0}).pipe(Object(v.a)("response"))})),Object(w.a)(V),Object(k.a)((function(t){var e=Object(r.h)(t,2),n=e[0],i=e[1],o=Object(C.e)("loc",n).map((function(t){return t.textContent}));if(o.length>1){var u=Object(r.h)(Object(c.a)(Object(a.a)("length"),o),2),b=u[0],f=u[1],s=0;if(b===f)s=b.length;else for(;b.charAt(s)===f.charAt(s);)s++;for(var O=0;O<o.length;O++)o[O]=o[O].replace(b.slice(0,s),i+"/")}return o}))).subscribe((function(t){Object(T.g)(t,{document$:e,location$:n,viewport$:B})})),J.pipe(Object($.a)((function(t){return"global"===t.mode&&"Tab"===t.type})),Object(S.a)(1)).subscribe((function(){var t,e;try{for(var n=Object(r.k)(Object(C.e)(".headerlink")),c=n.next();!c.done;c=n.next()){c.value.style.visibility="visible"}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}));var rt={document$:e,location$:n,viewport$:B,header$:Q,hero$:et,main$:X,navigation$:Z,search$:nt,tabs$:tt,toc$:G,clipboard$:K,keyboard$:J,dialog$:W};return j.a.apply(void 0,Object(r.i)(Object(i.a)(rt))).subscribe(),rt}document.documentElement.classList.remove("no-js"),document.documentElement.classList.add("js"),navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&document.documentElement.classList.add("ios")}]));
+//# sourceMappingURL=bundle.b39636ac.min.js.map
\ No newline at end of file
diff --git a/assets/javascripts/bundle.b39636ac.min.js.map b/assets/javascripts/bundle.b39636ac.min.js.map
new file mode 100644
index 0000000..c296972
--- /dev/null
+++ b/assets/javascripts/bundle.b39636ac.min.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/assets/javascripts/browser/document/index.ts","webpack:///./src/assets/javascripts/browser/element/_/index.ts","webpack:///./src/assets/javascripts/browser/element/focus/index.ts","webpack:///./src/assets/javascripts/browser/element/offset/index.ts","webpack:///./src/assets/javascripts/browser/element/select/index.ts","webpack:///./src/assets/javascripts/browser/element/size/index.ts","webpack:///./src/assets/javascripts/browser/keyboard/index.ts","webpack:///./src/assets/javascripts/browser/location/_/index.ts","webpack:///./src/assets/javascripts/browser/location/base/index.ts","webpack:///./src/assets/javascripts/browser/location/hash/index.ts","webpack:///./src/assets/javascripts/browser/media/index.ts","webpack:///./src/assets/javascripts/browser/toggle/index.ts","webpack:///./src/assets/javascripts/browser/viewport/offset/index.ts","webpack:///./src/assets/javascripts/browser/viewport/size/index.ts","webpack:///./src/assets/javascripts/browser/viewport/_/index.ts","webpack:///./src/assets/javascripts/browser/worker/index.ts","webpack:///./src/assets/javascripts/utilities/config/index.ts","webpack:///./src/assets/javascripts/utilities/jsx/index.ts","webpack:///./src/assets/javascripts/utilities/rxjs/index.ts","webpack:///./src/assets/javascripts/utilities/string/index.ts","webpack:///./src/assets/javascripts/components/index.ts","webpack:///./src/assets/javascripts/integrations/clipboard/index.ts","webpack:///./src/assets/javascripts/integrations/dialog/index.ts","webpack:///./src/assets/javascripts/integrations/instant/index.ts","webpack:///./src/assets/javascripts/integrations/keyboard/index.ts","webpack:///./src/assets/javascripts/components/_/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/set/index.ts","webpack:///./src/assets/javascripts/components/shared/index.ts","webpack:///./src/assets/javascripts/templates/clipboard/index.tsx","webpack:///./src/assets/javascripts/templates/search/index.tsx","webpack:///./src/assets/javascripts/templates/source/index.tsx","webpack:///./src/assets/javascripts/templates/table/index.tsx","webpack:///./src/assets/javascripts/components/shared/sidebar/set/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/index.ts","webpack:///./src/assets/javascripts/integrations/search/_/index.ts","webpack:///./src/assets/javascripts/integrations/search/document/index.ts","webpack:///./src/assets/javascripts/integrations/search/highlighter/index.ts","webpack:///./src/assets/javascripts/integrations/search/transform/index.ts","webpack:///./src/assets/javascripts/integrations/search/worker/message/index.ts","webpack:///./src/assets/javascripts/integrations/search/worker/_/index.ts","webpack:///./src/assets/javascripts/components/shared/sidebar/index.ts","webpack:///./src/assets/javascripts/components/shared/sidebar/react/index.ts","webpack:///./src/assets/javascripts/components/toc/index.ts","webpack:///./src/assets/javascripts/components/toc/_/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/react/index.ts","webpack:///./src/assets/javascripts/components/search/_/index.ts","webpack:///./src/assets/javascripts/components/search/query/_/index.ts","webpack:///./src/assets/javascripts/components/search/query/react/index.ts","webpack:///./src/assets/javascripts/components/search/reset/_/index.ts","webpack:///./src/assets/javascripts/components/search/reset/react/index.ts","webpack:///./src/assets/javascripts/components/search/result/set/index.ts","webpack:///./src/assets/javascripts/components/search/result/react/index.ts","webpack:///./src/assets/javascripts/components/search/result/_/index.ts","webpack:///./src/assets/javascripts/components/main/_/index.ts","webpack:///./src/assets/javascripts/components/main/react/index.ts","webpack:///./src/assets/javascripts/components/main/set/index.ts","webpack:///./src/assets/javascripts/components/hero/_/index.ts","webpack:///./src/assets/javascripts/components/hero/react/index.ts","webpack:///./src/assets/javascripts/components/hero/set/index.ts","webpack:///./src/assets/javascripts/components/header/_/index.ts","webpack:///./src/assets/javascripts/components/header/react/index.ts","webpack:///./src/assets/javascripts/components/header/set/index.ts","webpack:///./src/assets/javascripts/components/tabs/_/index.ts","webpack:///./src/assets/javascripts/components/tabs/react/index.ts","webpack:///./src/assets/javascripts/components/tabs/set/index.ts","webpack:///./src/assets/javascripts/components/navigation/_/index.ts","webpack:///./src/assets/javascripts/patches/scrollfix/index.ts","webpack:///./src/assets/javascripts/patches/source/index.ts","webpack:///./src/assets/javascripts/patches/source/github/index.ts","webpack:///./src/assets/javascripts/patches/source/gitlab/index.ts","webpack:///./src/assets/javascripts/index.ts","webpack:///./src/assets/javascripts/patches/code/index.ts","webpack:///./src/assets/javascripts/patches/details/index.ts","webpack:///./src/assets/javascripts/patches/script/index.ts","webpack:///./src/assets/javascripts/patches/table/index.ts"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","watchDocument","document$","ReplaySubject","fromEvent","document","pipe","mapTo","subscribe","getElement","selector","node","querySelector","undefined","getElementOrThrow","el","ReferenceError","getActiveElement","activeElement","HTMLElement","getElements","Array","from","querySelectorAll","createElement","tagName","replaceElement","source","target","replaceWith","setElementFocus","focus","blur","watchElementFocus","merge","map","startWith","shareReplay","getElementOffset","x","scrollLeft","y","scrollTop","watchElementOffset","setElementSelection","HTMLInputElement","Error","select","watchElementSize","fromEventPattern","next","contentRect","width","Math","round","height","observe","offsetWidth","offsetHeight","getElementSize","isSusceptibleToKeyboard","isContentEditable","watchKeyboard","filter","ev","metaKey","ctrlKey","type","claim","preventDefault","stopPropagation","share","setLocation","url","location","href","isLocalLocation","ref","host","test","pathname","isAnchorLocation","hash","watchLocation","BehaviorSubject","URL","watchLocationBase","base","take","toString","replace","getLocationHash","substring","setLocationHash","addEventListener","click","watchLocationHash","watchMedia","query","media","matchMedia","addListener","matches","toggles","drawer","search","getToggle","checked","setToggle","watchToggle","getViewportOffset","max","pageXOffset","pageYOffset","setViewportOffset","scrollTo","getViewportSize","innerWidth","innerHeight","watchViewport","combineLatest","passive","offset","size","watchViewportAt","header$","viewport$","size$","distinctUntilKeyChanged","offset$","offsetLeft","offsetTop","watchWorker","worker","tx$","rx$","pluck","throttle","leading","trailing","tap","message","postMessage","switchMapTo","isConfig","config","features","createElementNS","setAttribute","setAttributeNS","appendChild","child","innerHTML","Node","isArray","h","attributes","keys","attr","children","cache","factory","defer","sessionStorage","getItem","of","JSON","parse","value$","setItem","stringify","err","lang","translate","textContent","truncate","toFixed","len","charCodeAt","setupClipboard","dialog$","forEach","block","index","parent","parentElement","id","insertBefore","clipboard$","on","clearSelection","setupDialog","duration","Subject","dialog","classList","add","switchMap","text","body","container","observeOn","animationFrame","delay","removeAttribute","remove","setupInstantLoading","urls","location$","history","scrollRestoration","favicon","state$","closest","includes","push$","pop$","state","distinctUntilChanged","prev","ajax$","skip","ajax","responseType","withCredentials","catchError","sample","pushState","dom","DOMParser","response","parseFromString","instant$","withLatestFrom","title","head","dispatchEvent","CustomEvent","debounceTime","replaceState","bufferCount","setupKeyboard","keyboard$","active","els","indexOf","components$","setupComponents","names","reduce","components","useComponent","setAnchorBlur","resetAnchorBlur","setAnchorActive","toggle","resetAnchorActive","css","renderClipboardButton","class","xmlns","viewBox","renderSearchResult","article","sections","icon","tabIndex","renderSource","facts","fact","renderTable","table","setSidebarOffset","style","top","resetSidebarOffset","setSidebarHeight","resetSidebarHeight","docs","pipeline","this","documents","Map","doc","split","path","linked","set","setupSearchDocumentMap","highlight","separator","RegExp","_","term","trim","match","setupSearchHighlighter","lunr","tokenizer","use","multiLanguage","fns","a","b","Set","has","difference","language","fn","searchPipeline","field","boost","Index","load","groups","results","section","console","warn","defaultTransform","terms","join","SearchMessageType","isSearchReadyMessage","READY","isSearchQueryMessage","QUERY","isSearchResultMessage","RESULT","setupSearchIndex","identity","setupSearchWorker","index$","base$","Worker","SETUP","watchSidebar","main$","adjust","min","lock","applySidebar","mountTableOfContents","tablet$","tablet","sidebar$","anchors$","sidebar","anchors","watchAnchorList","decodeURIComponent","adjust$","header","anchor","pop","applyAnchorList","mountSearch","query$","reset$","result$","status$","status","mountSearchQuery","options","focus$","watchSearchQuery","mountSearchReset","watchSearchReset","addToSearchResultList","applySearchResult","ready$","fetch$","list","meta","setSearchResultMeta","resetSearchResultMeta","scan","scrollHeight","finalize","resetSearchResultList","mountSearchResult","mountMain","setHeaderShadow","resetHeaderShadow","border$","bottom","watchMain","main","mountHero","hidden","setHeroHidden","resetHeroHidden","applyHero","mountHeader","styles","getComputedStyle","position","sticky","watchHeader","type$","hx","setHeaderTitleActive","resetHeaderTitleActive","applyHeaderType","mountTabs","screen$","screen","setTabsHidden","resetTabsHidden","applyTabs","mountNavigation","isAppleDevice","navigator","userAgent","fetchSourceFacts","toLowerCase","user","repo","stargazers_count","forks_count","public_repos","fetchSourceFactsFromGitHub","project","encodeURIComponent","star_count","fetchSourceFactsFromGitLab","setScrollLock","resetScrollLock","parseInt","initialize","SyntaxError","hash$","els$","scrollWidth","clientWidth","patchCodeBlocks","details","open","scrollIntoView","patchDetails","src","script","hasAttribute","patchSource","sentinel","patchTables","iif","patchScrollfix","navigation$","toc$","tabs$","hero$","search$","transform","protocol","sortBy","prop","charAt","visibility","values","documentElement"],"mappings":"4DACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,E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A,GAAOlP,MACbjN,YACIiN,GAzVTpN,SAASuc,gBAAgBzQ,UAAUU,OAAO,SAC1CxM,SAASuc,gBAAgBzQ,UAAUC,IAAI,MAGnCwN,UAAUC,UAAUtH,MAAM,wBAC5BlS,SAASuc,gBAAgBzQ,UAAUC,IAAI","file":"assets/javascripts/bundle.b39636ac.min.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([88,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ReplaySubject, Subject, fromEvent } from \"rxjs\"\nimport { mapTo } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch document\n *\n * Documents must be implemented as subjects, so all downstream observables are\n * automatically updated when a new document is emitted. This enabled features\n * like instant loading.\n *\n * @return Document subject\n */\nexport function watchDocument(): Subject<Document> {\n  const document$ = new ReplaySubject<Document>()\n  fromEvent(document, \"DOMContentLoaded\")\n    .pipe(\n      mapTo(document)\n    )\n      .subscribe(document$)\n\n  /* Return document */\n  return document$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Element or nothing\n */\nexport function getElement<T extends HTMLElement>(\n  selector: string, node: ParentNode = document\n): T | undefined {\n  return node.querySelector<T>(selector) || undefined\n}\n\n/**\n * Retrieve an element matching a query selector or throw a reference error\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Element\n */\nexport function getElementOrThrow<T extends HTMLElement>(\n  selector: string, node: ParentNode = document\n): T {\n  const el = getElement<T>(selector, node)\n  if (typeof el === \"undefined\")\n    throw new ReferenceError(\n      `Missing element: expected \"${selector}\" to be present`\n    )\n  return el\n}\n\n/**\n * Retrieve the currently active element\n *\n * @return Element or nothing\n */\nexport function getActiveElement(): HTMLElement | undefined {\n  return document.activeElement instanceof HTMLElement\n    ? document.activeElement\n    : undefined\n}\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Elements\n */\nexport function getElements<T extends HTMLElement>(\n  selector: string, node: ParentNode = document\n): T[] {\n  return Array.from(node.querySelectorAll<T>(selector))\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Create an element\n *\n * @template T - Tag name type\n *\n * @param tagName - Tag name\n *\n * @return Element\n */\nexport function createElement<\n  T extends keyof HTMLElementTagNameMap\n>(tagName: T): HTMLElementTagNameMap[T] {\n  return document.createElement(tagName)\n}\n\n/**\n * Replace an element with another element\n *\n * @param source - Source element\n * @param target - Target element\n */\nexport function replaceElement(\n  source: HTMLElement, target: Node\n): void {\n  source.replaceWith(target)\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\nimport { getActiveElement } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set element focus\n *\n * @param el - Element\n * @param value - Whether the element should be focused\n */\nexport function setElementFocus(\nel: HTMLElement, value: boolean = true\n): void {\n  if (value)\n    el.focus()\n  else\n    el.blur()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element focus\n *\n * @param el - Element\n *\n * @return Element focus observable\n */\nexport function watchElementFocus(\n  el: HTMLElement\n): Observable<boolean> {\n  return merge(\n    fromEvent<FocusEvent>(el, \"focus\"),\n    fromEvent<FocusEvent>(el, \"blur\")\n  )\n    .pipe(\n      map(({ type }) => type === \"focus\"),\n      startWith(el === getActiveElement()),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementOffset {\n  x: number                            /* Horizontal offset */\n  y: number                            /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element offset\n *\n * @param el - Element\n *\n * @return Element offset\n */\nexport function getElementOffset(el: HTMLElement): ElementOffset {\n  return {\n    x: el.scrollLeft,\n    y: el.scrollTop\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element offset\n *\n * @param el - Element\n *\n * @return Element offset observable\n */\nexport function watchElementOffset(\n  el: HTMLElement\n): Observable<ElementOffset> {\n  return merge(\n    fromEvent(el, \"scroll\"),\n    fromEvent(window, \"resize\")\n  )\n    .pipe(\n      map(() => getElementOffset(el)),\n      startWith(getElementOffset(el)),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set element text selection\n *\n * @param el - Element\n */\nexport function setElementSelection(\n  el: HTMLElement\n): void {\n  if (el instanceof HTMLInputElement)\n    el.select()\n  else\n    throw new Error(\"Not implemented\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ResizeObserver from \"resize-observer-polyfill\"\nimport { Observable, fromEventPattern } from \"rxjs\"\nimport { shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementSize {\n  width: number                        /* Element width */\n  height: number                       /* Element height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element size\n *\n * @param el - Element\n *\n * @return Element size\n */\nexport function getElementSize(el: HTMLElement): ElementSize {\n  return {\n    width:  el.offsetWidth,\n    height: el.offsetHeight\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element size\n *\n * @param el - Element\n *\n * @return Element size observable\n */\nexport function watchElementSize(\n  el: HTMLElement\n): Observable<ElementSize> {\n  return fromEventPattern<ElementSize>(next => {\n    new ResizeObserver(([{ contentRect }]) => next({\n      width:  Math.round(contentRect.width),\n      height: Math.round(contentRect.height)\n    }))\n      .observe(el)\n  })\n    .pipe(\n      startWith(getElementSize(el)),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { filter, map, share } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Key\n */\nexport interface Key {\n  type: string                         /* Key type */\n  claim(): void                        /* Key claim */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether an element may receive keyboard input\n *\n * @param el - Element\n *\n * @return Test result\n */\nexport function isSusceptibleToKeyboard(el: HTMLElement): boolean {\n  switch (el.tagName) {\n\n    /* Form elements */\n    case \"INPUT\":\n    case \"SELECT\":\n    case \"TEXTAREA\":\n      return true\n\n    /* Everything else */\n    default:\n      return el.isContentEditable\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch keyboard\n *\n * @return Keyboard observable\n */\nexport function watchKeyboard(): Observable<Key> {\n  return fromEvent<KeyboardEvent>(window, \"keydown\")\n    .pipe(\n      filter(ev => !(ev.metaKey || ev.ctrlKey)),\n      map(ev => ({\n        type: ev.key,\n        claim() {\n          ev.preventDefault()\n          ev.stopPropagation()\n        }\n      })),\n      share()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { BehaviorSubject, Subject } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location\n *\n * This function will return a `URL` object (and not `Location`) in order to\n * normalize typings across the application. Furthermore, locations need to be\n * tracked without setting them and `Location` is a singleton which represents\n * the current location.\n *\n * @return URL\n */\nexport function getLocation(): URL {\n  return new URL(location.href)\n}\n\n/**\n * Set location\n *\n * @param url - URL to change to\n */\nexport function setLocation(url: URL): void {\n  location.href = url.href\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Check whether a URL is a local link or a file (except `.html`)\n *\n * @param url - URL or HTML anchor element\n * @param ref - Reference URL\n *\n * @return Test result\n */\nexport function isLocalLocation(\n  url: URL | HTMLAnchorElement,\n  ref: URL | Location = location\n): boolean {\n  return url.host === ref.host\n      && /^(?:\\/[\\w-]+)*(?:\\/?|\\.html)$/i.test(url.pathname)\n}\n\n/**\n * Check whether a URL is an anchor link on the current page\n *\n * @param url - URL or HTML anchor element\n * @param ref - Reference URL\n *\n * @return Test result\n */\nexport function isAnchorLocation(\n  url: URL | HTMLAnchorElement,\n  ref: URL | Location = location\n): boolean {\n  return url.pathname === ref.pathname\n      && url.hash.length > 0\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location\n *\n * @return Location subject\n */\nexport function watchLocation(): Subject<URL> {\n  return new BehaviorSubject<URL>(getLocation())\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport { map, shareReplay, take } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  location$: Observable<URL>           /* Location observable */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location base\n *\n * @return Location base observable\n */\nexport function watchLocationBase(\n  base: string, { location$ }: WatchOptions\n): Observable<string> {\n  return location$\n    .pipe(\n      take(1),\n      map(({ href }) => new URL(base, href)\n        .toString()\n        .replace(/\\/$/, \"\")\n      ),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { filter, map, share, startWith } from \"rxjs/operators\"\n\nimport { createElement } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location hash\n *\n * @return Location hash\n */\nexport function getLocationHash(): string {\n  return location.hash.substring(1)\n}\n\n/**\n * Set location hash\n *\n * Setting a new fragment identifier via `location.hash` will have no effect\n * if the value doesn't change. When a new fragment identifier is set, we want\n * the browser to target the respective element at all times, which is why we\n * use this dirty little trick.\n *\n * @param hash - Location hash\n */\nexport function setLocationHash(hash: string): void {\n  const el = createElement(\"a\")\n  el.href = hash\n  el.addEventListener(\"click\", ev => ev.stopPropagation())\n  el.click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location hash\n *\n * @return Location hash observable\n */\nexport function watchLocationHash(): Observable<string> {\n  return fromEvent<HashChangeEvent>(window, \"hashchange\")\n    .pipe(\n      map(getLocationHash),\n      startWith(getLocationHash()),\n      filter(hash => hash.length > 0),\n      share()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEventPattern } from \"rxjs\"\nimport { shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch media query\n *\n * @param query - Media query\n *\n * @return Media observable\n */\nexport function watchMedia(query: string): Observable<boolean> {\n  const media = matchMedia(query)\n  return fromEventPattern<boolean>(next =>\n    media.addListener(() => next(media.matches))\n  )\n    .pipe(\n      startWith(media.matches),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { map, startWith } from \"rxjs/operators\"\n\nimport { getElementOrThrow } from \"../element\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle\n */\nexport type Toggle =\n  | \"drawer\"                           /* Toggle for drawer */\n  | \"search\"                           /* Toggle for search */\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle map\n */\nconst toggles: Record<Toggle, HTMLInputElement> = {\n  drawer: getElementOrThrow(`[data-md-toggle=drawer]`),\n  search: getElementOrThrow(`[data-md-toggle=search]`)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve the value of a toggle\n *\n * @param name - Toggle\n *\n * @return Toggle value\n */\nexport function getToggle(name: Toggle): boolean {\n  return toggles[name].checked\n}\n\n/**\n * Set toggle\n *\n * Simulating a click event seems to be the most cross-browser compatible way\n * of changing the value while also emitting a `change` event. Before, Material\n * used `CustomEvent` to programmatically change the value of a toggle, but this\n * is a much simpler and cleaner solution which doesn't require a polyfill.\n *\n * @param name - Toggle\n * @param value - Toggle value\n */\nexport function setToggle(name: Toggle, value: boolean): void {\n  if (toggles[name].checked !== value)\n    toggles[name].click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch toggle\n *\n * @param name - Toggle\n *\n * @return Toggle value observable\n */\nexport function watchToggle(name: Toggle): Observable<boolean> {\n  const el = toggles[name]\n  return fromEvent(el, \"change\")\n    .pipe(\n      map(() => el.checked),\n      startWith(el.checked)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport offset\n */\nexport interface ViewportOffset {\n  x: number                            /* Horizontal offset */\n  y: number                            /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport offset\n *\n * On iOS Safari, viewport offset can be negative due to overflow scrolling.\n * As this may induce strange behaviors downstream, we'll just limit it to 0.\n *\n * @return Viewport offset\n */\nexport function getViewportOffset(): ViewportOffset {\n  return {\n    x: Math.max(0, pageXOffset),\n    y: Math.max(0, pageYOffset)\n  }\n}\n\n/**\n * Set viewport offset\n *\n * @param offset - Viewport offset\n */\nexport function setViewportOffset(\n  { x, y }: Partial<ViewportOffset>\n): void {\n  window.scrollTo(x || 0, y || 0)\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffset(): Observable<ViewportOffset> {\n  return merge(\n    fromEvent(window, \"scroll\", { passive: true }),\n    fromEvent(window, \"resize\", { passive: true })\n  )\n    .pipe(\n      map(getViewportOffset),\n      startWith(getViewportOffset())\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { map, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport size\n */\nexport interface ViewportSize {\n  width: number                        /* Viewport width */\n  height: number                       /* Viewport height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport size\n *\n * @return Viewport size\n */\nexport function getViewportSize(): ViewportSize {\n  return {\n    width:  innerWidth,\n    height: innerHeight\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport size\n *\n * @return Viewport size observable\n */\nexport function watchViewportSize(): Observable<ViewportSize> {\n  return fromEvent(window, \"resize\", { passive: true })\n    .pipe(\n      map(getViewportSize),\n      startWith(getViewportSize())\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  shareReplay\n} from \"rxjs/operators\"\n\nimport { Header } from \"components\"\n\nimport {\n  ViewportOffset,\n  watchViewportOffset\n} from \"../offset\"\nimport {\n  ViewportSize,\n  watchViewportSize\n} from \"../size\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport\n */\nexport interface Viewport {\n  offset: ViewportOffset               /* Viewport offset */\n  size: ViewportSize                   /* Viewport size */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch at options\n */\ninterface WatchAtOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport\n *\n * @return Viewport observable\n */\nexport function watchViewport(): Observable<Viewport> {\n  return combineLatest([\n    watchViewportOffset(),\n    watchViewportSize()\n  ])\n    .pipe(\n      map(([offset, size]) => ({ offset, size })),\n      shareReplay(1)\n    )\n}\n\n/**\n * Watch viewport relative to element\n *\n * @param el - Element\n * @param options - Options\n *\n * @return Viewport observable\n */\nexport function watchViewportAt(\n  el: HTMLElement, { header$, viewport$ }: WatchAtOptions\n): Observable<Viewport> {\n  const size$ = viewport$\n    .pipe(\n      distinctUntilKeyChanged(\"size\")\n    )\n\n  /* Compute element offset */\n  const offset$ = combineLatest([size$, header$])\n    .pipe(\n      map((): ViewportOffset => ({\n        x: el.offsetLeft,\n        y: el.offsetTop\n      }))\n    )\n\n  /* Compute relative viewport, return hot observable */\n  return combineLatest([header$, viewport$, offset$])\n    .pipe(\n      map(([{ height }, { offset, size }, { x, y }]) => ({\n        offset: {\n          x: offset.x - x,\n          y: offset.y - y + height\n        },\n        size\n      })),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, Subject, fromEventPattern } from \"rxjs\"\nimport {\n  pluck,\n  share,\n  switchMapTo,\n  tap,\n  throttle\n} from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Worker message\n */\nexport interface WorkerMessage {\n  type: unknown                        /* Message type */\n  data?: unknown                       /* Message data */\n}\n\n/**\n * Worker handler\n *\n * @template T - Message type\n */\nexport interface WorkerHandler<\n  T extends WorkerMessage\n> {\n  tx$: Subject<T>                      /* Message transmission subject */\n  rx$: Observable<T>                   /* Message receive observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n *\n * @template T - Worker message type\n */\ninterface WatchOptions<T extends WorkerMessage> {\n  tx$: Observable<T>                   /* Message transmission observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch a web worker\n *\n * This function returns an observable that will send all values emitted by the\n * message observable to the web worker. Web worker communication is expected\n * to be bidirectional (request-response) and synchronous. Messages that are\n * emitted during a pending request are throttled, the last one is emitted.\n *\n * @param worker - Web worker\n * @param options - Options\n *\n * @return Worker message observable\n */\nexport function watchWorker<T extends WorkerMessage>(\n  worker: Worker, { tx$ }: WatchOptions<T>\n): Observable<T> {\n\n  /* Intercept messages from worker-like objects */\n  const rx$ = fromEventPattern<MessageEvent>(next =>\n    worker.addEventListener(\"message\", next)\n  )\n    .pipe<T>(\n      pluck(\"data\")\n    )\n\n  /* Send and receive messages, return hot observable */\n  return tx$\n    .pipe(\n      throttle(() => rx$, { leading: true, trailing: true }),\n      tap(message => worker.postMessage(message)),\n      switchMapTo(rx$),\n      share()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndex, SearchTransformFn } from \"integrations\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Feature flags\n */\nexport type Feature =\n  | \"tabs\"                             /* Tabs navigation */\n  | \"instant\"                          /* Instant loading\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Configuration\n */\nexport interface Config {\n  base: string                         /* Base URL */\n  features: Feature[]                  /* Feature flags */\n  search: {\n    worker: string                     /* Worker URL */\n    index?: Promise<SearchIndex>       /* Promise resolving with index */\n    transform?: SearchTransformFn      /* Transformation function */\n  }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Ensure that the given value is a valid configuration\n *\n * We could use `jsonschema` or any other schema validation framework, but that\n * would just add more bloat to the bundle, so we'll keep it plain and simple.\n *\n * @param config - Configuration\n *\n * @return Test result\n */\nexport function isConfig(config: any): config is Config {\n  return typeof config === \"object\"\n      && typeof config.base === \"string\"\n      && typeof config.features === \"object\"\n      && typeof config.search === \"object\"\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n// tslint:disable no-null-keyword\n\nimport { JSX as JSXInternal } from \"preact\"\nimport { keys } from \"ramda\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * HTML and SVG attributes\n */\ntype Attributes =\n  & JSXInternal.HTMLAttributes\n  & JSXInternal.SVGAttributes\n  & Record<string, any>\n\n/**\n * Child element\n */\ntype Child =\n  | HTMLElement\n  | SVGElement\n  | Text\n  | string\n  | number\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create an element\n *\n * @param tagName - HTML or SVG tag\n *\n * @return Element\n */\nfunction createElement(tagName: string): HTMLElement | SVGElement {\n  switch (tagName) {\n\n    /* SVG elements */\n    case \"svg\":\n    case \"path\":\n      return document.createElementNS(\"http://www.w3.org/2000/svg\", tagName)\n\n    /* HTML elements */\n    default:\n      return document.createElement(tagName)\n  }\n}\n\n/**\n * Set an attribute\n *\n * @param el - Element\n * @param name - Attribute name\n * @param value - Attribute value\n */\nfunction setAttribute(\n  el: HTMLElement | SVGElement, name: string, value: string) {\n  switch (name) {\n\n    /* Attributes to be ignored */\n    case \"xmlns\":\n      break\n\n    /* Attributes of SVG elements */\n    case \"viewBox\":\n    case \"d\":\n      if (typeof value !== \"boolean\")\n        el.setAttributeNS(null, name, value)\n      else if (value)\n        el.setAttributeNS(null, name, \"\")\n      break\n\n    /* Attributes of HTML elements */\n    default:\n      if (typeof value !== \"boolean\")\n        el.setAttribute(name, value)\n      else if (value)\n        el.setAttribute(name, \"\")\n  }\n}\n\n/**\n * Append a child node to an element\n *\n * @param el - Element\n * @param child - Child node(s)\n */\nfunction appendChild(\n  el: HTMLElement | SVGElement, child: Child | Child[]\n): void {\n\n  /* Handle primitive types (including raw HTML) */\n  if (typeof child === \"string\" || typeof child === \"number\") {\n    el.innerHTML += child.toString()\n\n  /* Handle nodes */\n  } else if (child instanceof Node) {\n    el.appendChild(child)\n\n  /* Handle nested children */\n  } else if (Array.isArray(child)) {\n    for (const node of child)\n      appendChild(el, node)\n  }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * JSX factory\n *\n * @param tagName - HTML or SVG tag\n * @param attributes - HTML attributes\n * @param children - Child elements\n *\n * @return Element\n */\nexport function h(\n  tagName: string, attributes: Attributes | null, ...children: Child[]\n): HTMLElement | SVGElement {\n  const el = createElement(tagName)\n\n  /* Set attributes, if any */\n  if (attributes)\n    for (const attr of keys(attributes))\n      setAttribute(el, attr, attributes[attr])\n\n  /* Append child nodes */\n  for (const child of children)\n    appendChild(el, child)\n\n  /* Return element */\n  return el\n}\n\n/* ----------------------------------------------------------------------------\n * Namespace\n * ------------------------------------------------------------------------- */\n\nexport declare namespace h {\n  namespace JSX {\n    type Element = HTMLElement | SVGElement\n    type IntrinsicElements = JSXInternal.IntrinsicElements\n  }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, defer, of } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Cache the last value emitted by an observable in session storage\n *\n * If the key is not found in session storage, the factory is executed and the\n * latest value emitted will automatically be persisted to sessions storage.\n * Note that the values emitted by the returned observable must be serializable\n * as `JSON`, or data will be lost.\n *\n * @template T - Value type\n *\n * @param key - Cache key\n * @param factory - Observable factory\n *\n * @return Value observable\n */\nexport function cache<T>(\n  key: string, factory: () => Observable<T>\n): Observable<T> {\n  return defer(() => {\n    const data = sessionStorage.getItem(key)\n    if (data) {\n      return of(JSON.parse(data) as T)\n\n    /* Retrieve value from observable factory and write to storage */\n    } else {\n      const value$ = factory()\n      value$.subscribe(value => {\n        try {\n          sessionStorage.setItem(key, JSON.stringify(value))\n        } catch (err) {\n          /* Uncritical, just swallow */\n        }\n      })\n\n      /* Return value */\n      return value$\n    }\n  })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElementOrThrow } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Translation keys\n */\ntype TranslateKey =\n  | \"clipboard.copy\"                   /* Copy to clipboard */\n  | \"clipboard.copied\"                 /* Copied to clipboard */\n  | \"search.config.lang\"               /* Search language */\n  | \"search.config.pipeline\"           /* Search pipeline */\n  | \"search.config.separator\"          /* Search separator */\n  | \"search.result.placeholder\"        /* Type to start searching */\n  | \"search.result.none\"               /* No matching documents */\n  | \"search.result.one\"                /* 1 matching document */\n  | \"search.result.other\"              /* # matching documents */\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Translations\n */\nlet lang: Record<string, string>\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Translate the given key\n *\n * @param key - Key to be translated\n * @param value - Value to be replaced\n *\n * @return Translation\n */\nexport function translate(key: TranslateKey, value?: string): string {\n  if (typeof lang === \"undefined\") {\n    const el = getElementOrThrow(\"#__lang\")\n    lang = JSON.parse(el.textContent!)\n  }\n  if (typeof lang[key] === \"undefined\") {\n    throw new ReferenceError(`Invalid translation: ${key}`)\n  }\n  return typeof value !== \"undefined\"\n    ? lang[key].replace(\"#\", value)\n    : lang[key]\n}\n\n/**\n * Truncate a string after the given number of characters\n *\n * This is not a very reasonable approach, since the summaries kind of suck.\n * It would be better to create something more intelligent, highlighting the\n * search occurrences and making a better summary out of it, but this note was\n * written three years ago, so who knows if we'll ever fix it.\n *\n * @param value - Value to be truncated\n * @param n - Number of characters\n *\n * @return Truncated value\n */\nexport function truncate(value: string, n: number): string {\n  let i = n\n  if (value.length > i) {\n    while (value[i] !== \" \" && --i > 0); // tslint:disable-line\n    return `${value.substring(0, i)}...`\n  }\n  return value\n}\n\n/**\n * Round a number for display with source facts\n *\n * This is a reverse engineered version of GitHub's weird rounding algorithm\n * for stars, forks and all other numbers. While all numbers below `1,000` are\n * returned as-is, bigger numbers are converted to fixed numbers:\n *\n * - `1,049` => `1k`\n * - `1,050` => `1.1k`\n * - `1,949` => `1.9k`\n * - `1,950` => `2k`\n *\n * @param value - Original value\n *\n * @return Rounded value\n */\nexport function round(value: number): string {\n  if (value > 999) {\n    const digits = +((value - 950) % 1000 > 99)\n    return `${((value + 0.000001) / 1000).toFixed(digits)}k`\n  } else {\n    return value.toString()\n  }\n}\n\n/**\n * Simple hash function\n *\n * @see https://bit.ly/2wsVjJ4 - Original source\n *\n * @param value - Value to be hashed\n *\n * @return Hash as 32bit integer\n */\nexport function hash(value: string): number {\n    let h = 0\n    for (let i = 0, len = value.length; i < len; i++) {\n      h  = ((h << 5) - h) + value.charCodeAt(i)\n      h |= 0 // Convert to 32bit integer\n    }\n    return h\n  }\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./header\"\nexport * from \"./hero\"\nexport * from \"./main\"\nexport * from \"./navigation\"\nexport * from \"./search\"\nexport * from \"./shared\"\nexport * from \"./tabs\"\nexport * from \"./toc\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport * as ClipboardJS from \"clipboard\"\nimport { NEVER, Observable, Subject, fromEventPattern } from \"rxjs\"\nimport { mapTo, share, tap } from \"rxjs/operators\"\n\nimport { getElements } from \"browser\"\nimport { renderClipboardButton } from \"templates\"\nimport { translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  document$: Observable<Document>      /* Document observable */\n  dialog$: Subject<string>             /* Dialog subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up clipboard\n *\n * This function implements the Clipboard.js integration and injects a button\n * into all code blocks when the document changes.\n *\n * @param options - Options\n *\n * @return Clipboard observable\n */\nexport function setupClipboard(\n  { document$, dialog$ }: SetupOptions\n): Observable<ClipboardJS.Event> {\n  if (!ClipboardJS.isSupported())\n    return NEVER\n\n  /* Inject 'copy-to-clipboard' buttons */\n  document$.subscribe(() => {\n    const blocks = getElements(\"pre > code\")\n    blocks.forEach((block, index) => {\n      const parent = block.parentElement!\n      parent.id = `__code_${index}`\n      parent.insertBefore(renderClipboardButton(parent.id), block)\n    })\n  })\n\n  /* Initialize clipboard */\n  const clipboard$ = fromEventPattern<ClipboardJS.Event>(next => {\n    new ClipboardJS(\".md-clipboard\").on(\"success\", next)\n  })\n    .pipe(\n      share()\n    )\n\n  /* Display notification for clipboard event */\n  clipboard$\n    .pipe(\n      tap(ev => ev.clearSelection()),\n      mapTo(translate(\"clipboard.copied\"))\n    )\n      .subscribe(dialog$)\n\n  /* Return clipboard */\n  return clipboard$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Subject, animationFrameScheduler, of } from \"rxjs\"\nimport {\n  delay,\n  map,\n  observeOn,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { createElement } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  duration?: number                    /* Display duration (default: 2s) */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up dialog\n *\n * @param options - Options\n *\n * @return Dialog observable\n */\nexport function setupDialog(\n  { duration }: SetupOptions = {}\n): Subject<string> {\n  const dialog$ = new Subject<string>()\n\n  /* Create dialog */\n  const dialog = createElement(\"div\")                                           // TODO: improve scoping\n  dialog.classList.add(\"md-dialog\", \"md-typeset\")\n\n  /* Display dialog */\n  dialog$\n    .pipe(\n      switchMap(text => of(document.body) // useComponent(\"container\")\n        .pipe(\n          map(container => container.appendChild(dialog)),\n          observeOn(animationFrameScheduler),\n          delay(1), // Strangley it doesnt work when we push things to the new animation frame...\n          tap(el => {\n            el.innerHTML = text\n            el.setAttribute(\"data-md-state\", \"open\")\n          }),\n          delay(duration || 2000),\n          tap(el => el.removeAttribute(\"data-md-state\")),\n          delay(400),\n          tap(el => {\n            el.innerHTML = \"\"\n            el.remove()\n          })\n        )\n      )\n    )\n      .subscribe()\n\n  /* Return dialog */\n  return dialog$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { NEVER, Observable, Subject, fromEvent, merge, of } from \"rxjs\"\nimport { ajax } from \"rxjs//ajax\"\nimport {\n  bufferCount,\n  catchError,\n  debounceTime,\n  distinctUntilChanged,\n  distinctUntilKeyChanged,\n  filter,\n  map,\n  pluck,\n  sample,\n  share,\n  skip,\n  switchMap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport {\n  Viewport,\n  ViewportOffset,\n  getElement,\n  isAnchorLocation,\n  isLocalLocation,\n  replaceElement,\n  setLocation,\n  setLocationHash,\n  setToggle,\n  setViewportOffset\n} from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * History state\n */\ninterface State {\n  url: URL                             /* State URL */\n  offset?: ViewportOffset              /* State viewport offset */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  document$: Subject<Document>         /* Document subject */\n  location$: Subject<URL>              /* Location subject */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up instant loading\n *\n * When fetching, theoretically, we could use `responseType: \"document\"`, but\n * since all MkDocs links are relative, we need to make sure that the current\n * location matches the document we just loaded. Otherwise any relative links\n * in the document could use the old location.\n *\n * This is the reason why we need to synchronize history events and the process\n * of fetching the document for navigation changes (except `popstate` events):\n *\n * 1. Fetch document via `XMLHTTPRequest`\n * 2. Set new location via `history.pushState`\n * 3. Parse and emit fetched document\n *\n * For `popstate` events, we must not use `history.pushState`, or the forward\n * history will be irreversibly overwritten. In case the request fails, the\n * location change is dispatched regularly.\n *\n * @param options - Options\n */\nexport function setupInstantLoading(\n  urls: string[], { document$, viewport$, location$ }: SetupOptions\n): void {\n\n  /* Disable automatic scroll restoration */\n  if (\"scrollRestoration\" in history)\n    history.scrollRestoration = \"manual\"\n\n  /* Hack: ensure that reloads restore viewport offset */\n  fromEvent(window, \"beforeunload\")\n    .subscribe(() => {\n      history.scrollRestoration = \"auto\"\n    })\n\n  /* Hack: ensure absolute favicon link to omit 404s on document switch */\n  const favicon = getElement<HTMLLinkElement>(`link[rel=\"shortcut icon\"]`)\n  if (typeof favicon !== \"undefined\")\n    favicon.href = favicon.href // tslint:disable-line no-self-assignment\n\n  /* Intercept link clicks and convert to state change */\n  const state$ = fromEvent<MouseEvent>(document.body, \"click\")\n    .pipe(\n      filter(ev => !(ev.metaKey || ev.ctrlKey)),\n      switchMap(ev => {\n        if (ev.target instanceof HTMLElement) {\n          const el = ev.target.closest(\"a\")\n          if (\n            el && !el.target &&\n            isLocalLocation(el) &&\n            urls.includes(el.href)\n          ) {\n            if (!isAnchorLocation(el))\n              ev.preventDefault()\n            return of(el)\n          }\n        }\n        return NEVER\n      }),\n      map(el => ({ url: new URL(el.href) })),\n      share<State>()\n    )\n\n  /* Always close search on link click */\n  state$.subscribe(() => {\n    setToggle(\"search\", false)\n  })\n\n  /* Filter state changes to dispatch */\n  const push$ = state$\n    .pipe(\n      filter(({ url }) => !isAnchorLocation(url)),\n      share()\n    )\n\n  /* Intercept popstate events (history back and forward) */\n  const pop$ = fromEvent<PopStateEvent>(window, \"popstate\")\n    .pipe(\n      filter(ev => ev.state !== null),\n      map(ev => ({\n        url: new URL(location.href),\n        offset: ev.state\n      })),\n      share<State>()\n    )\n\n  /* Emit location change */\n  merge(push$, pop$)\n    .pipe(\n      distinctUntilChanged((prev, next) => prev.url.href === next.url.href),\n      pluck(\"url\")\n    )\n      .subscribe(location$)\n\n  /* Fetch document on location change */\n  const ajax$ = location$\n    .pipe(\n      distinctUntilKeyChanged(\"pathname\"),\n      skip(1),\n      switchMap(url => ajax({\n        url: url.href,\n        responseType: \"text\",\n        withCredentials: true\n      })\n        .pipe(\n          catchError(() => {\n            setLocation(url)\n            return NEVER\n          })\n        )\n      )\n    )\n\n  /* Set new location as soon as the document was fetched */\n  push$\n    .pipe(\n      sample(ajax$)\n    )\n      .subscribe(({ url }) => {\n        history.pushState({}, \"\", url.toString())\n      })\n\n  /* Parse and emit document */\n  const dom = new DOMParser()\n  ajax$\n    .pipe(\n      map(({ response }) => dom.parseFromString(response, \"text/html\"))\n    )\n      .subscribe(document$)\n\n  /* Intercept instant loading */\n  const instant$ = merge(push$, pop$)\n    .pipe(\n      sample(document$)\n    )\n\n  // TODO: this must be combined with search scroll restoration on mobile\n  instant$.subscribe(({ url, offset }) => {\n    if (url.hash && !offset) {\n      setLocationHash(url.hash)\n    } else {\n      setViewportOffset(offset || { y: 0 })\n    }\n  })\n\n  /* Replace document metadata */\n  instant$\n    .pipe(\n      withLatestFrom(document$)\n    )\n      .subscribe(([, { title, head }]) => {\n        document.dispatchEvent(new CustomEvent(\"DOMContentSwitch\"))\n        document.title = title\n\n        /* Replace meta tags */\n        for (const selector of [\n          `link[rel=\"canonical\"]`,\n          `meta[name=\"author\"]`,\n          `meta[name=\"description\"]`\n        ]) {\n          const next = getElement(selector, head)\n          const prev = getElement(selector, document.head)\n          if (\n            typeof next !== \"undefined\" &&\n            typeof prev !== \"undefined\"\n          ) {\n            replaceElement(prev, next)\n          }\n        }\n      })\n\n  /* Debounce update of viewport offset */\n  viewport$\n    .pipe(\n      debounceTime(250),\n      distinctUntilKeyChanged(\"offset\")\n    )\n      .subscribe(({ offset }) => {\n        history.replaceState(offset, \"\")\n      })\n\n  /* Set viewport offset from history */\n  merge(state$, pop$)\n    .pipe(\n      bufferCount(2, 1),\n      filter(([prev, next]) => {\n        return prev.url.pathname === next.url.pathname\n            && !isAnchorLocation(next.url)\n      }),\n      map(([, state]) => state)\n    )\n      .subscribe(({ offset }) => {\n        setViewportOffset(offset || { y: 0 })\n      })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport {\n  filter,\n  map,\n  share,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport {\n  Key,\n  getActiveElement,\n  getElement,\n  getElements,\n  getToggle,\n  isSusceptibleToKeyboard,\n  setElementFocus,\n  setElementSelection,\n  setToggle,\n  watchKeyboard\n} from \"browser\"\nimport { useComponent } from \"components\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Keyboard mode\n */\nexport type KeyboardMode =\n  | \"global\"                           /* Global */\n  | \"search\"                           /* Search is open */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Keyboard\n */\nexport interface Keyboard extends Key {\n  mode: KeyboardMode                   /* Keyboard mode */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up keyboard\n *\n * This function will set up the keyboard handlers and ensure that keys are\n * correctly propagated. Currently there are two modes:\n *\n * - `global`: This mode is active when the search is closed. It is intended\n *   to assign hotkeys to specific functions of the site. Currently the search,\n *   previous and next page can be triggered.\n *\n * - `search`: This mode is active when the search is open. It maps certain\n *   navigational keys to offer search results that can be entirely navigated\n *   through keyboard input.\n *\n * The keyboard observable is returned and can be used to monitor the keyboard\n * in order toassign further hotkeys to custom functions.\n *\n * @return Keyboard observable\n */\nexport function setupKeyboard(): Observable<Keyboard> {\n  const keyboard$ = watchKeyboard()\n    .pipe(\n      map<Key, Keyboard>(key => ({\n        mode: getToggle(\"search\") ? \"search\" : \"global\",\n        ...key\n      })),\n      filter(({ mode }) => {\n        if (mode === \"global\") {\n          const active = getActiveElement()\n          if (typeof active !== \"undefined\")\n            return !isSusceptibleToKeyboard(active)\n        }\n        return true\n      }),\n      share()\n    )\n\n  /* Set up search keyboard handlers */\n  keyboard$\n    .pipe(\n      filter(({ mode }) => mode === \"search\"),\n      withLatestFrom(\n        useComponent(\"search-query\"),\n        useComponent(\"search-result\")\n      )\n    )\n      .subscribe(([key, query, result]) => {\n        const active = getActiveElement()\n        switch (key.type) {\n\n          /* Enter: prevent form submission */\n          case \"Enter\":\n            if (active === query)\n              key.claim()\n            break\n\n          /* Escape or Tab: close search */\n          case \"Escape\":\n          case \"Tab\":\n            setToggle(\"search\", false)\n            setElementFocus(query, false)\n            break\n\n          /* Vertical arrows: select previous or next search result */\n          case \"ArrowUp\":\n          case \"ArrowDown\":\n            if (typeof active === \"undefined\") {\n              setElementFocus(query)\n            } else {\n              const els = [query, ...getElements(\"[href]\", result)]\n              const i = Math.max(0, (\n                Math.max(0, els.indexOf(active)) + els.length + (\n                  key.type === \"ArrowUp\" ? -1 : +1\n                )\n              ) % els.length)\n              setElementFocus(els[i])\n            }\n\n            /* Prevent scrolling of page */\n            key.claim()\n            break\n\n          /* All other keys: hand to search query */\n          default:\n            if (query !== getActiveElement())\n              setElementFocus(query)\n        }\n      })\n\n  /* Set up global keyboard handlers */\n  keyboard$\n    .pipe(\n      filter(({ mode }) => mode === \"global\"),\n      withLatestFrom(useComponent(\"search-query\"))\n    )\n      .subscribe(([key, query]) => {\n        switch (key.type) {\n\n          /* Open search and select query */\n          case \"f\":\n          case \"s\":\n          case \"/\":\n            setElementFocus(query)\n            setElementSelection(query)\n            key.claim()\n            break\n\n          /* Go to previous page */\n          case \"p\":\n          case \",\":\n            const prev = getElement(\"[href][rel=prev]\")\n            if (typeof prev !== \"undefined\")\n              prev.click()\n            break\n\n          /* Go to next page */\n          case \"n\":\n          case \".\":\n            const next = getElement(\"[href][rel=next]\")\n            if (typeof next !== \"undefined\")\n              next.click()\n            break\n        }\n      })\n\n  /* Return keyboard */\n  return keyboard$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { EMPTY, Observable, of } from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  map,\n  scan,\n  shareReplay,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { getElement, replaceElement } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component\n */\nexport type Component =\n  | \"announce\"                         /* Announcement bar */\n  | \"container\"                        /* Container */\n  | \"header\"                           /* Header */\n  | \"header-title\"                     /* Header title */\n  | \"hero\"                             /* Hero */\n  | \"main\"                             /* Main area */\n  | \"navigation\"                       /* Navigation */\n  | \"search\"                           /* Search */\n  | \"search-query\"                     /* Search input */\n  | \"search-reset\"                     /* Search reset */\n  | \"search-result\"                    /* Search results */\n  | \"skip\"                             /* Skip link */\n  | \"tabs\"                             /* Tabs */\n  | \"toc\"                              /* Table of contents */\n\n/**\n * Component map\n */\nexport type ComponentMap = {\n  [P in Component]?: HTMLElement\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Component map observable\n */\nlet components$: Observable<ComponentMap>\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up bindings to components with given names\n *\n * This function will maintain bindings to the elements identified by the given\n * names in-between document switches and update the elements in-place.\n *\n * @param names - Component names\n * @param options - Options\n */\nexport function setupComponents(\n  names: Component[], { document$ }: WatchOptions\n): void {\n  components$ = document$\n    .pipe(\n\n      /* Build component map */\n      map(document => names.reduce<ComponentMap>((components, name) => {\n        const el = getElement(`[data-md-component=${name}]`, document)\n        return {\n          ...components,\n          ...typeof el !== \"undefined\" ? { [name]: el } : {}\n        }\n      }, {})),\n\n      /* Re-compute component map on document switch */\n      scan((prev, next) => {\n        for (const name of names) {\n          switch (name) {\n\n            /* Top-level components: update */\n            case \"announce\":\n            case \"header-title\":\n            case \"container\":\n            case \"skip\":\n              if (name in prev && typeof prev[name] !== \"undefined\") {\n                replaceElement(prev[name]!, next[name]!)\n                prev[name] = next[name]\n              }\n              break\n\n            /* All other components: rebind */\n            default:\n              if (typeof next[name] !== \"undefined\")\n                prev[name] = getElement(`[data-md-component=${name}]`)\n              else\n                delete prev[name]\n          }\n        }\n        return prev\n      }),\n\n      /* Convert to hot observable */\n      shareReplay(1)\n    )\n}\n\n/**\n * Retrieve a component\n *\n * The returned observable will only re-emit if the element changed, i.e. if\n * it was replaced from a document which was switched to.\n *\n * @template T - Element type\n *\n * @param name - Component name\n *\n * @return Component observable\n */\nexport function useComponent<T extends HTMLInputElement>(\n  name: \"search-query\"\n): Observable<T>\nexport function useComponent<T extends HTMLElement>(\n  name: Component\n): Observable<T>\nexport function useComponent<T extends HTMLElement>(\n  name: Component\n): Observable<T> {\n  return components$\n    .pipe(\n      switchMap(components => (\n        typeof components[name] !== \"undefined\"\n          ? of(components[name] as T)\n          : EMPTY\n      )),\n      distinctUntilChanged()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set anchor blur\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is blurred\n */\nexport function setAnchorBlur(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"blur\" : \"\")\n}\n\n/**\n * Reset anchor blur\n *\n * @param el - Anchor element\n */\nexport function resetAnchorBlur(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set anchor active\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is active\n */\nexport function setAnchorActive(\n  el: HTMLElement, value: boolean\n): void {\n  el.classList.toggle(\"md-nav__link--active\", value)\n}\n\n/**\n * Reset anchor active\n *\n * @param el - Anchor element\n */\nexport function resetAnchorActive(\n  el: HTMLElement\n): void {\n  el.classList.remove(\"md-nav__link--active\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./sidebar\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  container: \"md-clipboard md-icon\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Path of `file-search-outline` icon\n */\nconst path =\n  \"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 \" +\n  \"21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a 'copy-to-clipboard' button\n *\n * @param id - Unique identifier\n *\n * @return Element\n */\nexport function renderClipboardButton(\n  id: string\n) {\n  return (\n    <button\n      class={css.container}\n      title={translate(\"clipboard.copy\")}\n      data-clipboard-target={`#${id} > code`}\n    >\n      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n        <path d={path}></path>\n      </svg>\n    </button>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchResult } from \"integrations/search\"\nimport { h, truncate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  item:    \"md-search-result__item\",\n  link:    \"md-search-result__link\",\n  article: \"md-search-result__article md-search-result__article--document\",\n  section: \"md-search-result__article\",\n  title:   \"md-search-result__title\",\n  teaser:  \"md-search-result__teaser\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Path of `content-copy` icon\n */\nconst path =\n  \"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H13C12.59,21.75 12.2,21.44 \" +\n  \"11.86,21.1C11.53,20.77 11.25,20.4 11,20H6V4H13V9H18V10.18C18.71,10.34 \" +\n  \"19.39,10.61 20,11V8L14,2M20.31,18.9C21.64,16.79 21,14 \" +\n  \"18.91,12.68C16.8,11.35 14,12 12.69,14.08C11.35,16.19 12,18.97 \" +\n  \"14.09,20.3C15.55,21.23 17.41,21.23 \" +\n  \"18.88,20.32L22,23.39L23.39,22L20.31,18.9M16.5,19A2.5,2.5 0 0,1 \" +\n  \"14,16.5A2.5,2.5 0 0,1 16.5,14A2.5,2.5 0 0,1 19,16.5A2.5,2.5 0 0,1 16.5,19Z\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search result\n *\n * @param result - Search result\n *\n * @return Element\n */\nexport function renderSearchResult(\n  { article, sections }: SearchResult\n) {\n\n  /* Render icon */\n  const icon = (\n    <div class=\"md-search-result__icon md-icon\">\n      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n        <path d={path}></path>\n      </svg>\n    </div>\n  )\n\n  /* Render article and sections */\n  const children = [article, ...sections].map(document => {\n    const { location, title, text } = document\n    return (\n      <a href={location} class={css.link} tabIndex={-1}>\n        <article class={\"parent\" in document ? css.section : css.article}>\n          {!(\"parent\" in document) && icon}\n          <h1 class={css.title}>{title}</h1>\n          {text.length > 0 && <p class={css.teaser}>{truncate(text, 320)}</p>}\n        </article>\n      </a>\n    )\n  })\n\n  /* Render search result */\n  return (\n    <li class={css.item}>\n      {children}\n    </li>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SourceFacts } from \"patches/source\"\nimport { h } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  facts: \"md-source__facts\",\n  fact:  \"md-source__fact\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render source facts\n *\n * @param facts - Source facts\n *\n * @return Element\n */\nexport function renderSource(\n  facts: SourceFacts\n) {\n  const children = facts.map(fact => (\n    <li class={css.fact}>{fact}</li>\n  ))\n  return (\n    <ul class={css.facts}>\n      {children}\n    </ul>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  wrapper: \"md-typeset__scrollwrap\",\n  table:   \"md-typeset__table\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a table inside a wrapper to improve scrolling on mobile\n *\n * @param table - Table element\n *\n * @return Element\n */\nexport function renderTable(\n  table: HTMLTableElement\n) {\n  return (\n    <div class={css.wrapper}>\n      <div class={css.table}>\n        {table}\n      </div>\n    </div>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar offset\n *\n * @param el - Sidebar element\n * @param value - Sidebar offset\n */\nexport function setSidebarOffset(\n  el: HTMLElement, value: number\n): void {\n  el.style.top = `${value}px`\n}\n\n/**\n * Reset sidebar offset\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarOffset(\n  el: HTMLElement\n): void {\n  el.style.top = \"\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar height\n *\n * @param el - Sidebar element\n * @param value - Sidebar height\n */\nexport function setSidebarHeight(\n  el: HTMLElement, value: number\n): void {\n  el.style.height = `${value}px`\n}\n\n/**\n * Reset sidebar height\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarHeight(\n  el: HTMLElement\n): void {\n  el.style.height = \"\"\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./react\"\nexport * from \"./set\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  ArticleDocument,\n  SearchDocumentMap,\n  SectionDocument,\n  setupSearchDocumentMap\n} from \"../document\"\nimport {\n  SearchHighlightFactoryFn,\n  setupSearchHighlighter\n} from \"../highlighter\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index configuration\n */\nexport interface SearchIndexConfig {\n  lang: string[]                       /* Search languages */\n  separator: string                    /* Search separator */\n}\n\n/**\n * Search index document\n */\nexport interface SearchIndexDocument {\n  location: string                     /* Document location */\n  title: string                        /* Document title */\n  text: string                         /* Document text */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index pipeline function\n */\nexport type SearchIndexPipelineFn =\n  | \"trimmer\"                          /* Trimmer */\n  | \"stopWordFilter\"                   /* Stop word filter */\n  | \"stemmer\"                          /* Stemmer */\n\n/**\n * Search index pipeline\n */\nexport type SearchIndexPipeline = SearchIndexPipelineFn[]\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index\n *\n * This interfaces describes the format of the `search_index.json` file which\n * is automatically built by the MkDocs search plugin.\n */\nexport interface SearchIndex {\n  config: SearchIndexConfig            /* Search index configuration */\n  docs: SearchIndexDocument[]          /* Search index documents */\n  index?: object | string              /* Prebuilt or serialized index */\n  pipeline?: SearchIndexPipeline       /* Search index pipeline */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search result\n */\nexport interface SearchResult {\n  article: ArticleDocument             /* Article document */\n  sections: SectionDocument[]          /* Section documents */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Compute the difference of two lists of strings\n *\n * @param a - 1st list of strings\n * @param b - 2nd list of strings\n *\n * @return Difference\n */\nfunction difference(a: string[], b: string[]): string[] {\n  const [x, y] = [new Set(a), new Set(b)]\n  return [\n    ...new Set([...x].filter(value => !y.has(value)))\n  ]\n}\n\n/* ----------------------------------------------------------------------------\n * Class\n * ------------------------------------------------------------------------- */\n\n/**\n * Search\n *\n * Note that `lunr` is injected via Webpack, as it will otherwise also be\n * bundled in the application bundle.\n */\nexport class Search {\n\n  /**\n   * Search document mapping\n   *\n   * A mapping of URLs (including hash fragments) to the actual articles and\n   * sections of the documentation. The search document mapping must be created\n   * regardless of whether the index was prebuilt or not, as `lunr` itself will\n   * only store the actual index.\n   */\n  protected documents: SearchDocumentMap\n\n  /**\n   * Search highlight factory function\n   */\n  protected highlight: SearchHighlightFactoryFn\n\n  /**\n   * The `lunr` search index\n   */\n  protected index: lunr.Index\n\n  /**\n   * Create the search integration\n   *\n   * @param data - Search index\n   */\n  public constructor({ config, docs, pipeline, index }: SearchIndex) {\n    this.documents = setupSearchDocumentMap(docs)\n    this.highlight = setupSearchHighlighter(config)\n\n    /* Set separator for tokenizer */\n    lunr.tokenizer.separator = new RegExp(config.separator)\n\n    /* If no index was given, create it */\n    if (typeof index === \"undefined\") {\n      this.index = lunr(function() {\n\n        /* Set up alternate search languages */\n        if (config.lang.length === 1 && config.lang[0] !== \"en\") {\n          this.use((lunr as any)[config.lang[0]])\n        } else if (config.lang.length > 1) {\n          this.use((lunr as any).multiLanguage(...config.lang))\n        }\n\n        /* Compute functions to be removed from the pipeline */\n        const fns = difference([\n          \"trimmer\", \"stopWordFilter\", \"stemmer\"\n        ], pipeline!)\n\n        /* Remove functions from the pipeline for every language */\n        for (const lang of config.lang.map(language => (\n          language === \"en\" ? lunr : (lunr as any)[language]\n        ))) {\n          for (const fn of fns) {\n            this.pipeline.remove(lang[fn])\n            this.searchPipeline.remove(lang[fn])\n          }\n        }\n\n        /* Set up fields and reference */\n        this.field(\"title\", { boost: 1000 })\n        this.field(\"text\")\n        this.ref(\"location\")\n\n        /* Index documents */\n        for (const doc of docs)\n          this.add(doc)\n      })\n\n    /* Prebuilt or serialized index */\n    } else {\n      this.index = lunr.Index.load(\n        typeof index === \"string\"\n          ? JSON.parse(index)\n          : index\n      )\n    }\n  }\n\n  /**\n   * Search for matching documents\n   *\n   * The search index which MkDocs provides is divided up into articles, which\n   * contain the whole content of the individual pages, and sections, which only\n   * contain the contents of the subsections obtained by breaking the individual\n   * pages up at `h1` ... `h6`. As there may be many sections on different pages\n   * with identical titles (for example within this very project, e.g. \"Usage\"\n   * or \"Installation\"), they need to be put into the context of the containing\n   * page. For this reason, section results are grouped within their respective\n   * articles which are the top-level results that are returned.\n   *\n   * @param value - Query value\n   *\n   * @return Search results\n   */\n  public query(value: string): SearchResult[] {\n    if (value) {\n      try {\n\n        /* Group sections by containing article */\n        const groups = this.index.search(value)\n          .reduce((results, result) => {\n            const document = this.documents.get(result.ref)\n            if (typeof document !== \"undefined\") {\n              if (\"parent\" in document) {\n                const ref = document.parent.location\n                results.set(ref, [...results.get(ref) || [], result])\n              } else {\n                const ref = document.location\n                results.set(ref, results.get(ref) || [])\n              }\n            }\n            return results\n          }, new Map<string, lunr.Index.Result[]>())\n\n        /* Create highlighter for query */\n        const fn = this.highlight(value)\n\n        /* Map groups to search documents */\n        return [...groups].map(([ref, sections]) => ({\n          article: fn(this.documents.get(ref) as ArticleDocument),\n          sections: sections.map(section => {\n            return fn(this.documents.get(section.ref) as SectionDocument)\n          })\n        }))\n\n      /* Log errors to console (for now) */\n      } catch (err) {\n        // tslint:disable-next-line no-console\n        console.warn(`Invalid query: ${value} – see https://bit.ly/2s3ChXG`)\n      }\n    }\n\n    /* Return nothing in case of error or empty query */\n    return []\n  }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport * as escapeHTML from \"escape-html\"\n\nimport { SearchIndexDocument } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * A top-level article\n */\nexport interface ArticleDocument extends SearchIndexDocument {\n  linked: boolean                      /* Whether the section was linked */\n}\n\n/**\n * A section of an article\n */\nexport interface SectionDocument extends SearchIndexDocument {\n  parent: ArticleDocument              /* Parent article */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search document\n */\nexport type SearchDocument =\n  | ArticleDocument\n  | SectionDocument\n\n/**\n * Search document mapping\n */\nexport type SearchDocumentMap = Map<string, SearchDocument>\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document mapping\n *\n * @param docs - Search index documents\n *\n * @return Search document map\n */\nexport function setupSearchDocumentMap(\n  docs: SearchIndexDocument[]\n): SearchDocumentMap {\n  const documents = new Map<string, SearchDocument>()\n  for (const doc of docs) {\n    const [path, hash] = doc.location.split(\"#\")\n\n    /* Extract location and title */\n    const location = doc.location\n    const title    = doc.title\n\n    /* Escape and cleanup text */\n    const text = escapeHTML(doc.text)\n      .replace(/\\s+(?=[,.:;!?])/g, \"\")\n      .replace(/\\s+/g, \" \")\n\n    /* Handle section */\n    if (hash) {\n      const parent = documents.get(path) as ArticleDocument\n\n      /* Ignore first section, override article */\n      if (!parent.linked) {\n        parent.title  = doc.title\n        parent.text   = text\n        parent.linked = true\n\n      /* Add subsequent section */\n      } else {\n        documents.set(location, {\n          location,\n          title,\n          text,\n          parent\n        })\n      }\n\n    /* Add article */\n    } else {\n      documents.set(location, {\n        location,\n        title,\n        text,\n        linked: false\n      })\n    }\n  }\n  return documents\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndexConfig } from \"../_\"\nimport { SearchDocument } from \"../document\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlight function\n *\n * @template T - Search document type\n *\n * @param document - Search document\n *\n * @return Highlighted document\n */\nexport type SearchHighlightFn = <\n  T extends SearchDocument\n>(document: Readonly<T>) => T\n\n/**\n * Search highlight factory function\n *\n * @param value - Query value\n *\n * @return Search highlight function\n */\nexport type SearchHighlightFactoryFn = (value: string) => SearchHighlightFn\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search highlighter\n *\n * @param config - Search index configuration\n *\n * @return Search highlight factory function\n */\nexport function setupSearchHighlighter(\n  config: SearchIndexConfig\n): SearchHighlightFactoryFn {\n  const separator = new RegExp(config.separator, \"img\")\n  const highlight = (_: unknown, data: string, term: string) => {\n    return `${data}<em>${term}</em>`\n  }\n\n  /* Return factory function */\n  return (value: string) => {\n    value = value\n      .replace(/[\\s*+\\-:~^]+/g, \" \")\n      .trim()\n\n    /* Create search term match expression */\n    const match = new RegExp(`(^|${config.separator})(${\n      value\n        .replace(/[|\\\\{}()[\\]^$+*?.-]/g, \"\\\\$&\")\n        .replace(separator, \"|\")\n    })`, \"img\")\n\n    /* Highlight document */\n    return document => ({\n      ...document,\n      title: document.title.replace(match, highlight),\n      text:  document.text.replace(match, highlight)\n    })\n  }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search transformation function\n *\n * @param value - Query value\n *\n * @return Transformed query value\n */\nexport type SearchTransformFn = (value: string) => string\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Default transformation function\n *\n * 1. Search for terms in quotation marks and prepend a `+` modifier to denote\n *    that the resulting document must contain all terms, converting the query\n *    to an `AND` query (as opposed to the default `OR` behavior). While users\n *    may expect terms enclosed in quotation marks to map to span queries, i.e.\n *    for which order is important, `lunr` doesn't support them, so the best\n *    we can do is to convert the terms to an `AND` query.\n *\n * 2. Replace control characters which are not located at the beginning of the\n *    query or preceded by white space, or are not followed by a non-whitespace\n *    character or are at the end of the query string. Furthermore, filter\n *    unmatched quotation marks.\n *\n * 3. Trim excess whitespace from left and right.\n *\n * 4. Append a wildcard to the end of every word to make every word a prefix\n *    query in order to provide a good type-ahead experience, by adding an\n *    asterisk (wildcard) in between terms, which can be denoted by whitespace,\n *    any non-control character, or a word boundary.\n *\n * @param value - Query value\n *\n * @return Transformed query value\n */\nexport function defaultTransform(value: string): string {\n  return value\n    .split(/\"([^\"]+)\"/g)                            /* => 1 */\n      .map((terms, i) => i & 1\n        ? terms.replace(/^\\b|^(?![^\\x00-\\x7F]|$)|\\s+/g, \" +\")\n        : terms\n      )\n      .join(\"\")\n    .replace(/\"|(?:^|\\s+)[*+\\-:^~]+(?=\\s+|$)/g, \"\") /* => 2 */\n    .trim()                                         /* => 3 */\n    .replace(/\\s+|(?![^\\x00-\\x7F]|^)$|\\b$/g, \"* \")  /* => 4 */\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndex, SearchResult } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search message type\n */\nexport const enum SearchMessageType {\n  SETUP,                               /* Search index setup */\n  READY,                               /* Search index ready */\n  QUERY,                               /* Search query */\n  RESULT                               /* Search results */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message containing the data necessary to setup the search index\n */\nexport interface SearchSetupMessage {\n  type: SearchMessageType.SETUP        /* Message type */\n  data: SearchIndex                    /* Message data */\n}\n\n/**\n * A message indicating the search index is ready\n */\nexport interface SearchReadyMessage {\n  type: SearchMessageType.READY       /* Message type */\n}\n\n/**\n * A message containing a search query\n */\nexport interface SearchQueryMessage {\n  type: SearchMessageType.QUERY        /* Message type */\n  data: string                         /* Message data */\n}\n\n/**\n * A message containing results for a search query\n */\nexport interface SearchResultMessage {\n  type: SearchMessageType.RESULT       /* Message type */\n  data: SearchResult[]                 /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message exchanged with the search worker\n */\nexport type SearchMessage =\n  | SearchSetupMessage\n  | SearchReadyMessage\n  | SearchQueryMessage\n  | SearchResultMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for search setup messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchSetupMessage(\n  message: SearchMessage\n): message is SearchSetupMessage {\n  return message.type === SearchMessageType.SETUP\n}\n\n/**\n * Type guard for search ready messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchReadyMessage(\n  message: SearchMessage\n): message is SearchReadyMessage {\n  return message.type === SearchMessageType.READY\n}\n\n/**\n * Type guard for search query messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchQueryMessage(\n  message: SearchMessage\n): message is SearchQueryMessage {\n  return message.type === SearchMessageType.QUERY\n}\n\n/**\n * Type guard for search result messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchResultMessage(\n  message: SearchMessage\n): message is SearchResultMessage {\n  return message.type === SearchMessageType.RESULT\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, Subject, asyncScheduler } from \"rxjs\"\nimport {\n  map,\n  observeOn,\n  shareReplay,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport { WorkerHandler, watchWorker } from \"browser\"\nimport { translate } from \"utilities\"\n\nimport { SearchIndex, SearchIndexPipeline } from \"../../_\"\nimport {\n  SearchMessage,\n  SearchMessageType,\n  SearchSetupMessage,\n  isSearchResultMessage\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  index$: Observable<SearchIndex>      /* Search index observable */\n  base$: Observable<string>            /* Location base observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search index\n *\n * @param data - Search index\n *\n * @return Search index\n */\nfunction setupSearchIndex(\n  { config, docs, index }: SearchIndex\n): SearchIndex {\n\n  /* Override default language with value from translation */\n  if (config.lang.length === 1 && config.lang[0] === \"en\")\n    config.lang = [translate(\"search.config.lang\")]\n\n  /* Override default separator with value from translation */\n  if (config.separator === \"[\\\\s\\\\-]+\")\n    config.separator = translate(\"search.config.separator\")\n\n  /* Set pipeline from translation */\n  const pipeline = translate(\"search.config.pipeline\")\n    .split(/\\s*,\\s*/)\n    .filter(identity) as SearchIndexPipeline\n\n  /* Return search index after defaulting */\n  return { config, docs, index, pipeline }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search web worker\n *\n * This function will create a web worker to set up and query the search index\n * which is done using `lunr`. The index must be passed as an observable to\n * enable hacks like _localsearch_ via search index embedding as JSON.\n *\n * @param url - Worker URL\n * @param options - Options\n *\n * @return Worker handler\n */\nexport function setupSearchWorker(\n  url: string, { index$, base$ }: SetupOptions\n): WorkerHandler<SearchMessage> {\n  const worker = new Worker(url)\n\n  /* Create communication channels and resolve relative links */\n  const tx$ = new Subject<SearchMessage>()\n  const rx$ = watchWorker(worker, { tx$ })\n    .pipe(\n      withLatestFrom(base$),\n      map(([message, base]) => {\n        if (isSearchResultMessage(message)) {\n          for (const { article, sections } of message.data) {\n            article.location = `${base}/${article.location}`\n            for (const section of sections)\n              section.location = `${base}/${section.location}`\n          }\n        }\n        return message\n      }),\n      shareReplay(1)\n    )\n\n  /* Set up search index */\n  index$\n    .pipe(\n      map<SearchIndex, SearchSetupMessage>(index => ({\n        type: SearchMessageType.SETUP,\n        data: setupSearchIndex(index)\n      })),\n      observeOn(asyncScheduler)\n    )\n      .subscribe(tx$.next.bind(tx$))\n\n  /* Return worker handler */\n  return { tx$, rx$ }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./react\"\nexport * from \"./set\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  combineLatest,\n  pipe\n} from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  finalize,\n  map,\n  observeOn,\n  tap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport { Viewport } from \"browser\"\n\nimport { Header } from \"../../../header\"\nimport { Main } from \"../../../main\"\nimport { Sidebar } from \"../_\"\nimport {\n  resetSidebarHeight,\n  resetSidebarOffset,\n  setSidebarHeight,\n  setSidebarOffset\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  main$: Observable<Main>              /* Main area observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/**\n * Apply options\n */\ninterface ApplyOptions {\n  header$: Observable<Header>          /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch sidebar\n *\n * This function returns an observable that computes the visual parameters of\n * the sidebar which depends on the vertical viewport offset, as well as the\n * height of the main area. When the page is scrolled beyond the header, the\n * sidebar is locked and fills the remaining space.\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @return Sidebar observable\n */\nexport function watchSidebar(\n  el: HTMLElement, { main$, viewport$ }: WatchOptions\n): Observable<Sidebar> {\n  const adjust = el.parentElement!.offsetTop\n               - el.parentElement!.parentElement!.offsetTop\n\n  /* Compute the sidebar's available height and if it should be locked */\n  return combineLatest([main$, viewport$])\n    .pipe(\n      map(([{ offset, height }, { offset: { y } }]) => {\n        height = height\n          + Math.min(adjust, Math.max(0, y - offset))\n          - adjust\n        return {\n          height,\n          lock: y >= offset + adjust\n        }\n      }),\n      distinctUntilChanged<Sidebar>((a, b) => {\n        return a.height === b.height\n            && a.lock   === b.lock\n      })\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply sidebar\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function applySidebar(\n  el: HTMLElement, { header$ }: ApplyOptions\n): MonoTypeOperatorFunction<Sidebar> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    withLatestFrom(header$),\n    tap(([{ height, lock }, { height: offset }]) => {\n      setSidebarHeight(el, height)\n\n      /* Set offset in locked state depending on header height */\n      if (lock)\n        setSidebarOffset(el, offset)\n      else\n        resetSidebarOffset(el)\n    }),\n\n    /* Re-map to sidebar */\n    map(([sidebar]) => sidebar),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetSidebarOffset(el)\n      resetSidebarHeight(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./anchor\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  Observable,\n  OperatorFunction,\n  combineLatest,\n  of,\n  pipe\n} from \"rxjs\"\nimport { map, switchMap } from \"rxjs/operators\"\n\nimport { Viewport, getElements } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { Main } from \"../../main\"\nimport {\n  Sidebar,\n  applySidebar,\n  watchSidebar\n} from \"../../shared\"\nimport {\n  AnchorList,\n  applyAnchorList,\n  watchAnchorList\n} from \"../anchor\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Table of contents for [tablet -]\n */\ninterface TableOfContentsBelowTablet {} // tslint:disable-line\n\n/**\n * Table of contents for [tablet +]\n */\ninterface TableOfContentsAboveTablet {\n  sidebar: Sidebar                     /* Sidebar */\n  anchors: AnchorList                  /* Anchor list */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Table of contents\n */\nexport type TableOfContents =\n  | TableOfContentsBelowTablet\n  | TableOfContentsAboveTablet\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  main$: Observable<Main>              /* Main area observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n  tablet$: Observable<boolean>         /* Tablet media observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount table of contents from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTableOfContents(\n  { header$, main$, viewport$, tablet$ }: MountOptions\n): OperatorFunction<HTMLElement, TableOfContents> {\n  return pipe(\n    switchMap(el => tablet$\n      .pipe(\n        switchMap(tablet => {\n\n          /* [tablet +]: Mount table of contents in sidebar */\n          if (tablet) {\n            const els = getElements<HTMLAnchorElement>(\".md-nav__link\", el)\n\n            /* Watch and apply sidebar */\n            const sidebar$ = watchSidebar(el, { main$, viewport$ })\n              .pipe(\n                applySidebar(el, { header$ })\n              )\n\n            /* Watch and apply anchor list (scroll spy) */\n            const anchors$ = watchAnchorList(els, { header$, viewport$ })\n              .pipe(\n                applyAnchorList(els)\n              )\n\n            /* Combine into single hot observable */\n            return combineLatest([sidebar$, anchors$])\n              .pipe(\n                map(([sidebar, anchors]) => ({ sidebar, anchors }))\n              )\n\n          /* [tablet -]: Unmount table of contents */\n          } else {\n            return of({})\n          }\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { reverse } from \"ramda\"\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  combineLatest,\n  pipe\n} from \"rxjs\"\nimport {\n  bufferCount,\n  distinctUntilChanged,\n  distinctUntilKeyChanged,\n  finalize,\n  map,\n  observeOn,\n  scan,\n  startWith,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { Viewport, getElement, watchElementSize } from \"browser\"\n\nimport { Header } from \"../../../header\"\nimport { AnchorList } from \"../_\"\nimport {\n  resetAnchorActive,\n  resetAnchorBlur,\n  setAnchorActive,\n  setAnchorBlur\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch anchor list\n *\n * This is effectively a scroll-spy implementation which will account for the\n * fixed header and automatically re-calculate anchor offsets when the viewport\n * is resized. The returned observable will only emit if the anchor list needs\n * to be repainted.\n *\n * This implementation tracks an anchor element's entire path starting from its\n * level up to the top-most anchor element, e.g. `[h3, h2, h1]`. Although the\n * Material theme currently doesn't make use of this information, it enables\n * the styling of the entire hierarchy through customization.\n *\n * Note that the current anchor is the last item of the `prev` anchor list.\n *\n * @param els - Anchor elements\n * @param options - Options\n *\n * @return Anchor list observable\n */\nexport function watchAnchorList(\n  els: HTMLAnchorElement[], { header$, viewport$ }: WatchOptions\n): Observable<AnchorList> {\n  const table = new Map<HTMLAnchorElement, HTMLElement>()\n  for (const el of els) {\n    const id = decodeURIComponent(el.hash.substring(1))\n    const target = getElement(`[id=\"${id}\"]`)\n    if (typeof target !== \"undefined\")\n      table.set(el, target)\n  }\n\n  /* Compute necessary adjustment for header */\n  const adjust$ = header$\n    .pipe(\n      map(header => 18 + header.height)\n    )\n\n  /* Compute partition of previous and next anchors */\n  const partition$ = watchElementSize(document.body)\n    .pipe(\n      distinctUntilKeyChanged(\"height\"),\n\n      /* Build index to map anchor paths to vertical offsets */\n      map(() => {\n        let path: HTMLAnchorElement[] = []\n        return [...table].reduce((index, [anchor, target]) => {\n          while (path.length) {\n            const last = table.get(path[path.length - 1])!\n            if (last.tagName >= target.tagName) {\n              path.pop()\n            } else {\n              break\n            }\n          }\n\n          /* If the current anchor is hidden, continue with its parent */\n          let offset = target.offsetTop\n          while (!offset && target.parentElement) {\n            target = target.parentElement\n            offset = target.offsetTop\n          }\n\n          /* Map reversed anchor path to vertical offset */\n          return index.set(\n            reverse(path = [...path, anchor]),\n            offset\n          )\n        }, new Map<HTMLAnchorElement[], number>())\n      }),\n\n      /* Re-compute partition when viewport offset changes */\n      switchMap(index => combineLatest([adjust$, viewport$])\n        .pipe(\n          scan(([prev, next], [adjust, { offset: { y } }]) => {\n\n            /* Look forward */\n            while (next.length) {\n              const [, offset] = next[0]\n              if (offset - adjust < y) {\n                prev = [...prev, next.shift()!]\n              } else {\n                break\n              }\n            }\n\n            /* Look backward */\n            while (prev.length) {\n              const [, offset] = prev[prev.length - 1]\n              if (offset - adjust >= y) {\n                next = [prev.pop()!, ...next]\n              } else {\n                break\n              }\n            }\n\n            /* Return partition */\n            return [prev, next]\n          }, [[], [...index]]),\n          distinctUntilChanged((a, b) => {\n            return a[0] === b[0]\n                && a[1] === b[1]\n          })\n        )\n      )\n    )\n\n  /* Compute and return anchor list migrations */\n  return partition$\n    .pipe(\n      map(([prev, next]) => ({\n        prev: prev.map(([path]) => path),\n        next: next.map(([path]) => path)\n      })),\n\n      /* Extract anchor list migrations */\n      startWith({ prev: [], next: [] }),\n      bufferCount(2, 1),\n      map(([a, b]) => {\n\n        /* Moving down */\n        if (a.prev.length < b.prev.length) {\n          return {\n            prev: b.prev.slice(Math.max(0, a.prev.length - 1), b.prev.length),\n            next: []\n          }\n\n        /* Moving up */\n        } else {\n          return {\n            prev: b.prev.slice(-1),\n            next: b.next.slice(0, b.next.length - a.next.length)\n          }\n        }\n      })\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply anchor list\n *\n * @param els - Anchor elements\n *\n * @return Operator function\n */\nexport function applyAnchorList(\n  els: HTMLAnchorElement[]\n): MonoTypeOperatorFunction<AnchorList> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ prev, next }) => {\n\n      /* Look forward */\n      for (const [el] of next) {\n        resetAnchorActive(el)\n        resetAnchorBlur(el)\n      }\n\n      /* Look backward */\n      prev.forEach(([el], index) => {\n        setAnchorActive(el, index === prev.length - 1)\n        setAnchorBlur(el, true)\n      })\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      for (const el of els) {\n        resetAnchorActive(el)\n        resetAnchorBlur(el)\n      }\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport {\n  filter,\n  map,\n  mapTo,\n  sample,\n  startWith,\n  switchMap,\n  take\n} from \"rxjs/operators\"\n\nimport { WorkerHandler } from \"browser\"\nimport {\n  SearchMessage,\n  SearchResult,\n  isSearchQueryMessage,\n  isSearchReadyMessage\n} from \"integrations/search\"\n\nimport { SearchQuery } from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search status\n */\nexport type SearchStatus =\n  | \"waiting\"                          /* Search waiting for initialization */\n  | \"ready\"                            /* Search ready */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search\n */\nexport interface Search {\n  status: SearchStatus                 /* Search status */\n  query: SearchQuery                   /* Search query */\n  result: SearchResult[]               /* Search result list */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  query$: Observable<SearchQuery>      /* Search query observable */\n  reset$: Observable<void>             /* Search reset observable */\n  result$: Observable<SearchResult[]>  /* Search result observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search from source observable\n *\n * @param handler - Worker handler\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearch(\n  { rx$, tx$ }: WorkerHandler<SearchMessage>,\n  { query$, reset$, result$ }: MountOptions\n): OperatorFunction<HTMLElement, Search> {\n  return pipe(\n    switchMap(() => {\n\n      /* Compute search status */\n      const status$ = rx$\n        .pipe(\n          filter(isSearchReadyMessage),\n          mapTo<SearchStatus>(\"ready\"),\n          startWith(\"waiting\")\n        ) as Observable<SearchStatus>\n\n      /* Re-emit the latest query when search is ready */\n      tx$\n        .pipe(\n          filter(isSearchQueryMessage),\n          sample(status$),\n          take(1)\n        )\n          .subscribe(tx$.next.bind(tx$))\n\n      /* Combine into single observable */\n      return combineLatest([status$, query$, result$, reset$])\n        .pipe(\n          map(([status, query, result]) => ({\n            status,\n            query,\n            result\n          }))\n        )\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { OperatorFunction, pipe } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { WorkerHandler, setToggle } from \"browser\"\nimport {\n  SearchMessage,\n  SearchMessageType,\n  SearchQueryMessage,\n  SearchTransformFn\n} from \"integrations\"\n\nimport { watchSearchQuery } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query\n */\nexport interface SearchQuery {\n  value: string                        /* Query value */\n  focus: boolean                       /* Query focus */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  transform?: SearchTransformFn        /* Transformation function */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search query from source observable\n *\n * @param handler - Worker handler\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearchQuery(\n  { tx$ }: WorkerHandler<SearchMessage>, options: MountOptions = {}\n): OperatorFunction<HTMLInputElement, SearchQuery> {\n  return pipe(\n    switchMap(el => {\n      const query$ = watchSearchQuery(el, options)\n\n      /* Subscribe worker to search query */\n      query$\n        .pipe(\n          distinctUntilKeyChanged(\"value\"),\n          map(({ value }): SearchQueryMessage => ({\n            type: SearchMessageType.QUERY,\n            data: value\n          }))\n        )\n          .subscribe(tx$.next.bind(tx$))\n\n      /* Toggle search on focus */\n      query$\n        .pipe(\n          distinctUntilKeyChanged(\"focus\")\n        )\n          .subscribe(({ focus }) => {\n            if (focus)\n              setToggle(\"search\", focus)\n          })\n\n      /* Return search query */\n      return query$\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest, fromEvent, merge } from \"rxjs\"\nimport {\n  delay,\n  distinctUntilChanged,\n  map,\n  startWith\n} from \"rxjs/operators\"\n\nimport { watchElementFocus } from \"browser\"\nimport { SearchTransformFn, defaultTransform } from \"integrations\"\n\nimport { SearchQuery } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  transform?: SearchTransformFn        /* Transformation function */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search query\n *\n * Note that the focus event which triggers re-reading the current query value\n * is delayed by `1ms` so the input's empty state is allowed to propagate.\n *\n * @param el - Search query element\n * @param options - Options\n *\n * @return Search query observable\n */\nexport function watchSearchQuery(\n  el: HTMLInputElement, { transform }: WatchOptions = {}\n): Observable<SearchQuery> {\n  const fn = transform || defaultTransform\n\n  /* Intercept keyboard events */\n  const value$ = merge(\n    fromEvent(el, \"keyup\"),\n    fromEvent(el, \"focus\").pipe(delay(1))\n  )\n    .pipe(\n      map(() => fn(el.value)),\n      startWith(fn(el.value)),\n      distinctUntilChanged()\n    )\n\n  /* Intercept focus events */\n  const focus$ = watchElementFocus(el)\n\n  /* Combine into single observable */\n  return combineLatest([value$, focus$])\n    .pipe(\n      map(([value, focus]) => ({ value, focus }))\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { OperatorFunction, pipe } from \"rxjs\"\nimport {\n  mapTo,\n  startWith,\n  switchMap,\n  switchMapTo,\n  tap\n} from \"rxjs/operators\"\n\nimport { setElementFocus } from \"browser\"\n\nimport { useComponent } from \"../../../_\"\nimport { watchSearchReset } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search reset from source observable\n *\n * @return Operator function\n */\nexport function mountSearchReset(): OperatorFunction<HTMLElement, void> {\n  return pipe(\n    switchMap(el => watchSearchReset(el)\n      .pipe(\n        switchMapTo(useComponent(\"search-query\")),\n        tap(setElementFocus),\n        mapTo(undefined)\n      )\n    ),\n    startWith(undefined)\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { mapTo } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search reset\n *\n * @param el - Search reset element\n *\n * @return Search reset observable\n */\nexport function watchSearchReset(\n  el: HTMLElement\n): Observable<void> {\n  return fromEvent(el, \"click\")\n    .pipe(\n      mapTo(undefined)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set number of search results\n *\n * @param el - Search result metadata element\n * @param value - Number of results\n */\nexport function setSearchResultMeta(\n  el: HTMLElement, value: number\n): void {\n  switch (value) {\n\n    /* No results */\n    case 0:\n      el.textContent = translate(\"search.result.none\")\n      break\n\n    /* One result */\n    case 1:\n      el.textContent = translate(\"search.result.one\")\n      break\n\n    /* Multiple result */\n    default:\n      el.textContent = translate(\"search.result.other\", value.toString())\n  }\n}\n\n/**\n * Reset number of search results\n *\n * @param el - Search result metadata element\n */\nexport function resetSearchResultMeta(\n  el: HTMLElement\n): void {\n  el.textContent = translate(\"search.result.placeholder\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Add an element to the search result list\n *\n * @param el - Search result list element\n * @param child - Search result element\n */\nexport function addToSearchResultList(\n  el: HTMLElement, child: Element\n): void {\n  el.appendChild(child)\n}\n\n/**\n * Reset search result list\n *\n * @param el - Search result list element\n */\nexport function resetSearchResultList(\n  el: HTMLElement\n): void {\n  el.innerHTML = \"\"\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  pipe\n} from \"rxjs\"\nimport {\n  finalize,\n  map,\n  mapTo,\n  observeOn,\n  scan,\n  switchMap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport { getElementOrThrow } from \"browser\"\nimport { SearchResult } from \"integrations/search\"\nimport { renderSearchResult } from \"templates\"\n\nimport { SearchQuery } from \"../../query\"\nimport {\n  addToSearchResultList,\n  resetSearchResultList,\n  resetSearchResultMeta,\n  setSearchResultMeta\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply options\n */\ninterface ApplyOptions {\n  query$: Observable<SearchQuery>     /* Search query observable */\n  ready$: Observable<boolean>         /* Search ready observable */\n  fetch$: Observable<boolean>         /* Result fetch observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply search results\n *\n * This function will perform a lazy rendering of the search results, depending\n * on the vertical offset of the search result container. When the scroll offset\n * reaches the bottom of the element, more results are fetched and rendered.\n *\n * @param el - Search result element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function applySearchResult(\n  el: HTMLElement, { query$, ready$, fetch$ }: ApplyOptions\n): MonoTypeOperatorFunction<SearchResult[]> {\n  const list = getElementOrThrow(\".md-search-result__list\", el)\n  const meta = getElementOrThrow(\".md-search-result__meta\", el)\n  return pipe(\n\n    /* Apply search result metadata */\n    withLatestFrom(query$, ready$),\n    map(([result, query]) => {\n      if (query.value) {\n        setSearchResultMeta(meta, result.length)\n      } else {\n        resetSearchResultMeta(meta)\n      }\n      return result\n    }),\n\n    /* Apply search result list */\n    switchMap(result => fetch$\n      .pipe(\n\n        /* Defer repaint to next animation frame */\n        observeOn(animationFrameScheduler),\n        scan(index => {\n          const container = el.parentElement!\n          while (index < result.length) {\n            addToSearchResultList(list, renderSearchResult(result[index++]))\n            if (container.scrollHeight - container.offsetHeight > 16)\n              break\n          }\n          return index\n        }, 0),\n\n        /* Re-map to search result */\n        mapTo(result),\n\n        /* Reset on complete or error */\n        finalize(() => {\n          resetSearchResultList(list)\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  filter,\n  map,\n  mapTo,\n  pluck,\n  startWith,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { WorkerHandler, watchElementOffset } from \"browser\"\nimport {\n  SearchMessage,\n  SearchResult,\n  isSearchReadyMessage,\n  isSearchResultMessage\n} from \"integrations\"\n\nimport { SearchQuery } from \"../../query\"\nimport { applySearchResult } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  query$: Observable<SearchQuery>      /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search result from source observable\n *\n * @param handler - Worker handler\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearchResult(\n  { rx$ }: WorkerHandler<SearchMessage>, { query$ }: MountOptions\n): OperatorFunction<HTMLElement, SearchResult[]> {\n  return pipe(\n    switchMap(el => {\n      const container = el.parentElement!\n\n      /* Compute if search is ready */\n      const ready$ = rx$\n        .pipe(\n          filter(isSearchReadyMessage),\n          mapTo(true)\n        )\n\n      /* Compute whether there are more search results to fetch */\n      const fetch$ = watchElementOffset(container)\n        .pipe(\n          map(({ y }) => {\n            return y >= container.scrollHeight - container.offsetHeight - 16\n          }),\n          distinctUntilChanged(),\n          filter(identity)\n        )\n\n      /* Apply search results */\n      return rx$\n        .pipe(\n          filter(isSearchResultMessage),\n          pluck(\"data\"),\n          applySearchResult(el, { query$, ready$, fetch$ }),\n          startWith([])\n        )\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, Subject, pipe } from \"rxjs\"\nimport { distinctUntilKeyChanged, switchMap, tap } from \"rxjs/operators\"\n\nimport { Viewport } from \"browser\"\n\nimport { useComponent } from \"../../_\"\nimport { Header } from \"../../header\"\nimport {\n  applyHeaderShadow,\n  watchMain\n} from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Main area\n */\nexport interface Main {\n  offset: number                       /* Main area top offset */\n  height: number                       /* Main area visible height */\n  active: boolean                      /* Scrolled past top offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount main area from source observable\n *\n * The header must be connected to the main area observable outside of the\n * operator function, as the header will persist in-between document switches\n * while the main area is replaced. However, the header observable must be\n * passed to this function, so we connect both via a long-living subject.\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountMain(\n  { header$, viewport$ }: MountOptions\n): OperatorFunction<HTMLElement, Main> {\n  const main$ = new Subject<Main>()\n\n  /* Connect to main area observable via long-living subject */\n  useComponent(\"header\")\n    .pipe(\n      switchMap(header => main$\n        .pipe(\n          distinctUntilKeyChanged(\"active\"),\n          applyHeaderShadow(header)\n        )\n      )\n    )\n      .subscribe()\n\n  /* Return operator */\n  return pipe(\n    switchMap(el => watchMain(el, { header$, viewport$ })),\n    tap(main => main$.next(main))\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  combineLatest,\n  pipe\n} from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  distinctUntilKeyChanged,\n  finalize,\n  map,\n  observeOn,\n  pluck,\n  shareReplay,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { Viewport, watchElementSize } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { Main } from \"../_\"\nimport {\n  resetHeaderShadow,\n  setHeaderShadow\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch main area\n *\n * This function returns an observable that computes the visual parameters of\n * the main area which depends on the viewport vertical offset and height, as\n * well as the height of the header element, if the header is fixed.\n *\n * @param el - Main area element\n * @param options - Options\n *\n * @return Main area observable\n */\nexport function watchMain(\n  el: HTMLElement, { header$, viewport$ }: WatchOptions\n): Observable<Main> {\n\n  /* Compute necessary adjustment for header */\n  const adjust$ = header$\n    .pipe(\n      pluck(\"height\"),\n      distinctUntilChanged(),\n      shareReplay(1)\n    )\n\n  /* Compute the main area's top and bottom borders */\n  const border$ = adjust$\n    .pipe(\n      switchMap(() => watchElementSize(el)\n        .pipe(\n          map(({ height }) => ({\n            top:    el.offsetTop,\n            bottom: el.offsetTop + height\n          }))\n        )\n      ),\n      distinctUntilKeyChanged(\"bottom\"),\n      shareReplay(1)\n    )\n\n  /* Compute the main area's offset, visible height and if we scrolled past */\n  return combineLatest([adjust$, border$, viewport$])\n    .pipe(\n      map(([header, { top, bottom }, { offset: { y }, size: { height } }]) => {\n        height = Math.max(0, height\n          - Math.max(0, top    - y,  header)\n          - Math.max(0, height + y - bottom)\n        )\n        return {\n          offset: top - header,\n          height,\n          active: top - header <= y\n        }\n      }),\n      distinctUntilChanged<Main>((a, b) => {\n        return a.offset === b.offset\n            && a.height === b.height\n            && a.active === b.active\n      })\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply header shadow\n *\n * @param el - Header element\n *\n * @return Operator function\n */\nexport function applyHeaderShadow(\n  el: HTMLElement\n): MonoTypeOperatorFunction<Main> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ active }) => {\n      setHeaderShadow(el, active)\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetHeaderShadow(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set header shadow\n *\n * @param el - Header element\n * @param value - Whether the shadow is shown\n */\nexport function setHeaderShadow(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"shadow\" : \"\")\n}\n\n/**\n * Reset header shadow\n *\n * @param el - Header element\n */\nexport function resetHeaderShadow(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { Viewport, watchViewportAt } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { applyHero } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Hero\n */\nexport interface Hero {\n  hidden: boolean                      /* Whether the hero is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount hero from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountHero(\n  { header$, viewport$ }: MountOptions\n): OperatorFunction<HTMLElement, Hero> {\n  return pipe(\n    switchMap(el => watchViewportAt(el, { header$, viewport$ })\n      .pipe(\n        map(({ offset: { y } }) => ({ hidden: y >= 20 })),\n        distinctUntilKeyChanged(\"hidden\"),\n        applyHero(el)\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  animationFrameScheduler,\n  pipe\n} from \"rxjs\"\nimport { finalize, observeOn, tap } from \"rxjs/operators\"\n\nimport { Hero } from \"../_\"\nimport {\n  resetHeroHidden,\n  setHeroHidden\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply hero\n *\n * @param el - Hero element\n *\n * @return Operator function\n */\nexport function applyHero(\n  el: HTMLElement\n): MonoTypeOperatorFunction<Hero> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ hidden }) => {\n      setHeroHidden(el, hidden)\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetHeroHidden(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set hero hidden\n *\n * @param el - Hero element\n * @param value - Whether the element is hidden\n */\nexport function setHeroHidden(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"hidden\" : \"\")\n}\n\n/**\n * Reset hero hidden\n *\n * @param el - Hero element\n */\nexport function resetHeroHidden(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  filter,\n  map,\n  shareReplay,\n  startWith,\n  switchMap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport {\n  Viewport,\n  getElement,\n  watchViewportAt\n} from \"browser\"\n\nimport { useComponent } from \"../../_\"\nimport {\n  applyHeaderType,\n  watchHeader\n} from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header type\n */\nexport type HeaderType =\n  | \"site\"                             /* Header shows site title */\n  | \"page\"                             /* Header shows page title */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Header\n */\nexport interface Header {\n  type: HeaderType                     /* Header type */\n  sticky: boolean                      /* Header stickyness */\n  height: number                       /* Header visible height */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  document$: Observable<Document>      /* Document observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount header from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountHeader(\n  { document$, viewport$ }: MountOptions\n): OperatorFunction<HTMLElement, Header> {\n  return pipe(\n    switchMap(el => {\n      const header$ = watchHeader(el, { document$ })\n\n      /* Compute whether the header should switch to page header */\n      const type$ = useComponent(\"main\")\n        .pipe(\n          map(main => getElement(\"h1, h2, h3, h4, h5, h6\", main)!),\n          filter(hx => typeof hx !== \"undefined\"),\n          withLatestFrom(useComponent(\"header-title\")),\n          switchMap(([hx, title]) => watchViewportAt(hx, { header$, viewport$ })\n            .pipe(\n              map(({ offset: { y } }) => {\n                return y >= hx.offsetHeight ? \"page\" : \"site\"\n              }),\n              distinctUntilChanged(),\n              applyHeaderType(title)\n            )\n          ),\n          startWith<HeaderType>(\"site\")\n        )\n\n      /* Combine into single observable */\n      return combineLatest([header$, type$])\n        .pipe(\n          map(([header, type]): Header => ({ type, ...header })),\n          shareReplay(1)\n        )\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  of,\n  pipe\n} from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  finalize,\n  map,\n  observeOn,\n  shareReplay,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { watchElementSize } from \"browser\"\n\nimport { Header, HeaderType } from \"../_\"\nimport {\n  resetHeaderTitleActive,\n  setHeaderTitleActive\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header\n *\n * @param el - Header element\n *\n * @return Header observable\n */\nexport function watchHeader(\n  el: HTMLElement, { document$ }: WatchOptions\n): Observable<Omit<Header, \"type\">> {\n  return document$\n    .pipe(\n      map(() => {\n        const styles = getComputedStyle(el)\n        return [\n          \"sticky\",                    /* Modern browsers */\n          \"-webkit-sticky\"             /* Safari */\n        ].includes(styles.position)\n      }),\n      distinctUntilChanged(),\n      switchMap(sticky => {\n        if (sticky) {\n          return watchElementSize(el)\n            .pipe(\n              map(({ height }) => ({\n                sticky: true,\n                height\n              }))\n            )\n        } else {\n          return of({\n            sticky: false,\n            height: 0\n          })\n        }\n      }),\n      shareReplay(1)\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply header title type\n *\n * @param el - Header title element\n *\n * @return Operator function\n */\nexport function applyHeaderType(\n  el: HTMLElement\n): MonoTypeOperatorFunction<HeaderType> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(type => {\n      setHeaderTitleActive(el, type === \"page\")\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetHeaderTitleActive(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set header title active\n *\n * @param el - Header title element\n * @param value - Whether the title is shown\n */\nexport function setHeaderTitleActive(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"active\" : \"\")\n}\n\n/**\n * Reset header title active\n *\n * @param el - Header title element\n */\nexport function resetHeaderTitleActive(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, of, pipe } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { Viewport, watchViewportAt } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { applyTabs } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Tabs\n */\nexport interface Tabs {\n  hidden: boolean                      /* Whether the tabs are hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n  screen$: Observable<boolean>         /* Media screen observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount tabs from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTabs(\n  { header$, viewport$, screen$ }: MountOptions\n): OperatorFunction<HTMLElement, Tabs> {\n  return pipe(\n    switchMap(el => screen$\n      .pipe(\n        switchMap(screen => {\n\n          /* [screen +]: Mount tabs above screen breakpoint */\n          if (screen) {\n            return watchViewportAt(el, { header$, viewport$ })\n              .pipe(\n                map(({ offset: { y } }) => ({ hidden: y >= 10 })),\n                distinctUntilKeyChanged(\"hidden\"),\n                applyTabs(el)\n              )\n\n          /* [screen -]: Unmount tabs below screen breakpoint */\n          } else {\n            return of({ hidden: true })\n          }\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  animationFrameScheduler,\n  pipe\n} from \"rxjs\"\nimport { finalize, observeOn, tap } from \"rxjs/operators\"\n\nimport { Tabs } from \"../_\"\nimport {\n  resetTabsHidden,\n  setTabsHidden\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply tabs\n *\n * @param el - Tabs element\n *\n * @return Operator function\n */\nexport function applyTabs(\n  el: HTMLElement\n): MonoTypeOperatorFunction<Tabs> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ hidden }) => {\n      setTabsHidden(el, hidden)\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetTabsHidden(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set tabs hidden\n *\n * @param el - Tabs element\n * @param value - Whether the element is hidden\n */\nexport function setTabsHidden(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"hidden\" : \"\")\n}\n\n/**\n * Reset tabs hidden\n *\n * @param el - Tabs element\n */\nexport function resetTabsHidden(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, of, pipe } from \"rxjs\"\nimport { map, switchMap } from \"rxjs/operators\"\n\nimport { Viewport } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { Main } from \"../../main\"\nimport {\n  Sidebar,\n  applySidebar,\n  watchSidebar\n} from \"../../shared\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Navigation for [screen -]\n */\ninterface NavigationBelowScreen {} // tslint:disable-line\n\n/**\n * Navigation for [screen +]\n */\ninterface NavigationAboveScreen {\n  sidebar: Sidebar                     /* Sidebar */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Navigation\n */\nexport type Navigation =\n  | NavigationBelowScreen\n  | NavigationAboveScreen\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  main$: Observable<Main>              /* Main area observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n  screen$: Observable<boolean>         /* Screen media observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount navigation from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountNavigation(\n  { header$, main$, viewport$, screen$ }: MountOptions\n): OperatorFunction<HTMLElement, Navigation> {\n  return pipe(\n    switchMap(el => screen$\n      .pipe(\n        switchMap(screen => {\n\n          /* [screen +]: Mount navigation in sidebar */\n          if (screen) {\n            return watchSidebar(el, { main$, viewport$ })\n              .pipe(\n                applySidebar(el, { header$ }),\n                map(sidebar => ({ sidebar }))\n              )\n\n          /* [screen -]: Mount navigation in drawer */\n          } else {\n            return of({})\n          }\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { NEVER, Observable, fromEvent, iif, merge } from \"rxjs\"\nimport { map, mapTo, shareReplay, switchMap } from \"rxjs/operators\"\n\nimport { getElements } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether the given device is an Apple device\n *\n * @return Test result\n */\nfunction isAppleDevice(): boolean {\n  return /(iPad|iPhone|iPod)/.test(navigator.userAgent)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all elements with `data-md-scrollfix` attributes\n *\n * This is a year-old patch which ensures that overflow scrolling works at the\n * top and bottom of containers on iOS by ensuring a `1px` scroll offset upon\n * the start of a touch event.\n *\n * @see https://bit.ly/2SCtAOO - Original source\n *\n * @param options - Options\n */\nexport function patchScrollfix(\n  { document$ }: PatchOptions\n): void {\n  const els$ = document$\n    .pipe(\n      map(() => getElements(\"[data-md-scrollfix]\")),\n      shareReplay(1)\n    )\n\n  /* Remove marker attribute, so we'll only add the fix once */\n  els$.subscribe(els => {\n    for (const el of els)\n      el.removeAttribute(\"data-md-scrollfix\")\n  })\n\n  /* Patch overflow scrolling on touch start */\n  iif(isAppleDevice, els$, NEVER)\n    .pipe(\n      switchMap(els => merge(...els.map(el => (\n        fromEvent(el, \"touchstart\", { passive: true })\n          .pipe(\n            mapTo(el)\n          )\n      ))))\n    )\n      .subscribe(el => {\n        const top = el.scrollTop\n\n        /* We're at the top of the container */\n        if (top === 0) {\n          el.scrollTop = 1\n\n        /* We're at the bottom of the container */\n        } else if (top + el.offsetHeight === el.scrollHeight) {\n          el.scrollTop = top - 1\n        }\n      })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { NEVER, Observable } from \"rxjs\"\nimport { catchError, map, switchMap } from \"rxjs/operators\"\n\nimport { getElementOrThrow, getElements } from \"browser\"\nimport { renderSource } from \"templates\"\nimport { cache, hash } from \"utilities\"\n\nimport { fetchSourceFactsFromGitHub } from \"./github\"\nimport { fetchSourceFactsFromGitLab } from \"./gitlab\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Source facts\n */\nexport type SourceFacts = string[]\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch source facts\n *\n * @param url - Source repository URL\n *\n * @return Source facts observable\n */\nfunction fetchSourceFacts(\n  url: string\n): Observable<SourceFacts> {\n  const [type] = url.match(/(git(?:hub|lab))/i) || []\n  switch (type.toLowerCase()) {\n\n    /* GitHub repository */\n    case \"github\":\n      const [, user, repo] = url.match(/^.+github\\.com\\/([^\\/]+)\\/?([^\\/]+)/i)\n      return fetchSourceFactsFromGitHub(user, repo)\n\n    /* GitLab repository */\n    case \"gitlab\":\n      const [, base, slug] = url.match(/^.+?([^\\/]*gitlab[^\\/]+)\\/(.+?)\\/?$/i)\n      return fetchSourceFactsFromGitLab(base, slug)\n\n    /* Everything else */\n    default:\n      return NEVER\n  }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch elements containing repository information\n *\n * This function will retrieve the URL from the repository link and try to\n * query data from integrated source code platforms like GitHub or GitLab.\n *\n * @param options - Options\n */\nexport function patchSource(\n  { document$ }: PatchOptions\n): void {\n  document$\n    .pipe(\n      map(() => getElementOrThrow<HTMLAnchorElement>(\".md-source[href]\")),\n      switchMap(({ href }) => (\n        cache(`${hash(href)}`, () => fetchSourceFacts(href))\n      )),\n      catchError(() => NEVER)\n    )\n      .subscribe(facts => {\n        for (const el of getElements(\".md-source__repository\")) {\n          if (!el.hasAttribute(\"data-md-state\")) {\n            el.setAttribute(\"data-md-state\", \"done\")\n            el.appendChild(renderSource(facts))\n          }\n        }\n      })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Repo, User } from \"github-types\"\nimport { Observable, of } from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport { filter, pluck, switchMap } from \"rxjs/operators\"\n\nimport { round } from \"utilities\"\n\nimport { SourceFacts } from \"..\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitHub source facts\n *\n * @param user - GitHub user\n * @param repo - GitHub repository\n *\n * @return Source facts observable\n */\nexport function fetchSourceFactsFromGitHub(\n  user: string, repo?: string\n): Observable<SourceFacts> {\n  return ajax({\n    url: typeof repo !== \"undefined\"\n      ? `https://api.github.com/repos/${user}/${repo}`\n      : `https://api.github.com/users/${user}`,\n    responseType: \"json\"\n  })\n    .pipe(\n      filter(({ status }) => status === 200),\n      pluck(\"response\"),\n      switchMap(data => {\n\n        /* GitHub repository */\n        if (typeof repo !== \"undefined\") {\n          const { stargazers_count, forks_count }: Repo = data\n          return of([\n            `${round(stargazers_count || 0)} Stars`,\n            `${round(forks_count || 0)} Forks`\n          ])\n\n        /* GitHub user/organization */\n        } else {\n          const { public_repos }: User = data\n          return of([\n            `${round(public_repos || 0)} Repositories`\n          ])\n        }\n      })\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ProjectSchema } from \"gitlab\"\nimport { Observable } from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport { filter, map, pluck } from \"rxjs/operators\"\n\nimport { round } from \"utilities\"\n\nimport { SourceFacts } from \"..\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitLab source facts\n *\n * @param base - GitLab base\n * @param project - GitLab project\n *\n * @return Source facts observable\n */\nexport function fetchSourceFactsFromGitLab(\n  base: string, project: string\n): Observable<SourceFacts> {\n  return ajax({\n    url: `https://${base}/api/v4/projects/${encodeURIComponent(project)}`,\n    responseType: \"json\"\n  })\n    .pipe(\n      filter(({ status }) => status === 200),\n      pluck(\"response\"),\n      map(({ star_count, forks_count }: ProjectSchema) => ([\n        `${round(star_count)} Stars`,\n        `${round(forks_count)} Forks`\n      ]))\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n// DISCLAIMER: this file is still WIP. There're some refactoring opportunities\n// which must be tackled after we gathered some feedback on v5.\n// tslint:disable\n\nimport { sortBy, prop, values } from \"ramda\"\nimport {\n  merge,\n  combineLatest,\n  animationFrameScheduler,\n  fromEvent,\n  from,\n  defer,\n  of,\n  NEVER\n} from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport {\n  delay,\n  switchMap,\n  tap,\n  filter,\n  withLatestFrom,\n  observeOn,\n  take,\n  shareReplay,\n  pluck,\n  catchError,\n  map\n} from \"rxjs/operators\"\n\nimport {\n  watchToggle,\n  setToggle,\n  getElements,\n  watchMedia,\n  watchDocument,\n  watchLocation,\n  watchLocationHash,\n  watchViewport,\n  isLocalLocation,\n  setLocationHash,\n  watchLocationBase\n} from \"browser\"\nimport {\n  mountHeader,\n  mountHero,\n  mountMain,\n  mountNavigation,\n  mountSearch,\n  mountTableOfContents,\n  mountTabs,\n  useComponent,\n  setupComponents,\n  mountSearchQuery,\n  mountSearchReset,\n  mountSearchResult\n} from \"components\"\nimport {\n  setupClipboard,\n  setupDialog,\n  setupKeyboard,\n  setupInstantLoading,\n  setupSearchWorker,\n  SearchIndex\n} from \"integrations\"\nimport {\n  patchCodeBlocks,\n  patchTables,\n  patchDetails,\n  patchScrollfix,\n  patchSource,\n  patchScripts\n} from \"patches\"\nimport { isConfig } from \"utilities\"\n\n/* ------------------------------------------------------------------------- */\n\n/* Denote that JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Test for iOS */\nif (navigator.userAgent.match(/(iPad|iPhone|iPod)/g))\n  document.documentElement.classList.add(\"ios\")\n\n/**\n * Set scroll lock\n *\n * @param el - Scrollable element\n * @param value - Vertical offset\n */\nexport function setScrollLock(\n  el: HTMLElement, value: number\n): void {\n  el.setAttribute(\"data-md-state\", \"lock\")\n  el.style.top = `-${value}px`\n}\n\n/**\n * Reset scroll lock\n *\n * @param el - Scrollable element\n */\nexport function resetScrollLock(\n  el: HTMLElement\n): void {\n  const value = -1 * parseInt(el.style.top, 10)\n  el.removeAttribute(\"data-md-state\")\n  el.style.top = \"\"\n  if (value)\n    window.scrollTo(0, value)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Initialize Material for MkDocs\n *\n * @param config - Configuration\n */\nexport function initialize(config: unknown) {\n  if (!isConfig(config))\n    throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`)\n\n  /* Set up subjects */\n  const document$ = watchDocument()\n  const location$ = watchLocation()\n\n  /* Set up user interface observables */\n  const base$     = watchLocationBase(config.base, { location$ })\n  const hash$     = watchLocationHash()\n  const viewport$ = watchViewport()\n  const tablet$   = watchMedia(\"(min-width: 960px)\")\n  const screen$   = watchMedia(\"(min-width: 1220px)\")\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Set up component bindings */\n  setupComponents([\n    \"announce\",                        /* Announcement bar */\n    \"container\",                       /* Container */\n    \"header\",                          /* Header */\n    \"header-title\",                    /* Header title */\n    \"hero\",                            /* Hero */\n    \"main\",                            /* Main area */\n    \"navigation\",                      /* Navigation */\n    \"search\",                          /* Search */\n    \"search-query\",                    /* Search input */\n    \"search-reset\",                    /* Search reset */\n    \"search-result\",                   /* Search results */\n    \"skip\",                            /* Skip link */\n    \"tabs\",                            /* Tabs */\n    \"toc\"                              /* Table of contents */\n  ], { document$ })\n\n  const keyboard$ = setupKeyboard()\n\n  patchCodeBlocks({ document$, viewport$ })\n  patchDetails({ document$, hash$ })\n  patchScripts({ document$ })\n  patchSource({ document$ })\n  patchTables({ document$ })\n\n  /* Force 1px scroll offset to trigger overflow scrolling */\n  patchScrollfix({ document$ })\n\n  /* Set up clipboard and dialog */\n  const dialog$ = setupDialog()\n  const clipboard$ = setupClipboard({ document$, dialog$ })\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Create header observable */\n  const header$ = useComponent(\"header\")\n    .pipe(\n      mountHeader({ document$, viewport$ }),\n      shareReplay(1)\n    )\n\n  const main$ = useComponent(\"main\")\n    .pipe(\n      mountMain({ header$, viewport$ }),\n      shareReplay(1)\n    )\n\n  /* ----------------------------------------------------------------------- */\n\n  const navigation$ = useComponent(\"navigation\")\n    .pipe(\n      mountNavigation({ header$, main$, viewport$, screen$ }),\n      shareReplay(1) // shareReplay because there might be late subscribers\n    )\n\n  const toc$ = useComponent(\"toc\")\n    .pipe(\n      mountTableOfContents({ header$, main$, viewport$, tablet$ }),\n      shareReplay(1)\n    )\n\n  const tabs$ = useComponent(\"tabs\")\n    .pipe(\n      mountTabs({ header$, viewport$, screen$ }),\n      shareReplay(1)\n    )\n\n  const hero$ = useComponent(\"hero\")\n    .pipe(\n      mountHero({ header$, viewport$ }),\n      shareReplay(1)\n    )\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Search worker */\n  const worker$ = defer(() => {\n    const index = config.search && config.search.index\n      ? config.search.index\n      : undefined\n\n    /* Fetch index if it wasn't passed explicitly */\n    const index$ = typeof index !== \"undefined\"\n      ? from(index)\n      : base$\n          .pipe(\n            switchMap(base => ajax({\n              url: `${base}/search/search_index.json`,\n              responseType: \"json\",\n              withCredentials: true\n            })\n              .pipe<SearchIndex>(\n                pluck(\"response\")\n              )\n            )\n          )\n\n    return of(setupSearchWorker(config.search.worker, {\n      base$, index$\n    }))\n  })\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Mount search query */\n  const search$ = worker$\n    .pipe(\n      switchMap(worker => {\n\n        const query$ = useComponent(\"search-query\")\n          .pipe(\n            mountSearchQuery(worker, { transform: config.search.transform }),\n            shareReplay(1)\n          )\n\n        /* Mount search reset */\n        const reset$ = useComponent(\"search-reset\")\n          .pipe(\n            mountSearchReset(),\n            shareReplay(1)\n          )\n\n        /* Mount search result */\n        const result$ = useComponent(\"search-result\")\n          .pipe(\n            mountSearchResult(worker, { query$ }),\n            shareReplay(1)\n          )\n\n        return useComponent(\"search\")\n          .pipe(\n            mountSearch(worker, { query$, reset$, result$ }),\n          )\n      }),\n      catchError(() => {\n        useComponent(\"search\")\n          .subscribe(el => el.hidden = true) // TODO: Hack\n        return NEVER\n      }),\n      shareReplay(1)\n    )\n\n  /* ----------------------------------------------------------------------- */\n\n  // // put into search...\n  hash$\n    .pipe(\n      tap(() => setToggle(\"search\", false)),\n      delay(125), // ensure that it runs after the body scroll reset...\n    )\n      .subscribe(hash => setLocationHash(`#${hash}`))\n\n  // TODO: scroll restoration must be centralized\n  combineLatest([\n    watchToggle(\"search\"),\n    tablet$,\n  ])\n    .pipe(\n      withLatestFrom(viewport$),\n      switchMap(([[toggle, tablet], { offset: { y }}]) => {\n        const active = toggle && !tablet\n        return document$\n          .pipe(\n            delay(active ? 400 : 100),\n            observeOn(animationFrameScheduler),\n            tap(({ body }) => active\n              ? setScrollLock(body, y)\n              : resetScrollLock(body)\n            )\n          )\n      })\n    )\n      .subscribe()\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Always close drawer on click */\n  fromEvent<MouseEvent>(document.body, \"click\")\n    .pipe(\n      filter(ev => !(ev.metaKey || ev.ctrlKey)),\n      filter(ev => {\n        if (ev.target instanceof HTMLElement) {\n          const el = ev.target.closest(\"a\") // TODO: abstract as link click?\n          if (el && isLocalLocation(el)) {\n            return true\n          }\n        }\n        return false\n      })\n    )\n      .subscribe(() => {\n        setToggle(\"drawer\", false)\n      })\n\n  /* Enable instant loading, if not on file:// protocol */\n  if (config.features.includes(\"instant\") && location.protocol !== \"file:\") {\n\n    /* Fetch sitemap and extract URL whitelist */\n    base$\n      .pipe(\n        switchMap(base => ajax({\n          url: `${base}/sitemap.xml`,\n          responseType: \"document\",\n          withCredentials: true\n        })\n          .pipe<Document>(\n            pluck(\"response\")\n          )\n        ),\n        withLatestFrom(base$),\n        map(([document, base]) => {\n          const urls = getElements(\"loc\", document)\n            .map(node => node.textContent!)\n\n          // Hack: This is a temporary fix to normalize instant loading lookup\n          // on localhost and Netlify previews. If this approach proves to be\n          // suitable, we'll refactor URL whitelisting anyway. We take the two\n          // shortest URLs and determine the common prefix to isolate the\n          // domain. If there're no two domains, we just leave it as-is, as\n          // there isn't anything to be loaded anway.\n          if (urls.length > 1) {\n            const [a, b] = sortBy(prop(\"length\"), urls)\n\n            /* Determine common prefix */\n            let index = 0\n            if (a === b)\n              index = a.length\n            else\n              while (a.charAt(index) === b.charAt(index))\n                index++\n\n            /* Replace common prefix (i.e. base) with effective base */\n            for (let i = 0; i < urls.length; i++)\n              urls[i] = urls[i].replace(a.slice(0, index), `${base}/`)\n          }\n          return urls\n        })\n      )\n        .subscribe(urls => {\n          setupInstantLoading(urls, { document$, location$, viewport$ })\n        })\n  }\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Unhide permalinks on first tab */\n  keyboard$\n    .pipe(\n      filter(key => key.mode === \"global\" && key.type === \"Tab\"),\n      take(1)\n    )\n      .subscribe(() => {\n        for (const link of getElements(\".headerlink\"))\n          link.style.visibility = \"visible\"\n      })\n\n  /* ----------------------------------------------------------------------- */\n\n  const state = {\n\n    /* Browser observables */\n    document$,\n    location$,\n    viewport$,\n\n    /* Component observables */\n    header$,\n    hero$,\n    main$,\n    navigation$,\n    search$,\n    tabs$,\n    toc$,\n\n    /* Integration observables */\n    clipboard$,\n    keyboard$,\n    dialog$\n  }\n\n  /* Subscribe to all observables */\n  merge(...values(state))\n    .subscribe()\n  return state\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest } from \"rxjs\"\nimport { distinctUntilKeyChanged, map } from \"rxjs/operators\"\n\nimport { Viewport, getElements } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  document$: Observable<Document>      /* Document observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `code` elements\n *\n * This function will make overflowing code blocks focusable via keyboard, so\n * they can be scrolled without a mouse.\n *\n * @param options - Options\n */\nexport function patchCodeBlocks(\n  { document$, viewport$ }: MountOptions\n): void {\n  const els$ = document$\n    .pipe(\n      map(() => getElements<HTMLTableElement>(\"pre > code\"))\n    )\n\n  /* Observe viewport size only */\n  const size$ = viewport$\n    .pipe(\n      distinctUntilKeyChanged(\"size\")\n    )\n\n  /* Make overflowing elements focusable */\n  combineLatest([els$, size$])\n    .subscribe(([els]) => {\n      for (const el of els) {\n        if (el.scrollWidth > el.clientWidth)\n          el.setAttribute(\"tabindex\", \"0\")\n        else\n          el.removeAttribute(\"tabindex\")\n      }\n    })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport {\n  filter,\n  map,\n  switchMapTo,\n  tap\n} from \"rxjs/operators\"\n\nimport {\n  getElement,\n  getElements,\n  watchMedia\n} from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n  hash$: Observable<string>            /* Location hash observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `details` elements\n *\n * This function will ensure that all `details` tags are opened prior to\n * printing, so the whole content of the page is included, and on anchor jumps.\n *\n * @param options - Options\n */\nexport function patchDetails(\n  { document$, hash$ }: PatchOptions\n): void {\n  const els$ = document$\n    .pipe(\n      map(() => getElements<HTMLDetailsElement>(\"details\"))\n    )\n\n  /* Open all details before printing */\n  merge(\n    watchMedia(\"print\").pipe(filter(identity)), /* Webkit */\n    fromEvent(window, \"beforeprint\")            /* IE, FF */\n  )\n    .pipe(\n      switchMapTo(els$)\n    )\n      .subscribe(els => {\n        for (const el of els)\n          el.setAttribute(\"open\", \"\")\n      })\n\n  /* Open parent details and fix anchor jump */\n  hash$\n    .pipe(\n      map(id => getElement(`[id=\"${id}\"]`)!),\n      filter(el => typeof el !== \"undefined\"),\n      tap(el => {\n        const details = el.closest(\"details\")\n        if (details && !details.open)\n          details.setAttribute(\"open\", \"\")\n      })\n    )\n      .subscribe(el => el.scrollIntoView())\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport { map, skip, withLatestFrom } from \"rxjs/operators\"\n\nimport {\n  createElement,\n  getElements,\n  replaceElement\n} from \"browser\"\nimport { useComponent } from \"components\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `script` elements\n *\n * This function must be run after a document switch, which means the first\n * emission must be ignored.\n *\n * @param options - Options\n */\nexport function patchScripts(\n  { document$ }: PatchOptions\n): void {\n  const els$ = document$\n    .pipe(\n      skip(1),\n      withLatestFrom(useComponent(\"container\")),\n      map(([, el]) => getElements<HTMLScriptElement>(\"script\", el))\n    )\n\n  /* Evaluate all scripts via replacement */\n  els$.subscribe(els => {\n    for (const el of els) {\n      if (el.src || /(^|\\/javascript)$/i.test(el.type)) {\n        const script = createElement(\"script\")\n        const key = el.src ? \"src\" : \"textContent\"\n        script[key] = el[key]!\n        replaceElement(el, script)\n      }\n    }\n  })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport { map } from \"rxjs/operators\"\n\nimport {\n  createElement,\n  getElements,\n  replaceElement\n} from \"browser\"\nimport { renderTable } from \"templates\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `table` elements\n *\n * This function will re-render all tables by wrapping them to improve overflow\n * scrolling on smaller screen sizes.\n *\n * @param options - Options\n */\nexport function patchTables(\n  { document$ }: MountOptions\n): void {\n  const sentinel = createElement(\"table\")\n  document$\n    .pipe(\n      map(() => getElements<HTMLTableElement>(\"table:not([class])\"))\n    )\n      .subscribe(els => {\n        for (const el of els) {\n          replaceElement(el, sentinel)\n          replaceElement(sentinel, renderTable(el))\n        }\n      })\n}\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/assets/javascripts/bundle.f9edbbd5.min.js b/assets/javascripts/bundle.f9edbbd5.min.js
deleted file mode 100644
index c9c526d..0000000
--- a/assets/javascripts/bundle.f9edbbd5.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function(t,e){for(var n in e)t[n]=e[n]}(window,function(t){function e(e){for(var r,i,o=e[0],u=e[1],b=e[2],s=0,O=[];s<o.length;s++)i=o[s],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&O.push(c[i][0]),c[i]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);for(f&&f(e);O.length;)O.shift()();return a.push.apply(a,b||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],r=!0,o=1;o<n.length;o++){var u=n[o];0!==c[u]&&(r=!1)}r&&(a.splice(e--,1),t=i(i.s=n[0]))}return t}var r={},c={0:0},a=[];function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="";var o=window.webpackJsonp=window.webpackJsonp||[],u=o.push.bind(o);o.push=e,o=o.slice();for(var b=0;b<o.length;b++)e(o[b]);var f=u;return a.push([86,1]),n()}([,function(t,e,n){"use strict";n.d(e,"q",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return b})),n.d(e,"e",(function(){return f})),n.d(e,"a",(function(){return s})),n.d(e,"j",(function(){return O})),n.d(e,"k",(function(){return h})),n.d(e,"r",(function(){return v})),n.d(e,"s",(function(){return y})),n.d(e,"l",(function(){return g})),n.d(e,"t",(function(){return k})),n.d(e,"i",(function(){return A})),n.d(e,"u",(function(){return T})),n.d(e,"m",(function(){return _})),n.d(e,"h",(function(){return L})),n.d(e,"g",(function(){return M})),n.d(e,"v",(function(){return H})),n.d(e,"w",(function(){return P})),n.d(e,"n",(function(){return q})),n.d(e,"x",(function(){return N})),n.d(e,"y",(function(){return z})),n.d(e,"f",(function(){return V})),n.d(e,"o",(function(){return D})),n.d(e,"z",(function(){return B})),n.d(e,"A",(function(){return Q})),n.d(e,"B",(function(){return X})),n.d(e,"p",(function(){return W})),n.d(e,"C",(function(){return nt}));var r=n(72),c=n(93),a=n(94);function i(){var t=new r.a;return Object(c.a)(document,"DOMContentLoaded").pipe(Object(a.a)(document)).subscribe(t),t}function o(t,e){return void 0===e&&(e=document),e.querySelector(t)||void 0}function u(t,e){void 0===e&&(e=document);var n=o(t,e);if(void 0===n)throw new ReferenceError('Missing element: expected "'+t+'" to be present');return n}function b(){return document.activeElement instanceof HTMLElement?document.activeElement:void 0}function f(t,e){return void 0===e&&(e=document),Array.from(e.querySelectorAll(t))}function s(t){return document.createElement(t)}function O(t,e){t.replaceWith(e)}var l=n(95),j=n(11),d=n(92),p=n(87);function h(t,e){void 0===e&&(e=!0),e?t.focus():t.blur()}function v(t){return Object(l.a)(Object(c.a)(t,"focus"),Object(c.a)(t,"blur")).pipe(Object(j.a)((function(t){return"focus"===t.type})),Object(d.a)(t===b()),Object(p.a)(1))}function m(t){return{x:t.scrollLeft,y:t.scrollTop}}function y(t){return Object(l.a)(Object(c.a)(t,"scroll"),Object(c.a)(window,"resize")).pipe(Object(j.a)((function(){return m(t)})),Object(d.a)(m(t)),Object(p.a)(1))}function g(t){if(!(t instanceof HTMLInputElement))throw new Error("Not implemented");t.select()}var w=n(0),x=n(73),$=n(96);function k(t){return Object($.a)((function(e){new x.a((function(t){var n=Object(w.f)(t,1)[0].contentRect;return e({width:Math.round(n.width),height:Math.round(n.height)})})).observe(t)})).pipe(Object(d.a)(function(t){return{width:t.offsetWidth,height:t.offsetHeight}}(t)),Object(p.a)(1))}var S=n(97),C=n(111);function A(t){switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return!0;default:return t.isContentEditable}}function T(){return Object(c.a)(window,"keydown").pipe(Object(S.a)((function(t){return!(t.metaKey||t.ctrlKey)})),Object(j.a)((function(t){return{type:t.key,claim:function(){t.preventDefault(),t.stopPropagation()}}})),Object(C.a)())}var E=n(98);function _(t){location.href=t.href}function L(t,e){return void 0===e&&(e=location),t.host===e.host&&/^(?:\/[\w-]+)*(?:\/?|\.html)$/i.test(t.pathname)}function M(t,e){return void 0===e&&(e=location),t.pathname===e.pathname&&t.hash.length>0}function H(){return new E.a(new URL(location.href))}var R=n(112);function P(t,e){return e.location$.pipe(Object(R.a)(1),Object(j.a)((function(e){var n=e.href;return new URL(t,n).toString().replace(/\/$/,"")})),Object(p.a)(1))}function U(){return location.hash.substring(1)}function q(t){var e=s("a");e.href=t,e.addEventListener("click",(function(t){return t.stopPropagation()})),e.click()}function N(){return Object(c.a)(window,"hashchange").pipe(Object(j.a)(U),Object(d.a)(U()),Object(S.a)((function(t){return t.length>0})),Object(C.a)())}function z(t){var e=matchMedia(t);return Object($.a)((function(t){return e.addListener((function(){return t(e.matches)}))})).pipe(Object(d.a)(e.matches),Object(p.a)(1))}var I={drawer:u("[data-md-toggle=drawer]"),search:u("[data-md-toggle=search]")};function V(t){return I[t].checked}function D(t,e){I[t].checked!==e&&I[t].click()}function B(t){var e=I[t];return Object(c.a)(e,"change").pipe(Object(j.a)((function(){return e.checked})),Object(d.a)(e.checked))}var Y=n(58),F=n(88);function J(){return{x:Math.max(0,pageXOffset),y:Math.max(0,pageYOffset)}}function W(t){var e=t.x,n=t.y;window.scrollTo(e||0,n||0)}function K(){return{width:innerWidth,height:innerHeight}}function Q(){return Object(Y.a)([Object(l.a)(Object(c.a)(window,"scroll",{passive:!0}),Object(c.a)(window,"resize",{passive:!0})).pipe(Object(j.a)(J),Object(d.a)(J())),Object(c.a)(window,"resize",{passive:!0}).pipe(Object(j.a)(K),Object(d.a)(K()))]).pipe(Object(j.a)((function(t){var e=Object(w.f)(t,2);return{offset:e[0],size:e[1]}})),Object(p.a)(1))}function X(t,e){var n=e.header$,r=e.viewport$,c=r.pipe(Object(F.a)("size")),a=Object(Y.a)([c,n]).pipe(Object(j.a)((function(){return{x:t.offsetLeft,y:t.offsetTop}})));return Object(Y.a)([n,r,a]).pipe(Object(j.a)((function(t){var e=Object(w.f)(t,3),n=e[0].height,r=e[1],c=r.offset,a=r.size,i=e[2],o=i.x,u=i.y;return{offset:{x:c.x-o,y:c.y-u+n},size:a}})),Object(p.a)(1))}var Z=n(99),G=n(100),tt=n(77),et=n(101);function nt(t,e){var n=e.tx$,r=Object($.a)((function(e){return t.addEventListener("message",e)})).pipe(Object(Z.a)("data"));return n.pipe(Object(G.a)((function(){return r}),{leading:!0,trailing:!0}),Object(tt.a)((function(e){return t.postMessage(e)})),Object(et.a)(r),Object(C.a)())}},,,,function(t,e,n){"use strict";function r(t){return"object"==typeof t&&"string"==typeof t.base&&"object"==typeof t.features&&"object"==typeof t.search}n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return O})),n.d(e,"f",(function(){return d})),n.d(e,"g",(function(){return p})),n.d(e,"e",(function(){return h})),n.d(e,"c",(function(){return v}));var c=n(0),a=n(76);function i(t){switch(t){case"svg":case"path":return document.createElementNS("http://www.w3.org/2000/svg",t);default:return document.createElement(t)}}function o(t,e,n){switch(e){case"xmlns":break;case"viewBox":case"d":"boolean"!=typeof n?t.setAttributeNS(null,e,n):n&&t.setAttributeNS(null,e,"");break;default:"boolean"!=typeof n?t.setAttribute(e,n):n&&t.setAttribute(e,"")}}function u(t,e){var n,r;if("string"==typeof e||"number"==typeof e)t.innerHTML+=e.toString();else if(e instanceof Node)t.appendChild(e);else if(Array.isArray(e))try{for(var a=Object(c.i)(e),i=a.next();!i.done;i=a.next()){u(t,i.value)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}function b(t,e){for(var n,r,b,f,s=[],O=2;O<arguments.length;O++)s[O-2]=arguments[O];var l=i(t);if(e)try{for(var j=Object(c.i)(Object(a.a)(e)),d=j.next();!d.done;d=j.next()){var p=d.value;o(l,p,e[p])}}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=j.return)&&r.call(j)}finally{if(n)throw n.error}}try{for(var h=Object(c.i)(s),v=h.next();!v.done;v=h.next()){var m=v.value;u(l,m)}}catch(t){b={error:t}}finally{try{v&&!v.done&&(f=h.return)&&f.call(h)}finally{if(b)throw b.error}}return l}var f=n(75),s=n(38);function O(t,e){return Object(f.a)((function(){var n=sessionStorage.getItem(t);if(n)return Object(s.a)(JSON.parse(n));var r=e();return r.subscribe((function(e){try{sessionStorage.setItem(t,JSON.stringify(e))}catch(t){}})),r}))}var l,j=n(1);function d(t,e){if(void 0===l){var n=Object(j.d)("#__lang");l=JSON.parse(n.textContent)}if(void 0===l[t])throw new ReferenceError("Invalid translation: "+t);return void 0!==e?l[t].replace("#",e):l[t]}function p(t,e){var n=e;if(t.length>n){for(;" "!==t[n]&&--n>0;);return t.substring(0,n)+"..."}return t}function h(t){return t>999?((t+1e-6)/1e3).toFixed(+((t-950)%1e3>99))+"k":t.toString()}function v(t){for(var e=0,n=0,r=t.length;n<r;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}},,,function(t,e,n){"use strict";var r=n(20);n.d(e,"setupComponents",(function(){return r.a})),n.d(e,"useComponent",(function(){return r.b}));var c=n(70);n.d(e,"mountHeader",(function(){return c.a}));var a=n(68);n.d(e,"mountHero",(function(){return a.a}));var i=n(67);n.d(e,"mountMain",(function(){return i.a}));var o=n(71);n.d(e,"mountNavigation",(function(){return o.a}));var u=n(66);n.d(e,"mountSearch",(function(){return u.a})),n.d(e,"mountSearchQuery",(function(){return u.b})),n.d(e,"mountSearchReset",(function(){return u.c})),n.d(e,"mountSearchResult",(function(){return u.d}));var b=n(26);n.o(b,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return b.mountTableOfContents})),n.o(b,"mountTabs")&&n.d(e,"mountTabs",(function(){return b.mountTabs}));var f=n(69);n.d(e,"mountTabs",(function(){return f.a}));var s=n(62);n.o(s,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return s.mountTableOfContents}))},,,,,,function(t,e,n){"use strict";n.d(e,"e",(function(){return O})),n.d(e,"f",(function(){return y})),n.d(e,"g",(function(){return R})),n.d(e,"h",(function(){return U})),n.d(e,"b",(function(){return q.b})),n.d(e,"i",(function(){return q.f})),n.d(e,"a",(function(){return q.a})),n.d(e,"c",(function(){return q.d})),n.d(e,"d",(function(){return q.e}));var r=n(57),c=n(103),a=n(96),i=n(111),o=n(77),u=n(94),b=n(1),f=n(27),s=n(5);function O(t){var e=t.document$,n=t.dialog$;if(!r.isSupported())return c.a;e.subscribe((function(){Object(b.e)("pre > code").forEach((function(t,e){var n=t.parentElement;n.id="__code_"+e,n.insertBefore(Object(f.a)(n.id),t)}))}));var O=Object(a.a)((function(t){new r(".md-clipboard").on("success",t)})).pipe(Object(i.a)());return O.pipe(Object(o.a)((function(t){return t.clearSelection()})),Object(u.a)(Object(s.f)("clipboard.copied"))).subscribe(n),O}var l=n(33),j=n(38),d=n(81),p=n(31),h=n(11),v=n(80),m=n(114);function y(t){var e=(void 0===t?{}:t).duration,n=new l.a,r=Object(b.a)("div");return r.classList.add("md-dialog","md-typeset"),n.pipe(Object(p.a)((function(t){return Object(j.a)(document.body).pipe(Object(h.a)((function(t){return t.appendChild(r)})),Object(v.a)(d.a),Object(m.a)(1),Object(o.a)((function(e){e.innerHTML=t,e.setAttribute("data-md-state","open")})),Object(m.a)(e||2e3),Object(o.a)((function(t){return t.removeAttribute("data-md-state")})),Object(m.a)(400),Object(o.a)((function(t){t.innerHTML="",t.remove()})))}))).subscribe(),n}var g=n(0),w=n(93),x=n(95),$=n(115),k=n(97),S=n(44),C=n(99),A=n(88),T=n(104),E=n(105),_=n(102),L=n(89),M=n(106),H=n(90);function R(t,e){var n=e.document$,r=e.viewport$,a=e.location$;"scrollRestoration"in history&&(history.scrollRestoration="manual"),Object(w.a)(window,"beforeunload").subscribe((function(){history.scrollRestoration="auto"}));var o=Object(b.c)('link[rel="shortcut icon"]');void 0!==o&&(o.href=o.href);var u=Object(w.a)(document.body,"click").pipe(Object(k.a)((function(t){return!(t.metaKey||t.ctrlKey)})),Object(p.a)((function(e){if(e.target instanceof HTMLElement){var n=e.target.closest("a");if(n&&!n.target&&Object(b.h)(n)&&t.includes(n.href))return Object(b.g)(n)||e.preventDefault(),Object(j.a)(n)}return c.a})),Object(h.a)((function(t){return{url:new URL(t.href)}})),Object(i.a)());u.subscribe((function(){Object(b.o)("search",!1)}));var f=u.pipe(Object(k.a)((function(t){var e=t.url;return!Object(b.g)(e)})),Object(i.a)()),s=Object(w.a)(window,"popstate").pipe(Object(k.a)((function(t){return null!==t.state})),Object(h.a)((function(t){return{url:new URL(location.href),offset:t.state}})),Object(i.a)());Object(x.a)(f,s).pipe(Object(S.a)((function(t,e){return t.url.href===e.url.href})),Object(C.a)("url")).subscribe(a);var O=a.pipe(Object(A.a)("pathname"),Object(T.a)(1),Object(p.a)((function(t){return Object($.a)({url:t.href,responseType:"text",withCredentials:!0}).pipe(Object(E.a)((function(){return Object(b.m)(t),c.a})))})));f.pipe(Object(_.a)(O)).subscribe((function(t){var e=t.url;history.pushState({},"",e.toString())}));var l=new DOMParser;O.pipe(Object(h.a)((function(t){var e=t.response;return l.parseFromString(e,"text/html")}))).subscribe(n);var d=Object(x.a)(f,s).pipe(Object(_.a)(n));d.subscribe((function(t){var e=t.url,n=t.offset;e.hash&&!n?Object(b.n)(e.hash):Object(b.p)(n||{y:0})})),d.pipe(Object(L.a)(n)).subscribe((function(t){var e,n,r=Object(g.f)(t,2)[1],c=r.title,a=r.head;document.title=c;try{for(var i=Object(g.i)(['link[rel="canonical"]','meta[name="author"]','meta[name="description"]']),o=i.next();!o.done;o=i.next()){var u=o.value,f=Object(b.c)(u,a),s=Object(b.c)(u,document.head);void 0!==f&&void 0!==s&&Object(b.j)(s,f)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}document.dispatchEvent(new CustomEvent("DOMContentSwitch"))})),r.pipe(Object(M.a)(250),Object(A.a)("offset")).subscribe((function(t){var e=t.offset;history.replaceState(e,"")})),Object(x.a)(u,s).pipe(Object(H.a)(2,1),Object(k.a)((function(t){var e=Object(g.f)(t,2),n=e[0],r=e[1];return n.url.pathname===r.url.pathname&&!Object(b.g)(r.url)})),Object(h.a)((function(t){return Object(g.f)(t,2)[1]}))).subscribe((function(t){var e=t.offset;Object(b.p)(e||{y:0})}))}var P=n(8);function U(){var t=Object(b.u)().pipe(Object(h.a)((function(t){return Object(g.a)({mode:Object(b.f)("search")?"search":"global"},t)})),Object(k.a)((function(t){if("global"===t.mode){var e=Object(b.b)();if(void 0!==e)return!Object(b.i)(e)}return!0})),Object(i.a)());return t.pipe(Object(k.a)((function(t){return"search"===t.mode})),Object(L.a)(Object(P.useComponent)("search-query"),Object(P.useComponent)("search-result"))).subscribe((function(t){var e=Object(g.f)(t,3),n=e[0],r=e[1],c=e[2],a=Object(b.b)();switch(n.type){case"Enter":a===r&&n.claim();break;case"Escape":case"Tab":Object(b.o)("search",!1),Object(b.k)(r,!1);break;case"ArrowUp":case"ArrowDown":if(void 0===a)Object(b.k)(r);else{var i=Object(g.g)([r],Object(b.e)("[href]",c)),o=Math.max(0,(Math.max(0,i.indexOf(a))+i.length+("ArrowUp"===n.type?-1:1))%i.length);Object(b.k)(i[o])}n.claim();break;default:r!==Object(b.b)()&&Object(b.k)(r)}})),t.pipe(Object(k.a)((function(t){return"global"===t.mode})),Object(L.a)(Object(P.useComponent)("search-query"))).subscribe((function(t){var e=Object(g.f)(t,2),n=e[0],r=e[1];switch(n.type){case"f":case"s":case"/":Object(b.k)(r),Object(b.l)(r),n.claim();break;case"p":case",":var c=Object(b.c)("[href][rel=prev]");void 0!==c&&c.click();break;case"n":case".":var a=Object(b.c)("[href][rel=next]");void 0!==a&&a.click()}})),t}var q=n(41)},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return j}));var r,c=n(0),a=n(38),i=n(28),o=n(11),u=n(78),b=n(87),f=n(31),s=n(44),O=n(1);function l(t,e){var n=e.document$;r=n.pipe(Object(o.a)((function(e){return t.reduce((function(t,n){var r,a=Object(O.c)("[data-md-component="+n+"]",e);return Object(c.a)(Object(c.a)({},t),void 0!==a?((r={})[n]=a,r):{})}),{})})),Object(u.a)((function(e,n){var r,a;try{for(var i=Object(c.i)(t),o=i.next();!o.done;o=i.next()){var u=o.value;switch(u){case"announce":case"header-title":case"container":case"skip":u in e&&void 0!==e[u]&&(Object(O.j)(e[u],n[u]),e[u]=n[u]);break;default:void 0!==n[u]?e[u]=Object(O.c)("[data-md-component="+u+"]"):delete e[u]}}}catch(t){r={error:t}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return e})),Object(b.a)(1))}function j(t){return r.pipe(Object(f.a)((function(e){return void 0!==e[t]?Object(a.a)(e[t]):i.a})),Object(s.a)())}},,function(t,e,n){"use strict";function r(t,e){t.setAttribute("data-md-state",e?"blur":"")}function c(t){t.removeAttribute("data-md-state")}function a(t,e){t.classList.toggle("md-nav__link--active",e)}function i(t){t.classList.remove("md-nav__link--active")}n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}))},,,,function(t,e,n){"use strict";var r=n(59);n.o(r,"applySidebar")&&n.d(e,"applySidebar",(function(){return r.applySidebar})),n.o(r,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return r.mountTableOfContents})),n.o(r,"mountTabs")&&n.d(e,"mountTabs",(function(){return r.mountTabs})),n.o(r,"watchSidebar")&&n.d(e,"watchSidebar",(function(){return r.watchSidebar}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return m}));var r=n(5),c="md-clipboard md-icon";function a(t){return Object(r.b)("button",{class:c,title:Object(r.f)("clipboard.copy"),"data-clipboard-target":"#"+t+" > code"},Object(r.b)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.b)("path",{d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})))}var i=n(0),o="md-search-result__item",u="md-search-result__link",b="md-search-result__article md-search-result__article--document",f="md-search-result__article",s="md-search-result__title",O="md-search-result__teaser";function l(t){var e=t.article,n=t.sections,c=Object(r.b)("div",{class:"md-search-result__icon md-icon"},Object(r.b)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.b)("path",{d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H13C12.59,21.75 12.2,21.44 11.86,21.1C11.53,20.77 11.25,20.4 11,20H6V4H13V9H18V10.18C18.71,10.34 19.39,10.61 20,11V8L14,2M20.31,18.9C21.64,16.79 21,14 18.91,12.68C16.8,11.35 14,12 12.69,14.08C11.35,16.19 12,18.97 14.09,20.3C15.55,21.23 17.41,21.23 18.88,20.32L22,23.39L23.39,22L20.31,18.9M16.5,19A2.5,2.5 0 0,1 14,16.5A2.5,2.5 0 0,1 16.5,14A2.5,2.5 0 0,1 19,16.5A2.5,2.5 0 0,1 16.5,19Z"}))),a=Object(i.g)([e],n).map((function(t){var e=t.location,n=t.title,a=t.text;return Object(r.b)("a",{href:e,class:u,tabIndex:-1},Object(r.b)("article",{class:"parent"in t?f:b},!("parent"in t)&&c,Object(r.b)("h1",{class:s},n),a.length>0&&Object(r.b)("p",{class:O},Object(r.g)(a,320))))}));return Object(r.b)("li",{class:o},a)}var j="md-source__facts",d="md-source__fact";function p(t){var e=t.map((function(t){return Object(r.b)("li",{class:d},t)}));return Object(r.b)("ul",{class:j},e)}var h="md-typeset__scrollwrap",v="md-typeset__table";function m(t){return Object(r.b)("div",{class:h},Object(r.b)("div",{class:v},t))}},,function(t,e,n){"use strict";function r(t,e){t.style.top=e+"px"}function c(t){t.style.top=""}function a(t,e){t.style.height=e+"px"}function i(t){t.style.height=""}n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}))},,,,,,,,,,,function(t,e,n){"use strict";var r=n(64);n.o(r,"applyAnchorList")&&n.d(e,"applyAnchorList",(function(){return r.applyAnchorList})),n.o(r,"watchAnchorList")&&n.d(e,"watchAnchorList",(function(){return r.watchAnchorList}));var c=n(65);n.d(e,"applyAnchorList",(function(){return c.a})),n.d(e,"watchAnchorList",(function(){return c.b}));n(22)},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"f",(function(){return y})),n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return p})),n.d(e,"c",(function(){return h})),n.d(e,"e",(function(){return v}));var r=n(0),c=n(74);!function(){function t(t){var e=t.config,n=t.docs,a=t.pipeline,i=t.index;this.documents=function(t){var e,n,a=new Map;try{for(var i=Object(r.i)(t),o=i.next();!o.done;o=i.next()){var u=o.value,b=Object(r.f)(u.location.split("#"),2),f=b[0],s=b[1],O=u.location,l=u.title,j=c(u.text).replace(/\s+(?=[,.:;!?])/g,"").replace(/\s+/g," ");if(s){var d=a.get(f);d.linked?a.set(O,{location:O,title:l,text:j,parent:d}):(d.title=u.title,d.text=j,d.linked=!0)}else a.set(O,{location:O,title:l,text:j,linked:!1})}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return a}(n),this.highlight=function(t){var e=new RegExp(t.separator,"img"),n=function(t,e,n){return e+"<em>"+n+"</em>"};return function(c){c=c.replace(/[\s*+\-:~^]+/g," ").trim();var a=new RegExp("(^|"+t.separator+")("+c.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(e,"|")+")","img");return function(t){return Object(r.a)(Object(r.a)({},t),{title:t.title.replace(a,n),text:t.text.replace(a,n)})}}}(e),lunr.tokenizer.separator=new RegExp(e.separator),this.index=void 0===i?lunr((function(){var t,c,i,o,u,b,f;1===e.lang.length&&"en"!==e.lang[0]?this.use(lunr[e.lang[0]]):e.lang.length>1&&this.use((t=lunr).multiLanguage.apply(t,Object(r.g)(e.lang)));var s=function(t,e){var n=Object(r.f)([new Set(t),new Set(e)],2),c=n[0],a=n[1];return Object(r.g)(new Set(Object(r.g)(c).filter((function(t){return!a.has(t)}))))}(["trimmer","stopWordFilter","stemmer"],a);try{for(var O=Object(r.i)(e.lang.map((function(t){return"en"===t?lunr:lunr[t]}))),l=O.next();!l.done;l=O.next()){var j=l.value;try{for(var d=(o=void 0,Object(r.i)(s)),p=d.next();!p.done;p=d.next()){var h=p.value;this.pipeline.remove(j[h]),this.searchPipeline.remove(j[h])}}catch(t){o={error:t}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(o)throw o.error}}}}catch(t){c={error:t}}finally{try{l&&!l.done&&(i=O.return)&&i.call(O)}finally{if(c)throw c.error}}this.field("title",{boost:1e3}),this.field("text"),this.ref("location");try{for(var v=Object(r.i)(n),m=v.next();!m.done;m=v.next()){var y=m.value;this.add(y)}}catch(t){b={error:t}}finally{try{m&&!m.done&&(f=v.return)&&f.call(v)}finally{if(b)throw b.error}}})):lunr.Index.load("string"==typeof i?JSON.parse(i):i)}t.prototype.query=function(t){var e=this;if(t)try{var n=this.index.search(t).reduce((function(t,n){var c=e.documents.get(n.ref);if(void 0!==c)if("parent"in c){var a=c.parent.location;t.set(a,Object(r.g)(t.get(a)||[],[n]))}else{a=c.location;t.set(a,t.get(a)||[])}return t}),new Map),c=this.highlight(t);return Object(r.g)(n).map((function(t){var n=Object(r.f)(t,2),a=n[0],i=n[1];return{article:c(e.documents.get(a)),sections:i.map((function(t){return c(e.documents.get(t.ref))}))}}))}catch(e){console.warn("Invalid query: "+t+" – see https://bit.ly/2s3ChXG")}return[]}}();function a(t){return t.split(/"([^"]+)"/g).map((function(t,e){return 1&e?t.replace(/^\b|^(?![^\x00-\x7F]|$)|\s+/g," +"):t})).join("").replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g,"").trim().replace(/\s+|(?![^\x00-\x7F]|^)$|\b$/g,"* ")}var i,o=n(113),u=n(33),b=n(50),f=n(89),s=n(11),O=n(87),l=n(80),j=n(1),d=n(5);function p(t){return t.type===i.READY}function h(t){return t.type===i.QUERY}function v(t){return t.type===i.RESULT}function m(t){var e=t.config,n=t.docs,r=t.index;return 1===e.lang.length&&"en"===e.lang[0]&&(e.lang=[Object(d.f)("search.config.lang")]),"[\\s\\-]+"===e.separator&&(e.separator=Object(d.f)("search.config.separator")),{config:e,docs:n,index:r,pipeline:Object(d.f)("search.config.pipeline").split(/\s*,\s*/).filter(o.a)}}function y(t,e){var n=e.index$,c=e.base$,a=new Worker(t),o=new u.a,d=Object(j.C)(a,{tx$:o}).pipe(Object(f.a)(c),Object(s.a)((function(t){var e,n,c,a,i=Object(r.f)(t,2),o=i[0],u=i[1];if(v(o))try{for(var b=Object(r.i)(o.data),f=b.next();!f.done;f=b.next()){var s=f.value,O=s.article,l=s.sections;O.location=u+"/"+O.location;try{for(var j=(c=void 0,Object(r.i)(l)),d=j.next();!d.done;d=j.next()){var p=d.value;p.location=u+"/"+p.location}}catch(t){c={error:t}}finally{try{d&&!d.done&&(a=j.return)&&a.call(j)}finally{if(c)throw c.error}}}}catch(t){e={error:t}}finally{try{f&&!f.done&&(n=b.return)&&n.call(b)}finally{if(e)throw e.error}}return o})),Object(O.a)(1));return n.pipe(Object(s.a)((function(t){return{type:i.SETUP,data:m(t)}})),Object(l.a)(b.b)).subscribe(o.next.bind(o)),{tx$:o,rx$:d}}!function(t){t[t.SETUP=0]="SETUP",t[t.READY=1]="READY",t[t.QUERY=2]="QUERY",t[t.RESULT=3]="RESULT"}(i||(i={}))},,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";var r=n(60);n.o(r,"applySidebar")&&n.d(e,"applySidebar",(function(){return r.applySidebar})),n.o(r,"mountTableOfContents")&&n.d(e,"mountTableOfContents",(function(){return r.mountTableOfContents})),n.o(r,"mountTabs")&&n.d(e,"mountTabs",(function(){return r.mountTabs})),n.o(r,"watchSidebar")&&n.d(e,"watchSidebar",(function(){return r.watchSidebar}));var c=n(61);n.d(e,"applySidebar",(function(){return c.a})),n.d(e,"watchSidebar",(function(){return c.b}));n(29)},function(t,e){},function(t,e,n){"use strict";n.d(e,"b",(function(){return j})),n.d(e,"a",(function(){return d}));var r=n(0),c=n(58),a=n(43),i=n(81),o=n(11),u=n(44),b=n(80),f=n(89),s=n(77),O=n(79),l=n(29);function j(t,e){var n=e.main$,a=e.viewport$,i=t.parentElement.offsetTop-t.parentElement.parentElement.offsetTop;return Object(c.a)([n,a]).pipe(Object(o.a)((function(t){var e=Object(r.f)(t,2),n=e[0],c=n.offset,a=n.height,o=e[1].offset.y;return{height:a=a+Math.min(i,Math.max(0,o-c))-i,lock:o>=c+i}})),Object(u.a)((function(t,e){return t.height===e.height&&t.lock===e.lock})))}function d(t,e){var n=e.header$;return Object(a.a)(Object(b.a)(i.a),Object(f.a)(n),Object(s.a)((function(e){var n=Object(r.f)(e,2),c=n[0],a=c.height,i=c.lock,o=n[1].height;Object(l.c)(t,a),i?Object(l.d)(t,o):Object(l.b)(t)})),Object(o.a)((function(t){return Object(r.f)(t,1)[0]})),Object(O.a)((function(){Object(l.b)(t),Object(l.a)(t)})))}},function(t,e,n){"use strict";var r=n(63);n.d(e,"mountTableOfContents",(function(){return r.a}));n(40)},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(0),c=n(43),a=n(58),i=n(38),o=n(31),u=n(11),b=n(1),f=n(26),s=n(40);function O(t){var e=t.header$,n=t.main$,O=t.viewport$,l=t.tablet$;return Object(c.a)(Object(o.a)((function(t){return l.pipe(Object(o.a)((function(c){if(c){var o=Object(b.e)(".md-nav__link",t),l=Object(f.watchSidebar)(t,{main$:n,viewport$:O}).pipe(Object(f.applySidebar)(t,{header$:e})),j=Object(s.watchAnchorList)(o,{header$:e,viewport$:O}).pipe(Object(s.applyAnchorList)(o));return Object(a.a)([l,j]).pipe(Object(u.a)((function(t){var e=Object(r.f)(t,2);return{sidebar:e[0],anchors:e[1]}})))}return Object(i.a)({})})))})))}},function(t,e){},function(t,e,n){"use strict";n.d(e,"b",(function(){return y})),n.d(e,"a",(function(){return g}));var r=n(0),c=n(91),a=n(58),i=n(43),o=n(81),u=n(11),b=n(88),f=n(31),s=n(78),O=n(44),l=n(92),j=n(90),d=n(80),p=n(77),h=n(79),v=n(1),m=n(22);function y(t,e){var n,i,o=e.header$,d=e.viewport$,p=new Map;try{for(var h=Object(r.i)(t),m=h.next();!m.done;m=h.next()){var y=m.value,g=decodeURIComponent(y.hash.substring(1)),w=Object(v.c)('[id="'+g+'"]');void 0!==w&&p.set(y,w)}}catch(t){n={error:t}}finally{try{m&&!m.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}var x=o.pipe(Object(u.a)((function(t){return 18+t.height})));return Object(v.t)(document.body).pipe(Object(b.a)("height"),Object(u.a)((function(){var t=[];return Object(r.g)(p).reduce((function(e,n){for(var a=Object(r.f)(n,2),i=a[0],o=a[1];t.length;){if(!(p.get(t[t.length-1]).tagName>=o.tagName))break;t.pop()}for(var u=o.offsetTop;!u&&o.parentElement;)u=(o=o.parentElement).offsetTop;return e.set(Object(c.a)(t=Object(r.g)(t,[i])),u)}),new Map)})),Object(f.a)((function(t){return Object(a.a)([x,d]).pipe(Object(s.a)((function(t,e){for(var n=Object(r.f)(t,2),c=n[0],a=n[1],i=Object(r.f)(e,2),o=i[0],u=i[1].offset.y;a.length;){if(!(Object(r.f)(a[0],2)[1]-o<u))break;c=Object(r.g)(c,[a.shift()])}for(;c.length;){if(!(Object(r.f)(c[c.length-1],2)[1]-o>=u))break;a=Object(r.g)([c.pop()],a)}return[c,a]}),[[],Object(r.g)(t)]),Object(O.a)((function(t,e){return t[0]===e[0]&&t[1]===e[1]})))}))).pipe(Object(u.a)((function(t){var e=Object(r.f)(t,2),n=e[0],c=e[1];return{prev:n.map((function(t){return Object(r.f)(t,1)[0]})),next:c.map((function(t){return Object(r.f)(t,1)[0]}))}})),Object(l.a)({prev:[],next:[]}),Object(j.a)(2,1),Object(u.a)((function(t){var e=Object(r.f)(t,2),n=e[0],c=e[1];return n.prev.length<c.prev.length?{prev:c.prev.slice(Math.max(0,n.prev.length-1),c.prev.length),next:[]}:{prev:c.prev.slice(-1),next:c.next.slice(0,c.next.length-n.next.length)}})))}function g(t){return Object(i.a)(Object(d.a)(o.a),Object(p.a)((function(t){var e,n,c=t.prev,a=t.next;try{for(var i=Object(r.i)(a),o=i.next();!o.done;o=i.next()){var u=Object(r.f)(o.value,1)[0];Object(m.a)(u),Object(m.b)(u)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.forEach((function(t,e){var n=Object(r.f)(t,1)[0];Object(m.c)(n,e===c.length-1),Object(m.d)(n,!0)}))})),Object(h.a)((function(){var e,n;try{for(var c=Object(r.i)(t),a=c.next();!a.done;a=c.next()){var i=a.value;Object(m.a)(i),Object(m.b)(i)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return j})),n.d(e,"b",(function(){return w})),n.d(e,"c",(function(){return S})),n.d(e,"d",(function(){return q}));var r=n(0),c=n(43),a=n(58),i=n(31),o=n(97),u=n(94),b=n(92),f=n(102),s=n(112),O=n(11),l=n(41);function j(t,e){var n=t.rx$,j=t.tx$,d=e.query$,p=e.reset$,h=e.result$;return Object(c.a)(Object(i.a)((function(){var t=n.pipe(Object(o.a)(l.d),Object(u.a)("ready"),Object(b.a)("waiting"));return j.pipe(Object(o.a)(l.c),Object(f.a)(t),Object(s.a)(1)).subscribe(j.next.bind(j)),Object(a.a)([t,d,h,p]).pipe(Object(O.a)((function(t){var e=Object(r.f)(t,3);return{status:e[0],query:e[1],result:e[2]}})))})))}var d=n(88),p=n(1),h=n(14),v=n(95),m=n(93),y=n(114),g=n(44);function w(t,e){var n=t.tx$;return void 0===e&&(e={}),Object(c.a)(Object(i.a)((function(t){var c=function(t,e){var n=(void 0===e?{}:e).transform||h.b,c=Object(v.a)(Object(m.a)(t,"keyup"),Object(m.a)(t,"focus").pipe(Object(y.a)(1))).pipe(Object(O.a)((function(){return n(t.value)})),Object(b.a)(n(t.value)),Object(g.a)()),i=Object(p.r)(t);return Object(a.a)([c,i]).pipe(Object(O.a)((function(t){var e=Object(r.f)(t,2);return{value:e[0],focus:e[1]}})))}(t,e);return c.pipe(Object(d.a)("value"),Object(O.a)((function(t){var e=t.value;return{type:h.a.QUERY,data:e}}))).subscribe(n.next.bind(n)),c.pipe(Object(d.a)("focus")).subscribe((function(t){var e=t.focus;e&&Object(p.o)("search",e)})),c})))}var x=n(101),$=n(77),k=n(20);function S(){return Object(c.a)(Object(i.a)((function(t){return function(t){return Object(m.a)(t,"click").pipe(Object(u.a)(void 0))}(t).pipe(Object(x.a)(Object(k.b)("search-query")),Object($.a)(p.k),Object(u.a)(void 0))})),Object(b.a)(void 0))}var C=n(113),A=n(99),T=n(81),E=n(89),_=n(80),L=n(78),M=n(79),H=n(27),R=n(5);function P(t,e){t.appendChild(e)}function U(t,e){var n=e.query$,a=e.ready$,o=e.fetch$,b=Object(p.d)(".md-search-result__list",t),f=Object(p.d)(".md-search-result__meta",t);return Object(c.a)(Object(E.a)(n,a),Object(O.a)((function(t){var e=Object(r.f)(t,2),n=e[0];return e[1].value?function(t,e){switch(e){case 0:t.textContent=Object(R.f)("search.result.none");break;case 1:t.textContent=Object(R.f)("search.result.one");break;default:t.textContent=Object(R.f)("search.result.other",e.toString())}}(f,n.length):function(t){t.textContent=Object(R.f)("search.result.placeholder")}(f),n})),Object(i.a)((function(e){return o.pipe(Object(_.a)(T.a),Object(L.a)((function(n){for(var r=t.parentElement;n<e.length&&(P(b,Object(H.b)(e[n++])),!(r.scrollHeight-r.offsetHeight>16)););return n}),0),Object(u.a)(e),Object(M.a)((function(){!function(t){t.innerHTML=""}(b)})))})))}function q(t,e){var n=t.rx$,r=e.query$;return Object(c.a)(Object(i.a)((function(t){var e=t.parentElement,c=n.pipe(Object(o.a)(h.c),Object(u.a)(!0)),a=Object(p.s)(e).pipe(Object(O.a)((function(t){return t.y>=e.scrollHeight-e.offsetHeight-16})),Object(g.a)(),Object(o.a)(C.a));return n.pipe(Object(o.a)(h.d),Object(A.a)("data"),U(t,{query$:r,ready$:c,fetch$:a}),Object(b.a)([]))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(33),c=n(43),a=n(31),i=n(88),o=n(77),u=n(20),b=n(0),f=n(58),s=n(81),O=n(99),l=n(44),j=n(87),d=n(11),p=n(80),h=n(79),v=n(1);function m(t){var e=t.header$,n=t.viewport$,m=new r.a;return Object(u.b)("header").pipe(Object(a.a)((function(t){return m.pipe(Object(i.a)("active"),(e=t,Object(c.a)(Object(p.a)(s.a),Object(o.a)((function(t){var n=t.active;!function(t,e){t.setAttribute("data-md-state",e?"shadow":"")}(e,n)})),Object(h.a)((function(){!function(t){t.removeAttribute("data-md-state")}(e)})))));var e}))).subscribe(),Object(c.a)(Object(a.a)((function(t){return function(t,e){var n=e.header$,r=e.viewport$,c=n.pipe(Object(O.a)("height"),Object(l.a)(),Object(j.a)(1)),o=c.pipe(Object(a.a)((function(){return Object(v.t)(t).pipe(Object(d.a)((function(e){var n=e.height;return{top:t.offsetTop,bottom:t.offsetTop+n}})))})),Object(i.a)("bottom"),Object(j.a)(1));return Object(f.a)([c,o,r]).pipe(Object(d.a)((function(t){var e=Object(b.f)(t,3),n=e[0],r=e[1],c=r.top,a=r.bottom,i=e[2],o=i.offset.y,u=i.size.height;return{offset:c-n,height:u=Math.max(0,u-Math.max(0,c-o,n)-Math.max(0,u+o-a)),active:c-n<=o}})),Object(l.a)((function(t,e){return t.offset===e.offset&&t.height===e.height&&t.active===e.active})))}(t,{header$:e,viewport$:n})})),Object(o.a)((function(t){return m.next(t)})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(43),c=n(31),a=n(11),i=n(88),o=n(1),u=n(81),b=n(80),f=n(77),s=n(79);function O(t){var e=t.header$,n=t.viewport$;return Object(r.a)(Object(c.a)((function(t){return Object(o.B)(t,{header$:e,viewport$:n}).pipe(Object(a.a)((function(t){return{hidden:t.offset.y>=20}})),Object(i.a)("hidden"),function(t){return Object(r.a)(Object(b.a)(u.a),Object(f.a)((function(e){var n=e.hidden;!function(t,e){t.setAttribute("data-md-state",e?"hidden":"")}(t,n)})),Object(s.a)((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}(t))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(43),c=n(38),a=n(31),i=n(11),o=n(88),u=n(1),b=n(81),f=n(80),s=n(77),O=n(79);function l(t){var e=t.header$,n=t.viewport$,l=t.screen$;return Object(r.a)(Object(a.a)((function(t){return l.pipe(Object(a.a)((function(a){return a?Object(u.B)(t,{header$:e,viewport$:n}).pipe(Object(i.a)((function(t){return{hidden:t.offset.y>=10}})),Object(o.a)("hidden"),function(t){return Object(r.a)(Object(f.a)(b.a),Object(s.a)((function(e){var n=e.hidden;!function(t,e){t.setAttribute("data-md-state",e?"hidden":"")}(t,n)})),Object(O.a)((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}(t)):Object(c.a)({hidden:!0})})))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(0),c=n(43),a=n(58),i=n(31),o=n(11),u=n(97),b=n(89),f=n(44),s=n(92),O=n(87),l=n(1),j=n(20),d=n(38),p=n(81),h=n(80),v=n(77),m=n(79);function y(t){var e=t.document$,n=t.viewport$;return Object(c.a)(Object(i.a)((function(t){var y=function(t,e){return e.document$.pipe(Object(o.a)((function(){var e=getComputedStyle(t);return["sticky","-webkit-sticky"].includes(e.position)})),Object(f.a)(),Object(i.a)((function(e){return e?Object(l.t)(t).pipe(Object(o.a)((function(t){return{sticky:!0,height:t.height}}))):Object(d.a)({sticky:!1,height:0})})),Object(O.a)(1))}(t,{document$:e}),g=Object(j.b)("main").pipe(Object(o.a)((function(t){return Object(l.c)("h1, h2, h3, h4, h5, h6",t)})),Object(u.a)((function(t){return void 0!==t})),Object(b.a)(Object(j.b)("header-title")),Object(i.a)((function(t){var e=Object(r.f)(t,2),a=e[0],i=e[1];return Object(l.B)(a,{header$:y,viewport$:n}).pipe(Object(o.a)((function(t){return t.offset.y>=a.offsetHeight?"page":"site"})),Object(f.a)(),function(t){return Object(c.a)(Object(h.a)(p.a),Object(v.a)((function(e){!function(t,e){t.setAttribute("data-md-state",e?"active":"")}(t,"page"===e)})),Object(m.a)((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}(i))})),Object(s.a)("site"));return Object(a.a)([y,g]).pipe(Object(o.a)((function(t){var e=Object(r.f)(t,2),n=e[0],c=e[1];return Object(r.a)({type:c},n)})),Object(O.a)(1))})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(43),c=n(38),a=n(31),i=n(11),o=n(26);function u(t){var e=t.header$,n=t.main$,u=t.viewport$,b=t.screen$;return Object(r.a)(Object(a.a)((function(t){return b.pipe(Object(a.a)((function(r){return r?Object(o.watchSidebar)(t,{main$:n,viewport$:u}).pipe(Object(o.applySidebar)(t,{header$:e}),Object(i.a)((function(t){return{sidebar:t}}))):Object(c.a)({})})))})))}},,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e),n.d(e,"setScrollLock",(function(){return z})),n.d(e,"resetScrollLock",(function(){return I})),n.d(e,"initialize",(function(){return V}));var r=n(0),c=n(108),a=n(110),i=n(109),o=n(75),u=n(36),b=n(38),f=n(103),s=n(58),O=n(81),l=n(93),j=n(95),d=n(115),p=n(87),h=n(31),v=n(99),m=n(105),y=n(77),g=n(114),w=n(89),x=n(80),$=n(97),k=n(11),S=n(112),C=n(1),A=n(8),T=n(14),E=n(88);var _=n(113),L=n(101);var M=n(104);var H=n(107),R=n(94);function P(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}var U=n(27),q=n(5);function N(t){switch(Object(r.f)(t.match(/(git(?:hub|lab))/i)||[],1)[0].toLowerCase()){case"github":var e=Object(r.f)(t.match(/^.+github\.com\/([^\/]+)\/?([^\/]+)/i),3);return function(t,e){return Object(d.a)({url:void 0!==e?"https://api.github.com/repos/"+t+"/"+e:"https://api.github.com/users/"+t,responseType:"json"}).pipe(Object($.a)((function(t){return 200===t.status})),Object(v.a)("response"),Object(h.a)((function(t){if(void 0!==e){var n=t.stargazers_count,r=t.forks_count;return Object(b.a)([Object(q.e)(n||0)+" Stars",Object(q.e)(r||0)+" Forks"])}var c=t.public_repos;return Object(b.a)([Object(q.e)(c||0)+" Repositories"])})))}(e[1],e[2]);case"gitlab":var n=Object(r.f)(t.match(/^.+?([^\/]*gitlab[^\/]+)\/(.+?)\/?$/i),3);return function(t,e){return Object(d.a)({url:"https://"+t+"/api/v4/projects/"+encodeURIComponent(e),responseType:"json"}).pipe(Object($.a)((function(t){return 200===t.status})),Object(v.a)("response"),Object(k.a)((function(t){var e=t.star_count,n=t.forks_count;return[Object(q.e)(e)+" Stars",Object(q.e)(n)+" Forks"]})))}(n[1],n[2]);default:return f.a}}function z(t,e){t.setAttribute("data-md-state","lock"),t.style.top="-"+e+"px"}function I(t){var e=-1*parseInt(t.style.top,10);t.removeAttribute("data-md-state"),t.style.top="",e&&window.scrollTo(0,e)}function V(t){if(!Object(q.d)(t))throw new SyntaxError("Invalid configuration: "+JSON.stringify(t));var e=Object(C.q)(),n=Object(C.v)(),V=Object(C.w)(t.base,{location$:n}),D=Object(C.x)(),B=Object(C.A)(),Y=Object(C.y)("(min-width: 960px)"),F=Object(C.y)("(min-width: 1220px)");Object(A.setupComponents)(["announce","container","header","header-title","hero","main","navigation","search","search-query","search-reset","search-result","skip","tabs","toc"],{document$:e});var J=Object(T.h)();matchMedia("(hover)").matches&&function(t){var e=t.document$,n=t.viewport$,c=e.pipe(Object(k.a)((function(){return Object(C.e)("pre > code")}))),a=n.pipe(Object(E.a)("size"));Object(s.a)([c,a]).subscribe((function(t){var e,n,c=Object(r.f)(t,1)[0];try{for(var a=Object(r.i)(c),i=a.next();!i.done;i=a.next()){var o=i.value;o.scrollWidth>o.clientWidth?o.setAttribute("tabindex","0"):o.removeAttribute("tabindex")}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}}))}({document$:e,viewport$:B}),function(t){var e=t.document$,n=t.hash$,c=e.pipe(Object(k.a)((function(){return Object(C.e)("details")})));Object(j.a)(Object(C.y)("print").pipe(Object($.a)(_.a)),Object(l.a)(window,"beforeprint")).pipe(Object(L.a)(c)).subscribe((function(t){var e,n;try{for(var c=Object(r.i)(t),a=c.next();!a.done;a=c.next()){a.value.setAttribute("open","")}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})),n.pipe(Object(k.a)((function(t){return Object(C.c)('[id="'+t+'"]')})),Object($.a)((function(t){return void 0!==t})),Object(y.a)((function(t){var e=t.closest("details");e&&!e.open&&e.setAttribute("open","")}))).subscribe((function(t){return t.scrollIntoView()}))}({document$:e,hash$:D}),{document$:e}.document$.pipe(Object(M.a)(1),Object(w.a)(Object(A.useComponent)("container")),Object(k.a)((function(t){var e=Object(r.f)(t,2)[1];return Object(C.e)("script",e)}))).subscribe((function(t){var e,n;try{for(var c=Object(r.i)(t),a=c.next();!a.done;a=c.next()){var i=a.value;if(i.src||/(^|\/javascript)$/i.test(i.type)){var o=Object(C.a)("script"),u=i.src?"src":"textContent";o[u]=i[u],Object(C.j)(i,o)}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})),function(t){t.document$.pipe(Object(k.a)((function(){return Object(C.d)(".md-source[href]")})),Object(h.a)((function(t){var e=t.href;return Object(q.a)(""+Object(q.c)(e),(function(){return N(e)}))})),Object(m.a)((function(){return f.a}))).subscribe((function(t){var e,n;try{for(var c=Object(r.i)(Object(C.e)(".md-source__repository")),a=c.next();!a.done;a=c.next()){var i=a.value;i.hasAttribute("data-md-state")||(i.setAttribute("data-md-state","done"),i.appendChild(Object(U.c)(t)))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}}))}({document$:e}),function(t){var e=t.document$,n=Object(C.a)("table");e.pipe(Object(k.a)((function(){return Object(C.e)("table:not([class])")}))).subscribe((function(t){var e,c;try{for(var a=Object(r.i)(t),i=a.next();!i.done;i=a.next()){var o=i.value;Object(C.j)(o,n),Object(C.j)(n,Object(U.d)(o))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(c=a.return)&&c.call(a)}finally{if(e)throw e.error}}}))}({document$:e}),function(t){var e=t.document$.pipe(Object(k.a)((function(){return Object(C.e)("[data-md-scrollfix]")})),Object(p.a)(1));e.subscribe((function(t){var e,n;try{for(var c=Object(r.i)(t),a=c.next();!a.done;a=c.next()){a.value.removeAttribute("data-md-scrollfix")}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}})),Object(H.a)(P,e,f.a).pipe(Object(h.a)((function(t){return j.a.apply(void 0,Object(r.g)(t.map((function(t){return Object(l.a)(t,"touchstart",{passive:!0}).pipe(Object(R.a)(t))}))))}))).subscribe((function(t){var e=t.scrollTop;0===e?t.scrollTop=1:e+t.offsetHeight===t.scrollHeight&&(t.scrollTop=e-1)}))}({document$:e});var W=Object(T.f)(),K=Object(T.e)({document$:e,dialog$:W}),Q=Object(A.useComponent)("header").pipe(Object(A.mountHeader)({document$:e,viewport$:B}),Object(p.a)(1)),X=Object(A.useComponent)("main").pipe(Object(A.mountMain)({header$:Q,viewport$:B}),Object(p.a)(1)),Z=Object(A.useComponent)("navigation").pipe(Object(A.mountNavigation)({header$:Q,main$:X,viewport$:B,screen$:F}),Object(p.a)(1)),G=Object(A.useComponent)("toc").pipe(Object(A.mountTableOfContents)({header$:Q,main$:X,viewport$:B,tablet$:Y}),Object(p.a)(1)),tt=Object(A.useComponent)("tabs").pipe(Object(A.mountTabs)({header$:Q,viewport$:B,screen$:F}),Object(p.a)(1)),et=Object(A.useComponent)("hero").pipe(Object(A.mountHero)({header$:Q,viewport$:B}),Object(p.a)(1)),nt=Object(o.a)((function(){var e=t.search&&t.search.index?t.search.index:void 0,n=void 0!==e?Object(u.a)(e):V.pipe(Object(h.a)((function(t){return Object(d.a)({url:t+"/search/search_index.json",responseType:"json",withCredentials:!0}).pipe(Object(v.a)("response"))})));return Object(b.a)(Object(T.i)(t.search.worker,{base$:V,index$:n}))})).pipe(Object(h.a)((function(e){var n=Object(A.useComponent)("search-query").pipe(Object(A.mountSearchQuery)(e,{transform:t.search.transform}),Object(p.a)(1)),r=Object(A.useComponent)("search-reset").pipe(Object(A.mountSearchReset)(),Object(p.a)(1)),c=Object(A.useComponent)("search-result").pipe(Object(A.mountSearchResult)(e,{query$:n}),Object(p.a)(1));return Object(A.useComponent)("search").pipe(Object(A.mountSearch)(e,{query$:n,reset$:r,result$:c}))})),Object(m.a)((function(){return Object(A.useComponent)("search").subscribe((function(t){return t.hidden=!0})),f.a})),Object(p.a)(1));D.pipe(Object(y.a)((function(){return Object(C.o)("search",!1)})),Object(g.a)(125)).subscribe((function(t){return Object(C.n)("#"+t)})),Object(s.a)([Object(C.z)("search"),Y]).pipe(Object(w.a)(B),Object(h.a)((function(t){var n=Object(r.f)(t,2),c=Object(r.f)(n[0],2),a=c[0],i=c[1],o=n[1].offset.y,u=a&&!i;return e.pipe(Object(g.a)(u?400:100),Object(x.a)(O.a),Object(y.a)((function(t){var e=t.body;return u?z(e,o):I(e)})))}))).subscribe(),Object(l.a)(document.body,"click").pipe(Object($.a)((function(t){return!(t.metaKey||t.ctrlKey)})),Object($.a)((function(t){if(t.target instanceof HTMLElement){var e=t.target.closest("a");if(e&&Object(C.h)(e))return!0}return!1}))).subscribe((function(){Object(C.o)("drawer",!1)})),t.features.includes("instant")&&"file:"!==location.protocol&&V.pipe(Object(h.a)((function(t){return Object(d.a)({url:t+"/sitemap.xml",responseType:"document",withCredentials:!0}).pipe(Object(v.a)("response"))})),Object(w.a)(V),Object(k.a)((function(t){var e=Object(r.f)(t,2),n=e[0],i=e[1],o=Object(C.e)("loc",n).map((function(t){return t.textContent}));if(o.length>1){var u=Object(r.f)(Object(c.a)(Object(a.a)("length"),o),2),b=u[0],f=u[1],s=0;if(b===f)s=b.length;else for(;b.charAt(s)===f.charAt(s);)s++;for(var O=0;O<o.length;O++)o[O]=o[O].replace(b.slice(0,s),i+"/")}return o}))).subscribe((function(t){Object(T.g)(t,{document$:e,location$:n,viewport$:B})})),J.pipe(Object($.a)((function(t){return"global"===t.mode&&"Tab"===t.type})),Object(S.a)(1)).subscribe((function(){var t,e;try{for(var n=Object(r.i)(Object(C.e)(".headerlink")),c=n.next();!c.done;c=n.next()){c.value.style.visibility="visible"}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}));var rt={document$:e,location$:n,viewport$:B,header$:Q,hero$:et,main$:X,navigation$:Z,search$:nt,tabs$:tt,toc$:G,clipboard$:K,keyboard$:J,dialog$:W};return j.a.apply(void 0,Object(r.g)(Object(i.a)(rt))).subscribe(),rt}document.documentElement.classList.remove("no-js"),document.documentElement.classList.add("js"),navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&document.documentElement.classList.add("ios")}]));
-//# sourceMappingURL=bundle.f9edbbd5.min.js.map
\ No newline at end of file
diff --git a/assets/javascripts/bundle.f9edbbd5.min.js.map b/assets/javascripts/bundle.f9edbbd5.min.js.map
deleted file mode 100644
index 032b3bb..0000000
--- a/assets/javascripts/bundle.f9edbbd5.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/assets/javascripts/browser/document/index.ts","webpack:///./src/assets/javascripts/browser/element/_/index.ts","webpack:///./src/assets/javascripts/browser/element/focus/index.ts","webpack:///./src/assets/javascripts/browser/element/offset/index.ts","webpack:///./src/assets/javascripts/browser/element/select/index.ts","webpack:///./src/assets/javascripts/browser/element/size/index.ts","webpack:///./src/assets/javascripts/browser/keyboard/index.ts","webpack:///./src/assets/javascripts/browser/location/_/index.ts","webpack:///./src/assets/javascripts/browser/location/base/index.ts","webpack:///./src/assets/javascripts/browser/location/hash/index.ts","webpack:///./src/assets/javascripts/browser/media/index.ts","webpack:///./src/assets/javascripts/browser/toggle/index.ts","webpack:///./src/assets/javascripts/browser/viewport/offset/index.ts","webpack:///./src/assets/javascripts/browser/viewport/size/index.ts","webpack:///./src/assets/javascripts/browser/viewport/_/index.ts","webpack:///./src/assets/javascripts/browser/worker/index.ts","webpack:///./src/assets/javascripts/utilities/config/index.ts","webpack:///./src/assets/javascripts/utilities/jsx/index.ts","webpack:///./src/assets/javascripts/utilities/rxjs/index.ts","webpack:///./src/assets/javascripts/utilities/string/index.ts","webpack:///./src/assets/javascripts/components/index.ts","webpack:///./src/assets/javascripts/integrations/clipboard/index.ts","webpack:///./src/assets/javascripts/integrations/dialog/index.ts","webpack:///./src/assets/javascripts/integrations/instant/index.ts","webpack:///./src/assets/javascripts/integrations/keyboard/index.ts","webpack:///./src/assets/javascripts/components/_/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/set/index.ts","webpack:///./src/assets/javascripts/components/shared/index.ts","webpack:///./src/assets/javascripts/templates/clipboard/index.tsx","webpack:///./src/assets/javascripts/templates/search/index.tsx","webpack:///./src/assets/javascripts/templates/source/index.tsx","webpack:///./src/assets/javascripts/templates/table/index.tsx","webpack:///./src/assets/javascripts/components/shared/sidebar/set/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/index.ts","webpack:///./src/assets/javascripts/integrations/search/_/index.ts","webpack:///./src/assets/javascripts/integrations/search/document/index.ts","webpack:///./src/assets/javascripts/integrations/search/highlighter/index.ts","webpack:///./src/assets/javascripts/integrations/search/transform/index.ts","webpack:///./src/assets/javascripts/integrations/search/worker/message/index.ts","webpack:///./src/assets/javascripts/integrations/search/worker/_/index.ts","webpack:///./src/assets/javascripts/components/shared/sidebar/index.ts","webpack:///./src/assets/javascripts/components/shared/sidebar/react/index.ts","webpack:///./src/assets/javascripts/components/toc/index.ts","webpack:///./src/assets/javascripts/components/toc/_/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/react/index.ts","webpack:///./src/assets/javascripts/components/search/_/index.ts","webpack:///./src/assets/javascripts/components/search/query/_/index.ts","webpack:///./src/assets/javascripts/components/search/query/react/index.ts","webpack:///./src/assets/javascripts/components/search/reset/_/index.ts","webpack:///./src/assets/javascripts/components/search/reset/react/index.ts","webpack:///./src/assets/javascripts/components/search/result/set/index.ts","webpack:///./src/assets/javascripts/components/search/result/react/index.ts","webpack:///./src/assets/javascripts/components/search/result/_/index.ts","webpack:///./src/assets/javascripts/components/main/_/index.ts","webpack:///./src/assets/javascripts/components/main/react/index.ts","webpack:///./src/assets/javascripts/components/main/set/index.ts","webpack:///./src/assets/javascripts/components/hero/_/index.ts","webpack:///./src/assets/javascripts/components/hero/react/index.ts","webpack:///./src/assets/javascripts/components/hero/set/index.ts","webpack:///./src/assets/javascripts/components/tabs/_/index.ts","webpack:///./src/assets/javascripts/components/tabs/react/index.ts","webpack:///./src/assets/javascripts/components/tabs/set/index.ts","webpack:///./src/assets/javascripts/components/header/_/index.ts","webpack:///./src/assets/javascripts/components/header/react/index.ts","webpack:///./src/assets/javascripts/components/header/set/index.ts","webpack:///./src/assets/javascripts/components/navigation/_/index.ts","webpack:///./src/assets/javascripts/patches/scrollfix/index.ts","webpack:///./src/assets/javascripts/patches/source/index.ts","webpack:///./src/assets/javascripts/patches/source/github/index.ts","webpack:///./src/assets/javascripts/patches/source/gitlab/index.ts","webpack:///./src/assets/javascripts/index.ts","webpack:///./src/assets/javascripts/patches/code/index.ts","webpack:///./src/assets/javascripts/patches/details/index.ts","webpack:///./src/assets/javascripts/patches/script/index.ts","webpack:///./src/assets/javascripts/patches/table/index.ts"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","watchDocument","document$","ReplaySubject","fromEvent","document","pipe","mapTo","subscribe","getElement","selector","node","querySelector","undefined","getElementOrThrow","el","ReferenceError","getActiveElement","activeElement","HTMLElement","getElements","Array","from","querySelectorAll","createElement","tagName","replaceElement","source","target","replaceWith","setElementFocus","focus","blur","watchElementFocus","merge","map","startWith","shareReplay","getElementOffset","x","scrollLeft","y","scrollTop","watchElementOffset","setElementSelection","HTMLInputElement","Error","select","watchElementSize","fromEventPattern","next","contentRect","width","Math","round","height","observe","offsetWidth","offsetHeight","getElementSize","isSusceptibleToKeyboard","isContentEditable","watchKeyboard","filter","ev","metaKey","ctrlKey","type","claim","preventDefault","stopPropagation","share","setLocation","url","location","href","isLocalLocation","ref","host","test","pathname","isAnchorLocation","hash","watchLocation","BehaviorSubject","URL","watchLocationBase","base","take","toString","replace","getLocationHash","substring","setLocationHash","addEventListener","click","watchLocationHash","watchMedia","query","media","matchMedia","addListener","matches","toggles","drawer","search","getToggle","checked","setToggle","watchToggle","getViewportOffset","max","pageXOffset","pageYOffset","setViewportOffset","scrollTo","getViewportSize","innerWidth","innerHeight","watchViewport","combineLatest","passive","offset","size","watchViewportAt","header$","viewport$","size$","distinctUntilKeyChanged","offset$","offsetLeft","offsetTop","watchWorker","worker","tx$","rx$","pluck","throttle","leading","trailing","tap","message","postMessage","switchMapTo","isConfig","config","features","createElementNS","setAttribute","setAttributeNS","appendChild","child","innerHTML","Node","isArray","h","attributes","keys","attr","children","cache","factory","defer","sessionStorage","getItem","of","JSON","parse","value$","setItem","stringify","err","lang","translate","textContent","truncate","toFixed","len","charCodeAt","setupClipboard","dialog$","forEach","block","index","parent","parentElement","id","insertBefore","clipboard$","on","clearSelection","setupDialog","duration","Subject","dialog","classList","add","switchMap","text","body","container","observeOn","animationFrame","delay","removeAttribute","remove","setupInstantLoading","urls","location$","history","scrollRestoration","favicon","state$","closest","includes","push$","pop$","state","distinctUntilChanged","prev","ajax$","skip","ajax","responseType","withCredentials","catchError","sample","pushState","dom","DOMParser","response","parseFromString","instant$","withLatestFrom","title","head","dispatchEvent","CustomEvent","debounceTime","replaceState","bufferCount","setupKeyboard","keyboard$","active","els","indexOf","components$","setupComponents","names","reduce","components","useComponent","setAnchorBlur","resetAnchorBlur","setAnchorActive","toggle","resetAnchorActive","css","renderClipboardButton","class","xmlns","viewBox","renderSearchResult","article","sections","icon","tabIndex","renderSource","facts","fact","renderTable","table","setSidebarOffset","style","top","resetSidebarOffset","setSidebarHeight","resetSidebarHeight","docs","pipeline","this","documents","Map","doc","split","path","linked","set","setupSearchDocumentMap","highlight","separator","RegExp","_","term","trim","match","setupSearchHighlighter","lunr","tokenizer","use","multiLanguage","fns","a","b","Set","has","difference","language","fn","searchPipeline","field","boost","Index","load","groups","results","section","console","warn","defaultTransform","terms","join","SearchMessageType","isSearchReadyMessage","READY","isSearchQueryMessage","QUERY","isSearchResultMessage","RESULT","setupSearchIndex","identity","setupSearchWorker","index$","base$","Worker","SETUP","watchSidebar","main$","adjust","min","lock","applySidebar","mountTableOfContents","tablet$","tablet","sidebar$","anchors$","sidebar","anchors","watchAnchorList","decodeURIComponent","adjust$","header","anchor","pop","applyAnchorList","mountSearch","query$","reset$","result$","status$","status","mountSearchQuery","options","focus$","watchSearchQuery","mountSearchReset","watchSearchReset","addToSearchResultList","applySearchResult","ready$","fetch$","list","meta","setSearchResultMeta","resetSearchResultMeta","scan","scrollHeight","finalize","resetSearchResultList","mountSearchResult","mountMain","setHeaderShadow","resetHeaderShadow","border$","bottom","watchMain","main","mountHero","hidden","setHeroHidden","resetHeroHidden","applyHero","mountTabs","screen$","screen","setTabsHidden","resetTabsHidden","applyTabs","mountHeader","styles","getComputedStyle","position","sticky","watchHeader","type$","hx","setHeaderTitleActive","resetHeaderTitleActive","applyHeaderType","mountNavigation","isAppleDevice","navigator","userAgent","fetchSourceFacts","toLowerCase","user","repo","stargazers_count","forks_count","public_repos","fetchSourceFactsFromGitHub","project","encodeURIComponent","star_count","fetchSourceFactsFromGitLab","setScrollLock","resetScrollLock","parseInt","initialize","SyntaxError","hash$","els$","scrollWidth","clientWidth","patchCodeBlocks","details","open","scrollIntoView","patchDetails","src","script","hasAttribute","patchSource","sentinel","patchTables","iif","patchScrollfix","navigation$","toc$","tabs$","hero$","search$","transform","protocol","sortBy","prop","charAt","visibility","values","documentElement"],"mappings":"4DACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBhB,EAAkB,CACrBiB,EAAG,GAGAZ,EAAkB,GAGtB,SAASS,EAAoB1B,GAG5B,GAAG4B,EAAiB5B,GACnB,OAAO4B,EAAiB5B,GAAU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EAAI,KAExD,OAAOwH,MAGRvM,WAAU,SAAAuM,GACT,YAAoBA,EAAM,CAAE7M,UAAS,EAAE8M,UAAS,EAAElF,UAAS,OAOnEoH,EACG5O,KACC,OAAAyD,EAAA,IAAO,SAAAxE,GAAO,MAAa,WAAbA,EAAIJ,MAAkC,QAAbI,EAAI4E,QAC3C,OAAAqB,EAAA,GAAK,IAEJhF,WAAU,W,YACT,IAAmB,8BAAY,gBAAc,+BAA9B,QACRyQ,MAAMyL,WAAa,W,qGAKhC,IAAMjP,GAAQ,CAGZvN,UAAS,EACT8M,UAAS,EACTlF,UAAS,EAGTD,QAAO,EACPsU,MAAK,GACLlH,MAAK,EACL+G,YAAW,EACXI,QAAO,GACPF,MAAK,GACLD,KAAI,EAGJrQ,WAAU,EACVsD,UAAS,EACT9D,QAAO,GAMT,OAFAlJ,EAAA,EAAK,yBAAI,OAAAya,EAAA,GAAOlP,MACbjN,YACIiN,GA3VTpN,SAASuc,gBAAgBzQ,UAAUU,OAAO,SAC1CxM,SAASuc,gBAAgBzQ,UAAUC,IAAI,MAGnCwN,UAAUC,UAAUtH,MAAM,wBAC5BlS,SAASuc,gBAAgBzQ,UAAUC,IAAI","file":"assets/javascripts/bundle.f9edbbd5.min.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([86,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ReplaySubject, Subject, fromEvent } from \"rxjs\"\nimport { mapTo } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch document\n *\n * Documents must be implemented as subjects, so all downstream observables are\n * automatically updated when a new document is emitted. This enabled features\n * like instant loading.\n *\n * @return Document subject\n */\nexport function watchDocument(): Subject<Document> {\n  const document$ = new ReplaySubject<Document>()\n  fromEvent(document, \"DOMContentLoaded\")\n    .pipe(\n      mapTo(document)\n    )\n      .subscribe(document$)\n\n  /* Return document */\n  return document$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Element or nothing\n */\nexport function getElement<T extends HTMLElement>(\n  selector: string, node: ParentNode = document\n): T | undefined {\n  return node.querySelector<T>(selector) || undefined\n}\n\n/**\n * Retrieve an element matching a query selector or throw a reference error\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Element\n */\nexport function getElementOrThrow<T extends HTMLElement>(\n  selector: string, node: ParentNode = document\n): T {\n  const el = getElement<T>(selector, node)\n  if (typeof el === \"undefined\")\n    throw new ReferenceError(\n      `Missing element: expected \"${selector}\" to be present`\n    )\n  return el\n}\n\n/**\n * Retrieve the currently active element\n *\n * @return Element or nothing\n */\nexport function getActiveElement(): HTMLElement | undefined {\n  return document.activeElement instanceof HTMLElement\n    ? document.activeElement\n    : undefined\n}\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Elements\n */\nexport function getElements<T extends HTMLElement>(\n  selector: string, node: ParentNode = document\n): T[] {\n  return Array.from(node.querySelectorAll<T>(selector))\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Create an element\n *\n * @template T - Tag name type\n *\n * @param tagName - Tag name\n *\n * @return Element\n */\nexport function createElement<\n  T extends keyof HTMLElementTagNameMap\n>(tagName: T): HTMLElementTagNameMap[T] {\n  return document.createElement(tagName)\n}\n\n/**\n * Replace an element with another element\n *\n * @param source - Source element\n * @param target - Target element\n */\nexport function replaceElement(\n  source: HTMLElement, target: Node\n): void {\n  source.replaceWith(target)\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\nimport { getActiveElement } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set element focus\n *\n * @param el - Element\n * @param value - Whether the element should be focused\n */\nexport function setElementFocus(\nel: HTMLElement, value: boolean = true\n): void {\n  if (value)\n    el.focus()\n  else\n    el.blur()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element focus\n *\n * @param el - Element\n *\n * @return Element focus observable\n */\nexport function watchElementFocus(\n  el: HTMLElement\n): Observable<boolean> {\n  return merge(\n    fromEvent<FocusEvent>(el, \"focus\"),\n    fromEvent<FocusEvent>(el, \"blur\")\n  )\n    .pipe(\n      map(({ type }) => type === \"focus\"),\n      startWith(el === getActiveElement()),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementOffset {\n  x: number                            /* Horizontal offset */\n  y: number                            /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element offset\n *\n * @param el - Element\n *\n * @return Element offset\n */\nexport function getElementOffset(el: HTMLElement): ElementOffset {\n  return {\n    x: el.scrollLeft,\n    y: el.scrollTop\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element offset\n *\n * @param el - Element\n *\n * @return Element offset observable\n */\nexport function watchElementOffset(\n  el: HTMLElement\n): Observable<ElementOffset> {\n  return merge(\n    fromEvent(el, \"scroll\"),\n    fromEvent(window, \"resize\")\n  )\n    .pipe(\n      map(() => getElementOffset(el)),\n      startWith(getElementOffset(el)),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set element text selection\n *\n * @param el - Element\n */\nexport function setElementSelection(\n  el: HTMLElement\n): void {\n  if (el instanceof HTMLInputElement)\n    el.select()\n  else\n    throw new Error(\"Not implemented\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ResizeObserver from \"resize-observer-polyfill\"\nimport { Observable, fromEventPattern } from \"rxjs\"\nimport { shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementSize {\n  width: number                        /* Element width */\n  height: number                       /* Element height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element size\n *\n * @param el - Element\n *\n * @return Element size\n */\nexport function getElementSize(el: HTMLElement): ElementSize {\n  return {\n    width:  el.offsetWidth,\n    height: el.offsetHeight\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element size\n *\n * @param el - Element\n *\n * @return Element size observable\n */\nexport function watchElementSize(\n  el: HTMLElement\n): Observable<ElementSize> {\n  return fromEventPattern<ElementSize>(next => {\n    new ResizeObserver(([{ contentRect }]) => next({\n      width:  Math.round(contentRect.width),\n      height: Math.round(contentRect.height)\n    }))\n      .observe(el)\n  })\n    .pipe(\n      startWith(getElementSize(el)),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { filter, map, share } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Key\n */\nexport interface Key {\n  type: string                         /* Key type */\n  claim(): void                        /* Key claim */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether an element may receive keyboard input\n *\n * @param el - Element\n *\n * @return Test result\n */\nexport function isSusceptibleToKeyboard(el: HTMLElement): boolean {\n  switch (el.tagName) {\n\n    /* Form elements */\n    case \"INPUT\":\n    case \"SELECT\":\n    case \"TEXTAREA\":\n      return true\n\n    /* Everything else */\n    default:\n      return el.isContentEditable\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch keyboard\n *\n * @return Keyboard observable\n */\nexport function watchKeyboard(): Observable<Key> {\n  return fromEvent<KeyboardEvent>(window, \"keydown\")\n    .pipe(\n      filter(ev => !(ev.metaKey || ev.ctrlKey)),\n      map(ev => ({\n        type: ev.key,\n        claim() {\n          ev.preventDefault()\n          ev.stopPropagation()\n        }\n      })),\n      share()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { BehaviorSubject, Subject } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location\n *\n * This function will return a `URL` object (and not `Location`) in order to\n * normalize typings across the application. Furthermore, locations need to be\n * tracked without setting them and `Location` is a singleton which represents\n * the current location.\n *\n * @return URL\n */\nexport function getLocation(): URL {\n  return new URL(location.href)\n}\n\n/**\n * Set location\n *\n * @param url - URL to change to\n */\nexport function setLocation(url: URL): void {\n  location.href = url.href\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Check whether a URL is a local link or a file (except `.html`)\n *\n * @param url - URL or HTML anchor element\n * @param ref - Reference URL\n *\n * @return Test result\n */\nexport function isLocalLocation(\n  url: URL | HTMLAnchorElement,\n  ref: URL | Location = location\n): boolean {\n  return url.host === ref.host\n      && /^(?:\\/[\\w-]+)*(?:\\/?|\\.html)$/i.test(url.pathname)\n}\n\n/**\n * Check whether a URL is an anchor link on the current page\n *\n * @param url - URL or HTML anchor element\n * @param ref - Reference URL\n *\n * @return Test result\n */\nexport function isAnchorLocation(\n  url: URL | HTMLAnchorElement,\n  ref: URL | Location = location\n): boolean {\n  return url.pathname === ref.pathname\n      && url.hash.length > 0\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location\n *\n * @return Location subject\n */\nexport function watchLocation(): Subject<URL> {\n  return new BehaviorSubject<URL>(getLocation())\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport { map, shareReplay, take } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  location$: Observable<URL>           /* Location observable */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location base\n *\n * @return Location base observable\n */\nexport function watchLocationBase(\n  base: string, { location$ }: WatchOptions\n): Observable<string> {\n  return location$\n    .pipe(\n      take(1),\n      map(({ href }) => new URL(base, href)\n        .toString()\n        .replace(/\\/$/, \"\")\n      ),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { filter, map, share, startWith } from \"rxjs/operators\"\n\nimport { createElement } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location hash\n *\n * @return Location hash\n */\nexport function getLocationHash(): string {\n  return location.hash.substring(1)\n}\n\n/**\n * Set location hash\n *\n * Setting a new fragment identifier via `location.hash` will have no effect\n * if the value doesn't change. When a new fragment identifier is set, we want\n * the browser to target the respective element at all times, which is why we\n * use this dirty little trick.\n *\n * @param hash - Location hash\n */\nexport function setLocationHash(hash: string): void {\n  const el = createElement(\"a\")\n  el.href = hash\n  el.addEventListener(\"click\", ev => ev.stopPropagation())\n  el.click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location hash\n *\n * @return Location hash observable\n */\nexport function watchLocationHash(): Observable<string> {\n  return fromEvent<HashChangeEvent>(window, \"hashchange\")\n    .pipe(\n      map(getLocationHash),\n      startWith(getLocationHash()),\n      filter(hash => hash.length > 0),\n      share()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEventPattern } from \"rxjs\"\nimport { shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch media query\n *\n * @param query - Media query\n *\n * @return Media observable\n */\nexport function watchMedia(query: string): Observable<boolean> {\n  const media = matchMedia(query)\n  return fromEventPattern<boolean>(next =>\n    media.addListener(() => next(media.matches))\n  )\n    .pipe(\n      startWith(media.matches),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { map, startWith } from \"rxjs/operators\"\n\nimport { getElementOrThrow } from \"../element\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle\n */\nexport type Toggle =\n  | \"drawer\"                           /* Toggle for drawer */\n  | \"search\"                           /* Toggle for search */\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle map\n */\nconst toggles: Record<Toggle, HTMLInputElement> = {\n  drawer: getElementOrThrow(`[data-md-toggle=drawer]`),\n  search: getElementOrThrow(`[data-md-toggle=search]`)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve the value of a toggle\n *\n * @param name - Toggle\n *\n * @return Toggle value\n */\nexport function getToggle(name: Toggle): boolean {\n  return toggles[name].checked\n}\n\n/**\n * Set toggle\n *\n * Simulating a click event seems to be the most cross-browser compatible way\n * of changing the value while also emitting a `change` event. Before, Material\n * used `CustomEvent` to programmatically change the value of a toggle, but this\n * is a much simpler and cleaner solution which doesn't require a polyfill.\n *\n * @param name - Toggle\n * @param value - Toggle value\n */\nexport function setToggle(name: Toggle, value: boolean): void {\n  if (toggles[name].checked !== value)\n    toggles[name].click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch toggle\n *\n * @param name - Toggle\n *\n * @return Toggle value observable\n */\nexport function watchToggle(name: Toggle): Observable<boolean> {\n  const el = toggles[name]\n  return fromEvent(el, \"change\")\n    .pipe(\n      map(() => el.checked),\n      startWith(el.checked)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport offset\n */\nexport interface ViewportOffset {\n  x: number                            /* Horizontal offset */\n  y: number                            /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport offset\n *\n * On iOS Safari, viewport offset can be negative due to overflow scrolling.\n * As this may induce strange behaviors downstream, we'll just limit it to 0.\n *\n * @return Viewport offset\n */\nexport function getViewportOffset(): ViewportOffset {\n  return {\n    x: Math.max(0, pageXOffset),\n    y: Math.max(0, pageYOffset)\n  }\n}\n\n/**\n * Set viewport offset\n *\n * @param offset - Viewport offset\n */\nexport function setViewportOffset(\n  { x, y }: Partial<ViewportOffset>\n): void {\n  window.scrollTo(x || 0, y || 0)\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffset(): Observable<ViewportOffset> {\n  return merge(\n    fromEvent(window, \"scroll\", { passive: true }),\n    fromEvent(window, \"resize\", { passive: true })\n  )\n    .pipe(\n      map(getViewportOffset),\n      startWith(getViewportOffset())\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { map, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport size\n */\nexport interface ViewportSize {\n  width: number                        /* Viewport width */\n  height: number                       /* Viewport height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport size\n *\n * @return Viewport size\n */\nexport function getViewportSize(): ViewportSize {\n  return {\n    width:  innerWidth,\n    height: innerHeight\n  }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport size\n *\n * @return Viewport size observable\n */\nexport function watchViewportSize(): Observable<ViewportSize> {\n  return fromEvent(window, \"resize\", { passive: true })\n    .pipe(\n      map(getViewportSize),\n      startWith(getViewportSize())\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  shareReplay\n} from \"rxjs/operators\"\n\nimport { Header } from \"components\"\n\nimport {\n  ViewportOffset,\n  watchViewportOffset\n} from \"../offset\"\nimport {\n  ViewportSize,\n  watchViewportSize\n} from \"../size\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport\n */\nexport interface Viewport {\n  offset: ViewportOffset               /* Viewport offset */\n  size: ViewportSize                   /* Viewport size */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch at options\n */\ninterface WatchAtOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport\n *\n * @return Viewport observable\n */\nexport function watchViewport(): Observable<Viewport> {\n  return combineLatest([\n    watchViewportOffset(),\n    watchViewportSize()\n  ])\n    .pipe(\n      map(([offset, size]) => ({ offset, size })),\n      shareReplay(1)\n    )\n}\n\n/**\n * Watch viewport relative to element\n *\n * @param el - Element\n * @param options - Options\n *\n * @return Viewport observable\n */\nexport function watchViewportAt(\n  el: HTMLElement, { header$, viewport$ }: WatchAtOptions\n): Observable<Viewport> {\n  const size$ = viewport$\n    .pipe(\n      distinctUntilKeyChanged(\"size\")\n    )\n\n  /* Compute element offset */\n  const offset$ = combineLatest([size$, header$])\n    .pipe(\n      map((): ViewportOffset => ({\n        x: el.offsetLeft,\n        y: el.offsetTop\n      }))\n    )\n\n  /* Compute relative viewport, return hot observable */\n  return combineLatest([header$, viewport$, offset$])\n    .pipe(\n      map(([{ height }, { offset, size }, { x, y }]) => ({\n        offset: {\n          x: offset.x - x,\n          y: offset.y - y + height\n        },\n        size\n      })),\n      shareReplay(1)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, Subject, fromEventPattern } from \"rxjs\"\nimport {\n  pluck,\n  share,\n  switchMapTo,\n  tap,\n  throttle\n} from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Worker message\n */\nexport interface WorkerMessage {\n  type: unknown                        /* Message type */\n  data?: unknown                       /* Message data */\n}\n\n/**\n * Worker handler\n *\n * @template T - Message type\n */\nexport interface WorkerHandler<\n  T extends WorkerMessage\n> {\n  tx$: Subject<T>                      /* Message transmission subject */\n  rx$: Observable<T>                   /* Message receive observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n *\n * @template T - Worker message type\n */\ninterface WatchOptions<T extends WorkerMessage> {\n  tx$: Observable<T>                   /* Message transmission observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch a web worker\n *\n * This function returns an observable that will send all values emitted by the\n * message observable to the web worker. Web worker communication is expected\n * to be bidirectional (request-response) and synchronous. Messages that are\n * emitted during a pending request are throttled, the last one is emitted.\n *\n * @param worker - Web worker\n * @param options - Options\n *\n * @return Worker message observable\n */\nexport function watchWorker<T extends WorkerMessage>(\n  worker: Worker, { tx$ }: WatchOptions<T>\n): Observable<T> {\n\n  /* Intercept messages from worker-like objects */\n  const rx$ = fromEventPattern<MessageEvent>(next =>\n    worker.addEventListener(\"message\", next)\n  )\n    .pipe<T>(\n      pluck(\"data\")\n    )\n\n  /* Send and receive messages, return hot observable */\n  return tx$\n    .pipe(\n      throttle(() => rx$, { leading: true, trailing: true }),\n      tap(message => worker.postMessage(message)),\n      switchMapTo(rx$),\n      share()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndex, SearchTransformFn } from \"integrations\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Feature flags\n */\nexport type Feature =\n  | \"tabs\"                             /* Tabs navigation */\n  | \"instant\"                          /* Instant loading\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Configuration\n */\nexport interface Config {\n  base: string                         /* Base URL */\n  features: Feature[]                  /* Feature flags */\n  search: {\n    worker: string                     /* Worker URL */\n    index?: Promise<SearchIndex>       /* Promise resolving with index */\n    transform?: SearchTransformFn      /* Transformation function */\n  }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Ensure that the given value is a valid configuration\n *\n * We could use `jsonschema` or any other schema validation framework, but that\n * would just add more bloat to the bundle, so we'll keep it plain and simple.\n *\n * @param config - Configuration\n *\n * @return Test result\n */\nexport function isConfig(config: any): config is Config {\n  return typeof config === \"object\"\n      && typeof config.base === \"string\"\n      && typeof config.features === \"object\"\n      && typeof config.search === \"object\"\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n// tslint:disable no-null-keyword\n\nimport { JSX as JSXInternal } from \"preact\"\nimport { keys } from \"ramda\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * HTML and SVG attributes\n */\ntype Attributes =\n  & JSXInternal.HTMLAttributes\n  & JSXInternal.SVGAttributes\n  & Record<string, any>\n\n/**\n * Child element\n */\ntype Child =\n  | HTMLElement\n  | SVGElement\n  | Text\n  | string\n  | number\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create an element\n *\n * @param tagName - HTML or SVG tag\n *\n * @return Element\n */\nfunction createElement(tagName: string): HTMLElement | SVGElement {\n  switch (tagName) {\n\n    /* SVG elements */\n    case \"svg\":\n    case \"path\":\n      return document.createElementNS(\"http://www.w3.org/2000/svg\", tagName)\n\n    /* HTML elements */\n    default:\n      return document.createElement(tagName)\n  }\n}\n\n/**\n * Set an attribute\n *\n * @param el - Element\n * @param name - Attribute name\n * @param value - Attribute value\n */\nfunction setAttribute(\n  el: HTMLElement | SVGElement, name: string, value: string) {\n  switch (name) {\n\n    /* Attributes to be ignored */\n    case \"xmlns\":\n      break\n\n    /* Attributes of SVG elements */\n    case \"viewBox\":\n    case \"d\":\n      if (typeof value !== \"boolean\")\n        el.setAttributeNS(null, name, value)\n      else if (value)\n        el.setAttributeNS(null, name, \"\")\n      break\n\n    /* Attributes of HTML elements */\n    default:\n      if (typeof value !== \"boolean\")\n        el.setAttribute(name, value)\n      else if (value)\n        el.setAttribute(name, \"\")\n  }\n}\n\n/**\n * Append a child node to an element\n *\n * @param el - Element\n * @param child - Child node(s)\n */\nfunction appendChild(\n  el: HTMLElement | SVGElement, child: Child | Child[]\n): void {\n\n  /* Handle primitive types (including raw HTML) */\n  if (typeof child === \"string\" || typeof child === \"number\") {\n    el.innerHTML += child.toString()\n\n  /* Handle nodes */\n  } else if (child instanceof Node) {\n    el.appendChild(child)\n\n  /* Handle nested children */\n  } else if (Array.isArray(child)) {\n    for (const node of child)\n      appendChild(el, node)\n  }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * JSX factory\n *\n * @param tagName - HTML or SVG tag\n * @param attributes - HTML attributes\n * @param children - Child elements\n *\n * @return Element\n */\nexport function h(\n  tagName: string, attributes: Attributes | null, ...children: Child[]\n): HTMLElement | SVGElement {\n  const el = createElement(tagName)\n\n  /* Set attributes, if any */\n  if (attributes)\n    for (const attr of keys(attributes))\n      setAttribute(el, attr, attributes[attr])\n\n  /* Append child nodes */\n  for (const child of children)\n    appendChild(el, child)\n\n  /* Return element */\n  return el\n}\n\n/* ----------------------------------------------------------------------------\n * Namespace\n * ------------------------------------------------------------------------- */\n\nexport declare namespace h {\n  namespace JSX {\n    type Element = HTMLElement | SVGElement\n    type IntrinsicElements = JSXInternal.IntrinsicElements\n  }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, defer, of } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Cache the last value emitted by an observable in session storage\n *\n * If the key is not found in session storage, the factory is executed and the\n * latest value emitted will automatically be persisted to sessions storage.\n * Note that the values emitted by the returned observable must be serializable\n * as `JSON`, or data will be lost.\n *\n * @template T - Value type\n *\n * @param key - Cache key\n * @param factory - Observable factory\n *\n * @return Value observable\n */\nexport function cache<T>(\n  key: string, factory: () => Observable<T>\n): Observable<T> {\n  return defer(() => {\n    const data = sessionStorage.getItem(key)\n    if (data) {\n      return of(JSON.parse(data) as T)\n\n    /* Retrieve value from observable factory and write to storage */\n    } else {\n      const value$ = factory()\n      value$.subscribe(value => {\n        try {\n          sessionStorage.setItem(key, JSON.stringify(value))\n        } catch (err) {\n          /* Uncritical, just swallow */\n        }\n      })\n\n      /* Return value */\n      return value$\n    }\n  })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElementOrThrow } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Translation keys\n */\ntype TranslateKey =\n  | \"clipboard.copy\"                   /* Copy to clipboard */\n  | \"clipboard.copied\"                 /* Copied to clipboard */\n  | \"search.config.lang\"               /* Search language */\n  | \"search.config.pipeline\"           /* Search pipeline */\n  | \"search.config.separator\"          /* Search separator */\n  | \"search.result.placeholder\"        /* Type to start searching */\n  | \"search.result.none\"               /* No matching documents */\n  | \"search.result.one\"                /* 1 matching document */\n  | \"search.result.other\"              /* # matching documents */\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Translations\n */\nlet lang: Record<string, string>\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Translate the given key\n *\n * @param key - Key to be translated\n * @param value - Value to be replaced\n *\n * @return Translation\n */\nexport function translate(key: TranslateKey, value?: string): string {\n  if (typeof lang === \"undefined\") {\n    const el = getElementOrThrow(\"#__lang\")\n    lang = JSON.parse(el.textContent!)\n  }\n  if (typeof lang[key] === \"undefined\") {\n    throw new ReferenceError(`Invalid translation: ${key}`)\n  }\n  return typeof value !== \"undefined\"\n    ? lang[key].replace(\"#\", value)\n    : lang[key]\n}\n\n/**\n * Truncate a string after the given number of characters\n *\n * This is not a very reasonable approach, since the summaries kind of suck.\n * It would be better to create something more intelligent, highlighting the\n * search occurrences and making a better summary out of it, but this note was\n * written three years ago, so who knows if we'll ever fix it.\n *\n * @param value - Value to be truncated\n * @param n - Number of characters\n *\n * @return Truncated value\n */\nexport function truncate(value: string, n: number): string {\n  let i = n\n  if (value.length > i) {\n    while (value[i] !== \" \" && --i > 0); // tslint:disable-line\n    return `${value.substring(0, i)}...`\n  }\n  return value\n}\n\n/**\n * Round a number for display with source facts\n *\n * This is a reverse engineered version of GitHub's weird rounding algorithm\n * for stars, forks and all other numbers. While all numbers below `1,000` are\n * returned as-is, bigger numbers are converted to fixed numbers:\n *\n * - `1,049` => `1k`\n * - `1,050` => `1.1k`\n * - `1,949` => `1.9k`\n * - `1,950` => `2k`\n *\n * @param value - Original value\n *\n * @return Rounded value\n */\nexport function round(value: number): string {\n  if (value > 999) {\n    const digits = +((value - 950) % 1000 > 99)\n    return `${((value + 0.000001) / 1000).toFixed(digits)}k`\n  } else {\n    return value.toString()\n  }\n}\n\n/**\n * Simple hash function\n *\n * @see https://bit.ly/2wsVjJ4 - Original source\n *\n * @param value - Value to be hashed\n *\n * @return Hash as 32bit integer\n */\nexport function hash(value: string): number {\n    let h = 0\n    for (let i = 0, len = value.length; i < len; i++) {\n      h  = ((h << 5) - h) + value.charCodeAt(i)\n      h |= 0 // Convert to 32bit integer\n    }\n    return h\n  }\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./header\"\nexport * from \"./hero\"\nexport * from \"./main\"\nexport * from \"./navigation\"\nexport * from \"./search\"\nexport * from \"./shared\"\nexport * from \"./tabs\"\nexport * from \"./toc\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport * as ClipboardJS from \"clipboard\"\nimport { NEVER, Observable, Subject, fromEventPattern } from \"rxjs\"\nimport { mapTo, share, tap } from \"rxjs/operators\"\n\nimport { getElements } from \"browser\"\nimport { renderClipboardButton } from \"templates\"\nimport { translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  document$: Observable<Document>      /* Document observable */\n  dialog$: Subject<string>             /* Dialog subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up clipboard\n *\n * This function implements the Clipboard.js integration and injects a button\n * into all code blocks when the document changes.\n *\n * @param options - Options\n *\n * @return Clipboard observable\n */\nexport function setupClipboard(\n  { document$, dialog$ }: SetupOptions\n): Observable<ClipboardJS.Event> {\n  if (!ClipboardJS.isSupported())\n    return NEVER\n\n  /* Inject 'copy-to-clipboard' buttons */\n  document$.subscribe(() => {\n    const blocks = getElements(\"pre > code\")\n    blocks.forEach((block, index) => {\n      const parent = block.parentElement!\n      parent.id = `__code_${index}`\n      parent.insertBefore(renderClipboardButton(parent.id), block)\n    })\n  })\n\n  /* Initialize clipboard */\n  const clipboard$ = fromEventPattern<ClipboardJS.Event>(next => {\n    new ClipboardJS(\".md-clipboard\").on(\"success\", next)\n  })\n    .pipe(\n      share()\n    )\n\n  /* Display notification for clipboard event */\n  clipboard$\n    .pipe(\n      tap(ev => ev.clearSelection()),\n      mapTo(translate(\"clipboard.copied\"))\n    )\n      .subscribe(dialog$)\n\n  /* Return clipboard */\n  return clipboard$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Subject, animationFrameScheduler, of } from \"rxjs\"\nimport {\n  delay,\n  map,\n  observeOn,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { createElement } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  duration?: number                    /* Display duration (default: 2s) */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up dialog\n *\n * @param options - Options\n *\n * @return Dialog observable\n */\nexport function setupDialog(\n  { duration }: SetupOptions = {}\n): Subject<string> {\n  const dialog$ = new Subject<string>()\n\n  /* Create dialog */\n  const dialog = createElement(\"div\")                                           // TODO: improve scoping\n  dialog.classList.add(\"md-dialog\", \"md-typeset\")\n\n  /* Display dialog */\n  dialog$\n    .pipe(\n      switchMap(text => of(document.body) // useComponent(\"container\")\n        .pipe(\n          map(container => container.appendChild(dialog)),\n          observeOn(animationFrameScheduler),\n          delay(1), // Strangley it doesnt work when we push things to the new animation frame...\n          tap(el => {\n            el.innerHTML = text\n            el.setAttribute(\"data-md-state\", \"open\")\n          }),\n          delay(duration || 2000),\n          tap(el => el.removeAttribute(\"data-md-state\")),\n          delay(400),\n          tap(el => {\n            el.innerHTML = \"\"\n            el.remove()\n          })\n        )\n      )\n    )\n      .subscribe()\n\n  /* Return dialog */\n  return dialog$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { NEVER, Observable, Subject, fromEvent, merge, of } from \"rxjs\"\nimport { ajax } from \"rxjs//ajax\"\nimport {\n  bufferCount,\n  catchError,\n  debounceTime,\n  distinctUntilChanged,\n  distinctUntilKeyChanged,\n  filter,\n  map,\n  pluck,\n  sample,\n  share,\n  skip,\n  switchMap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport {\n  Viewport,\n  ViewportOffset,\n  getElement,\n  isAnchorLocation,\n  isLocalLocation,\n  replaceElement,\n  setLocation,\n  setLocationHash,\n  setToggle,\n  setViewportOffset\n} from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * History state\n */\ninterface State {\n  url: URL                             /* State URL */\n  offset?: ViewportOffset              /* State viewport offset */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  document$: Subject<Document>         /* Document subject */\n  location$: Subject<URL>              /* Location subject */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up instant loading\n *\n * When fetching, theoretically, we could use `responseType: \"document\"`, but\n * since all MkDocs links are relative, we need to make sure that the current\n * location matches the document we just loaded. Otherwise any relative links\n * in the document could use the old location.\n *\n * This is the reason why we need to synchronize history events and the process\n * of fetching the document for navigation changes (except `popstate` events):\n *\n * 1. Fetch document via `XMLHTTPRequest`\n * 2. Set new location via `history.pushState`\n * 3. Parse and emit fetched document\n *\n * For `popstate` events, we must not use `history.pushState`, or the forward\n * history will be irreversibly overwritten. In case the request fails, the\n * location change is dispatched regularly.\n *\n * @param options - Options\n */\nexport function setupInstantLoading(\n  urls: string[], { document$, viewport$, location$ }: SetupOptions\n): void {\n\n  /* Disable automatic scroll restoration */\n  if (\"scrollRestoration\" in history)\n    history.scrollRestoration = \"manual\"\n\n  /* Hack: ensure that reloads restore viewport offset */\n  fromEvent(window, \"beforeunload\")\n    .subscribe(() => {\n      history.scrollRestoration = \"auto\"\n    })\n\n  /* Hack: ensure absolute favicon link to omit 404s on document switch */\n  const favicon = getElement<HTMLLinkElement>(`link[rel=\"shortcut icon\"]`)\n  if (typeof favicon !== \"undefined\")\n    favicon.href = favicon.href // tslint:disable-line no-self-assignment\n\n  /* Intercept link clicks and convert to state change */\n  const state$ = fromEvent<MouseEvent>(document.body, \"click\")\n    .pipe(\n      filter(ev => !(ev.metaKey || ev.ctrlKey)),\n      switchMap(ev => {\n        if (ev.target instanceof HTMLElement) {\n          const el = ev.target.closest(\"a\")\n          if (\n            el && !el.target &&\n            isLocalLocation(el) &&\n            urls.includes(el.href)\n          ) {\n            if (!isAnchorLocation(el))\n              ev.preventDefault()\n            return of(el)\n          }\n        }\n        return NEVER\n      }),\n      map(el => ({ url: new URL(el.href) })),\n      share<State>()\n    )\n\n  /* Always close search on link click */\n  state$.subscribe(() => {\n    setToggle(\"search\", false)\n  })\n\n  /* Filter state changes to dispatch */\n  const push$ = state$\n    .pipe(\n      filter(({ url }) => !isAnchorLocation(url)),\n      share()\n    )\n\n  /* Intercept popstate events (history back and forward) */\n  const pop$ = fromEvent<PopStateEvent>(window, \"popstate\")\n    .pipe(\n      filter(ev => ev.state !== null),\n      map(ev => ({\n        url: new URL(location.href),\n        offset: ev.state\n      })),\n      share<State>()\n    )\n\n  /* Emit location change */\n  merge(push$, pop$)\n    .pipe(\n      distinctUntilChanged((prev, next) => prev.url.href === next.url.href),\n      pluck(\"url\")\n    )\n      .subscribe(location$)\n\n  /* Fetch document on location change */\n  const ajax$ = location$\n    .pipe(\n      distinctUntilKeyChanged(\"pathname\"),\n      skip(1),\n      switchMap(url => ajax({\n        url: url.href,\n        responseType: \"text\",\n        withCredentials: true\n      })\n        .pipe(\n          catchError(() => {\n            setLocation(url)\n            return NEVER\n          })\n        )\n      )\n    )\n\n  /* Set new location as soon as the document was fetched */\n  push$\n    .pipe(\n      sample(ajax$)\n    )\n      .subscribe(({ url }) => {\n        history.pushState({}, \"\", url.toString())\n      })\n\n  /* Parse and emit document */\n  const dom = new DOMParser()\n  ajax$\n    .pipe(\n      map(({ response }) => dom.parseFromString(response, \"text/html\"))\n    )\n      .subscribe(document$)\n\n  /* Intercept instant loading */\n  const instant$ = merge(push$, pop$)\n    .pipe(\n      sample(document$)\n    )\n\n  // TODO: this must be combined with search scroll restoration on mobile\n  instant$.subscribe(({ url, offset }) => {\n    if (url.hash && !offset) {\n      setLocationHash(url.hash)\n    } else {\n      setViewportOffset(offset || { y: 0 })\n    }\n  })\n\n  /* Replace document metadata */\n  instant$\n    .pipe(\n      withLatestFrom(document$)\n    )\n      .subscribe(([, { title, head }]) => {\n        document.title = title\n\n        /* Replace meta tags */\n        for (const selector of [\n          `link[rel=\"canonical\"]`,\n          `meta[name=\"author\"]`,\n          `meta[name=\"description\"]`\n        ]) {\n          const next = getElement(selector, head)\n          const prev = getElement(selector, document.head)\n          if (\n            typeof next !== \"undefined\" &&\n            typeof prev !== \"undefined\"\n          ) {\n            replaceElement(prev, next)\n          }\n        }\n\n        /* Finished, dispatch document switch event */\n        document.dispatchEvent(new CustomEvent(\"DOMContentSwitch\"))\n      })\n\n  /* Debounce update of viewport offset */\n  viewport$\n    .pipe(\n      debounceTime(250),\n      distinctUntilKeyChanged(\"offset\")\n    )\n      .subscribe(({ offset }) => {\n        history.replaceState(offset, \"\")\n      })\n\n  /* Set viewport offset from history */\n  merge(state$, pop$)\n    .pipe(\n      bufferCount(2, 1),\n      filter(([prev, next]) => {\n        return prev.url.pathname === next.url.pathname\n            && !isAnchorLocation(next.url)\n      }),\n      map(([, state]) => state)\n    )\n      .subscribe(({ offset }) => {\n        setViewportOffset(offset || { y: 0 })\n      })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport {\n  filter,\n  map,\n  share,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport {\n  Key,\n  getActiveElement,\n  getElement,\n  getElements,\n  getToggle,\n  isSusceptibleToKeyboard,\n  setElementFocus,\n  setElementSelection,\n  setToggle,\n  watchKeyboard\n} from \"browser\"\nimport { useComponent } from \"components\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Keyboard mode\n */\nexport type KeyboardMode =\n  | \"global\"                           /* Global */\n  | \"search\"                           /* Search is open */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Keyboard\n */\nexport interface Keyboard extends Key {\n  mode: KeyboardMode                   /* Keyboard mode */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up keyboard\n *\n * This function will set up the keyboard handlers and ensure that keys are\n * correctly propagated. Currently there are two modes:\n *\n * - `global`: This mode is active when the search is closed. It is intended\n *   to assign hotkeys to specific functions of the site. Currently the search,\n *   previous and next page can be triggered.\n *\n * - `search`: This mode is active when the search is open. It maps certain\n *   navigational keys to offer search results that can be entirely navigated\n *   through keyboard input.\n *\n * The keyboard observable is returned and can be used to monitor the keyboard\n * in order toassign further hotkeys to custom functions.\n *\n * @return Keyboard observable\n */\nexport function setupKeyboard(): Observable<Keyboard> {\n  const keyboard$ = watchKeyboard()\n    .pipe(\n      map<Key, Keyboard>(key => ({\n        mode: getToggle(\"search\") ? \"search\" : \"global\",\n        ...key\n      })),\n      filter(({ mode }) => {\n        if (mode === \"global\") {\n          const active = getActiveElement()\n          if (typeof active !== \"undefined\")\n            return !isSusceptibleToKeyboard(active)\n        }\n        return true\n      }),\n      share()\n    )\n\n  /* Set up search keyboard handlers */\n  keyboard$\n    .pipe(\n      filter(({ mode }) => mode === \"search\"),\n      withLatestFrom(\n        useComponent(\"search-query\"),\n        useComponent(\"search-result\")\n      )\n    )\n      .subscribe(([key, query, result]) => {\n        const active = getActiveElement()\n        switch (key.type) {\n\n          /* Enter: prevent form submission */\n          case \"Enter\":\n            if (active === query)\n              key.claim()\n            break\n\n          /* Escape or Tab: close search */\n          case \"Escape\":\n          case \"Tab\":\n            setToggle(\"search\", false)\n            setElementFocus(query, false)\n            break\n\n          /* Vertical arrows: select previous or next search result */\n          case \"ArrowUp\":\n          case \"ArrowDown\":\n            if (typeof active === \"undefined\") {\n              setElementFocus(query)\n            } else {\n              const els = [query, ...getElements(\"[href]\", result)]\n              const i = Math.max(0, (\n                Math.max(0, els.indexOf(active)) + els.length + (\n                  key.type === \"ArrowUp\" ? -1 : +1\n                )\n              ) % els.length)\n              setElementFocus(els[i])\n            }\n\n            /* Prevent scrolling of page */\n            key.claim()\n            break\n\n          /* All other keys: hand to search query */\n          default:\n            if (query !== getActiveElement())\n              setElementFocus(query)\n        }\n      })\n\n  /* Set up global keyboard handlers */\n  keyboard$\n    .pipe(\n      filter(({ mode }) => mode === \"global\"),\n      withLatestFrom(useComponent(\"search-query\"))\n    )\n      .subscribe(([key, query]) => {\n        switch (key.type) {\n\n          /* Open search and select query */\n          case \"f\":\n          case \"s\":\n          case \"/\":\n            setElementFocus(query)\n            setElementSelection(query)\n            key.claim()\n            break\n\n          /* Go to previous page */\n          case \"p\":\n          case \",\":\n            const prev = getElement(\"[href][rel=prev]\")\n            if (typeof prev !== \"undefined\")\n              prev.click()\n            break\n\n          /* Go to next page */\n          case \"n\":\n          case \".\":\n            const next = getElement(\"[href][rel=next]\")\n            if (typeof next !== \"undefined\")\n              next.click()\n            break\n        }\n      })\n\n  /* Return keyboard */\n  return keyboard$\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { EMPTY, Observable, of } from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  map,\n  scan,\n  shareReplay,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { getElement, replaceElement } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component\n */\nexport type Component =\n  | \"announce\"                         /* Announcement bar */\n  | \"container\"                        /* Container */\n  | \"header\"                           /* Header */\n  | \"header-title\"                     /* Header title */\n  | \"hero\"                             /* Hero */\n  | \"main\"                             /* Main area */\n  | \"navigation\"                       /* Navigation */\n  | \"search\"                           /* Search */\n  | \"search-query\"                     /* Search input */\n  | \"search-reset\"                     /* Search reset */\n  | \"search-result\"                    /* Search results */\n  | \"skip\"                             /* Skip link */\n  | \"tabs\"                             /* Tabs */\n  | \"toc\"                              /* Table of contents */\n\n/**\n * Component map\n */\nexport type ComponentMap = {\n  [P in Component]?: HTMLElement\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Component map observable\n */\nlet components$: Observable<ComponentMap>\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up bindings to components with given names\n *\n * This function will maintain bindings to the elements identified by the given\n * names in-between document switches and update the elements in-place.\n *\n * @param names - Component names\n * @param options - Options\n */\nexport function setupComponents(\n  names: Component[], { document$ }: WatchOptions\n): void {\n  components$ = document$\n    .pipe(\n\n      /* Build component map */\n      map(document => names.reduce<ComponentMap>((components, name) => {\n        const el = getElement(`[data-md-component=${name}]`, document)\n        return {\n          ...components,\n          ...typeof el !== \"undefined\" ? { [name]: el } : {}\n        }\n      }, {})),\n\n      /* Re-compute component map on document switch */\n      scan((prev, next) => {\n        for (const name of names) {\n          switch (name) {\n\n            /* Top-level components: update */\n            case \"announce\":\n            case \"header-title\":\n            case \"container\":\n            case \"skip\":\n              if (name in prev && typeof prev[name] !== \"undefined\") {\n                replaceElement(prev[name]!, next[name]!)\n                prev[name] = next[name]\n              }\n              break\n\n            /* All other components: rebind */\n            default:\n              if (typeof next[name] !== \"undefined\")\n                prev[name] = getElement(`[data-md-component=${name}]`)\n              else\n                delete prev[name]\n          }\n        }\n        return prev\n      }),\n\n      /* Convert to hot observable */\n      shareReplay(1)\n    )\n}\n\n/**\n * Retrieve a component\n *\n * The returned observable will only re-emit if the element changed, i.e. if\n * it was replaced from a document which was switched to.\n *\n * @template T - Element type\n *\n * @param name - Component name\n *\n * @return Component observable\n */\nexport function useComponent<T extends HTMLInputElement>(\n  name: \"search-query\"\n): Observable<T>\nexport function useComponent<T extends HTMLElement>(\n  name: Component\n): Observable<T>\nexport function useComponent<T extends HTMLElement>(\n  name: Component\n): Observable<T> {\n  return components$\n    .pipe(\n      switchMap(components => (\n        typeof components[name] !== \"undefined\"\n          ? of(components[name] as T)\n          : EMPTY\n      )),\n      distinctUntilChanged()\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set anchor blur\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is blurred\n */\nexport function setAnchorBlur(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"blur\" : \"\")\n}\n\n/**\n * Reset anchor blur\n *\n * @param el - Anchor element\n */\nexport function resetAnchorBlur(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set anchor active\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is active\n */\nexport function setAnchorActive(\n  el: HTMLElement, value: boolean\n): void {\n  el.classList.toggle(\"md-nav__link--active\", value)\n}\n\n/**\n * Reset anchor active\n *\n * @param el - Anchor element\n */\nexport function resetAnchorActive(\n  el: HTMLElement\n): void {\n  el.classList.remove(\"md-nav__link--active\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./sidebar\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  container: \"md-clipboard md-icon\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Path of `file-search-outline` icon\n */\nconst path =\n  \"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 \" +\n  \"21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a 'copy-to-clipboard' button\n *\n * @param id - Unique identifier\n *\n * @return Element\n */\nexport function renderClipboardButton(\n  id: string\n) {\n  return (\n    <button\n      class={css.container}\n      title={translate(\"clipboard.copy\")}\n      data-clipboard-target={`#${id} > code`}\n    >\n      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n        <path d={path}></path>\n      </svg>\n    </button>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchResult } from \"integrations/search\"\nimport { h, truncate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  item:    \"md-search-result__item\",\n  link:    \"md-search-result__link\",\n  article: \"md-search-result__article md-search-result__article--document\",\n  section: \"md-search-result__article\",\n  title:   \"md-search-result__title\",\n  teaser:  \"md-search-result__teaser\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Path of `content-copy` icon\n */\nconst path =\n  \"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H13C12.59,21.75 12.2,21.44 \" +\n  \"11.86,21.1C11.53,20.77 11.25,20.4 11,20H6V4H13V9H18V10.18C18.71,10.34 \" +\n  \"19.39,10.61 20,11V8L14,2M20.31,18.9C21.64,16.79 21,14 \" +\n  \"18.91,12.68C16.8,11.35 14,12 12.69,14.08C11.35,16.19 12,18.97 \" +\n  \"14.09,20.3C15.55,21.23 17.41,21.23 \" +\n  \"18.88,20.32L22,23.39L23.39,22L20.31,18.9M16.5,19A2.5,2.5 0 0,1 \" +\n  \"14,16.5A2.5,2.5 0 0,1 16.5,14A2.5,2.5 0 0,1 19,16.5A2.5,2.5 0 0,1 16.5,19Z\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search result\n *\n * @param result - Search result\n *\n * @return Element\n */\nexport function renderSearchResult(\n  { article, sections }: SearchResult\n) {\n\n  /* Render icon */\n  const icon = (\n    <div class=\"md-search-result__icon md-icon\">\n      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n        <path d={path}></path>\n      </svg>\n    </div>\n  )\n\n  /* Render article and sections */\n  const children = [article, ...sections].map(document => {\n    const { location, title, text } = document\n    return (\n      <a href={location} class={css.link} tabIndex={-1}>\n        <article class={\"parent\" in document ? css.section : css.article}>\n          {!(\"parent\" in document) && icon}\n          <h1 class={css.title}>{title}</h1>\n          {text.length > 0 && <p class={css.teaser}>{truncate(text, 320)}</p>}\n        </article>\n      </a>\n    )\n  })\n\n  /* Render search result */\n  return (\n    <li class={css.item}>\n      {children}\n    </li>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SourceFacts } from \"patches/source\"\nimport { h } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  facts: \"md-source__facts\",\n  fact:  \"md-source__fact\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render source facts\n *\n * @param facts - Source facts\n *\n * @return Element\n */\nexport function renderSource(\n  facts: SourceFacts\n) {\n  const children = facts.map(fact => (\n    <li class={css.fact}>{fact}</li>\n  ))\n  return (\n    <ul class={css.facts}>\n      {children}\n    </ul>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n  wrapper: \"md-typeset__scrollwrap\",\n  table:   \"md-typeset__table\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a table inside a wrapper to improve scrolling on mobile\n *\n * @param table - Table element\n *\n * @return Element\n */\nexport function renderTable(\n  table: HTMLTableElement\n) {\n  return (\n    <div class={css.wrapper}>\n      <div class={css.table}>\n        {table}\n      </div>\n    </div>\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar offset\n *\n * @param el - Sidebar element\n * @param value - Sidebar offset\n */\nexport function setSidebarOffset(\n  el: HTMLElement, value: number\n): void {\n  el.style.top = `${value}px`\n}\n\n/**\n * Reset sidebar offset\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarOffset(\n  el: HTMLElement\n): void {\n  el.style.top = \"\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar height\n *\n * @param el - Sidebar element\n * @param value - Sidebar height\n */\nexport function setSidebarHeight(\n  el: HTMLElement, value: number\n): void {\n  el.style.height = `${value}px`\n}\n\n/**\n * Reset sidebar height\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarHeight(\n  el: HTMLElement\n): void {\n  el.style.height = \"\"\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./react\"\nexport * from \"./set\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  ArticleDocument,\n  SearchDocumentMap,\n  SectionDocument,\n  setupSearchDocumentMap\n} from \"../document\"\nimport {\n  SearchHighlightFactoryFn,\n  setupSearchHighlighter\n} from \"../highlighter\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index configuration\n */\nexport interface SearchIndexConfig {\n  lang: string[]                       /* Search languages */\n  separator: string                    /* Search separator */\n}\n\n/**\n * Search index document\n */\nexport interface SearchIndexDocument {\n  location: string                     /* Document location */\n  title: string                        /* Document title */\n  text: string                         /* Document text */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index pipeline function\n */\nexport type SearchIndexPipelineFn =\n  | \"trimmer\"                          /* Trimmer */\n  | \"stopWordFilter\"                   /* Stop word filter */\n  | \"stemmer\"                          /* Stemmer */\n\n/**\n * Search index pipeline\n */\nexport type SearchIndexPipeline = SearchIndexPipelineFn[]\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index\n *\n * This interfaces describes the format of the `search_index.json` file which\n * is automatically built by the MkDocs search plugin.\n */\nexport interface SearchIndex {\n  config: SearchIndexConfig            /* Search index configuration */\n  docs: SearchIndexDocument[]          /* Search index documents */\n  index?: object | string              /* Prebuilt or serialized index */\n  pipeline?: SearchIndexPipeline       /* Search index pipeline */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search result\n */\nexport interface SearchResult {\n  article: ArticleDocument             /* Article document */\n  sections: SectionDocument[]          /* Section documents */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Compute the difference of two lists of strings\n *\n * @param a - 1st list of strings\n * @param b - 2nd list of strings\n *\n * @return Difference\n */\nfunction difference(a: string[], b: string[]): string[] {\n  const [x, y] = [new Set(a), new Set(b)]\n  return [\n    ...new Set([...x].filter(value => !y.has(value)))\n  ]\n}\n\n/* ----------------------------------------------------------------------------\n * Class\n * ------------------------------------------------------------------------- */\n\n/**\n * Search\n *\n * Note that `lunr` is injected via Webpack, as it will otherwise also be\n * bundled in the application bundle.\n */\nexport class Search {\n\n  /**\n   * Search document mapping\n   *\n   * A mapping of URLs (including hash fragments) to the actual articles and\n   * sections of the documentation. The search document mapping must be created\n   * regardless of whether the index was prebuilt or not, as `lunr` itself will\n   * only store the actual index.\n   */\n  protected documents: SearchDocumentMap\n\n  /**\n   * Search highlight factory function\n   */\n  protected highlight: SearchHighlightFactoryFn\n\n  /**\n   * The `lunr` search index\n   */\n  protected index: lunr.Index\n\n  /**\n   * Create the search integration\n   *\n   * @param data - Search index\n   */\n  public constructor({ config, docs, pipeline, index }: SearchIndex) {\n    this.documents = setupSearchDocumentMap(docs)\n    this.highlight = setupSearchHighlighter(config)\n\n    /* Set separator for tokenizer */\n    lunr.tokenizer.separator = new RegExp(config.separator)\n\n    /* If no index was given, create it */\n    if (typeof index === \"undefined\") {\n      this.index = lunr(function() {\n\n        /* Set up alternate search languages */\n        if (config.lang.length === 1 && config.lang[0] !== \"en\") {\n          this.use((lunr as any)[config.lang[0]])\n        } else if (config.lang.length > 1) {\n          this.use((lunr as any).multiLanguage(...config.lang))\n        }\n\n        /* Compute functions to be removed from the pipeline */\n        const fns = difference([\n          \"trimmer\", \"stopWordFilter\", \"stemmer\"\n        ], pipeline!)\n\n        /* Remove functions from the pipeline for every language */\n        for (const lang of config.lang.map(language => (\n          language === \"en\" ? lunr : (lunr as any)[language]\n        ))) {\n          for (const fn of fns) {\n            this.pipeline.remove(lang[fn])\n            this.searchPipeline.remove(lang[fn])\n          }\n        }\n\n        /* Set up fields and reference */\n        this.field(\"title\", { boost: 1000 })\n        this.field(\"text\")\n        this.ref(\"location\")\n\n        /* Index documents */\n        for (const doc of docs)\n          this.add(doc)\n      })\n\n    /* Prebuilt or serialized index */\n    } else {\n      this.index = lunr.Index.load(\n        typeof index === \"string\"\n          ? JSON.parse(index)\n          : index\n      )\n    }\n  }\n\n  /**\n   * Search for matching documents\n   *\n   * The search index which MkDocs provides is divided up into articles, which\n   * contain the whole content of the individual pages, and sections, which only\n   * contain the contents of the subsections obtained by breaking the individual\n   * pages up at `h1` ... `h6`. As there may be many sections on different pages\n   * with identical titles (for example within this very project, e.g. \"Usage\"\n   * or \"Installation\"), they need to be put into the context of the containing\n   * page. For this reason, section results are grouped within their respective\n   * articles which are the top-level results that are returned.\n   *\n   * @param value - Query value\n   *\n   * @return Search results\n   */\n  public query(value: string): SearchResult[] {\n    if (value) {\n      try {\n\n        /* Group sections by containing article */\n        const groups = this.index.search(value)\n          .reduce((results, result) => {\n            const document = this.documents.get(result.ref)\n            if (typeof document !== \"undefined\") {\n              if (\"parent\" in document) {\n                const ref = document.parent.location\n                results.set(ref, [...results.get(ref) || [], result])\n              } else {\n                const ref = document.location\n                results.set(ref, results.get(ref) || [])\n              }\n            }\n            return results\n          }, new Map<string, lunr.Index.Result[]>())\n\n        /* Create highlighter for query */\n        const fn = this.highlight(value)\n\n        /* Map groups to search documents */\n        return [...groups].map(([ref, sections]) => ({\n          article: fn(this.documents.get(ref) as ArticleDocument),\n          sections: sections.map(section => {\n            return fn(this.documents.get(section.ref) as SectionDocument)\n          })\n        }))\n\n      /* Log errors to console (for now) */\n      } catch (err) {\n        // tslint:disable-next-line no-console\n        console.warn(`Invalid query: ${value} – see https://bit.ly/2s3ChXG`)\n      }\n    }\n\n    /* Return nothing in case of error or empty query */\n    return []\n  }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport * as escapeHTML from \"escape-html\"\n\nimport { SearchIndexDocument } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * A top-level article\n */\nexport interface ArticleDocument extends SearchIndexDocument {\n  linked: boolean                      /* Whether the section was linked */\n}\n\n/**\n * A section of an article\n */\nexport interface SectionDocument extends SearchIndexDocument {\n  parent: ArticleDocument              /* Parent article */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search document\n */\nexport type SearchDocument =\n  | ArticleDocument\n  | SectionDocument\n\n/**\n * Search document mapping\n */\nexport type SearchDocumentMap = Map<string, SearchDocument>\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document mapping\n *\n * @param docs - Search index documents\n *\n * @return Search document map\n */\nexport function setupSearchDocumentMap(\n  docs: SearchIndexDocument[]\n): SearchDocumentMap {\n  const documents = new Map<string, SearchDocument>()\n  for (const doc of docs) {\n    const [path, hash] = doc.location.split(\"#\")\n\n    /* Extract location and title */\n    const location = doc.location\n    const title    = doc.title\n\n    /* Escape and cleanup text */\n    const text = escapeHTML(doc.text)\n      .replace(/\\s+(?=[,.:;!?])/g, \"\")\n      .replace(/\\s+/g, \" \")\n\n    /* Handle section */\n    if (hash) {\n      const parent = documents.get(path) as ArticleDocument\n\n      /* Ignore first section, override article */\n      if (!parent.linked) {\n        parent.title  = doc.title\n        parent.text   = text\n        parent.linked = true\n\n      /* Add subsequent section */\n      } else {\n        documents.set(location, {\n          location,\n          title,\n          text,\n          parent\n        })\n      }\n\n    /* Add article */\n    } else {\n      documents.set(location, {\n        location,\n        title,\n        text,\n        linked: false\n      })\n    }\n  }\n  return documents\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndexConfig } from \"../_\"\nimport { SearchDocument } from \"../document\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlight function\n *\n * @template T - Search document type\n *\n * @param document - Search document\n *\n * @return Highlighted document\n */\nexport type SearchHighlightFn = <\n  T extends SearchDocument\n>(document: Readonly<T>) => T\n\n/**\n * Search highlight factory function\n *\n * @param value - Query value\n *\n * @return Search highlight function\n */\nexport type SearchHighlightFactoryFn = (value: string) => SearchHighlightFn\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search highlighter\n *\n * @param config - Search index configuration\n *\n * @return Search highlight factory function\n */\nexport function setupSearchHighlighter(\n  config: SearchIndexConfig\n): SearchHighlightFactoryFn {\n  const separator = new RegExp(config.separator, \"img\")\n  const highlight = (_: unknown, data: string, term: string) => {\n    return `${data}<em>${term}</em>`\n  }\n\n  /* Return factory function */\n  return (value: string) => {\n    value = value\n      .replace(/[\\s*+\\-:~^]+/g, \" \")\n      .trim()\n\n    /* Create search term match expression */\n    const match = new RegExp(`(^|${config.separator})(${\n      value\n        .replace(/[|\\\\{}()[\\]^$+*?.-]/g, \"\\\\$&\")\n        .replace(separator, \"|\")\n    })`, \"img\")\n\n    /* Highlight document */\n    return document => ({\n      ...document,\n      title: document.title.replace(match, highlight),\n      text:  document.text.replace(match, highlight)\n    })\n  }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search transformation function\n *\n * @param value - Query value\n *\n * @return Transformed query value\n */\nexport type SearchTransformFn = (value: string) => string\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Default transformation function\n *\n * 1. Search for terms in quotation marks and prepend a `+` modifier to denote\n *    that the resulting document must contain all terms, converting the query\n *    to an `AND` query (as opposed to the default `OR` behavior). While users\n *    may expect terms enclosed in quotation marks to map to span queries, i.e.\n *    for which order is important, `lunr` doesn't support them, so the best\n *    we can do is to convert the terms to an `AND` query.\n *\n * 2. Replace control characters which are not located at the beginning of the\n *    query or preceded by white space, or are not followed by a non-whitespace\n *    character or are at the end of the query string. Furthermore, filter\n *    unmatched quotation marks.\n *\n * 3. Trim excess whitespace from left and right.\n *\n * 4. Append a wildcard to the end of every word to make every word a prefix\n *    query in order to provide a good typeahead experience, by adding an\n *    asterisk (wildcard) in between terms, which can be denoted by whitespace,\n *    any non-control character, or a word boundary.\n *\n * @param value - Query value\n *\n * @return Transformed query value\n */\nexport function defaultTransform(value: string): string {\n  return value\n    .split(/\"([^\"]+)\"/g)                            /* => 1 */\n      .map((terms, i) => i & 1\n        ? terms.replace(/^\\b|^(?![^\\x00-\\x7F]|$)|\\s+/g, \" +\")\n        : terms\n      )\n      .join(\"\")\n    .replace(/\"|(?:^|\\s+)[*+\\-:^~]+(?=\\s+|$)/g, \"\") /* => 2 */\n    .trim()                                         /* => 3 */\n    .replace(/\\s+|(?![^\\x00-\\x7F]|^)$|\\b$/g, \"* \")  /* => 4 */\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndex, SearchResult } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search message type\n */\nexport const enum SearchMessageType {\n  SETUP,                               /* Search index setup */\n  READY,                               /* Search index ready */\n  QUERY,                               /* Search query */\n  RESULT                               /* Search results */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message containing the data necessary to setup the search index\n */\nexport interface SearchSetupMessage {\n  type: SearchMessageType.SETUP        /* Message type */\n  data: SearchIndex                    /* Message data */\n}\n\n/**\n * A message indicating the search index is ready\n */\nexport interface SearchReadyMessage {\n  type: SearchMessageType.READY        /* Message type */\n}\n\n/**\n * A message containing a search query\n */\nexport interface SearchQueryMessage {\n  type: SearchMessageType.QUERY        /* Message type */\n  data: string                         /* Message data */\n}\n\n/**\n * A message containing results for a search query\n */\nexport interface SearchResultMessage {\n  type: SearchMessageType.RESULT       /* Message type */\n  data: SearchResult[]                 /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message exchanged with the search worker\n */\nexport type SearchMessage =\n  | SearchSetupMessage\n  | SearchReadyMessage\n  | SearchQueryMessage\n  | SearchResultMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for search setup messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchSetupMessage(\n  message: SearchMessage\n): message is SearchSetupMessage {\n  return message.type === SearchMessageType.SETUP\n}\n\n/**\n * Type guard for search ready messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchReadyMessage(\n  message: SearchMessage\n): message is SearchReadyMessage {\n  return message.type === SearchMessageType.READY\n}\n\n/**\n * Type guard for search query messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchQueryMessage(\n  message: SearchMessage\n): message is SearchQueryMessage {\n  return message.type === SearchMessageType.QUERY\n}\n\n/**\n * Type guard for search result messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchResultMessage(\n  message: SearchMessage\n): message is SearchResultMessage {\n  return message.type === SearchMessageType.RESULT\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, Subject, asyncScheduler } from \"rxjs\"\nimport {\n  map,\n  observeOn,\n  shareReplay,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport { WorkerHandler, watchWorker } from \"browser\"\nimport { translate } from \"utilities\"\n\nimport { SearchIndex, SearchIndexPipeline } from \"../../_\"\nimport {\n  SearchMessage,\n  SearchMessageType,\n  SearchSetupMessage,\n  isSearchResultMessage\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n  index$: Observable<SearchIndex>      /* Search index observable */\n  base$: Observable<string>            /* Location base observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search index\n *\n * @param data - Search index\n *\n * @return Search index\n */\nfunction setupSearchIndex(\n  { config, docs, index }: SearchIndex\n): SearchIndex {\n\n  /* Override default language with value from translation */\n  if (config.lang.length === 1 && config.lang[0] === \"en\")\n    config.lang = [translate(\"search.config.lang\")]\n\n  /* Override default separator with value from translation */\n  if (config.separator === \"[\\\\s\\\\-]+\")\n    config.separator = translate(\"search.config.separator\")\n\n  /* Set pipeline from translation */\n  const pipeline = translate(\"search.config.pipeline\")\n    .split(/\\s*,\\s*/)\n    .filter(identity) as SearchIndexPipeline\n\n  /* Return search index after defaulting */\n  return { config, docs, index, pipeline }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search web worker\n *\n * This function will create a web worker to set up and query the search index\n * which is done using `lunr`. The index must be passed as an observable to\n * enable hacks like _localsearch_ via search index embedding as JSON.\n *\n * @param url - Worker URL\n * @param options - Options\n *\n * @return Worker handler\n */\nexport function setupSearchWorker(\n  url: string, { index$, base$ }: SetupOptions\n): WorkerHandler<SearchMessage> {\n  const worker = new Worker(url)\n\n  /* Create communication channels and resolve relative links */\n  const tx$ = new Subject<SearchMessage>()\n  const rx$ = watchWorker(worker, { tx$ })\n    .pipe(\n      withLatestFrom(base$),\n      map(([message, base]) => {\n        if (isSearchResultMessage(message)) {\n          for (const { article, sections } of message.data) {\n            article.location = `${base}/${article.location}`\n            for (const section of sections)\n              section.location = `${base}/${section.location}`\n          }\n        }\n        return message\n      }),\n      shareReplay(1)\n    )\n\n  /* Set up search index */\n  index$\n    .pipe(\n      map<SearchIndex, SearchSetupMessage>(index => ({\n        type: SearchMessageType.SETUP,\n        data: setupSearchIndex(index)\n      })),\n      observeOn(asyncScheduler)\n    )\n      .subscribe(tx$.next.bind(tx$))\n\n  /* Return worker handler */\n  return { tx$, rx$ }\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./react\"\nexport * from \"./set\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  combineLatest,\n  pipe\n} from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  finalize,\n  map,\n  observeOn,\n  tap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport { Viewport } from \"browser\"\n\nimport { Header } from \"../../../header\"\nimport { Main } from \"../../../main\"\nimport { Sidebar } from \"../_\"\nimport {\n  resetSidebarHeight,\n  resetSidebarOffset,\n  setSidebarHeight,\n  setSidebarOffset\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  main$: Observable<Main>              /* Main area observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/**\n * Apply options\n */\ninterface ApplyOptions {\n  header$: Observable<Header>          /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch sidebar\n *\n * This function returns an observable that computes the visual parameters of\n * the sidebar which depends on the vertical viewport offset, as well as the\n * height of the main area. When the page is scrolled beyond the header, the\n * sidebar is locked and fills the remaining space.\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @return Sidebar observable\n */\nexport function watchSidebar(\n  el: HTMLElement, { main$, viewport$ }: WatchOptions\n): Observable<Sidebar> {\n  const adjust = el.parentElement!.offsetTop\n               - el.parentElement!.parentElement!.offsetTop\n\n  /* Compute the sidebar's available height and if it should be locked */\n  return combineLatest([main$, viewport$])\n    .pipe(\n      map(([{ offset, height }, { offset: { y } }]) => {\n        height = height\n          + Math.min(adjust, Math.max(0, y - offset))\n          - adjust\n        return {\n          height,\n          lock: y >= offset + adjust\n        }\n      }),\n      distinctUntilChanged<Sidebar>((a, b) => {\n        return a.height === b.height\n            && a.lock   === b.lock\n      })\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply sidebar\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function applySidebar(\n  el: HTMLElement, { header$ }: ApplyOptions\n): MonoTypeOperatorFunction<Sidebar> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    withLatestFrom(header$),\n    tap(([{ height, lock }, { height: offset }]) => {\n      setSidebarHeight(el, height)\n\n      /* Set offset in locked state depending on header height */\n      if (lock)\n        setSidebarOffset(el, offset)\n      else\n        resetSidebarOffset(el)\n    }),\n\n    /* Re-map to sidebar */\n    map(([sidebar]) => sidebar),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetSidebarOffset(el)\n      resetSidebarHeight(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport * from \"./_\"\nexport * from \"./anchor\"\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  Observable,\n  OperatorFunction,\n  combineLatest,\n  of,\n  pipe\n} from \"rxjs\"\nimport { map, switchMap } from \"rxjs/operators\"\n\nimport { Viewport, getElements } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { Main } from \"../../main\"\nimport {\n  Sidebar,\n  applySidebar,\n  watchSidebar\n} from \"../../shared\"\nimport {\n  AnchorList,\n  applyAnchorList,\n  watchAnchorList\n} from \"../anchor\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Table of contents for [tablet -]\n */\ninterface TableOfContentsBelowTablet {} // tslint:disable-line\n\n/**\n * Table of contents for [tablet +]\n */\ninterface TableOfContentsAboveTablet {\n  sidebar: Sidebar                     /* Sidebar */\n  anchors: AnchorList                  /* Anchor list */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Table of contents\n */\nexport type TableOfContents =\n  | TableOfContentsBelowTablet\n  | TableOfContentsAboveTablet\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  main$: Observable<Main>              /* Main area observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n  tablet$: Observable<boolean>         /* Tablet media observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount table of contents from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTableOfContents(\n  { header$, main$, viewport$, tablet$ }: MountOptions\n): OperatorFunction<HTMLElement, TableOfContents> {\n  return pipe(\n    switchMap(el => tablet$\n      .pipe(\n        switchMap(tablet => {\n\n          /* [tablet +]: Mount table of contents in sidebar */\n          if (tablet) {\n            const els = getElements<HTMLAnchorElement>(\".md-nav__link\", el)\n\n            /* Watch and apply sidebar */\n            const sidebar$ = watchSidebar(el, { main$, viewport$ })\n              .pipe(\n                applySidebar(el, { header$ })\n              )\n\n            /* Watch and apply anchor list (scroll spy) */\n            const anchors$ = watchAnchorList(els, { header$, viewport$ })\n              .pipe(\n                applyAnchorList(els)\n              )\n\n            /* Combine into single hot observable */\n            return combineLatest([sidebar$, anchors$])\n              .pipe(\n                map(([sidebar, anchors]) => ({ sidebar, anchors }))\n              )\n\n          /* [tablet -]: Unmount table of contents */\n          } else {\n            return of({})\n          }\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { reverse } from \"ramda\"\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  combineLatest,\n  pipe\n} from \"rxjs\"\nimport {\n  bufferCount,\n  distinctUntilChanged,\n  distinctUntilKeyChanged,\n  finalize,\n  map,\n  observeOn,\n  scan,\n  startWith,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { Viewport, getElement, watchElementSize } from \"browser\"\n\nimport { Header } from \"../../../header\"\nimport { AnchorList } from \"../_\"\nimport {\n  resetAnchorActive,\n  resetAnchorBlur,\n  setAnchorActive,\n  setAnchorBlur\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch anchor list\n *\n * This is effectively a scroll-spy implementation which will account for the\n * fixed header and automatically re-calculate anchor offsets when the viewport\n * is resized. The returned observable will only emit if the anchor list needs\n * to be repainted.\n *\n * This implementation tracks an anchor element's entire path starting from its\n * level up to the top-most anchor element, e.g. `[h3, h2, h1]`. Although the\n * Material theme currently doesn't make use of this information, it enables\n * the styling of the entire hierarchy through customization.\n *\n * Note that the current anchor is the last item of the `prev` anchor list.\n *\n * @param els - Anchor elements\n * @param options - Options\n *\n * @return Anchor list observable\n */\nexport function watchAnchorList(\n  els: HTMLAnchorElement[], { header$, viewport$ }: WatchOptions\n): Observable<AnchorList> {\n  const table = new Map<HTMLAnchorElement, HTMLElement>()\n  for (const el of els) {\n    const id = decodeURIComponent(el.hash.substring(1))\n    const target = getElement(`[id=\"${id}\"]`)\n    if (typeof target !== \"undefined\")\n      table.set(el, target)\n  }\n\n  /* Compute necessary adjustment for header */\n  const adjust$ = header$\n    .pipe(\n      map(header => 18 + header.height)\n    )\n\n  /* Compute partition of previous and next anchors */\n  const partition$ = watchElementSize(document.body)\n    .pipe(\n      distinctUntilKeyChanged(\"height\"),\n\n      /* Build index to map anchor paths to vertical offsets */\n      map(() => {\n        let path: HTMLAnchorElement[] = []\n        return [...table].reduce((index, [anchor, target]) => {\n          while (path.length) {\n            const last = table.get(path[path.length - 1])!\n            if (last.tagName >= target.tagName) {\n              path.pop()\n            } else {\n              break\n            }\n          }\n\n          /* If the current anchor is hidden, continue with its parent */\n          let offset = target.offsetTop\n          while (!offset && target.parentElement) {\n            target = target.parentElement\n            offset = target.offsetTop\n          }\n\n          /* Map reversed anchor path to vertical offset */\n          return index.set(\n            reverse(path = [...path, anchor]),\n            offset\n          )\n        }, new Map<HTMLAnchorElement[], number>())\n      }),\n\n      /* Re-compute partition when viewport offset changes */\n      switchMap(index => combineLatest([adjust$, viewport$])\n        .pipe(\n          scan(([prev, next], [adjust, { offset: { y } }]) => {\n\n            /* Look forward */\n            while (next.length) {\n              const [, offset] = next[0]\n              if (offset - adjust < y) {\n                prev = [...prev, next.shift()!]\n              } else {\n                break\n              }\n            }\n\n            /* Look backward */\n            while (prev.length) {\n              const [, offset] = prev[prev.length - 1]\n              if (offset - adjust >= y) {\n                next = [prev.pop()!, ...next]\n              } else {\n                break\n              }\n            }\n\n            /* Return partition */\n            return [prev, next]\n          }, [[], [...index]]),\n          distinctUntilChanged((a, b) => {\n            return a[0] === b[0]\n                && a[1] === b[1]\n          })\n        )\n      )\n    )\n\n  /* Compute and return anchor list migrations */\n  return partition$\n    .pipe(\n      map(([prev, next]) => ({\n        prev: prev.map(([path]) => path),\n        next: next.map(([path]) => path)\n      })),\n\n      /* Extract anchor list migrations */\n      startWith({ prev: [], next: [] }),\n      bufferCount(2, 1),\n      map(([a, b]) => {\n\n        /* Moving down */\n        if (a.prev.length < b.prev.length) {\n          return {\n            prev: b.prev.slice(Math.max(0, a.prev.length - 1), b.prev.length),\n            next: []\n          }\n\n        /* Moving up */\n        } else {\n          return {\n            prev: b.prev.slice(-1),\n            next: b.next.slice(0, b.next.length - a.next.length)\n          }\n        }\n      })\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply anchor list\n *\n * @param els - Anchor elements\n *\n * @return Operator function\n */\nexport function applyAnchorList(\n  els: HTMLAnchorElement[]\n): MonoTypeOperatorFunction<AnchorList> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ prev, next }) => {\n\n      /* Look forward */\n      for (const [el] of next) {\n        resetAnchorActive(el)\n        resetAnchorBlur(el)\n      }\n\n      /* Look backward */\n      prev.forEach(([el], index) => {\n        setAnchorActive(el, index === prev.length - 1)\n        setAnchorBlur(el, true)\n      })\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      for (const el of els) {\n        resetAnchorActive(el)\n        resetAnchorBlur(el)\n      }\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport {\n  filter,\n  map,\n  mapTo,\n  sample,\n  startWith,\n  switchMap,\n  take\n} from \"rxjs/operators\"\n\nimport { WorkerHandler } from \"browser\"\nimport {\n  SearchMessage,\n  SearchResult,\n  isSearchQueryMessage,\n  isSearchReadyMessage\n} from \"integrations/search\"\n\nimport { SearchQuery } from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search status\n */\nexport type SearchStatus =\n  | \"waiting\"                          /* Search waiting for initialization */\n  | \"ready\"                            /* Search ready */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search\n */\nexport interface Search {\n  status: SearchStatus                 /* Search status */\n  query: SearchQuery                   /* Search query */\n  result: SearchResult[]               /* Search result list */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  query$: Observable<SearchQuery>      /* Search query observable */\n  reset$: Observable<void>             /* Search reset observable */\n  result$: Observable<SearchResult[]>  /* Search result observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search from source observable\n *\n * @param handler - Worker handler\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearch(\n  { rx$, tx$ }: WorkerHandler<SearchMessage>,\n  { query$, reset$, result$ }: MountOptions\n): OperatorFunction<HTMLElement, Search> {\n  return pipe(\n    switchMap(() => {\n\n      /* Compute search status */\n      const status$ = rx$\n        .pipe(\n          filter(isSearchReadyMessage),\n          mapTo<SearchStatus>(\"ready\"),\n          startWith(\"waiting\")\n        ) as Observable<SearchStatus>\n\n      /* Re-emit the latest query when search is ready */\n      tx$\n        .pipe(\n          filter(isSearchQueryMessage),\n          sample(status$),\n          take(1)\n        )\n          .subscribe(tx$.next.bind(tx$))\n\n      /* Combine into single observable */\n      return combineLatest([status$, query$, result$, reset$])\n        .pipe(\n          map(([status, query, result]) => ({\n            status,\n            query,\n            result\n          }))\n        )\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { OperatorFunction, pipe } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { WorkerHandler, setToggle } from \"browser\"\nimport {\n  SearchMessage,\n  SearchMessageType,\n  SearchQueryMessage,\n  SearchTransformFn\n} from \"integrations\"\n\nimport { watchSearchQuery } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query\n */\nexport interface SearchQuery {\n  value: string                        /* Query value */\n  focus: boolean                       /* Query focus */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  transform?: SearchTransformFn        /* Transformation function */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search query from source observable\n *\n * @param handler - Worker handler\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearchQuery(\n  { tx$ }: WorkerHandler<SearchMessage>, options: MountOptions = {}\n): OperatorFunction<HTMLInputElement, SearchQuery> {\n  return pipe(\n    switchMap(el => {\n      const query$ = watchSearchQuery(el, options)\n\n      /* Subscribe worker to search query */\n      query$\n        .pipe(\n          distinctUntilKeyChanged(\"value\"),\n          map(({ value }): SearchQueryMessage => ({\n            type: SearchMessageType.QUERY,\n            data: value\n          }))\n        )\n          .subscribe(tx$.next.bind(tx$))\n\n      /* Toggle search on focus */\n      query$\n        .pipe(\n          distinctUntilKeyChanged(\"focus\")\n        )\n          .subscribe(({ focus }) => {\n            if (focus)\n              setToggle(\"search\", focus)\n          })\n\n      /* Return search query */\n      return query$\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest, fromEvent, merge } from \"rxjs\"\nimport {\n  delay,\n  distinctUntilChanged,\n  map,\n  startWith\n} from \"rxjs/operators\"\n\nimport { watchElementFocus } from \"browser\"\nimport { SearchTransformFn, defaultTransform } from \"integrations\"\n\nimport { SearchQuery } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  transform?: SearchTransformFn        /* Transformation function */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search query\n *\n * Note that the focus event which triggers re-reading the current query value\n * is delayed by `1ms` so the input's empty state is allowed to propagate.\n *\n * @param el - Search query element\n * @param options - Options\n *\n * @return Search query observable\n */\nexport function watchSearchQuery(\n  el: HTMLInputElement, { transform }: WatchOptions = {}\n): Observable<SearchQuery> {\n  const fn = transform || defaultTransform\n\n  /* Intercept keyboard events */\n  const value$ = merge(\n    fromEvent(el, \"keyup\"),\n    fromEvent(el, \"focus\").pipe(delay(1))\n  )\n    .pipe(\n      map(() => fn(el.value)),\n      startWith(fn(el.value)),\n      distinctUntilChanged()\n    )\n\n  /* Intercept focus events */\n  const focus$ = watchElementFocus(el)\n\n  /* Combine into single observable */\n  return combineLatest([value$, focus$])\n    .pipe(\n      map(([value, focus]) => ({ value, focus }))\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { OperatorFunction, pipe } from \"rxjs\"\nimport {\n  mapTo,\n  startWith,\n  switchMap,\n  switchMapTo,\n  tap\n} from \"rxjs/operators\"\n\nimport { setElementFocus } from \"browser\"\n\nimport { useComponent } from \"../../../_\"\nimport { watchSearchReset } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search reset from source observable\n *\n * @return Operator function\n */\nexport function mountSearchReset(): OperatorFunction<HTMLElement, void> {\n  return pipe(\n    switchMap(el => watchSearchReset(el)\n      .pipe(\n        switchMapTo(useComponent(\"search-query\")),\n        tap(setElementFocus),\n        mapTo(undefined)\n      )\n    ),\n    startWith(undefined)\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { mapTo } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search reset\n *\n * @param el - Search reset element\n *\n * @return Search reset observable\n */\nexport function watchSearchReset(\n  el: HTMLElement\n): Observable<void> {\n  return fromEvent(el, \"click\")\n    .pipe(\n      mapTo(undefined)\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set number of search results\n *\n * @param el - Search result metadata element\n * @param value - Number of results\n */\nexport function setSearchResultMeta(\n  el: HTMLElement, value: number\n): void {\n  switch (value) {\n\n    /* No results */\n    case 0:\n      el.textContent = translate(\"search.result.none\")\n      break\n\n    /* One result */\n    case 1:\n      el.textContent = translate(\"search.result.one\")\n      break\n\n    /* Multiple result */\n    default:\n      el.textContent = translate(\"search.result.other\", value.toString())\n  }\n}\n\n/**\n * Reset number of search results\n *\n * @param el - Search result metadata element\n */\nexport function resetSearchResultMeta(\n  el: HTMLElement\n): void {\n  el.textContent = translate(\"search.result.placeholder\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Add an element to the search result list\n *\n * @param el - Search result list element\n * @param child - Search result element\n */\nexport function addToSearchResultList(\n  el: HTMLElement, child: Element\n): void {\n  el.appendChild(child)\n}\n\n/**\n * Reset search result list\n *\n * @param el - Search result list element\n */\nexport function resetSearchResultList(\n  el: HTMLElement\n): void {\n  el.innerHTML = \"\"\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  pipe\n} from \"rxjs\"\nimport {\n  finalize,\n  map,\n  mapTo,\n  observeOn,\n  scan,\n  switchMap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport { getElementOrThrow } from \"browser\"\nimport { SearchResult } from \"integrations/search\"\nimport { renderSearchResult } from \"templates\"\n\nimport { SearchQuery } from \"../../query\"\nimport {\n  addToSearchResultList,\n  resetSearchResultList,\n  resetSearchResultMeta,\n  setSearchResultMeta\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply options\n */\ninterface ApplyOptions {\n  query$: Observable<SearchQuery>     /* Search query observable */\n  ready$: Observable<boolean>         /* Search ready observable */\n  fetch$: Observable<boolean>         /* Result fetch observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply search results\n *\n * This function will perform a lazy rendering of the search results, depending\n * on the vertical offset of the search result container. When the scroll offset\n * reaches the bottom of the element, more results are fetched and rendered.\n *\n * @param el - Search result element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function applySearchResult(\n  el: HTMLElement, { query$, ready$, fetch$ }: ApplyOptions\n): MonoTypeOperatorFunction<SearchResult[]> {\n  const list = getElementOrThrow(\".md-search-result__list\", el)\n  const meta = getElementOrThrow(\".md-search-result__meta\", el)\n  return pipe(\n\n    /* Apply search result metadata */\n    withLatestFrom(query$, ready$),\n    map(([result, query]) => {\n      if (query.value) {\n        setSearchResultMeta(meta, result.length)\n      } else {\n        resetSearchResultMeta(meta)\n      }\n      return result\n    }),\n\n    /* Apply search result list */\n    switchMap(result => fetch$\n      .pipe(\n\n        /* Defer repaint to next animation frame */\n        observeOn(animationFrameScheduler),\n        scan(index => {\n          const container = el.parentElement!\n          while (index < result.length) {\n            addToSearchResultList(list, renderSearchResult(result[index++]))\n            if (container.scrollHeight - container.offsetHeight > 16)\n              break\n          }\n          return index\n        }, 0),\n\n        /* Re-map to search result */\n        mapTo(result),\n\n        /* Reset on complete or error */\n        finalize(() => {\n          resetSearchResultList(list)\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  filter,\n  map,\n  mapTo,\n  pluck,\n  startWith,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { WorkerHandler, watchElementOffset } from \"browser\"\nimport {\n  SearchMessage,\n  SearchResult,\n  isSearchReadyMessage,\n  isSearchResultMessage\n} from \"integrations\"\n\nimport { SearchQuery } from \"../../query\"\nimport { applySearchResult } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  query$: Observable<SearchQuery>      /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search result from source observable\n *\n * @param handler - Worker handler\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearchResult(\n  { rx$ }: WorkerHandler<SearchMessage>, { query$ }: MountOptions\n): OperatorFunction<HTMLElement, SearchResult[]> {\n  return pipe(\n    switchMap(el => {\n      const container = el.parentElement!\n\n      /* Compute if search is ready */\n      const ready$ = rx$\n        .pipe(\n          filter(isSearchReadyMessage),\n          mapTo(true)\n        )\n\n      /* Compute whether there are more search results to fetch */\n      const fetch$ = watchElementOffset(container)\n        .pipe(\n          map(({ y }) => {\n            return y >= container.scrollHeight - container.offsetHeight - 16\n          }),\n          distinctUntilChanged(),\n          filter(identity)\n        )\n\n      /* Apply search results */\n      return rx$\n        .pipe(\n          filter(isSearchResultMessage),\n          pluck(\"data\"),\n          applySearchResult(el, { query$, ready$, fetch$ }),\n          startWith([])\n        )\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, Subject, pipe } from \"rxjs\"\nimport { distinctUntilKeyChanged, switchMap, tap } from \"rxjs/operators\"\n\nimport { Viewport } from \"browser\"\n\nimport { useComponent } from \"../../_\"\nimport { Header } from \"../../header\"\nimport {\n  applyHeaderShadow,\n  watchMain\n} from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Main area\n */\nexport interface Main {\n  offset: number                       /* Main area top offset */\n  height: number                       /* Main area visible height */\n  active: boolean                      /* Scrolled past top offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount main area from source observable\n *\n * The header must be connected to the main area observable outside of the\n * operator function, as the header will persist in-between document switches\n * while the main area is replaced. However, the header observable must be\n * passed to this function, so we connect both via a long-living subject.\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountMain(\n  { header$, viewport$ }: MountOptions\n): OperatorFunction<HTMLElement, Main> {\n  const main$ = new Subject<Main>()\n\n  /* Connect to main area observable via long-living subject */\n  useComponent(\"header\")\n    .pipe(\n      switchMap(header => main$\n        .pipe(\n          distinctUntilKeyChanged(\"active\"),\n          applyHeaderShadow(header)\n        )\n      )\n    )\n      .subscribe()\n\n  /* Return operator */\n  return pipe(\n    switchMap(el => watchMain(el, { header$, viewport$ })),\n    tap(main => main$.next(main))\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  combineLatest,\n  pipe\n} from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  distinctUntilKeyChanged,\n  finalize,\n  map,\n  observeOn,\n  pluck,\n  shareReplay,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { Viewport, watchElementSize } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { Main } from \"../_\"\nimport {\n  resetHeaderShadow,\n  setHeaderShadow\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch main area\n *\n * This function returns an observable that computes the visual parameters of\n * the main area which depends on the viewport vertical offset and height, as\n * well as the height of the header element, if the header is fixed.\n *\n * @param el - Main area element\n * @param options - Options\n *\n * @return Main area observable\n */\nexport function watchMain(\n  el: HTMLElement, { header$, viewport$ }: WatchOptions\n): Observable<Main> {\n\n  /* Compute necessary adjustment for header */\n  const adjust$ = header$\n    .pipe(\n      pluck(\"height\"),\n      distinctUntilChanged(),\n      shareReplay(1)\n    )\n\n  /* Compute the main area's top and bottom borders */\n  const border$ = adjust$\n    .pipe(\n      switchMap(() => watchElementSize(el)\n        .pipe(\n          map(({ height }) => ({\n            top:    el.offsetTop,\n            bottom: el.offsetTop + height\n          }))\n        )\n      ),\n      distinctUntilKeyChanged(\"bottom\"),\n      shareReplay(1)\n    )\n\n  /* Compute the main area's offset, visible height and if we scrolled past */\n  return combineLatest([adjust$, border$, viewport$])\n    .pipe(\n      map(([header, { top, bottom }, { offset: { y }, size: { height } }]) => {\n        height = Math.max(0, height\n          - Math.max(0, top    - y,  header)\n          - Math.max(0, height + y - bottom)\n        )\n        return {\n          offset: top - header,\n          height,\n          active: top - header <= y\n        }\n      }),\n      distinctUntilChanged<Main>((a, b) => {\n        return a.offset === b.offset\n            && a.height === b.height\n            && a.active === b.active\n      })\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply header shadow\n *\n * @param el - Header element\n *\n * @return Operator function\n */\nexport function applyHeaderShadow(\n  el: HTMLElement\n): MonoTypeOperatorFunction<Main> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ active }) => {\n      setHeaderShadow(el, active)\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetHeaderShadow(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set header shadow\n *\n * @param el - Header element\n * @param value - Whether the shadow is shown\n */\nexport function setHeaderShadow(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"shadow\" : \"\")\n}\n\n/**\n * Reset header shadow\n *\n * @param el - Header element\n */\nexport function resetHeaderShadow(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { Viewport, watchViewportAt } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { applyHero } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Hero\n */\nexport interface Hero {\n  hidden: boolean                      /* Whether the hero is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount hero from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountHero(\n  { header$, viewport$ }: MountOptions\n): OperatorFunction<HTMLElement, Hero> {\n  return pipe(\n    switchMap(el => watchViewportAt(el, { header$, viewport$ })\n      .pipe(\n        map(({ offset: { y } }) => ({ hidden: y >= 20 })),\n        distinctUntilKeyChanged(\"hidden\"),\n        applyHero(el)\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  animationFrameScheduler,\n  pipe\n} from \"rxjs\"\nimport { finalize, observeOn, tap } from \"rxjs/operators\"\n\nimport { Hero } from \"../_\"\nimport {\n  resetHeroHidden,\n  setHeroHidden\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply hero\n *\n * @param el - Hero element\n *\n * @return Operator function\n */\nexport function applyHero(\n  el: HTMLElement\n): MonoTypeOperatorFunction<Hero> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ hidden }) => {\n      setHeroHidden(el, hidden)\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetHeroHidden(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set hero hidden\n *\n * @param el - Hero element\n * @param value - Whether the element is hidden\n */\nexport function setHeroHidden(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"hidden\" : \"\")\n}\n\n/**\n * Reset hero hidden\n *\n * @param el - Hero element\n */\nexport function resetHeroHidden(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, of, pipe } from \"rxjs\"\nimport {\n  distinctUntilKeyChanged,\n  map,\n  switchMap\n} from \"rxjs/operators\"\n\nimport { Viewport, watchViewportAt } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { applyTabs } from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Tabs\n */\nexport interface Tabs {\n  hidden: boolean                      /* Whether the tabs are hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n  screen$: Observable<boolean>         /* Media screen observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount tabs from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTabs(\n  { header$, viewport$, screen$ }: MountOptions\n): OperatorFunction<HTMLElement, Tabs> {\n  return pipe(\n    switchMap(el => screen$\n      .pipe(\n        switchMap(screen => {\n\n          /* [screen +]: Mount tabs above screen breakpoint */\n          if (screen) {\n            return watchViewportAt(el, { header$, viewport$ })\n              .pipe(\n                map(({ offset: { y } }) => ({ hidden: y >= 10 })),\n                distinctUntilKeyChanged(\"hidden\"),\n                applyTabs(el)\n              )\n\n          /* [screen -]: Unmount tabs below screen breakpoint */\n          } else {\n            return of({ hidden: true })\n          }\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  animationFrameScheduler,\n  pipe\n} from \"rxjs\"\nimport { finalize, observeOn, tap } from \"rxjs/operators\"\n\nimport { Tabs } from \"../_\"\nimport {\n  resetTabsHidden,\n  setTabsHidden\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Apply tabs\n *\n * @param el - Tabs element\n *\n * @return Operator function\n */\nexport function applyTabs(\n  el: HTMLElement\n): MonoTypeOperatorFunction<Tabs> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(({ hidden }) => {\n      setTabsHidden(el, hidden)\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetTabsHidden(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set tabs hidden\n *\n * @param el - Tabs element\n * @param value - Whether the element is hidden\n */\nexport function setTabsHidden(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"hidden\" : \"\")\n}\n\n/**\n * Reset tabs hidden\n *\n * @param el - Tabs element\n */\nexport function resetTabsHidden(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  filter,\n  map,\n  shareReplay,\n  startWith,\n  switchMap,\n  withLatestFrom\n} from \"rxjs/operators\"\n\nimport {\n  Viewport,\n  getElement,\n  watchViewportAt\n} from \"browser\"\n\nimport { useComponent } from \"../../_\"\nimport {\n  applyHeaderType,\n  watchHeader\n} from \"../react\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header type\n */\nexport type HeaderType =\n  | \"site\"                             /* Header shows site title */\n  | \"page\"                             /* Header shows page title */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Header\n */\nexport interface Header {\n  type: HeaderType                     /* Header type */\n  sticky: boolean                      /* Header stickyness */\n  height: number                       /* Header visible height */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  document$: Observable<Document>      /* Document observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount header from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountHeader(\n  { document$, viewport$ }: MountOptions\n): OperatorFunction<HTMLElement, Header> {\n  return pipe(\n    switchMap(el => {\n      const header$ = watchHeader(el, { document$ })\n\n      /* Compute whether the header should switch to page header */\n      const type$ = useComponent(\"main\")\n        .pipe(\n          map(main => getElement(\"h1, h2, h3, h4, h5, h6\", main)!),\n          filter(hx => typeof hx !== \"undefined\"),\n          withLatestFrom(useComponent(\"header-title\")),\n          switchMap(([hx, title]) => watchViewportAt(hx, { header$, viewport$ })\n            .pipe(\n              map(({ offset: { y } }) => {\n                return y >= hx.offsetHeight ? \"page\" : \"site\"\n              }),\n              distinctUntilChanged(),\n              applyHeaderType(title)\n            )\n          ),\n          startWith<HeaderType>(\"site\")\n        )\n\n      /* Combine into single observable */\n      return combineLatest([header$, type$])\n        .pipe(\n          map(([header, type]): Header => ({ type, ...header })),\n          shareReplay(1)\n        )\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n  MonoTypeOperatorFunction,\n  Observable,\n  animationFrameScheduler,\n  of,\n  pipe\n} from \"rxjs\"\nimport {\n  distinctUntilChanged,\n  finalize,\n  map,\n  observeOn,\n  shareReplay,\n  switchMap,\n  tap\n} from \"rxjs/operators\"\n\nimport { watchElementSize } from \"browser\"\n\nimport { Header, HeaderType } from \"../_\"\nimport {\n  resetHeaderTitleActive,\n  setHeaderTitleActive\n} from \"../set\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header\n *\n * @param el - Header element\n *\n * @return Header observable\n */\nexport function watchHeader(\n  el: HTMLElement, { document$ }: WatchOptions\n): Observable<Omit<Header, \"type\">> {\n  return document$\n    .pipe(\n      map(() => {\n        const styles = getComputedStyle(el)\n        return [\n          \"sticky\",                    /* Modern browsers */\n          \"-webkit-sticky\"             /* Safari */\n        ].includes(styles.position)\n      }),\n      distinctUntilChanged(),\n      switchMap(sticky => {\n        if (sticky) {\n          return watchElementSize(el)\n            .pipe(\n              map(({ height }) => ({\n                sticky: true,\n                height\n              }))\n            )\n        } else {\n          return of({\n            sticky: false,\n            height: 0\n          })\n        }\n      }),\n      shareReplay(1)\n    )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Apply header title type\n *\n * @param el - Header title element\n *\n * @return Operator function\n */\nexport function applyHeaderType(\n  el: HTMLElement\n): MonoTypeOperatorFunction<HeaderType> {\n  return pipe(\n\n    /* Defer repaint to next animation frame */\n    observeOn(animationFrameScheduler),\n    tap(type => {\n      setHeaderTitleActive(el, type === \"page\")\n    }),\n\n    /* Reset on complete or error */\n    finalize(() => {\n      resetHeaderTitleActive(el)\n    })\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set header title active\n *\n * @param el - Header title element\n * @param value - Whether the title is shown\n */\nexport function setHeaderTitleActive(\n  el: HTMLElement, value: boolean\n): void {\n  el.setAttribute(\"data-md-state\", value ? \"active\" : \"\")\n}\n\n/**\n * Reset header title active\n *\n * @param el - Header title element\n */\nexport function resetHeaderTitleActive(\n  el: HTMLElement\n): void {\n  el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, of, pipe } from \"rxjs\"\nimport { map, switchMap } from \"rxjs/operators\"\n\nimport { Viewport } from \"browser\"\n\nimport { Header } from \"../../header\"\nimport { Main } from \"../../main\"\nimport {\n  Sidebar,\n  applySidebar,\n  watchSidebar\n} from \"../../shared\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Navigation for [screen -]\n */\ninterface NavigationBelowScreen {} // tslint:disable-line\n\n/**\n * Navigation for [screen +]\n */\ninterface NavigationAboveScreen {\n  sidebar: Sidebar                     /* Sidebar */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Navigation\n */\nexport type Navigation =\n  | NavigationBelowScreen\n  | NavigationAboveScreen\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  header$: Observable<Header>          /* Header observable */\n  main$: Observable<Main>              /* Main area observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n  screen$: Observable<boolean>         /* Screen media observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount navigation from source observable\n *\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountNavigation(\n  { header$, main$, viewport$, screen$ }: MountOptions\n): OperatorFunction<HTMLElement, Navigation> {\n  return pipe(\n    switchMap(el => screen$\n      .pipe(\n        switchMap(screen => {\n\n          /* [screen +]: Mount navigation in sidebar */\n          if (screen) {\n            return watchSidebar(el, { main$, viewport$ })\n              .pipe(\n                applySidebar(el, { header$ }),\n                map(sidebar => ({ sidebar }))\n              )\n\n          /* [screen -]: Mount navigation in drawer */\n          } else {\n            return of({})\n          }\n        })\n      )\n    )\n  )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { NEVER, Observable, fromEvent, iif, merge } from \"rxjs\"\nimport { map, mapTo, shareReplay, switchMap } from \"rxjs/operators\"\n\nimport { getElements } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether the given device is an Apple device\n *\n * @return Test result\n */\nfunction isAppleDevice(): boolean {\n  return /(iPad|iPhone|iPod)/.test(navigator.userAgent)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all elements with `data-md-scrollfix` attributes\n *\n * This is a year-old patch which ensures that overflow scrolling works at the\n * top and bottom of containers on iOS by ensuring a `1px` scroll offset upon\n * the start of a touch event.\n *\n * @see https://bit.ly/2SCtAOO - Original source\n *\n * @param options - Options\n */\nexport function patchScrollfix(\n  { document$ }: PatchOptions\n): void {\n  const els$ = document$\n    .pipe(\n      map(() => getElements(\"[data-md-scrollfix]\")),\n      shareReplay(1)\n    )\n\n  /* Remove marker attribute, so we'll only add the fix once */\n  els$.subscribe(els => {\n    for (const el of els)\n      el.removeAttribute(\"data-md-scrollfix\")\n  })\n\n  /* Patch overflow scrolling on touch start */\n  iif(isAppleDevice, els$, NEVER)\n    .pipe(\n      switchMap(els => merge(...els.map(el => (\n        fromEvent(el, \"touchstart\", { passive: true })\n          .pipe(\n            mapTo(el)\n          )\n      ))))\n    )\n      .subscribe(el => {\n        const top = el.scrollTop\n\n        /* We're at the top of the container */\n        if (top === 0) {\n          el.scrollTop = 1\n\n        /* We're at the bottom of the container */\n        } else if (top + el.offsetHeight === el.scrollHeight) {\n          el.scrollTop = top - 1\n        }\n      })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { NEVER, Observable } from \"rxjs\"\nimport { catchError, map, switchMap } from \"rxjs/operators\"\n\nimport { getElementOrThrow, getElements } from \"browser\"\nimport { renderSource } from \"templates\"\nimport { cache, hash } from \"utilities\"\n\nimport { fetchSourceFactsFromGitHub } from \"./github\"\nimport { fetchSourceFactsFromGitLab } from \"./gitlab\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Source facts\n */\nexport type SourceFacts = string[]\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch source facts\n *\n * @param url - Source repository URL\n *\n * @return Source facts observable\n */\nfunction fetchSourceFacts(\n  url: string\n): Observable<SourceFacts> {\n  const [type] = url.match(/(git(?:hub|lab))/i) || []\n  switch (type.toLowerCase()) {\n\n    /* GitHub repository */\n    case \"github\":\n      const [, user, repo] = url.match(/^.+github\\.com\\/([^\\/]+)\\/?([^\\/]+)/i)\n      return fetchSourceFactsFromGitHub(user, repo)\n\n    /* GitLab repository */\n    case \"gitlab\":\n      const [, base, slug] = url.match(/^.+?([^\\/]*gitlab[^\\/]+)\\/(.+?)\\/?$/i)\n      return fetchSourceFactsFromGitLab(base, slug)\n\n    /* Everything else */\n    default:\n      return NEVER\n  }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch elements containing repository information\n *\n * This function will retrieve the URL from the repository link and try to\n * query data from integrated source code platforms like GitHub or GitLab.\n *\n * @param options - Options\n */\nexport function patchSource(\n  { document$ }: PatchOptions\n): void {\n  document$\n    .pipe(\n      map(() => getElementOrThrow<HTMLAnchorElement>(\".md-source[href]\")),\n      switchMap(({ href }) => (\n        cache(`${hash(href)}`, () => fetchSourceFacts(href))\n      )),\n      catchError(() => NEVER)\n    )\n      .subscribe(facts => {\n        for (const el of getElements(\".md-source__repository\")) {\n          if (!el.hasAttribute(\"data-md-state\")) {\n            el.setAttribute(\"data-md-state\", \"done\")\n            el.appendChild(renderSource(facts))\n          }\n        }\n      })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Repo, User } from \"github-types\"\nimport { Observable, of } from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport { filter, pluck, switchMap } from \"rxjs/operators\"\n\nimport { round } from \"utilities\"\n\nimport { SourceFacts } from \"..\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitHub source facts\n *\n * @param user - GitHub user\n * @param repo - GitHub repository\n *\n * @return Source facts observable\n */\nexport function fetchSourceFactsFromGitHub(\n  user: string, repo?: string\n): Observable<SourceFacts> {\n  return ajax({\n    url: typeof repo !== \"undefined\"\n      ? `https://api.github.com/repos/${user}/${repo}`\n      : `https://api.github.com/users/${user}`,\n    responseType: \"json\"\n  })\n    .pipe(\n      filter(({ status }) => status === 200),\n      pluck(\"response\"),\n      switchMap(data => {\n\n        /* GitHub repository */\n        if (typeof repo !== \"undefined\") {\n          const { stargazers_count, forks_count }: Repo = data\n          return of([\n            `${round(stargazers_count || 0)} Stars`,\n            `${round(forks_count || 0)} Forks`\n          ])\n\n        /* GitHub user/organization */\n        } else {\n          const { public_repos }: User = data\n          return of([\n            `${round(public_repos || 0)} Repositories`\n          ])\n        }\n      })\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ProjectSchema } from \"gitlab\"\nimport { Observable } from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport { filter, map, pluck } from \"rxjs/operators\"\n\nimport { round } from \"utilities\"\n\nimport { SourceFacts } from \"..\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitLab source facts\n *\n * @param base - GitLab base\n * @param project - GitLab project\n *\n * @return Source facts observable\n */\nexport function fetchSourceFactsFromGitLab(\n  base: string, project: string\n): Observable<SourceFacts> {\n  return ajax({\n    url: `https://${base}/api/v4/projects/${encodeURIComponent(project)}`,\n    responseType: \"json\"\n  })\n    .pipe(\n      filter(({ status }) => status === 200),\n      pluck(\"response\"),\n      map(({ star_count, forks_count }: ProjectSchema) => ([\n        `${round(star_count)} Stars`,\n        `${round(forks_count)} Forks`\n      ]))\n    )\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n// DISCLAIMER: this file is still WIP. There're some refactoring opportunities\n// which must be tackled after we gathered some feedback on v5.\n// tslint:disable\n\nimport { sortBy, prop, values } from \"ramda\"\nimport {\n  merge,\n  combineLatest,\n  animationFrameScheduler,\n  fromEvent,\n  from,\n  defer,\n  of,\n  NEVER\n} from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport {\n  delay,\n  switchMap,\n  tap,\n  filter,\n  withLatestFrom,\n  observeOn,\n  take,\n  shareReplay,\n  pluck,\n  catchError,\n  map\n} from \"rxjs/operators\"\n\nimport {\n  watchToggle,\n  setToggle,\n  getElements,\n  watchMedia,\n  watchDocument,\n  watchLocation,\n  watchLocationHash,\n  watchViewport,\n  isLocalLocation,\n  setLocationHash,\n  watchLocationBase\n} from \"browser\"\nimport {\n  mountHeader,\n  mountHero,\n  mountMain,\n  mountNavigation,\n  mountSearch,\n  mountTableOfContents,\n  mountTabs,\n  useComponent,\n  setupComponents,\n  mountSearchQuery,\n  mountSearchReset,\n  mountSearchResult\n} from \"components\"\nimport {\n  setupClipboard,\n  setupDialog,\n  setupKeyboard,\n  setupInstantLoading,\n  setupSearchWorker,\n  SearchIndex\n} from \"integrations\"\nimport {\n  patchCodeBlocks,\n  patchTables,\n  patchDetails,\n  patchScrollfix,\n  patchSource,\n  patchScripts\n} from \"patches\"\nimport { isConfig } from \"utilities\"\n\n/* ------------------------------------------------------------------------- */\n\n/* Denote that JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Test for iOS */\nif (navigator.userAgent.match(/(iPad|iPhone|iPod)/g))\n  document.documentElement.classList.add(\"ios\")\n\n/**\n * Set scroll lock\n *\n * @param el - Scrollable element\n * @param value - Vertical offset\n */\nexport function setScrollLock(\n  el: HTMLElement, value: number\n): void {\n  el.setAttribute(\"data-md-state\", \"lock\")\n  el.style.top = `-${value}px`\n}\n\n/**\n * Reset scroll lock\n *\n * @param el - Scrollable element\n */\nexport function resetScrollLock(\n  el: HTMLElement\n): void {\n  const value = -1 * parseInt(el.style.top, 10)\n  el.removeAttribute(\"data-md-state\")\n  el.style.top = \"\"\n  if (value)\n    window.scrollTo(0, value)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Initialize Material for MkDocs\n *\n * @param config - Configuration\n */\nexport function initialize(config: unknown) {\n  if (!isConfig(config))\n    throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`)\n\n  /* Set up subjects */\n  const document$ = watchDocument()\n  const location$ = watchLocation()\n\n  /* Set up user interface observables */\n  const base$     = watchLocationBase(config.base, { location$ })\n  const hash$     = watchLocationHash()\n  const viewport$ = watchViewport()\n  const tablet$   = watchMedia(\"(min-width: 960px)\")\n  const screen$   = watchMedia(\"(min-width: 1220px)\")\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Set up component bindings */\n  setupComponents([\n    \"announce\",                        /* Announcement bar */\n    \"container\",                       /* Container */\n    \"header\",                          /* Header */\n    \"header-title\",                    /* Header title */\n    \"hero\",                            /* Hero */\n    \"main\",                            /* Main area */\n    \"navigation\",                      /* Navigation */\n    \"search\",                          /* Search */\n    \"search-query\",                    /* Search input */\n    \"search-reset\",                    /* Search reset */\n    \"search-result\",                   /* Search results */\n    \"skip\",                            /* Skip link */\n    \"tabs\",                            /* Tabs */\n    \"toc\"                              /* Table of contents */\n  ], { document$ })\n\n  const keyboard$ = setupKeyboard()\n\n  // Hack: only make code blocks focusable on non-touch devices\n  if (matchMedia(\"(hover)\").matches)\n    patchCodeBlocks({ document$, viewport$ })\n  patchDetails({ document$, hash$ })\n  patchScripts({ document$ })\n  patchSource({ document$ })\n  patchTables({ document$ })\n\n  /* Force 1px scroll offset to trigger overflow scrolling */\n  patchScrollfix({ document$ })\n\n  /* Set up clipboard and dialog */\n  const dialog$ = setupDialog()\n  const clipboard$ = setupClipboard({ document$, dialog$ })\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Create header observable */\n  const header$ = useComponent(\"header\")\n    .pipe(\n      mountHeader({ document$, viewport$ }),\n      shareReplay(1)\n    )\n\n  const main$ = useComponent(\"main\")\n    .pipe(\n      mountMain({ header$, viewport$ }),\n      shareReplay(1)\n    )\n\n  /* ----------------------------------------------------------------------- */\n\n  const navigation$ = useComponent(\"navigation\")\n    .pipe(\n      mountNavigation({ header$, main$, viewport$, screen$ }),\n      shareReplay(1) // shareReplay because there might be late subscribers\n    )\n\n  const toc$ = useComponent(\"toc\")\n    .pipe(\n      mountTableOfContents({ header$, main$, viewport$, tablet$ }),\n      shareReplay(1)\n    )\n\n  const tabs$ = useComponent(\"tabs\")\n    .pipe(\n      mountTabs({ header$, viewport$, screen$ }),\n      shareReplay(1)\n    )\n\n  const hero$ = useComponent(\"hero\")\n    .pipe(\n      mountHero({ header$, viewport$ }),\n      shareReplay(1)\n    )\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Search worker */\n  const worker$ = defer(() => {\n    const index = config.search && config.search.index\n      ? config.search.index\n      : undefined\n\n    /* Fetch index if it wasn't passed explicitly */\n    const index$ = typeof index !== \"undefined\"\n      ? from(index)\n      : base$\n          .pipe(\n            switchMap(base => ajax({\n              url: `${base}/search/search_index.json`,\n              responseType: \"json\",\n              withCredentials: true\n            })\n              .pipe<SearchIndex>(\n                pluck(\"response\")\n              )\n            )\n          )\n\n    return of(setupSearchWorker(config.search.worker, {\n      base$, index$\n    }))\n  })\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Mount search query */\n  const search$ = worker$\n    .pipe(\n      switchMap(worker => {\n\n        const query$ = useComponent(\"search-query\")\n          .pipe(\n            mountSearchQuery(worker, { transform: config.search.transform }),\n            shareReplay(1)\n          )\n\n        /* Mount search reset */\n        const reset$ = useComponent(\"search-reset\")\n          .pipe(\n            mountSearchReset(),\n            shareReplay(1)\n          )\n\n        /* Mount search result */\n        const result$ = useComponent(\"search-result\")\n          .pipe(\n            mountSearchResult(worker, { query$ }),\n            shareReplay(1)\n          )\n\n        return useComponent(\"search\")\n          .pipe(\n            mountSearch(worker, { query$, reset$, result$ }),\n          )\n      }),\n      catchError(() => {\n        useComponent(\"search\")\n          .subscribe(el => el.hidden = true) // TODO: Hack\n        return NEVER\n      }),\n      shareReplay(1)\n    )\n\n  /* ----------------------------------------------------------------------- */\n\n  // // put into search...\n  hash$\n    .pipe(\n      tap(() => setToggle(\"search\", false)),\n      delay(125), // ensure that it runs after the body scroll reset...\n    )\n      .subscribe(hash => setLocationHash(`#${hash}`))\n\n  // TODO: scroll restoration must be centralized\n  combineLatest([\n    watchToggle(\"search\"),\n    tablet$,\n  ])\n    .pipe(\n      withLatestFrom(viewport$),\n      switchMap(([[toggle, tablet], { offset: { y }}]) => {\n        const active = toggle && !tablet\n        return document$\n          .pipe(\n            delay(active ? 400 : 100),\n            observeOn(animationFrameScheduler),\n            tap(({ body }) => active\n              ? setScrollLock(body, y)\n              : resetScrollLock(body)\n            )\n          )\n      })\n    )\n      .subscribe()\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Always close drawer on click */\n  fromEvent<MouseEvent>(document.body, \"click\")\n    .pipe(\n      filter(ev => !(ev.metaKey || ev.ctrlKey)),\n      filter(ev => {\n        if (ev.target instanceof HTMLElement) {\n          const el = ev.target.closest(\"a\") // TODO: abstract as link click?\n          if (el && isLocalLocation(el)) {\n            return true\n          }\n        }\n        return false\n      })\n    )\n      .subscribe(() => {\n        setToggle(\"drawer\", false)\n      })\n\n  /* Enable instant loading, if not on file:// protocol */\n  if (config.features.includes(\"instant\") && location.protocol !== \"file:\") {\n\n    /* Fetch sitemap and extract URL whitelist */\n    base$\n      .pipe(\n        switchMap(base => ajax({\n          url: `${base}/sitemap.xml`,\n          responseType: \"document\",\n          withCredentials: true\n        })\n          .pipe<Document>(\n            pluck(\"response\")\n          )\n        ),\n        withLatestFrom(base$),\n        map(([document, base]) => {\n          const urls = getElements(\"loc\", document)\n            .map(node => node.textContent!)\n\n          // Hack: This is a temporary fix to normalize instant loading lookup\n          // on localhost and Netlify previews. If this approach proves to be\n          // suitable, we'll refactor URL whitelisting anyway. We take the two\n          // shortest URLs and determine the common prefix to isolate the\n          // domain. If there're no two domains, we just leave it as-is, as\n          // there isn't anything to be loaded anway.\n          if (urls.length > 1) {\n            const [a, b] = sortBy(prop(\"length\"), urls)\n\n            /* Determine common prefix */\n            let index = 0\n            if (a === b)\n              index = a.length\n            else\n              while (a.charAt(index) === b.charAt(index))\n                index++\n\n            /* Replace common prefix (i.e. base) with effective base */\n            for (let i = 0; i < urls.length; i++)\n              urls[i] = urls[i].replace(a.slice(0, index), `${base}/`)\n          }\n          return urls\n        })\n      )\n        .subscribe(urls => {\n          setupInstantLoading(urls, { document$, location$, viewport$ })\n        })\n  }\n\n  /* ----------------------------------------------------------------------- */\n\n  /* Unhide permalinks on first tab */\n  keyboard$\n    .pipe(\n      filter(key => key.mode === \"global\" && key.type === \"Tab\"),\n      take(1)\n    )\n      .subscribe(() => {\n        for (const link of getElements(\".headerlink\"))\n          link.style.visibility = \"visible\"\n      })\n\n  /* ----------------------------------------------------------------------- */\n\n  const state = {\n\n    /* Browser observables */\n    document$,\n    location$,\n    viewport$,\n\n    /* Component observables */\n    header$,\n    hero$,\n    main$,\n    navigation$,\n    search$,\n    tabs$,\n    toc$,\n\n    /* Integration observables */\n    clipboard$,\n    keyboard$,\n    dialog$\n  }\n\n  /* Subscribe to all observables */\n  merge(...values(state))\n    .subscribe()\n  return state\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest } from \"rxjs\"\nimport { distinctUntilKeyChanged, map } from \"rxjs/operators\"\n\nimport { Viewport, getElements } from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  document$: Observable<Document>      /* Document observable */\n  viewport$: Observable<Viewport>      /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `code` elements\n *\n * This function will make overflowing code blocks focusable via keyboard, so\n * they can be scrolled without a mouse.\n *\n * @param options - Options\n */\nexport function patchCodeBlocks(\n  { document$, viewport$ }: MountOptions\n): void {\n  const els$ = document$\n    .pipe(\n      map(() => getElements<HTMLTableElement>(\"pre > code\"))\n    )\n\n  /* Observe viewport size only */\n  const size$ = viewport$\n    .pipe(\n      distinctUntilKeyChanged(\"size\")\n    )\n\n  /* Make overflowing elements focusable */\n  combineLatest([els$, size$])\n    .subscribe(([els]) => {\n      for (const el of els) {\n        if (el.scrollWidth > el.clientWidth)\n          el.setAttribute(\"tabindex\", \"0\")\n        else\n          el.removeAttribute(\"tabindex\")\n      }\n    })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport {\n  filter,\n  map,\n  switchMapTo,\n  tap\n} from \"rxjs/operators\"\n\nimport {\n  getElement,\n  getElements,\n  watchMedia\n} from \"browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n  hash$: Observable<string>            /* Location hash observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `details` elements\n *\n * This function will ensure that all `details` tags are opened prior to\n * printing, so the whole content of the page is included, and on anchor jumps.\n *\n * @param options - Options\n */\nexport function patchDetails(\n  { document$, hash$ }: PatchOptions\n): void {\n  const els$ = document$\n    .pipe(\n      map(() => getElements<HTMLDetailsElement>(\"details\"))\n    )\n\n  /* Open all details before printing */\n  merge(\n    watchMedia(\"print\").pipe(filter(identity)), /* Webkit */\n    fromEvent(window, \"beforeprint\")            /* IE, FF */\n  )\n    .pipe(\n      switchMapTo(els$)\n    )\n      .subscribe(els => {\n        for (const el of els)\n          el.setAttribute(\"open\", \"\")\n      })\n\n  /* Open parent details and fix anchor jump */\n  hash$\n    .pipe(\n      map(id => getElement(`[id=\"${id}\"]`)!),\n      filter(el => typeof el !== \"undefined\"),\n      tap(el => {\n        const details = el.closest(\"details\")\n        if (details && !details.open)\n          details.setAttribute(\"open\", \"\")\n      })\n    )\n      .subscribe(el => el.scrollIntoView())\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport { map, skip, withLatestFrom } from \"rxjs/operators\"\n\nimport {\n  createElement,\n  getElements,\n  replaceElement\n} from \"browser\"\nimport { useComponent } from \"components\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `script` elements\n *\n * This function must be run after a document switch, which means the first\n * emission must be ignored.\n *\n * @param options - Options\n */\nexport function patchScripts(\n  { document$ }: PatchOptions\n): void {\n  const els$ = document$\n    .pipe(\n      skip(1),\n      withLatestFrom(useComponent(\"container\")),\n      map(([, el]) => getElements<HTMLScriptElement>(\"script\", el))\n    )\n\n  /* Evaluate all scripts via replacement */\n  els$.subscribe(els => {\n    for (const el of els) {\n      if (el.src || /(^|\\/javascript)$/i.test(el.type)) {\n        const script = createElement(\"script\")\n        const key = el.src ? \"src\" : \"textContent\"\n        script[key] = el[key]!\n        replaceElement(el, script)\n      }\n    }\n  })\n}\n","/*\n * Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable } from \"rxjs\"\nimport { map } from \"rxjs/operators\"\n\nimport {\n  createElement,\n  getElements,\n  replaceElement\n} from \"browser\"\nimport { renderTable } from \"templates\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n  document$: Observable<Document>      /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all `table` elements\n *\n * This function will re-render all tables by wrapping them to improve overflow\n * scrolling on smaller screen sizes.\n *\n * @param options - Options\n */\nexport function patchTables(\n  { document$ }: MountOptions\n): void {\n  const sentinel = createElement(\"table\")\n  document$\n    .pipe(\n      map(() => getElements<HTMLTableElement>(\"table:not([class])\"))\n    )\n      .subscribe(els => {\n        for (const el of els) {\n          replaceElement(el, sentinel)\n          replaceElement(sentinel, renderTable(el))\n        }\n      })\n}\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/assets/javascripts/lunr/tinyseg.min.js b/assets/javascripts/lunr/tinyseg.min.js
index 302befb..02c61e9 100644
--- a/assets/javascripts/lunr/tinyseg.min.js
+++ b/assets/javascripts/lunr/tinyseg.min.js
@@ -1 +1 @@
-!function(_,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(_.lunr)}(this,(function(){return function(_){function t(){var _={"[一二三四五六七八九十百千万億兆]":"M","[一-龠々〆ヵヶ]":"H","[ぁ-ん]":"I","[ァ-ヴーア-ン゙ー]":"K","[a-zA-Za-zA-Z]":"A","[0-90-9]":"N"};for(var t in this.chartype_=[],_){var H=new RegExp(t);this.chartype_.push([H,_[t]])}return this.BIAS__=-332,this.BC1__={HH:6,II:2461,KH:406,OH:-1378},this.BC2__={AA:-3267,AI:2744,AN:-878,HH:-4070,HM:-1711,HN:4012,HO:3761,IA:1327,IH:-1184,II:-1332,IK:1721,IO:5492,KI:3831,KK:-8741,MH:-3132,MK:3334,OO:-2920},this.BC3__={HH:996,HI:626,HK:-721,HN:-1307,HO:-836,IH:-301,KK:2762,MK:1079,MM:4034,OA:-1652,OH:266},this.BP1__={BB:295,OB:304,OO:-125,UB:352},this.BP2__={BO:60,OO:-1762},this.BQ1__={BHH:1150,BHM:1521,BII:-1158,BIM:886,BMH:1208,BNH:449,BOH:-91,BOO:-2597,OHI:451,OIH:-296,OKA:1851,OKH:-1020,OKK:904,OOO:2965},this.BQ2__={BHH:118,BHI:-1159,BHM:466,BIH:-919,BKK:-1720,BKO:864,OHH:-1139,OHM:-181,OIH:153,UHI:-1146},this.BQ3__={BHH:-792,BHI:2664,BII:-299,BKI:419,BMH:937,BMM:8335,BNN:998,BOH:775,OHH:2174,OHM:439,OII:280,OKH:1798,OKI:-793,OKO:-2242,OMH:-2402,OOO:11699},this.BQ4__={BHH:-3895,BIH:3761,BII:-4654,BIK:1348,BKK:-1806,BMI:-3385,BOO:-12396,OAH:926,OHH:266,OHK:-2036,ONN:-973},this.BW1__={",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682},this.BW2__={"..":-11822,11:-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669},this.BW3__={"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1e3,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990},this.TC1__={AAA:1093,HHH:1029,HHM:580,HII:998,HOH:-390,HOM:-331,IHI:1169,IOH:-142,IOI:-1015,IOM:467,MMH:187,OOI:-1832},this.TC2__={HHO:2088,HII:-1023,HMM:-1154,IHI:-1965,KKH:703,OII:-2649},this.TC3__={AAA:-294,HHH:346,HHI:-341,HII:-1088,HIK:731,HOH:-1486,IHH:128,IHI:-3041,IHO:-1935,IIH:-825,IIM:-1035,IOI:-542,KHH:-1216,KKA:491,KKH:-1217,KOK:-1009,MHH:-2694,MHM:-457,MHO:123,MMH:-471,NNH:-1689,NNO:662,OHO:-3393},this.TC4__={HHH:-203,HHI:1344,HHK:365,HHM:-122,HHN:182,HHO:669,HIH:804,HII:679,HOH:446,IHH:695,IHO:-2324,IIH:321,III:1497,IIO:656,IOO:54,KAK:4845,KKA:3386,KKK:3065,MHH:-405,MHI:201,MMH:-241,MMM:661,MOM:841},this.TQ1__={BHHH:-227,BHHI:316,BHIH:-132,BIHH:60,BIII:1595,BNHH:-744,BOHH:225,BOOO:-908,OAKK:482,OHHH:281,OHIH:249,OIHI:200,OIIH:-68},this.TQ2__={BIHH:-1401,BIII:-1033,BKAK:-543,BOOO:-5591},this.TQ3__={BHHH:478,BHHM:-1073,BHIH:222,BHII:-504,BIIH:-116,BIII:-105,BMHI:-863,BMHM:-464,BOMH:620,OHHH:346,OHHI:1729,OHII:997,OHMH:481,OIHH:623,OIIH:1344,OKAK:2792,OKHH:587,OKKA:679,OOHH:110,OOII:-685},this.TQ4__={BHHH:-721,BHHM:-3604,BHII:-966,BIIH:-607,BIII:-2181,OAAA:-2763,OAKK:180,OHHH:-294,OHHI:2446,OHHO:480,OHIH:-1573,OIHH:1935,OIHI:-493,OIIH:626,OIII:-4007,OKAK:-8156},this.TW1__={"につい":-4681,"東京都":2026},this.TW2__={"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216},this.TW3__={"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287},this.TW4__={"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865},this.UC1__={A:484,K:93,M:645,O:-505},this.UC2__={A:819,H:1059,I:409,M:3987,N:5775,O:646},this.UC3__={A:-1370,I:2311},this.UC4__={A:-2643,H:1809,I:-1032,K:-3450,M:3565,N:3876,O:6646},this.UC5__={H:313,I:-1238,K:-799,M:539,O:-831},this.UC6__={H:-506,I:-253,K:87,M:247,O:-387},this.UP1__={O:-214},this.UP2__={B:69,O:935},this.UP3__={B:189},this.UQ1__={BH:21,BI:-12,BK:-99,BN:142,BO:-56,OH:-95,OI:477,OK:410,OO:-2422},this.UQ2__={BH:216,BI:113,OK:1759},this.UQ3__={BA:-479,BH:42,BI:1913,BK:-7198,BM:3160,BN:6427,BO:14761,OI:-827,ON:-3212},this.UW1__={",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135},this.UW2__={",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568},this.UW3__={",":4889,1:-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278},this.UW4__={",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1e3,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637},this.UW5__={",":465,".":-299,1:-514,E2:-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"1":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343},this.UW6__={",":227,".":808,1:-270,E1:306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496},this}t.prototype.ctype_=function(_){for(var t in this.chartype_)if(_.match(this.chartype_[t][0]))return this.chartype_[t][1];return"O"},t.prototype.ts_=function(_){return _||0},t.prototype.segment=function(_){if(null==_||null==_||""==_)return[];var t=[],H=["B3","B2","B1"],s=["O","O","O"],h=_.split("");for(K=0;K<h.length;++K)H.push(h[K]),s.push(this.ctype_(h[K]));H.push("E1"),H.push("E2"),H.push("E3"),s.push("O"),s.push("O"),s.push("O");for(var i=H[3],I="U",O="U",B="U",K=4;K<H.length-3;++K){var M=this.BIAS__,U=H[K-3],e=H[K-2],r=H[K-1],n=H[K],A=H[K+1],p=H[K+2],u=s[K-3],C=s[K-2],W=s[K-1],T=s[K],o=s[K+1],Q=s[K+2];M+=this.ts_(this.UP1__[I]),M+=this.ts_(this.UP2__[O]),M+=this.ts_(this.UP3__[B]),M+=this.ts_(this.BP1__[I+O]),M+=this.ts_(this.BP2__[O+B]),M+=this.ts_(this.UW1__[U]),M+=this.ts_(this.UW2__[e]),M+=this.ts_(this.UW3__[r]),M+=this.ts_(this.UW4__[n]),M+=this.ts_(this.UW5__[A]),M+=this.ts_(this.UW6__[p]),M+=this.ts_(this.BW1__[e+r]),M+=this.ts_(this.BW2__[r+n]),M+=this.ts_(this.BW3__[n+A]),M+=this.ts_(this.TW1__[U+e+r]),M+=this.ts_(this.TW2__[e+r+n]),M+=this.ts_(this.TW3__[r+n+A]),M+=this.ts_(this.TW4__[n+A+p]),M+=this.ts_(this.UC1__[u]),M+=this.ts_(this.UC2__[C]),M+=this.ts_(this.UC3__[W]),M+=this.ts_(this.UC4__[T]),M+=this.ts_(this.UC5__[o]),M+=this.ts_(this.UC6__[Q]),M+=this.ts_(this.BC1__[C+W]),M+=this.ts_(this.BC2__[W+T]),M+=this.ts_(this.BC3__[T+o]),M+=this.ts_(this.TC1__[u+C+W]),M+=this.ts_(this.TC2__[C+W+T]),M+=this.ts_(this.TC3__[W+T+o]),M+=this.ts_(this.TC4__[T+o+Q]),M+=this.ts_(this.UQ1__[I+u]),M+=this.ts_(this.UQ2__[O+C]),M+=this.ts_(this.UQ3__[B+W]),M+=this.ts_(this.BQ1__[O+C+W]),M+=this.ts_(this.BQ2__[O+W+T]),M+=this.ts_(this.BQ3__[B+C+W]),M+=this.ts_(this.BQ4__[B+W+T]),M+=this.ts_(this.TQ1__[O+u+C+W]),M+=this.ts_(this.TQ2__[O+C+W+T]),M+=this.ts_(this.TQ3__[B+u+C+W]);var N="O";(M+=this.ts_(this.TQ4__[B+C+W+T]))>0&&(t.push(i),i="",N="B"),I=O,O=B,B=N,i+=H[K]}return t.push(i),t},_.TinySegmenter=t}}));
\ No newline at end of file
+!function(_,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(_.lunr)}(this,(function(){return function(_){function t(){var _={"[一二三四五六七八九十百千万億兆]":"M","[一-龠々〆ヵヶ]":"H","[ぁ-ん]":"I","[ァ-ヴーア-ン゙ー]":"K","[a-zA-Za-zA-Z]":"A","[0-90-9]":"N"};for(var t in this.chartype_=[],_){var H=new RegExp(t);this.chartype_.push([H,_[t]])}return this.BIAS__=-332,this.BC1__={HH:6,II:2461,KH:406,OH:-1378},this.BC2__={AA:-3267,AI:2744,AN:-878,HH:-4070,HM:-1711,HN:4012,HO:3761,IA:1327,IH:-1184,II:-1332,IK:1721,IO:5492,KI:3831,KK:-8741,MH:-3132,MK:3334,OO:-2920},this.BC3__={HH:996,HI:626,HK:-721,HN:-1307,HO:-836,IH:-301,KK:2762,MK:1079,MM:4034,OA:-1652,OH:266},this.BP1__={BB:295,OB:304,OO:-125,UB:352},this.BP2__={BO:60,OO:-1762},this.BQ1__={BHH:1150,BHM:1521,BII:-1158,BIM:886,BMH:1208,BNH:449,BOH:-91,BOO:-2597,OHI:451,OIH:-296,OKA:1851,OKH:-1020,OKK:904,OOO:2965},this.BQ2__={BHH:118,BHI:-1159,BHM:466,BIH:-919,BKK:-1720,BKO:864,OHH:-1139,OHM:-181,OIH:153,UHI:-1146},this.BQ3__={BHH:-792,BHI:2664,BII:-299,BKI:419,BMH:937,BMM:8335,BNN:998,BOH:775,OHH:2174,OHM:439,OII:280,OKH:1798,OKI:-793,OKO:-2242,OMH:-2402,OOO:11699},this.BQ4__={BHH:-3895,BIH:3761,BII:-4654,BIK:1348,BKK:-1806,BMI:-3385,BOO:-12396,OAH:926,OHH:266,OHK:-2036,ONN:-973},this.BW1__={",と":660,",同":727,B1あ:1404,B1同:542,"、と":660,"、同":727,"」と":1682,あっ:1505,いう:1743,いっ:-2055,いる:672,うし:-4817,うん:665,から:3472,がら:600,こう:-790,こと:2083,こん:-1262,さら:-4143,さん:4573,した:2641,して:1104,すで:-3399,そこ:1977,それ:-871,たち:1122,ため:601,った:3463,つい:-802,てい:805,てき:1249,でき:1127,です:3445,では:844,とい:-4915,とみ:1922,どこ:3887,ない:5713,なっ:3015,など:7379,なん:-1113,にし:2468,には:1498,にも:1671,に対:-912,の一:-501,の中:741,ませ:2448,まで:1711,まま:2600,まる:-2155,やむ:-1947,よっ:-2565,れた:2369,れで:-913,をし:1860,を見:731,亡く:-1886,京都:2558,取り:-2784,大き:-2604,大阪:1497,平方:-2314,引き:-1336,日本:-195,本当:-2423,毎日:-2113,目指:-724,B1あ:1404,B1同:542,"」と":1682},this.BW2__={"..":-11822,11:-669,"――":-5730,"−−":-13175,いう:-1609,うか:2490,かし:-1350,かも:-602,から:-7194,かれ:4612,がい:853,がら:-3198,きた:1941,くな:-1597,こと:-8392,この:-4193,させ:4533,され:13168,さん:-3977,しい:-1819,しか:-545,した:5078,して:972,しな:939,その:-3744,たい:-1253,たた:-662,ただ:-3857,たち:-786,たと:1224,たは:-939,った:4589,って:1647,っと:-2094,てい:6144,てき:3640,てく:2551,ては:-3110,ても:-3065,でい:2666,でき:-1528,でし:-3828,です:-4761,でも:-4203,とい:1890,とこ:-1746,とと:-2279,との:720,とみ:5168,とも:-3941,ない:-2488,なが:-1313,など:-6509,なの:2614,なん:3099,にお:-1615,にし:2748,にな:2454,によ:-7236,に対:-14943,に従:-4688,に関:-11388,のか:2093,ので:-7059,のに:-6041,のの:-6125,はい:1073,はが:-1033,はず:-2532,ばれ:1813,まし:-1316,まで:-6621,まれ:5409,めて:-3153,もい:2230,もの:-10713,らか:-944,らし:-1611,らに:-1897,りし:651,りま:1620,れた:4270,れて:849,れば:4114,ろう:6067,われ:7901,を通:-11877,んだ:728,んな:-4115,一人:602,一方:-1375,一日:970,一部:-1051,上が:-4479,会社:-1116,出て:2163,分の:-7758,同党:970,同日:-913,大阪:-2471,委員:-1250,少な:-1050,年度:-8669,年間:-1626,府県:-2363,手権:-1982,新聞:-4066,日新:-722,日本:-7068,日米:3372,曜日:-601,朝鮮:-2355,本人:-2697,東京:-1543,然と:-1384,社会:-1276,立て:-990,第に:-1612,米国:-4268,"11":-669},this.BW3__={あた:-2194,あり:719,ある:3846,"い.":-1185,"い。":-1185,いい:5308,いえ:2079,いく:3029,いた:2056,いっ:1883,いる:5600,いわ:1527,うち:1117,うと:4798,えと:1454,"か.":2857,"か。":2857,かけ:-743,かっ:-4098,かに:-669,から:6520,かり:-2670,"が,":1816,"が、":1816,がき:-4855,がけ:-1127,がっ:-913,がら:-4977,がり:-2064,きた:1645,けど:1374,こと:7397,この:1542,ころ:-2757,さい:-714,さを:976,"し,":1557,"し、":1557,しい:-3714,した:3562,して:1449,しな:2608,しま:1200,"す.":-1310,"す。":-1310,する:6521,"ず,":3426,"ず、":3426,ずに:841,そう:428,"た.":8875,"た。":8875,たい:-594,たの:812,たり:-1183,たる:-853,"だ.":4098,"だ。":4098,だっ:1004,った:-4748,って:300,てい:6240,てお:855,ても:302,です:1437,でに:-1482,では:2295,とう:-1387,とし:2266,との:541,とも:-3543,どう:4664,ない:1796,なく:-903,など:2135,"に,":-1021,"に、":-1021,にし:1771,にな:1906,には:2644,"の,":-724,"の、":-724,の子:-1e3,"は,":1337,"は、":1337,べき:2181,まし:1113,ます:6943,まっ:-1549,まで:6154,まれ:-793,らし:1479,られ:6820,るる:3818,"れ,":854,"れ、":854,れた:1850,れて:1375,れば:-3246,れる:1091,われ:-605,んだ:606,んで:798,カ月:990,会議:860,入り:1232,大会:2217,始め:1681,市:965,新聞:-5055,"日,":974,"日、":974,社会:2024,カ月:990},this.TC1__={AAA:1093,HHH:1029,HHM:580,HII:998,HOH:-390,HOM:-331,IHI:1169,IOH:-142,IOI:-1015,IOM:467,MMH:187,OOI:-1832},this.TC2__={HHO:2088,HII:-1023,HMM:-1154,IHI:-1965,KKH:703,OII:-2649},this.TC3__={AAA:-294,HHH:346,HHI:-341,HII:-1088,HIK:731,HOH:-1486,IHH:128,IHI:-3041,IHO:-1935,IIH:-825,IIM:-1035,IOI:-542,KHH:-1216,KKA:491,KKH:-1217,KOK:-1009,MHH:-2694,MHM:-457,MHO:123,MMH:-471,NNH:-1689,NNO:662,OHO:-3393},this.TC4__={HHH:-203,HHI:1344,HHK:365,HHM:-122,HHN:182,HHO:669,HIH:804,HII:679,HOH:446,IHH:695,IHO:-2324,IIH:321,III:1497,IIO:656,IOO:54,KAK:4845,KKA:3386,KKK:3065,MHH:-405,MHI:201,MMH:-241,MMM:661,MOM:841},this.TQ1__={BHHH:-227,BHHI:316,BHIH:-132,BIHH:60,BIII:1595,BNHH:-744,BOHH:225,BOOO:-908,OAKK:482,OHHH:281,OHIH:249,OIHI:200,OIIH:-68},this.TQ2__={BIHH:-1401,BIII:-1033,BKAK:-543,BOOO:-5591},this.TQ3__={BHHH:478,BHHM:-1073,BHIH:222,BHII:-504,BIIH:-116,BIII:-105,BMHI:-863,BMHM:-464,BOMH:620,OHHH:346,OHHI:1729,OHII:997,OHMH:481,OIHH:623,OIIH:1344,OKAK:2792,OKHH:587,OKKA:679,OOHH:110,OOII:-685},this.TQ4__={BHHH:-721,BHHM:-3604,BHII:-966,BIIH:-607,BIII:-2181,OAAA:-2763,OAKK:180,OHHH:-294,OHHI:2446,OHHO:480,OHIH:-1573,OIHH:1935,OIHI:-493,OIIH:626,OIII:-4007,OKAK:-8156},this.TW1__={につい:-4681,東京都:2026},this.TW2__={ある程:-2049,いった:-1256,ころが:-2434,しょう:3873,その後:-4430,だって:-1049,ていた:1833,として:-4657,ともに:-4517,もので:1882,一気に:-792,初めて:-1512,同時に:-8097,大きな:-1255,対して:-2721,社会党:-3216},this.TW3__={いただ:-1734,してい:1314,として:-4314,につい:-5483,にとっ:-5989,に当た:-6247,"ので,":-727,"ので、":-727,のもの:-600,れから:-3752,十二月:-2287},this.TW4__={"いう.":8576,"いう。":8576,からな:-2348,してい:2958,"たが,":1516,"たが、":1516,ている:1538,という:1349,ました:5543,ません:1097,ようと:-4258,よると:5865},this.UC1__={A:484,K:93,M:645,O:-505},this.UC2__={A:819,H:1059,I:409,M:3987,N:5775,O:646},this.UC3__={A:-1370,I:2311},this.UC4__={A:-2643,H:1809,I:-1032,K:-3450,M:3565,N:3876,O:6646},this.UC5__={H:313,I:-1238,K:-799,M:539,O:-831},this.UC6__={H:-506,I:-253,K:87,M:247,O:-387},this.UP1__={O:-214},this.UP2__={B:69,O:935},this.UP3__={B:189},this.UQ1__={BH:21,BI:-12,BK:-99,BN:142,BO:-56,OH:-95,OI:477,OK:410,OO:-2422},this.UQ2__={BH:216,BI:113,OK:1759},this.UQ3__={BA:-479,BH:42,BI:1913,BK:-7198,BM:3160,BN:6427,BO:14761,OI:-827,ON:-3212},this.UW1__={",":156,"、":156,"「":-463,あ:-941,う:-127,が:-553,き:121,こ:505,で:-201,と:-547,ど:-123,に:-789,の:-185,は:-847,も:-466,や:-470,よ:182,ら:-292,り:208,れ:169,を:-446,ん:-137,"・":-135,主:-402,京:-268,区:-912,午:871,国:-460,大:561,委:729,市:-411,日:-141,理:361,生:-408,県:-386,都:-718,"「":-463,"・":-135},this.UW2__={",":-829,"、":-829,〇:892,"「":-645,"」":3145,あ:-538,い:505,う:134,お:-502,か:1454,が:-856,く:-412,こ:1141,さ:878,ざ:540,し:1529,す:-675,せ:300,そ:-1011,た:188,だ:1837,つ:-949,て:-291,で:-268,と:-981,ど:1273,な:1063,に:-1764,の:130,は:-409,ひ:-1273,べ:1261,ま:600,も:-1263,や:-402,よ:1639,り:-579,る:-694,れ:571,を:-2516,ん:2095,ア:-587,カ:306,キ:568,ッ:831,三:-758,不:-2150,世:-302,中:-968,主:-861,事:492,人:-123,会:978,保:362,入:548,初:-3025,副:-1566,北:-3414,区:-422,大:-1769,天:-865,太:-483,子:-1519,学:760,実:1023,小:-2009,市:-813,年:-1060,強:1067,手:-1519,揺:-1033,政:1522,文:-1355,新:-1682,日:-1815,明:-1462,最:-630,朝:-1843,本:-1650,東:-931,果:-665,次:-2378,民:-180,気:-1740,理:752,発:529,目:-1584,相:-242,県:-1165,立:-763,第:810,米:509,自:-1353,行:838,西:-744,見:-3874,調:1010,議:1198,込:3041,開:1758,間:-1257,"「":-645,"」":3145,ッ:831,ア:-587,カ:306,キ:568},this.UW3__={",":4889,1:-800,"−":-1723,"、":4889,々:-2311,〇:5827,"」":2670,"〓":-3573,あ:-2696,い:1006,う:2342,え:1983,お:-4864,か:-1163,が:3271,く:1004,け:388,げ:401,こ:-3552,ご:-3116,さ:-1058,し:-395,す:584,せ:3685,そ:-5228,た:842,ち:-521,っ:-1444,つ:-1081,て:6167,で:2318,と:1691,ど:-899,な:-2788,に:2745,の:4056,は:4555,ひ:-2171,ふ:-1798,へ:1199,ほ:-5516,ま:-4384,み:-120,め:1205,も:2323,や:-788,よ:-202,ら:727,り:649,る:5905,れ:2773,わ:-1207,を:6620,ん:-518,ア:551,グ:1319,ス:874,ッ:-1350,ト:521,ム:1109,ル:1591,ロ:2201,ン:278,"・":-3794,一:-1619,下:-1759,世:-2087,両:3815,中:653,主:-758,予:-1193,二:974,人:2742,今:792,他:1889,以:-1368,低:811,何:4265,作:-361,保:-2439,元:4858,党:3593,全:1574,公:-3030,六:755,共:-1880,円:5807,再:3095,分:457,初:2475,別:1129,前:2286,副:4437,力:365,動:-949,務:-1872,化:1327,北:-1038,区:4646,千:-2309,午:-783,協:-1006,口:483,右:1233,各:3588,合:-241,同:3906,和:-837,員:4513,国:642,型:1389,場:1219,外:-241,妻:2016,学:-1356,安:-423,実:-1008,家:1078,小:-513,少:-3102,州:1155,市:3197,平:-1804,年:2416,広:-1030,府:1605,度:1452,建:-2352,当:-3885,得:1905,思:-1291,性:1822,戸:-488,指:-3973,政:-2013,教:-1479,数:3222,文:-1489,新:1764,日:2099,旧:5792,昨:-661,時:-1248,曜:-951,最:-937,月:4125,期:360,李:3094,村:364,東:-805,核:5156,森:2438,業:484,氏:2613,民:-1694,決:-1073,法:1868,海:-495,無:979,物:461,特:-3850,生:-273,用:914,町:1215,的:7313,直:-1835,省:792,県:6293,知:-1528,私:4231,税:401,立:-960,第:1201,米:7767,系:3066,約:3663,級:1384,統:-4229,総:1163,線:1255,者:6457,能:725,自:-2869,英:785,見:1044,調:-562,財:-733,費:1777,車:1835,軍:1375,込:-1504,通:-1136,選:-681,郎:1026,郡:4404,部:1200,金:2163,長:421,開:-1432,間:1302,関:-1282,雨:2009,電:-1045,非:2066,駅:1620,"1":-800,"」":2670,"・":-3794,ッ:-1350,ア:551,グ:1319,ス:874,ト:521,ム:1109,ル:1591,ロ:2201,ン:278},this.UW4__={",":3930,".":3508,"―":-4841,"、":3930,"。":3508,〇:4999,"「":1895,"」":3798,"〓":-5156,あ:4752,い:-3435,う:-640,え:-2514,お:2405,か:530,が:6006,き:-4482,ぎ:-3821,く:-3788,け:-4376,げ:-4734,こ:2255,ご:1979,さ:2864,し:-843,じ:-2506,す:-731,ず:1251,せ:181,そ:4091,た:5034,だ:5408,ち:-3654,っ:-5882,つ:-1659,て:3994,で:7410,と:4547,な:5433,に:6499,ぬ:1853,ね:1413,の:7396,は:8578,ば:1940,ひ:4249,び:-4134,ふ:1345,へ:6665,べ:-744,ほ:1464,ま:1051,み:-2082,む:-882,め:-5046,も:4169,ゃ:-2666,や:2795,ょ:-1544,よ:3351,ら:-2922,り:-9726,る:-14896,れ:-2613,ろ:-4570,わ:-1783,を:13150,ん:-2352,カ:2145,コ:1789,セ:1287,ッ:-724,ト:-403,メ:-1635,ラ:-881,リ:-541,ル:-856,ン:-3637,"・":-4371,ー:-11870,一:-2069,中:2210,予:782,事:-190,井:-1768,人:1036,以:544,会:950,体:-1286,作:530,側:4292,先:601,党:-2006,共:-1212,内:584,円:788,初:1347,前:1623,副:3879,力:-302,動:-740,務:-2715,化:776,区:4517,協:1013,参:1555,合:-1834,和:-681,員:-910,器:-851,回:1500,国:-619,園:-1200,地:866,場:-1410,塁:-2094,士:-1413,多:1067,大:571,子:-4802,学:-1397,定:-1057,寺:-809,小:1910,屋:-1328,山:-1500,島:-2056,川:-2667,市:2771,年:374,庁:-4556,後:456,性:553,感:916,所:-1566,支:856,改:787,政:2182,教:704,文:522,方:-856,日:1798,時:1829,最:845,月:-9066,木:-485,来:-442,校:-360,業:-1043,氏:5388,民:-2716,気:-910,沢:-939,済:-543,物:-735,率:672,球:-1267,生:-1286,産:-1101,田:-2900,町:1826,的:2586,目:922,省:-3485,県:2997,空:-867,立:-2112,第:788,米:2937,系:786,約:2171,経:1146,統:-1169,総:940,線:-994,署:749,者:2145,能:-730,般:-852,行:-792,規:792,警:-1184,議:-244,谷:-1e3,賞:730,車:-1481,軍:1158,輪:-1433,込:-3370,近:929,道:-1291,選:2596,郎:-4866,都:1192,野:-1100,銀:-2213,長:357,間:-2344,院:-2297,際:-2604,電:-878,領:-1659,題:-792,館:-1984,首:1749,高:2120,"「":1895,"」":3798,"・":-4371,ッ:-724,ー:-11870,カ:2145,コ:1789,セ:1287,ト:-403,メ:-1635,ラ:-881,リ:-541,ル:-856,ン:-3637},this.UW5__={",":465,".":-299,1:-514,E2:-32768,"]":-2762,"、":465,"。":-299,"「":363,あ:1655,い:331,う:-503,え:1199,お:527,か:647,が:-421,き:1624,ぎ:1971,く:312,げ:-983,さ:-1537,し:-1371,す:-852,だ:-1186,ち:1093,っ:52,つ:921,て:-18,で:-850,と:-127,ど:1682,な:-787,に:-1224,の:-635,は:-578,べ:1001,み:502,め:865,ゃ:3350,ょ:854,り:-208,る:429,れ:504,わ:419,を:-1264,ん:327,イ:241,ル:451,ン:-343,中:-871,京:722,会:-1153,党:-654,務:3519,区:-901,告:848,員:2104,大:-1296,学:-548,定:1785,嵐:-1304,市:-2991,席:921,年:1763,思:872,所:-814,挙:1618,新:-1682,日:218,月:-4353,査:932,格:1356,機:-1508,氏:-1347,田:240,町:-3912,的:-3149,相:1319,省:-1052,県:-4003,研:-997,社:-278,空:-813,統:1955,者:-2233,表:663,語:-1073,議:1219,選:-1018,郎:-368,長:786,間:1191,題:2368,館:-689,"1":-514,E2:-32768,"「":363,イ:241,ル:451,ン:-343},this.UW6__={",":227,".":808,1:-270,E1:306,"、":227,"。":808,あ:-307,う:189,か:241,が:-73,く:-121,こ:-200,じ:1782,す:383,た:-428,っ:573,て:-1014,で:101,と:-105,な:-253,に:-149,の:-417,は:-236,も:-206,り:187,る:-135,を:195,ル:-673,ン:-496,一:-277,中:201,件:-800,会:624,前:302,区:1792,員:-1212,委:798,学:-960,市:887,広:-695,後:535,業:-697,相:753,社:-507,福:974,空:-822,者:1811,連:463,郎:1082,"1":-270,E1:306,ル:-673,ン:-496},this}t.prototype.ctype_=function(_){for(var t in this.chartype_)if(_.match(this.chartype_[t][0]))return this.chartype_[t][1];return"O"},t.prototype.ts_=function(_){return _||0},t.prototype.segment=function(_){if(null==_||null==_||""==_)return[];var t=[],H=["B3","B2","B1"],s=["O","O","O"],h=_.split("");for(K=0;K<h.length;++K)H.push(h[K]),s.push(this.ctype_(h[K]));H.push("E1"),H.push("E2"),H.push("E3"),s.push("O"),s.push("O"),s.push("O");for(var i=H[3],I="U",O="U",B="U",K=4;K<H.length-3;++K){var M=this.BIAS__,U=H[K-3],e=H[K-2],r=H[K-1],n=H[K],A=H[K+1],p=H[K+2],u=s[K-3],C=s[K-2],W=s[K-1],T=s[K],o=s[K+1],Q=s[K+2];M+=this.ts_(this.UP1__[I]),M+=this.ts_(this.UP2__[O]),M+=this.ts_(this.UP3__[B]),M+=this.ts_(this.BP1__[I+O]),M+=this.ts_(this.BP2__[O+B]),M+=this.ts_(this.UW1__[U]),M+=this.ts_(this.UW2__[e]),M+=this.ts_(this.UW3__[r]),M+=this.ts_(this.UW4__[n]),M+=this.ts_(this.UW5__[A]),M+=this.ts_(this.UW6__[p]),M+=this.ts_(this.BW1__[e+r]),M+=this.ts_(this.BW2__[r+n]),M+=this.ts_(this.BW3__[n+A]),M+=this.ts_(this.TW1__[U+e+r]),M+=this.ts_(this.TW2__[e+r+n]),M+=this.ts_(this.TW3__[r+n+A]),M+=this.ts_(this.TW4__[n+A+p]),M+=this.ts_(this.UC1__[u]),M+=this.ts_(this.UC2__[C]),M+=this.ts_(this.UC3__[W]),M+=this.ts_(this.UC4__[T]),M+=this.ts_(this.UC5__[o]),M+=this.ts_(this.UC6__[Q]),M+=this.ts_(this.BC1__[C+W]),M+=this.ts_(this.BC2__[W+T]),M+=this.ts_(this.BC3__[T+o]),M+=this.ts_(this.TC1__[u+C+W]),M+=this.ts_(this.TC2__[C+W+T]),M+=this.ts_(this.TC3__[W+T+o]),M+=this.ts_(this.TC4__[T+o+Q]),M+=this.ts_(this.UQ1__[I+u]),M+=this.ts_(this.UQ2__[O+C]),M+=this.ts_(this.UQ3__[B+W]),M+=this.ts_(this.BQ1__[O+C+W]),M+=this.ts_(this.BQ2__[O+W+T]),M+=this.ts_(this.BQ3__[B+C+W]),M+=this.ts_(this.BQ4__[B+W+T]),M+=this.ts_(this.TQ1__[O+u+C+W]),M+=this.ts_(this.TQ2__[O+C+W+T]),M+=this.ts_(this.TQ3__[B+u+C+W]);var N="O";(M+=this.ts_(this.TQ4__[B+C+W+T]))>0&&(t.push(i),i="",N="B"),I=O,O=B,B=N,i+=H[K]}return t.push(i),t},_.TinySegmenter=t}}));
\ No newline at end of file
diff --git a/assets/javascripts/vendor.c3dc8c49.min.js b/assets/javascripts/vendor.c3dc8c49.min.js
deleted file mode 100644
index f58aff7..0000000
--- a/assets/javascripts/vendor.c3dc8c49.min.js
+++ /dev/null
@@ -1,31 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return c})),n.d(e,"i",(function(){return s})),n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return f})),n.d(e,"h",(function(){return h})),n.d(e,"b",(function(){return l}));
-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */
-var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function u(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{s(r.next(t))}catch(t){o(t)}}function c(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}s((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}function h(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],u=0,c=o.length;u<c;u++,i++)r[i]=o[u];return r}function l(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=s(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}Object.create},,,function(t,e,n){"use strict";function r(t,e){if(i(t))return t.lift(e);throw new TypeError("Unable to lift unknown Observable type")}function i(t){return t&&"function"==typeof t.lift}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(0),i=n(16),o=n(37),u=n(9),c=n(12),s=n(21),a=function(t){function e(n,r,i){var u=t.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=o.a;break;case 1:if(!n){u.destination=o.a;break}if("object"==typeof n){n instanceof e?(u.syncErrorThrowable=n.syncErrorThrowable,u.destination=n,n.add(u)):(u.syncErrorThrowable=!0,u.destination=new f(u,n));break}default:u.syncErrorThrowable=!0,u.destination=new f(u,n,r,i)}return u}return Object(r.d)(e,t),e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(u.a),f=function(t){function e(e,n,r,c){var s,a=t.call(this)||this;a._parentSubscriber=e;var f=a;return Object(i.a)(n)?s=n:n&&(s=n.next,r=n.error,c=n.complete,n!==o.a&&(f=Object.create(n),Object(u.b)(n)&&n.add(a.unsubscribe.bind(a)),f.unsubscribe=a.unsubscribe.bind(a))),a._context=f,a._next=s,a._error=r,a._complete=c,a}return Object(r.d)(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=c.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(s.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(s.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};c.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.a.useDeprecatedSynchronousErrorHandling)throw t;Object(s.a)(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!c.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return c.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(Object(s.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(a)},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(4);var i=n(0),o=n(37),u=n(9);function c(t,e,n){if(t){if((i=t)instanceof r.a||s(i)&&Object(u.b)(i))return t;if(s(t))return new a(t)}var i;return t||e||n?new r.a(t,e,n):new r.a(o.a)}function s(t){return t&&"function"==typeof t.next&&"function"==typeof t.error&&"function"==typeof t.complete}var a=function(t){function e(e){var n=t.call(this)||this;return n.destination=e,n}return Object(i.d)(e,t),e}(r.a),f=n(17),h=n(43),l=n(12),p=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,i=c(t,e,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||l.a.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),l.a.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){l.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,i=e.destination,o=e.isStopped;if(n||o)return!1;t=i&&i instanceof r.a?i:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=d(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[f.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:Object(h.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=d(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function d(t){if(t||(t=l.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return s}));var r=n(23),i=n(32),o=n(16),u=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),c=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,c=this._ctorUnsubscribe,s=this._unsubscribe,f=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var h=0;h<n.length;++h){n[h].remove(this)}if(Object(o.a)(s)){c&&(this._unsubscribe=void 0);try{s.call(this)}catch(t){e=t instanceof u?a(t.errors):[t]}}if(Object(r.a)(f)){h=-1;for(var l=f.length;++h<l;){var p=f[h];if(Object(i.a)(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof u?e=e.concat(a(t.errors)):e.push(t)}}}if(e)throw new u(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function s(t){return t instanceof c||t&&"closed"in t&&"function"==typeof t.remove&&"function"==typeof t.add&&"function"==typeof t.unsubscribe}function a(t){return t.reduce((function(t,e){return t.concat(e instanceof u?e.errors:e)}),[])}},function(t,e,n){"use strict";n.d(e,"c",(function(){return c})),n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return f})),n.d(e,"e",(function(){return h}));var r=n(0),i=n(4),o=n(7),u=n(52),c=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return Object(r.d)(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(i.a),s=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i}return Object(r.d)(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(i.a),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(i.a),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.notifyNext=function(t,e,n,r){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(i.a);function h(t,e){if(!e.closed)return t instanceof o.a?t.subscribe(e):Object(u.a)(t)(e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(4),o=n(3);function u(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return Object(o.a)(n,new c(t,e))}}var c=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.project,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return Object(r.d)(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(30);function i(t){return function e(n){return 0===arguments.length||Object(r.a)(n)?e:t.apply(this,arguments)}}},,function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(13),i=n(30);function o(t){return function e(n,o){switch(arguments.length){case 0:return e;case 1:return Object(i.a)(n)?e:Object(r.a)((function(e){return t(n,e)}));default:return Object(i.a)(n)&&Object(i.a)(o)?e:Object(i.a)(n)?Object(r.a)((function(e){return t(e,o)})):Object(i.a)(o)?Object(r.a)((function(e){return t(n,e)})):t(n,o)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},,function(t,e,n){"use strict";function r(t){setTimeout((function(){throw t}),0)}n.d(e,"a",(function(){return r}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=Array.isArray||function(t){return t&&"number"==typeof t.length}},function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(7),i=new r.a((function(t){return t.complete()}))},,function(t,e,n){"use strict";function r(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(11),o=n(36),u=n(3),c=n(10);function s(t,e){return"function"==typeof e?function(n){return n.pipe(s((function(n,r){return Object(o.a)(t(n,r)).pipe(Object(i.a)((function(t,i){return e(n,t,r,i)})))})))}:function(e){return Object(u.a)(e,new a(t))}}var a=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.project))},t}(),f=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.project=n,r.index=0,r}return Object(r.d)(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}var r=this.innerSubscription;r&&r.unsubscribe();var i=new c.c(this);this.destination.add(i),this.innerSubscription=Object(c.e)(e,i)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(c.d)},function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(7),o=n(9),u=n(19),c=n(45),s=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Object(r.d)(e,t),e.prototype.lift=function(t){var e=new a(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new u.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new u.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new u.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new u.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new u.a;return this.hasError?(t.error(this.thrownError),o.a.EMPTY):this.isStopped?(t.complete(),o.a.EMPTY):(this.observers.push(t),new c.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new a(t,e)},e}(i.a),a=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Object(r.d)(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):o.a.EMPTY},e}(s)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(7),i=n(9);function o(t,e){return new r.a((function(n){var r=new i.a,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(7),i=n(48),o=n(34);function u(t,e){return e?Object(o.a)(t,e):new r.a(Object(i.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(7),i=n(52),o=n(9),u=n(17);var c=n(34),s=n(25);var a=n(49),f=n(47);function h(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[u.a]}(t))return function(t,e){return new r.a((function(n){var r=new o.a;return r.add(e.schedule((function(){var i=t[u.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(Object(a.a)(t))return function(t,e){return new r.a((function(n){var r=new o.a;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(Object(f.a)(t))return Object(c.a)(t,e);if(function(t){return t&&"function"==typeof t[s.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a((function(n){var r,i=new o.a;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[s.a](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}))}(t,e);if(Symbol&&Symbol.asyncIterator&&"function"==typeof t[Symbol.asyncIterator])return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a((function(n){var r=new o.a;return r.add(e.schedule((function(){var i=t[Symbol.asyncIterator]();r.add(e.schedule((function(){var t=this;i.next().then((function(e){e.done?n.complete():(n.next(e.value),t.schedule())}))})))}))),r}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function l(t,e){return e?h(t,e):t instanceof r.a?t:new r.a(Object(i.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(12),i=n(21),o={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(24),i=n(35),o=n(34);function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(r.a)(n)?(t.pop(),Object(o.a)(t,n)):Object(i.a)(t)}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(46);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(t)}function o(t){return 0===t.length?r.a:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(4),o=n(3);function u(t,e){return function(n){return Object(o.a)(n,new c(t,e))}}var c=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.compare,this.keySelector))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return Object(r.d)(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return Object(r.d)(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(9).a)},function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},function(t,e,n){"use strict";function r(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(55),i=new(n(54).a)(r.a),o=i},function(t,e,n){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(48),i=n(21),o=n(25),u=n(17),c=n(47),s=n(49),a=n(32),f=n(0);function h(t){return function(e){(function(t,e){var n,r,i,o;return Object(f.c)(this,void 0,void 0,(function(){var u,c;return Object(f.e)(this,(function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=Object(f.b)(t),s.label=1;case 1:return[4,n.next()];case 2:if((r=s.sent()).done)return[3,4];u=r.value,e.next(u),s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=s.sent(),i={error:c},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}}var l=function(t){if(t&&"function"==typeof t[u.a])return f=t,function(t){var e=f[u.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Object(c.a)(t))return Object(r.a)(t);if(Object(s.a)(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,i.a),t};if(t&&"function"==typeof t[o.a])return e=t,function(t){for(var n=e[o.a]();;){var r=void 0;try{r=n.next()}catch(e){return void t.error(e)}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};if(Symbol&&Symbol.asyncIterator&&t&&"function"==typeof t[Symbol.asyncIterator])return h(t);var e,n,f,l=Object(a.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+l+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(0),i=n(11),o=n(36),u=n(3),c=n(10);function s(t,e,n){return void 0===n&&(n=1/0),"function"==typeof e?function(r){return r.pipe(s((function(n,r){return Object(o.a)(t(n,r)).pipe(Object(i.a)((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return Object(u.a)(e,new a(t,n))})}var a=function(){function t(t,e){void 0===e&&(e=1/0),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.project,this.concurrent))},t}(),f=function(t){function e(e,n,r){void 0===r&&(r=1/0);var i=t.call(this,e)||this;return i.destination=e,i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return Object(r.d)(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=void 0,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++;var r=new c.c(this);this.destination.add(r),Object(c.e)(e,r)}else this.buffer.push(t)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(c.d),h=n(46);function l(t){return void 0===t&&(t=1/0),s(h.a,t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(42),o=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=i.a.now,t}(),u=function(t){function e(n,r){void 0===r&&(r=o.now);var i=t.call(this,n,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return Object(r.d)(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(o)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return Object(r.d)(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return Object(r.d)(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(9).a))},,function(t,e,n){
-/*!
- * clipboard.js v2.0.6
- * https://clipboardjs.com/
- * 
- * Licensed MIT © Zeno Rocha
- */
-var r;r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(t),r.removeAllRanges(),r.addRange(i),e=r.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function i(){r.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,u=r.length;o<u;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}},t.exports=n,t.exports.TinyEmitter=n},function(t,e,n){var r=n(3),i=n(4);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!r.string(e))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(t))return function(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}(t,e,n);if(r.nodeList(t))return function(t,e,n){return Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,n)})),{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,n)}))}}}(t,e,n);if(r.string(t))return function(t,e,n){return i(document.body,t,e,n)}(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var r=n(5);function i(t,e,n,r,i){var u=o.apply(this,arguments);return t.addEventListener(n,u,i),{destroy:function(){t.removeEventListener(n,u,i)}}}function o(t,e,n,i){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&i.call(t,n)}}t.exports=function(t,e,n,r,o){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return i(t,e,n,r,o)})))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n.n(r),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.resolveOptions(e),this.initSelection()}return u(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=i()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=i()(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":o(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}(),s=n(1),a=n.n(s),f=n(2),h=n.n(f),l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),d=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.resolveOptions(n),r.listenClick(t),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),p(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===l(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=h()(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new c({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return b("action",t)}},{key:"defaultTarget",value:function(t){var e=b("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return b("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach((function(t){n=n&&!!document.queryCommandSupported(t)})),n}}]),e}(a.a);function b(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}e.default=d}]).default},t.exports=r()},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(0),i=n(24),o=n(23),u=n(10),c=n(32),s=n(35),a=n(3),f={};function h(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0,u=void 0;if(Object(i.a)(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length){var f=t[0];Object(o.a)(f)&&(t=f),Object(c.a)(f)&&Object.getPrototypeOf(f)===Object.prototype&&(t=(u=Object.keys(f)).map((function(t){return f[t]})))}return Object(a.a)(Object(s.a)(t,r),new l(n,u))}var l=function(){function t(t,e){this.resultSelector=t,this.keys=e}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.resultSelector,this.keys))},t}(),p=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.resultSelector=n,i.keys=r,i.active=0,i.values=[],i.observables=[],i}return Object(r.d)(e,t),e.prototype._next=function(t){this.values.push(f),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Object(u.e)(r,new u.a(this,null,n)))}}},e.prototype.notifyComplete=function(){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n){var r=this.values,i=r[n],o=this.toRespond?i===f?--this.toRespond:this.toRespond:0;r[n]=e,0===o&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(this.keys?this.keys.reduce((function(t,e,n){return t[e]=r[n],t}),{}):r.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(u.b)},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(0),i=n(33),o=n(9),u=n(19),c=n(45),s=n(42),a=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=s.a);var i=t.call(this)||this;return i.timestampProvider=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===1/0?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return Object(r.d)(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push({time:this._getNow(),value:e}),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=r.length;if(this.closed)throw new u.a;if(this.isStopped||this.hasError?e=o.a.EMPTY:(this.observers.push(t),e=new c.a(this,t)),n)for(var s=0;s<i&&!t.closed;s++)t.next(r[s]);else for(s=0;s<i&&!t.closed;s++)t.next(r[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){var t=this.timestampProvider;return t?t.now():s.a.now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(t-r[o].time<n);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(i.a)},function(t,e,n){"use strict";(function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var u=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,s=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function u(){n&&(n=!1,t()),r&&s()}function c(){o(u)}function s(){var t=Date.now();if(n){if(t-i<2)return;r=!0}else n=!0,r=!1,setTimeout(c,e);i=t}return s}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;u.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),a=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},f=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||i},h=y(0,0,0,0);function l(t){return parseFloat(t)||0}function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+l(t["border-"+n+"-width"])}),0)}function d(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return h;var r=f(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=t["padding-"+i];e[i]=l(o)}return e}(r),o=i.left+i.right,u=i.top+i.bottom,c=l(r.width),s=l(r.height);if("border-box"===r.boxSizing&&(Math.round(c+o)!==e&&(c-=p(r,"left","right")+o),Math.round(s+u)!==n&&(s-=p(r,"top","bottom")+u)),!function(t){return t===f(t).document.documentElement}(t)){var a=Math.round(c+o)-e,d=Math.round(s+u)-n;1!==Math.abs(a)&&(c-=a),1!==Math.abs(d)&&(s-=d)}return y(i.left,i.top,c,s)}var b="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof f(t).SVGGraphicsElement}:function(t){return t instanceof f(t).SVGElement&&"function"==typeof t.getBBox};function v(t){return r?b(t)?function(t){var e=t.getBBox();return y(0,0,e.width,e.height)}(t):d(t):h}function y(t,e,n,r){return{x:t,y:e,width:n,height:r}}var m=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=v(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),w=function(t,e){var n,r,i,o,u,c,s,f=(r=(n=e).x,i=n.y,o=n.width,u=n.height,c="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(c.prototype),a(s,{x:r,y:i,width:o,height:u,top:i,right:r+o,bottom:u+i,left:r}),s);a(this,{target:t,contentRect:f})},_=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof f(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new m(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof f(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new w(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),g="undefined"!=typeof WeakMap?new WeakMap:new n,O=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=s.getInstance(),r=new _(e,n,this);g.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){O.prototype[t]=function(){var e;return(e=g.get(this))[t].apply(e,arguments)}}));var j=void 0!==i.ResizeObserver?i.ResizeObserver:O;e.a=j}).call(this,n(82))},function(t,e,n){"use strict";
-/*!
- * escape-html
- * Copyright(c) 2012-2013 TJ Holowaychuk
- * Copyright(c) 2015 Andreas Lubbe
- * Copyright(c) 2015 Tiancheng "Timothy" Gu
- * MIT Licensed
- */var r=/["'&<>]/;t.exports=function(t){var e,n=""+t,i=r.exec(n);if(!i)return n;var o="",u=0,c=0;for(u=i.index;u<n.length;u++){switch(n.charCodeAt(u)){case 34:e="&quot;";break;case 38:e="&amp;";break;case 39:e="&#39;";break;case 60:e="&lt;";break;case 62:e="&gt;";break;default:continue}c!==u&&(o+=n.substring(c,u)),c=u+1,o+=e}return c!==u?o+n.substring(c,u):o}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(7),i=n(36);function o(t){return new r.a((function(e){var n;try{n=t()}catch(t){return void e.error(t)}return Object(i.a)(n).subscribe(e)}))}},function(t,e,n){"use strict";var r=n(13);function i(t,e){return Object.prototype.hasOwnProperty.call(e,t)}var o=Object.prototype.toString,u=function(){return"[object Arguments]"===o.call(arguments)?function(t){return"[object Arguments]"===o.call(t)}:function(t){return i("callee",t)}}(),c=!{toString:null}.propertyIsEnumerable("toString"),s=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],a=function(){return arguments.propertyIsEnumerable("length")}(),f=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1},h="function"!=typeof Object.keys||a?Object(r.a)((function(t){if(Object(t)!==t)return[];var e,n,r=[],o=a&&u(t);for(e in t)!i(e,t)||o&&"length"===e||(r[r.length]=e);if(c)for(n=s.length-1;n>=0;)i(e=s[n],t)&&!f(r,e)&&(r[r.length]=e),n-=1;return r})):Object(r.a)((function(t){return Object(t)!==t?[]:Object.keys(t)}));e.a=h},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(4),o=n(15),u=n(16),c=n(3);function s(t,e,n){return function(r){return Object(c.a)(r,new a(t,e,n))}}var a=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.nextOrObserver,this.error,this.complete))},t}(),f=function(t){function e(e,n,r,i){var c=t.call(this,e)||this;return c._tapNext=o.a,c._tapError=o.a,c._tapComplete=o.a,c._tapError=r||o.a,c._tapComplete=i||o.a,Object(u.a)(n)?(c._context=c,c._tapNext=n):n&&(c._context=n,c._tapNext=n.next||o.a,c._tapError=n.error||o.a,c._tapComplete=n.complete||o.a),c}return Object(r.d)(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(4),o=n(3);function u(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return Object(o.a)(r,new c(t,e,n))}}var c=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.accumulator,this.seed,this.hasSeed))},t}(),s=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o._state=r,o._hasState=i,o.index=0,o}return Object(r.d)(e,t),e.prototype._next=function(t){var e=this.destination;if(this._hasState){var n=this.index++,r=void 0;try{r=this.accumulator(this._state,t,n)}catch(t){return void e.error(t)}this._state=r,e.next(r)}else this._state=t,this._hasState=!0,e.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(3);function i(t){return function(e){return Object(r.a)(e,new o(t))}}var o=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){var n=e.subscribe(t);return n.add(this.callback),n},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r,i=n(0),o=n(4),u=n(28),c=n(38),s=n(7);function a(t){var e=t.error;t.subscriber.error(e)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(r||(r={}));!function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}t.prototype.observe=function(t){var e,n,r;switch(this.kind){case"N":null===(e=t.next)||void 0===e||e.call(t,this.value);break;case"E":null===(n=t.error)||void 0===n||n.call(t,this.error);break;case"C":null===(r=t.complete)||void 0===r||r.call(t)}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":null==t||t(this.value);break;case"E":null==e||e(this.error);break;case"C":null==n||n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return Object(c.a)(this.value);case"E":return t=this.error,e?new s.a((function(n){return e.schedule(a,0,{error:t,subscriber:n})})):new s.a((function(e){return e.error(t)}));case"C":return u.a}throw new Error("unexpected notification kind value")},t.createNext=function(e){return new t("N",e)},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C")}();var f=h("C",void 0,void 0);function h(t,e,n){return{kind:t,value:e,error:n}}var l=n(3);function p(t,e){return void 0===e&&(e=0),function(n){return Object(l.a)(n,new d(t,e))}}var d=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new b(t,this.scheduler,this.delay))},t}(),b=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return Object(i.d)(e,t),e.dispatch=function(t){!function(t,e){var n,r,i;if("string"!=typeof t.kind)throw new TypeError('Invalid notification, missing "kind"');switch(t.kind){case"N":null===(n=e.next)||void 0===n||n.call(e,t.value);break;case"E":null===(r=e.error)||void 0===r||r.call(e,t.error);break;case"C":null===(i=e.complete)||void 0===i||i.call(e)}}(t.notification,t.destination),this.unsubscribe()},e.prototype.scheduleMessage=function(t){var n=this.destination;n.add(this.scheduler.schedule(e.dispatch,this.delay,{notification:t,destination:n}))},e.prototype._next=function(t){this.scheduleMessage(function(t){return h("N",t,void 0)}(t))},e.prototype._error=function(t){this.scheduleMessage(function(t){return h("E",void 0,t)}(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(f),this.unsubscribe()},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Object(r.d)(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(n(55).a),o=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1;t=t||n.shift();var i=n.length;do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(n(54).a))(i)},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(72),i=n(3);function o(t,e,n){var o;return o=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return Object(i.a)(t,function(t){var e,n,i=t.bufferSize,o=void 0===i?1/0:i,u=t.windowTime,c=void 0===u?1/0:u,s=t.refCount,a=t.scheduler,f=0;return function(t){var i;f++,e?i=e.subscribe(this):(e=new r.a(o,c,a),i=e.subscribe(this),(n=t.subscribe({next:function(t){e.next(t)},error:function(t){var r=e;n=void 0,e=void 0,r.error(t)},complete:function(){n=void 0,e.complete()}})).closed&&(n=void 0)),this.add((function(){f--,i.unsubscribe(),s&&0===f&&n&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(o))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(44);function i(t,e){return Object(r.a)((function(n,r){return e?e(n[t],r[t]):n[t]===r[t]}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(10),o=n(3);function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return Object(o.a)(e,new c(r,n))}}var c=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.observables,this.project))},t}(),s=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.project=r,o.toRespond=[];var u=n.length;o.values=new Array(u);for(var c=0;c<u;c++)o.toRespond.push(c);for(c=0;c<u;c++){var s=n[c];o.add(Object(i.e)(s,new i.a(o,void 0,c)))}return o}return Object(r.d)(e,t),e.prototype.notifyNext=function(t,e,n){this.values[n]=e;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=Object(r.h)([t],this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.b)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(4),o=n(3);function u(t,e){return void 0===e&&(e=null),function(n){return Object(o.a)(n,new c(t,e))}}var c=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?a:s}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return Object(r.d)(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(i.a),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return Object(r.d)(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var o=r.length;o--;){var u=r[o];u.push(t),u.length===e&&(r.splice(o,1),this.destination.next(u))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(i.a)},function(t,e,n){"use strict";var r=n(13),i=n(51),o=Object(r.a)((function(t){return Object(i.a)(t)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse()}));e.a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(38),i=n(53);function o(){return Object(i.a)(1)}function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o()(r.a.apply(void 0,t))}var c=n(24);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(c.a)(n)?(t.pop(),function(e){return u(t,e,n)}):function(e){return u(t,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(7),i=n(23),o=n(16),u=n(11);function c(t,e,n,s){return Object(o.a)(n)&&(s=n,n=void 0),s?c(t,e,n).pipe(Object(u.a)((function(t){return Object(i.a)(t)?s.apply(void 0,t):s(t)}))):new r.a((function(r){!function t(e,n,r,i,o){var u;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var c=e;e.addEventListener(n,r,o),u=function(){return c.removeEventListener(n,r,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var s=e;e.on(n,r),u=function(){return s.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var a=e;e.addListener(n,r),u=function(){return a.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var f=0,h=e.length;f<h;f++)t(e[f],n,r,i,o)}i.add(u)}(t,e,(function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)}),r,n)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(4),o=n(3);function u(t){return function(e){return Object(o.a)(e,new c(t))}}var c=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.value))},t}(),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return Object(r.d)(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(7),i=n(24),o=n(53),u=n(35);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=1/0,c=void 0,s=t[t.length-1];return Object(i.a)(s)?(c=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof s&&(n=t.pop()),!c&&1===t.length&&t[0]instanceof r.a?t[0]:Object(o.a)(n)(Object(u.a)(t,c))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(7),i=n(23),o=n(16),u=n(11);function c(t,e,n){return n?c(t,e).pipe(Object(u.a)((function(t){return Object(i.a)(t)?n.apply(void 0,t):n(t)}))):new r.a((function(n){var r,i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.next(1===t.length?t[0]:t)};try{r=t(i)}catch(t){return void n.error(t)}if(Object(o.a)(e))return function(){return e(i,r)}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(4),o=n(3);function u(t,e){return function(n){return Object(o.a)(n,new c(t,e))}}var c=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return Object(r.d)(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(33),o=n(19),u=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return Object(r.d)(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(11);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return Object(r.a)((function(e){for(var r=e,i=0;i<n;i++){var o=null==r?void 0:r[t[i]];if(void 0===o)return;r=o}return r}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0),i=n(3),o=n(10),u={leading:!0,trailing:!1};function c(t,e){return void 0===e&&(e=u),function(n){return Object(i.a)(n,new s(t,!!e.leading,!!e.trailing))}}var s=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector,this.leading,this.trailing))},t}(),a=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.destination=e,o.durationSelector=n,o._leading=r,o._trailing=i,o._sendValue=null,o._hasValue=!1,o}return Object(r.d)(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=null},e.prototype.throttle=function(t){var e;try{e=this.durationSelector(t)}catch(t){return void this.destination.error(t)}this.add(this._throttled=Object(o.e)(e,new o.c(this)))},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=null,e&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(o.d)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(31);function i(t,e){return e?Object(r.a)((function(){return t}),e):Object(r.a)((function(){return t}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(3),o=n(10);function u(t){return function(e){return Object(i.a)(e,new c(t))}}var c=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new s(t),r=e.subscribe(n);return r.add(Object(o.e)(this.notifier,new o.c(n))),r},t}(),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return Object(r.d)(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(o.d)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(7),i=n(15),o=new r.a(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(4),o=n(3);function u(t){return function(e){return Object(o.a)(e,new c(t))}}var c=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.total))},t}(),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return Object(r.d)(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(3),o=n(10);function u(t){return function(e){var n=new c(t),r=Object(i.a)(e,n);return n.caught=r,r}}var c=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.selector,this.caught))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return Object(r.d)(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new o.c(this);this.add(r),Object(o.e)(n,r)}},e}(o.d)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0),i=n(4),o=n(50),u=n(3);function c(t,e){return void 0===e&&(e=o.a),function(n){return Object(u.a)(n,new s(t,e))}}var s=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.dueTime,this.scheduler))},t}(),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return Object(r.d)(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(f,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(i.a);function f(t){t.debouncedNext()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(75),i=n(28);function o(t,e,n){return void 0===e&&(e=i.a),void 0===n&&(n=i.a),Object(r.a)((function(){return t()?e:n}))}},function(t,e,n){"use strict";var r=n(18),i=Object(r.a)((function(t,e){return Array.prototype.slice.call(e,0).sort((function(e,n){var r=t(e),i=t(n);return r<i?-1:r>i?1:0}))}));e.a=i},function(t,e,n){"use strict";var r=n(13),i=n(76),o=Object(r.a)((function(t){for(var e=Object(i.a)(t),n=e.length,r=[],o=0;o<n;)r[o]=t[e[o]],o+=1;return r}));e.a=o},function(t,e,n){"use strict";var r=n(18),i=Number.isInteger||function(t){return t<<0===t},o=n(51),u=Object(r.a)((function(t,e){var n=t<0?e.length+t:t;return Object(o.a)(e)?e.charAt(n):e[n]})),c=Object(r.a)((function(t,e){return t.map((function(t){for(var n,r=e,o=0;o<t.length;){if(null==r)return;n=t[o],r=i(n)?u(n,r):r[n],o+=1}return r}))})),s=Object(r.a)((function(t,e){return c([t],e)[0]})),a=Object(r.a)((function(t,e){return s([t],e)}));e.a=a},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var r=n(0),i=n(7),o=n(4),u=n(9),c=n(3);function s(){return function(t){return Object(c.a)(t,new f)}}var a,f=function(){function t(){}return t.prototype.call=function(t,e){e._refCount++;var n=new h(t,e),r=e.subscribe(n);return n.closed||(n.connection=e.connect()),r},t}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r.connection=null,r}return Object(r.d)(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(o.a),l=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return Object(r.d)(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new u.a).add(this.source.subscribe(new d(this.getSubject(),this))),t.closed&&(this._connection=null,t=u.a.EMPTY)),t},e.prototype.refCount=function(){return s()(this)},e}(i.a),p={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(a=l.prototype)._subscribe},_isComplete:{value:a._isComplete,writable:!0},getSubject:{value:a.getSubject},connect:{value:a.connect},refCount:{value:a.refCount}},d=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.connectable=n,r}return Object(r.d)(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(o.a),b=(function(){function t(t){this.connectable=t}t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new b(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i}}(),function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return Object(r.d)(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(o.a));var v=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}(),y=n(33);function m(){return new y.a}function w(){return function(t){return s()((e=m,function(t){var r;if(r="function"==typeof e?e:function(){return e},"function"==typeof n)return Object(c.a)(t,new v(r,n));var i=Object.create(t,p);return i.source=t,i.subjectFactory=r,i})(t));var e,n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(4),o=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),u=n(28),c=n(3);function s(t){if(isNaN(t))throw new TypeError("'count' is not a number");if(t<0)throw new o;return function(e){return 0===t?u.a:Object(c.a)(e,new a(t))}}var a=function(){function t(t){this.count=t}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.count))},t}(),f=function(t){function e(e,n){var r=t.call(this,e)||this;return r.count=n,r._valueCount=0,r}return Object(r.d)(e,t),e.prototype._next=function(t){var e=this.count,n=++this._valueCount;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(i.a)},function(t,e,n){"use strict";var r=n(13);function i(t){return t}var o=Object(r.a)(i);e.a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0),i=n(50);var o=n(4),u=n(3);function c(t,e){void 0===e&&(e=i.a);var n,r=(n=t)instanceof Date&&!isNaN(n)?+t-e.now():Math.abs(t);return function(t){return Object(u.a)(t,new s(r,e))}}var s=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.delay,this.scheduler))},t}(),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.destination=e,i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i}return Object(r.d)(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)i.next(n.shift().value);if(n.length>0){var o=Math.max(0,n[0].time-r.now());this.schedule(t,o)}else e.isStopped?(e.destination.complete(),e.active=!1):(this.unsubscribe(),e.active=!1)},e.prototype._schedule=function(t){this.active=!0;var n=this.destination;n.add(t.schedule(e.dispatch,this.delay,{source:this,destination:n,scheduler:t}))},e.prototype._next=function(t){var e=this.scheduler,n=new f(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)},e.prototype._error=function(t){this.queue.length=0,this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){0===this.queue.length&&this.destination.complete(),this.unsubscribe()},e}(o.a),f=function(t,e){this.time=t,this.value=e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(0),i=n(7),o=n(4);function u(t){return"undefined"!=typeof FormData&&t instanceof FormData}var c=function(t){function e(e){var n=t.call(this)||this,r={async:!0,createXHR:function(){return new XMLHttpRequest},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof e)r.url=e;else for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return n.request=r,n}return Object(r.d)(e,t),e.prototype._subscribe=function(t){return new s(t,this.request)},e}(i.a),s=function(t){function e(e,n){var r=t.call(this,e)||this;r.request=n,r.done=!1;var i=n.headers=n.headers||{};return n.crossDomain||r.getHeader(i,"X-Requested-With")||(i["X-Requested-With"]="XMLHttpRequest"),r.getHeader(i,"Content-Type")||void 0===n.body||u(n.body)||(i["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),n.body=r.serializeBody(n.body,r.getHeader(n.headers,"Content-Type")),r.send(),r}return Object(r.d)(e,t),e.prototype.next=function(t){this.done=!0;var e,n=this.destination;try{e=new a(t,this.xhr,this.request)}catch(t){return n.error(t)}n.next(e)},e.prototype.send=function(){var t=this.request,e=this.request,n=e.user,r=e.method,i=e.url,o=e.async,u=e.password,c=e.headers,s=e.body;try{var a=this.xhr=t.createXHR();this.setupEvents(a,t),n?a.open(r,i,o,n,u):a.open(r,i,o),o&&(a.timeout=t.timeout,a.responseType=t.responseType),"withCredentials"in a&&(a.withCredentials=!!t.withCredentials),this.setHeaders(a,c),s?a.send(s):a.send()}catch(t){this.error(t)}},e.prototype.serializeBody=function(t,e){if(!t||"string"==typeof t)return t;if(u(t))return t;if(e){var n=e.indexOf(";");-1!==n&&(e=e.substring(0,n))}switch(e){case"application/x-www-form-urlencoded":return Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");case"application/json":return JSON.stringify(t);default:return t}},e.prototype.setHeaders=function(t,e){for(var n in e)e.hasOwnProperty(n)&&t.setRequestHeader(n,e[n])},e.prototype.getHeader=function(t,e){for(var n in t)if(n.toLowerCase()===e.toLowerCase())return t[n]},e.prototype.setupEvents=function(t,e){var n=this,r=e.progressSubscriber;t.ontimeout=function(i){var o,u;null===(o=null==r?void 0:r.error)||void 0===o||o.call(r,i);try{u=new l(t,e)}catch(t){u=t}n.error(u)},r&&(t.upload.onprogress=function(t){var e;null===(e=r.next)||void 0===e||e.call(r,t)}),t.onerror=function(i){var o;null===(o=null==r?void 0:r.error)||void 0===o||o.call(r,i),n.error(new f("ajax error",t,e))},t.onload=function(i){var o,u;if(t.status<400)null===(o=null==r?void 0:r.complete)||void 0===o||o.call(r),n.next(i),n.complete();else{null===(u=null==r?void 0:r.error)||void 0===u||u.call(r,i);var c=void 0;try{c=new f("ajax error "+t.status,t,e)}catch(t){c=t}n.error(c)}}},e.prototype.unsubscribe=function(){var e=this.done,n=this.xhr;!e&&n&&4!==n.readyState&&"function"==typeof n.abort&&n.abort(),t.prototype.unsubscribe.call(this)},e}(o.a),a=function(t,e,n){this.originalEvent=t,this.xhr=e,this.request=n,this.status=e.status,this.responseType=e.responseType||n.responseType,this.response=h(e)},f=function(){function t(t,e,n){var r;Error.call(this),this.message=t,this.name="AjaxError",this.xhr=e,this.request=n,this.status=e.status,this.responseType=e.responseType;try{r=h(e)}catch(t){r=e.responseText}return this.response=r,this}return t.prototype=Object.create(Error.prototype),t}();function h(t){switch(t.responseType){case"json":if("response"in t)return t.response;var e=t;return JSON.parse(e.responseText);case"document":return t.responseXML;case"text":default:return"response"in t?t.response:(e=t).responseText}}var l=function(){function t(t,e){return f.call(this,"ajax timeout",t,e),this.name="AjaxTimeoutError",this}return t.prototype=Object.create(f.prototype),t}(),p=n(11);function d(t,e){return O({method:"GET",url:t,headers:e})}function b(t,e,n){return O({method:"POST",url:t,body:e,headers:n})}function v(t,e){return O({method:"DELETE",url:t,headers:e})}function y(t,e,n){return O({method:"PUT",url:t,body:e,headers:n})}function m(t,e,n){return O({method:"PATCH",url:t,body:e,headers:n})}var w=Object(p.a)((function(t){return t.response}));function _(t,e){return w(O({method:"GET",url:t,responseType:"json",headers:e}))}var g,O=((g=function(t){return new c(t)}).get=d,g.post=b,g.delete=v,g.put=y,g.patch=m,g.getJSON=_,g)}]]);
-//# sourceMappingURL=vendor.c3dc8c49.min.js.map
\ No newline at end of file
diff --git a/assets/javascripts/vendor.c3dc8c49.min.js.map b/assets/javascripts/vendor.c3dc8c49.min.js.map
deleted file mode 100644
index 17c38da..0000000
--- a/assets/javascripts/vendor.c3dc8c49.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/lift.js","webpack:///./node_modules/rxjs/dist/esm5/internal/Subscriber.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/toSubscriber.js","webpack:///./node_modules/rxjs/dist/esm5/internal/Observable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/canReportError.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","webpack:///./node_modules/rxjs/dist/esm5/internal/Subscription.js","webpack:///./node_modules/rxjs/dist/esm5/internal/innerSubscribe.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/map.js","webpack:///./node_modules/rxjs/dist/esm5/internal/config.js","webpack:///./node_modules/ramda/es/internal/_curry1.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/noop.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isFunction.js","webpack:///./node_modules/rxjs/dist/esm5/internal/symbol/observable.js","webpack:///./node_modules/ramda/es/internal/_curry2.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/hostReportError.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isArray.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","webpack:///./node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/empty.js","webpack:///./node_modules/ramda/es/internal/_isPlaceholder.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/switchMap.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isObject.js","webpack:///./node_modules/rxjs/dist/esm5/internal/Subject.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/fromArray.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isIterable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/from.js","webpack:///./node_modules/rxjs/dist/esm5/internal/Observer.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/of.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/pipe.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js","webpack:///./node_modules/rxjs/dist/esm5/internal/SubjectSubscription.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/identity.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/subscribeToArray.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isPromise.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/async.js","webpack:///./node_modules/ramda/es/internal/_isString.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/subscribeToAsyncIterable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/subscribeTo.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/subscribeToObservable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/subscribeToPromise.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/subscribeToIterable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/mergeAll.js","webpack:///./node_modules/rxjs/dist/esm5/internal/Scheduler.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","webpack:///./node_modules/clipboard/dist/clipboard.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js","webpack:///./node_modules/rxjs/dist/esm5/internal/ReplaySubject.js","webpack:///./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","webpack:///./node_modules/escape-html/index.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/defer.js","webpack:///./node_modules/ramda/es/internal/_has.js","webpack:///./node_modules/ramda/es/internal/_isArguments.js","webpack:///./node_modules/ramda/es/keys.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/tap.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/scan.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/finalize.js","webpack:///./node_modules/rxjs/dist/esm5/internal/Notification.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/throwError.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/observeOn.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameAction.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/animationFrame.js","webpack:///./node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameScheduler.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/shareReplay.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/distinctUntilKeyChanged.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/withLatestFrom.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/bufferCount.js","webpack:///./node_modules/ramda/es/reverse.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/concatAll.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/concat.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/startWith.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/fromEvent.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/mapTo.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/merge.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/fromEventPattern.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/filter.js","webpack:///./node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/pluck.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/throttle.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/switchMapTo.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/sample.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/never.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/skip.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/catchError.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/debounceTime.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/iif.js","webpack:///./node_modules/ramda/es/sortBy.js","webpack:///./node_modules/ramda/es/values.js","webpack:///./node_modules/ramda/es/internal/_isInteger.js","webpack:///./node_modules/ramda/es/nth.js","webpack:///./node_modules/ramda/es/paths.js","webpack:///./node_modules/ramda/es/path.js","webpack:///./node_modules/ramda/es/prop.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/refCount.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/ConnectableObservable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/multicast.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/share.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/ArgumentOutOfRangeError.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/take.js","webpack:///./node_modules/ramda/es/internal/_identity.js","webpack:///./node_modules/ramda/es/identity.js","webpack:///./node_modules/rxjs/dist/esm5/internal/operators/delay.js","webpack:///./node_modules/rxjs/dist/esm5/internal/util/isDate.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/dom/AjaxObservable.js","webpack:///./node_modules/rxjs/dist/esm5/internal/observable/dom/ajax.js"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","Symbol","iterator","v","op","TypeError","pop","push","__values","o","m","__read","r","ar","error","__spread","concat","__spreadArrays","il","k","a","j","jl","__asyncValues","asyncIterator","settle","lift","source","operator","hasLift","Subscriber","_super","destinationOrNext","complete","_this","syncErrorValue","syncErrorThrown","syncErrorThrowable","isStopped","destination","add","SafeSubscriber","subscriber","_next","err","_error","_complete","unsubscribe","closed","_unsubscribeAndRecycle","_parentOrParents","_parentSubscriber","observerOrNext","context","bind","_context","useDeprecatedSynchronousErrorHandling","__tryOrSetError","__tryOrUnsub","wrappedComplete","fn","parent","Error","_unsubscribe","toSubscriber","nextOrObserver","isObserver","FullObserverSubscriber","Observable","subscribe","_subscribe","observable","sink","config","_trySubscribe","observer","_a","closed_1","canReportError","console","warn","forEach","promiseCtor","getPromiseCtor","subscription","pipe","operations","_i","toPromise","x","UnsubscriptionError","UnsubscriptionErrorImpl","errors","message","map","toString","join","name","Subscription","_subscriptions","_ctorUnsubscribe","empty","remove","index","isFunction","undefined","flattenUnsubscriptionErrors","isArray","len","sub","isObject","teardown","EMPTY","tmp","indexOf","subscriptions","subscriptionIndex","splice","isSubscription","reduce","errs","SimpleInnerSubscriber","notifyNext","notifyError","notifyComplete","ComplexInnerSubscriber","outerValue","outerIndex","SimpleOuterSubscriber","innerValue","ComplexOuterSubscriber","_outerValue","_outerIndex","_innerSub","innerSubscribe","innerSubscriber","project","MapOperator","MapSubscriber","count","_enable_super_gross_mode_that_will_cause_bad_things","stack","log","_curry1","f1","noop","_curry2","f2","_b","ObjectUnsubscribedError","ObjectUnsubscribedErrorImpl","hostReportError","setTimeout","isScheduler","schedule","_isPlaceholder","switchMap","resultSelector","ii","SwitchMapOperator","SwitchMapSubscriber","innerSubscription","Subject","observers","hasError","thrownError","subject","AnonymousSubject","copy","slice","asObservable","scheduleArray","input","scheduler","fromArray","scheduled","isInteropObservable","scheduleObservable","isPromise","schedulePromise","isArrayLike","isIterable","return","scheduleIterable","scheduleAsyncIterable","from","subscribeTo","of","args","dateTimestampProvider","now","delegate","Date","fns","pipeFromArray","prev","distinctUntilChanged","compare","keySelector","DistinctUntilChangedOperator","DistinctUntilChangedSubscriber","hasKey","key","SubjectSubscription","subscriberIndex","identity","subscribeToArray","array","asyncScheduler","async","_isString","subscribeToAsyncIterable","asyncIterable","asyncIterable_1","asyncIterable_1_1","e_1","e_1_1","process","catch","obj","obs","promise","iterable","item","mergeMap","concurrent","Infinity","MergeMapOperator","MergeMapSubscriber","hasCompleted","buffer","active","shift","mergeAll","Scheduler","SchedulerAction","work","delay","state","AsyncScheduler","actions","flush","action","execute","AsyncAction","pending","id","recycleAsyncId","requestAsyncId","setInterval","clearInterval","_execute","errored","errorValue","Action","factory","modules","installedModules","__webpack_require__","moduleId","exports","module","l","c","getter","defineProperty","enumerable","get","toStringTag","mode","__esModule","ns","object","property","element","selectedText","nodeName","focus","isReadOnly","hasAttribute","setAttribute","select","setSelectionRange","removeAttribute","selection","window","getSelection","range","document","createRange","selectNodeContents","removeAllRanges","addRange","E","on","callback","ctx","once","self","listener","off","emit","data","evtArr","evts","liveEvents","TinyEmitter","is","target","type","string","node","addEventListener","destroy","removeEventListener","listenNode","nodeList","listenNodeList","selector","listenSelector","HTMLElement","nodeType","String","closest","_delegate","useCapture","listenerFn","delegateTarget","elements","querySelectorAll","Element","matches","proto","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","parentNode","__webpack_exports__","src_select","select_default","_typeof","_createClass","defineProperties","props","descriptor","configurable","writable","Constructor","protoProps","staticProps","clipboard_action","ClipboardAction","options","instance","_classCallCheck","resolveOptions","initSelection","container","emitter","text","trigger","selectFake","selectTarget","isRTL","documentElement","getAttribute","removeFake","fakeHandlerCallback","fakeHandler","fakeElem","createElement","style","fontSize","border","padding","margin","position","yPosition","pageYOffset","scrollTop","top","appendChild","copyText","removeChild","succeeded","execCommand","handleResult","clearSelection","activeElement","blur","set","_action","_target","tiny_emitter","tiny_emitter_default","listen","listen_default","clipboard_typeof","clipboard_createClass","clipboard_Clipboard","_Emitter","Clipboard","clipboard_classCallCheck","ReferenceError","_possibleConstructorReturn","getPrototypeOf","listenClick","subClass","superClass","_inherits","defaultAction","defaultTarget","defaultText","_this2","onClick","currentTarget","clipboardAction","getAttributeValue","querySelector","support","queryCommandSupported","suffix","attribute","NONE","combineLatest","observables","keys","first_1","CombineLatestOperator","CombineLatestSubscriber","values","toRespond","oldVal","_tryResultSelector","ReplaySubject","bufferSize","windowTime","timestampProvider","_events","_infiniteTimeWindow","_bufferSize","_windowTime","nextInfiniteTimeWindow","nextTimeWindow","time","_getNow","_trimBufferThenGetEvents","eventsCount","spliceCount","Math","max","MapShim","Map","getIndex","arr","some","entry","class_1","__entries__","delete","entries","has","clear","isBrowser","global$1","global","Function","requestAnimationFrame$1","requestAnimationFrame","transitionKeys","mutationObserverSupported","MutationObserver","ResizeObserverController","connected_","mutationEventsAdded_","mutationsObserver_","observers_","onTransitionEnd_","refresh","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","throttle","addObserver","connect_","removeObserver","disconnect_","updateObservers_","activeObservers","filter","gatherActive","hasActive","broadcastActive","observe","attributes","childList","characterData","subtree","disconnect","propertyName","getInstance","instance_","defineConfigurable","getWindowOf","ownerDocument","defaultView","emptyRect","createRectInit","toFloat","parseFloat","getBordersSize","styles","positions","size","getHTMLElementContentRect","clientWidth","clientHeight","getComputedStyle","paddings","positions_1","getPaddings","horizPad","left","right","vertPad","bottom","width","height","boxSizing","round","isDocumentElement","vertScrollbar","horizScrollbar","abs","isSVGGraphicsElement","SVGGraphicsElement","SVGElement","getBBox","getContentRect","bbox","getSVGContentRect","ResizeObservation","broadcastWidth","broadcastHeight","contentRect_","isActive","rect","broadcastRect","ResizeObserverEntry","rectInit","Constr","contentRect","DOMRectReadOnly","ResizeObserverSPI","controller","callbackCtx","activeObservations_","observations_","callback_","controller_","callbackCtx_","observations","unobserve","clearActive","observation","WeakMap","ResizeObserver","method","matchHtmlRegExp","escape","str","match","exec","html","lastIndex","charCodeAt","substring","defer","observableFactory","_has","prop","hasEnumBug","propertyIsEnumerable","nonEnumerableProps","hasArgsEnumBug","contains","list","idx","nIdx","ks","checkArgsLength","tap","TapOperator","TapSubscriber","_tapNext","_tapError","_tapComplete","scan","accumulator","seed","hasSeed","ScanOperator","ScanSubscriber","_state","_hasState","finalize","FinallyOperator","NotificationKind","dispatch","Notification","kind","hasValue","_c","do","accept","toObservable","createNext","createError","createComplete","completeNotification","COMPLETE_NOTIFICATION","createNotification","observeOn","ObserveOnOperator","ObserveOnSubscriber","arg","notification","observeNotification","scheduleMessage","nextNotification","errorNotification","AnimationFrameAction","cancelAnimationFrame","animationFrameScheduler","AnimationFrameScheduler","shareReplay","configOrBufferSize","refCount","useRefCount","innerSub","dest","shareReplayOperator","distinctUntilKeyChanged","withLatestFrom","WithLatestFromOperator","WithLatestFromSubscriber","found","_tryProject","bufferCount","startBufferEvery","BufferCountOperator","subscriberClass","BufferSkipCountSubscriber","BufferCountSubscriber","buffers","reverse","split","concatAll","startWith","fromEvent","eventName","setupSubscription","sourceObj","handler","isEventTarget","source_1","isJQueryStyleEventEmitter","source_2","addListener","removeListener","isNodeStyleEventEmitter","source_3","mapTo","MapToOperator","MapToSubscriber","merge","last","fromEventPattern","addHandler","removeHandler","retValue","predicate","FilterOperator","FilterSubscriber","BehaviorSubject","_value","getValue","pluck","properties","currentProp","defaultThrottleConfig","leading","trailing","durationSelector","ThrottleOperator","ThrottleSubscriber","_leading","_trailing","_sendValue","_hasValue","_throttled","send","throttlingDone","switchMapTo","innerObservable","sample","notifier","SampleOperator","sampleSubscriber","SampleSubscriber","emitValue","NEVER","skip","SkipOperator","total","SkipSubscriber","catchError","CatchOperator","caught","CatchSubscriber","err2","debounceTime","dueTime","DebounceTimeOperator","DebounceTimeSubscriber","debouncedSubscription","lastValue","clearDebounce","dispatchNext","debouncedNext","iif","condition","trueResult","falseResult","sortBy","sort","aa","bb","vals","Number","offset","charAt","pathsArray","paths","val","_isInteger","pathAr","RefCountOperator","connectableProto","connectable","_refCount","refCounter","connection","connect","RefCountSubscriber","sharedConnection","_connection","ConnectableObservable","subjectFactory","_isComplete","getSubject","_subject","connectableObservableDescriptor","ConnectableSubscriber","MulticastOperator","shareSubjectFactory","share","subjectOrSubjectFactory","ArgumentOutOfRangeError","ArgumentOutOfRangeErrorImpl","take","isNaN","TakeOperator","TakeSubscriber","_valueCount","_identity","delayFor","DelayOperator","DelaySubscriber","queue","delay_1","_schedule","DelayMessage","isFormData","FormData","AjaxObservable","urlOrRequest","request","createXHR","XMLHttpRequest","crossDomain","withCredentials","headers","responseType","timeout","url","AjaxSubscriber","getHeader","serializeBody","AjaxResponse","xhr","user","password","setupEvents","open","setHeaders","contentType","splitIndex","encodeURIComponent","JSON","stringify","setRequestHeader","headerName","toLowerCase","progressSubscriber","ontimeout","AjaxTimeoutError","upload","onprogress","onerror","AjaxError","onload","status","readyState","abort","originalEvent","response","getXHRResponse","AjaxErrorImpl","responseText","ieXHR","parse","responseXML","AjaxTimeoutErrorImpl","ajaxGet","ajax","ajaxPost","ajaxDelete","ajaxPut","ajaxPatch","mapResponse","ajaxGetJSON","post","put","patch","getJSON"],"mappings":"sFAAA;;;;;;;;;;;;;;;AAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAK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YAC9C,SAASe,EAAY9C,EAAKH,GACtB,OAAOgD,EAAYL,EAAK,CACpB5Q,OAAQ,MACRoO,IAAKA,EACLF,aAAc,OACdD,QAASA,KAGV,IACCp0B,EADG+2B,IACH/2B,EAAS,SAAU8zB,GACnB,OAAO,IAAI,EAAeA,KAEvB7gB,IAAM6jB,EACb92B,EAAOs3B,KAAON,EACdh3B,EAAOmf,OAAS8X,EAChBj3B,EAAOu3B,IAAML,EACbl3B,EAAOw3B,MAAQL,EACfn3B,EAAOy3B,QAAUJ,EACVr3B","file":"assets/javascripts/vendor.c3dc8c49.min.js","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    }\r\n    return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n    return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n    for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n    if (m) return m.call(o);\r\n    if (o && typeof o.length === \"number\") return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\nexport function __spread() {\r\n    for (var ar = [], i = 0; i < arguments.length; i++)\r\n        ar = ar.concat(__read(arguments[i]));\r\n    return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n            r[k] = a[j];\r\n    return r;\r\n};\r\n\r\nexport function __await(v) {\r\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n    return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n    function fulfill(value) { resume(\"next\", value); }\r\n    function reject(value) { resume(\"throw\", value); }\r\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n    var i, p;\r\n    return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var m = o[Symbol.asyncIterator], i;\r\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n    o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n    if (mod && mod.__esModule) return mod;\r\n    var result = {};\r\n    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n    __setModuleDefault(result, mod);\r\n    return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n    return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to get private field on non-instance\");\r\n    }\r\n    return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to set private field on non-instance\");\r\n    }\r\n    privateMap.set(receiver, value);\r\n    return value;\r\n}\r\n","export function lift(source, operator) {\n    if (hasLift(source)) {\n        return source.lift(operator);\n    }\n    throw new TypeError('Unable to lift unknown Observable type');\n}\nexport function stankyLift(source, liftedSource, operator) {\n    if (hasLift(source)) {\n        return source.lift.call(liftedSource, operator);\n    }\n    throw new TypeError('Unable to lift unknown Observable type');\n}\nfunction hasLift(source) {\n    return source && typeof source.lift === 'function';\n}\n//# sourceMappingURL=lift.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Subscription, isSubscription } from './Subscription';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nvar Subscriber = (function (_super) {\n    __extends(Subscriber, _super);\n    function Subscriber(destinationOrNext, error, complete) {\n        var _this = _super.call(this) || this;\n        _this.syncErrorValue = null;\n        _this.syncErrorThrown = false;\n        _this.syncErrorThrowable = false;\n        _this.isStopped = false;\n        switch (arguments.length) {\n            case 0:\n                _this.destination = emptyObserver;\n                break;\n            case 1:\n                if (!destinationOrNext) {\n                    _this.destination = emptyObserver;\n                    break;\n                }\n                if (typeof destinationOrNext === 'object') {\n                    if (destinationOrNext instanceof Subscriber) {\n                        _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n                        _this.destination = destinationOrNext;\n                        destinationOrNext.add(_this);\n                    }\n                    else {\n                        _this.syncErrorThrowable = true;\n                        _this.destination = new SafeSubscriber(_this, destinationOrNext);\n                    }\n                    break;\n                }\n            default:\n                _this.syncErrorThrowable = true;\n                _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);\n                break;\n        }\n        return _this;\n    }\n    Subscriber.create = function (next, error, complete) {\n        var subscriber = new Subscriber(next, error, complete);\n        subscriber.syncErrorThrowable = false;\n        return subscriber;\n    };\n    Subscriber.prototype.next = function (value) {\n        if (!this.isStopped) {\n            this._next(value);\n        }\n    };\n    Subscriber.prototype.error = function (err) {\n        if (!this.isStopped) {\n            this.isStopped = true;\n            this._error(err);\n        }\n    };\n    Subscriber.prototype.complete = function () {\n        if (!this.isStopped) {\n            this.isStopped = true;\n            this._complete();\n        }\n    };\n    Subscriber.prototype.unsubscribe = function () {\n        if (this.closed) {\n            return;\n        }\n        this.isStopped = true;\n        _super.prototype.unsubscribe.call(this);\n    };\n    Subscriber.prototype._next = function (value) {\n        this.destination.next(value);\n    };\n    Subscriber.prototype._error = function (err) {\n        this.destination.error(err);\n        this.unsubscribe();\n    };\n    Subscriber.prototype._complete = function () {\n        this.destination.complete();\n        this.unsubscribe();\n    };\n    Subscriber.prototype._unsubscribeAndRecycle = function () {\n        var _parentOrParents = this._parentOrParents;\n        this._parentOrParents = null;\n        this.unsubscribe();\n        this.closed = false;\n        this.isStopped = false;\n        this._parentOrParents = _parentOrParents;\n        return this;\n    };\n    return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar SafeSubscriber = (function (_super) {\n    __extends(SafeSubscriber, _super);\n    function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n        var _this = _super.call(this) || this;\n        _this._parentSubscriber = _parentSubscriber;\n        var next;\n        var context = _this;\n        if (isFunction(observerOrNext)) {\n            next = observerOrNext;\n        }\n        else if (observerOrNext) {\n            next = observerOrNext.next;\n            error = observerOrNext.error;\n            complete = observerOrNext.complete;\n            if (observerOrNext !== emptyObserver) {\n                context = Object.create(observerOrNext);\n                if (isSubscription(observerOrNext)) {\n                    observerOrNext.add(_this.unsubscribe.bind(_this));\n                }\n                context.unsubscribe = _this.unsubscribe.bind(_this);\n            }\n        }\n        _this._context = context;\n        _this._next = next;\n        _this._error = error;\n        _this._complete = complete;\n        return _this;\n    }\n    SafeSubscriber.prototype.next = function (value) {\n        if (!this.isStopped && this._next) {\n            var _parentSubscriber = this._parentSubscriber;\n            if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n                this.__tryOrUnsub(this._next, value);\n            }\n            else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n                this.unsubscribe();\n            }\n        }\n    };\n    SafeSubscriber.prototype.error = function (err) {\n        if (!this.isStopped) {\n            var _parentSubscriber = this._parentSubscriber;\n            var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;\n            if (this._error) {\n                if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n                    this.__tryOrUnsub(this._error, err);\n                    this.unsubscribe();\n                }\n                else {\n                    this.__tryOrSetError(_parentSubscriber, this._error, err);\n                    this.unsubscribe();\n                }\n            }\n            else if (!_parentSubscriber.syncErrorThrowable) {\n                this.unsubscribe();\n                if (useDeprecatedSynchronousErrorHandling) {\n                    throw err;\n                }\n                hostReportError(err);\n            }\n            else {\n                if (useDeprecatedSynchronousErrorHandling) {\n                    _parentSubscriber.syncErrorValue = err;\n                    _parentSubscriber.syncErrorThrown = true;\n                }\n                else {\n                    hostReportError(err);\n                }\n                this.unsubscribe();\n            }\n        }\n    };\n    SafeSubscriber.prototype.complete = function () {\n        var _this = this;\n        if (!this.isStopped) {\n            var _parentSubscriber = this._parentSubscriber;\n            if (this._complete) {\n                var wrappedComplete = function () { return _this._complete.call(_this._context); };\n                if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n                    this.__tryOrUnsub(wrappedComplete);\n                    this.unsubscribe();\n                }\n                else {\n                    this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n                    this.unsubscribe();\n                }\n            }\n            else {\n                this.unsubscribe();\n            }\n        }\n    };\n    SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n        try {\n            fn.call(this._context, value);\n        }\n        catch (err) {\n            this.unsubscribe();\n            if (config.useDeprecatedSynchronousErrorHandling) {\n                throw err;\n            }\n            else {\n                hostReportError(err);\n            }\n        }\n    };\n    SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n        if (!config.useDeprecatedSynchronousErrorHandling) {\n            throw new Error('bad call');\n        }\n        try {\n            fn.call(this._context, value);\n        }\n        catch (err) {\n            if (config.useDeprecatedSynchronousErrorHandling) {\n                parent.syncErrorValue = err;\n                parent.syncErrorThrown = true;\n                return true;\n            }\n            else {\n                hostReportError(err);\n                return true;\n            }\n        }\n        return false;\n    };\n    SafeSubscriber.prototype._unsubscribe = function () {\n        var _parentSubscriber = this._parentSubscriber;\n        this._context = null;\n        this._parentSubscriber = null;\n        _parentSubscriber.unsubscribe();\n    };\n    return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\n//# sourceMappingURL=Subscriber.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { empty as emptyObserver } from '../Observer';\nimport { isSubscription } from '../Subscription';\nexport function toSubscriber(nextOrObserver, error, complete) {\n    if (nextOrObserver) {\n        if (isSubscriber(nextOrObserver)) {\n            return nextOrObserver;\n        }\n        if (isObserver(nextOrObserver)) {\n            return new FullObserverSubscriber(nextOrObserver);\n        }\n    }\n    if (!nextOrObserver && !error && !complete) {\n        return new Subscriber(emptyObserver);\n    }\n    return new Subscriber(nextOrObserver, error, complete);\n}\nfunction isObserver(value) {\n    return value && typeof value.next === 'function' && typeof value.error === 'function' && typeof value.complete === 'function';\n}\nfunction isSubscriber(value) {\n    return value instanceof Subscriber || (isObserver(value) && isSubscription(value));\n}\nvar FullObserverSubscriber = (function (_super) {\n    __extends(FullObserverSubscriber, _super);\n    function FullObserverSubscriber(destination) {\n        var _this = _super.call(this) || this;\n        _this.destination = destination;\n        return _this;\n    }\n    return FullObserverSubscriber;\n}(Subscriber));\n//# sourceMappingURL=toSubscriber.js.map","import { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nvar Observable = (function () {\n    function Observable(subscribe) {\n        if (subscribe) {\n            this._subscribe = subscribe;\n        }\n    }\n    Observable.prototype.lift = function (operator) {\n        var observable = new Observable();\n        observable.source = this;\n        observable.operator = operator;\n        return observable;\n    };\n    Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n        var operator = this.operator;\n        var sink = toSubscriber(observerOrNext, error, complete);\n        if (operator) {\n            sink.add(operator.call(sink, this.source));\n        }\n        else {\n            sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable)\n                ? this._subscribe(sink)\n                : this._trySubscribe(sink));\n        }\n        if (config.useDeprecatedSynchronousErrorHandling) {\n            if (sink.syncErrorThrowable) {\n                sink.syncErrorThrowable = false;\n                if (sink.syncErrorThrown) {\n                    throw sink.syncErrorValue;\n                }\n            }\n        }\n        return sink;\n    };\n    Observable.prototype._trySubscribe = function (sink) {\n        try {\n            return this._subscribe(sink);\n        }\n        catch (err) {\n            if (config.useDeprecatedSynchronousErrorHandling) {\n                sink.syncErrorThrown = true;\n                sink.syncErrorValue = err;\n            }\n            if (canReportError(sink)) {\n                sink.error(err);\n            }\n            else {\n                console.warn(err);\n            }\n        }\n    };\n    Observable.prototype.forEach = function (next, promiseCtor) {\n        var _this = this;\n        promiseCtor = getPromiseCtor(promiseCtor);\n        return new promiseCtor(function (resolve, reject) {\n            var subscription;\n            subscription = _this.subscribe(function (value) {\n                try {\n                    next(value);\n                }\n                catch (err) {\n                    reject(err);\n                    if (subscription) {\n                        subscription.unsubscribe();\n                    }\n                }\n            }, reject, resolve);\n        });\n    };\n    Observable.prototype._subscribe = function (subscriber) {\n        var source = this.source;\n        return source && source.subscribe(subscriber);\n    };\n    Observable.prototype[Symbol_observable] = function () {\n        return this;\n    };\n    Observable.prototype.pipe = function () {\n        var operations = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            operations[_i] = arguments[_i];\n        }\n        if (operations.length === 0) {\n            return this;\n        }\n        return pipeFromArray(operations)(this);\n    };\n    Observable.prototype.toPromise = function (promiseCtor) {\n        var _this = this;\n        promiseCtor = getPromiseCtor(promiseCtor);\n        return new promiseCtor(function (resolve, reject) {\n            var value;\n            _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n        });\n    };\n    Observable.create = function (subscribe) {\n        return new Observable(subscribe);\n    };\n    return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n    if (!promiseCtor) {\n        promiseCtor = config.Promise || Promise;\n    }\n    if (!promiseCtor) {\n        throw new Error('no Promise impl found');\n    }\n    return promiseCtor;\n}\n//# sourceMappingURL=Observable.js.map","import { Subscriber } from '../Subscriber';\nexport function canReportError(observer) {\n    while (observer) {\n        var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;\n        if (closed_1 || isStopped) {\n            return false;\n        }\n        else if (destination && destination instanceof Subscriber) {\n            observer = destination;\n        }\n        else {\n            observer = null;\n        }\n    }\n    return true;\n}\n//# sourceMappingURL=canReportError.js.map","var UnsubscriptionErrorImpl = (function () {\n    function UnsubscriptionErrorImpl(errors) {\n        Error.call(this);\n        this.message = errors ?\n            errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n  ') : '';\n        this.name = 'UnsubscriptionError';\n        this.errors = errors;\n        return this;\n    }\n    UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);\n    return UnsubscriptionErrorImpl;\n})();\nexport var UnsubscriptionError = UnsubscriptionErrorImpl;\n//# sourceMappingURL=UnsubscriptionError.js.map","import { isArray } from './util/isArray';\nimport { isObject } from './util/isObject';\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nvar Subscription = (function () {\n    function Subscription(unsubscribe) {\n        this.closed = false;\n        this._parentOrParents = null;\n        this._subscriptions = null;\n        if (unsubscribe) {\n            this._ctorUnsubscribe = true;\n            this._unsubscribe = unsubscribe;\n        }\n    }\n    Subscription.prototype.unsubscribe = function () {\n        var errors;\n        if (this.closed) {\n            return;\n        }\n        var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;\n        this.closed = true;\n        this._parentOrParents = null;\n        this._subscriptions = null;\n        if (_parentOrParents instanceof Subscription) {\n            _parentOrParents.remove(this);\n        }\n        else if (_parentOrParents !== null) {\n            for (var index = 0; index < _parentOrParents.length; ++index) {\n                var parent_1 = _parentOrParents[index];\n                parent_1.remove(this);\n            }\n        }\n        if (isFunction(_unsubscribe)) {\n            if (_ctorUnsubscribe) {\n                this._unsubscribe = undefined;\n            }\n            try {\n                _unsubscribe.call(this);\n            }\n            catch (e) {\n                errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n            }\n        }\n        if (isArray(_subscriptions)) {\n            var index = -1;\n            var len = _subscriptions.length;\n            while (++index < len) {\n                var sub = _subscriptions[index];\n                if (isObject(sub)) {\n                    try {\n                        sub.unsubscribe();\n                    }\n                    catch (e) {\n                        errors = errors || [];\n                        if (e instanceof UnsubscriptionError) {\n                            errors = errors.concat(flattenUnsubscriptionErrors(e.errors));\n                        }\n                        else {\n                            errors.push(e);\n                        }\n                    }\n                }\n            }\n        }\n        if (errors) {\n            throw new UnsubscriptionError(errors);\n        }\n    };\n    Subscription.prototype.add = function (teardown) {\n        var subscription = teardown;\n        if (!teardown) {\n            return Subscription.EMPTY;\n        }\n        switch (typeof teardown) {\n            case 'function':\n                subscription = new Subscription(teardown);\n            case 'object':\n                if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n                    return subscription;\n                }\n                else if (this.closed) {\n                    subscription.unsubscribe();\n                    return subscription;\n