mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
58 lines
34 KiB
JavaScript
58 lines
34 KiB
JavaScript
var Application=function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(1),a=i(s),c=n(2),u=i(c),l=n(3),d=i(l),h=function(){function e(){o(this,e)}return r(e,[{key:"initialize",value:function(){var e=new d["default"];e.initialize()}}]),e}();t["default"]=h,document.addEventListener("DOMContentLoaded",function(){Modernizr.addTest("ios",function(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}),Modernizr.addTest("standalone",function(){return!!navigator.standalone}),a["default"].attach(document.body);var e=document.getElementById("query");e.addEventListener("focus",function(){document.querySelector(".md-search").classList.add("md-js__search--locked")});var t=0,n=document.getElementById("search");n.addEventListener("click",function(e){var n=document.body.classList,i=!matchMedia("only screen and (min-width: 960px)").matches;n.contains("md-js__body--locked")?(n.remove("md-js__body--locked"),i&&setTimeout(function(){window.scrollTo(0,t)},100)):(t=window.scrollY,i&&setTimeout(function(){window.scrollTo(0,0)},400),setTimeout(function(){e.target.checked&&(i&&n.add("md-js__body--locked"),setTimeout(function(){document.getElementById("md-search").focus()},200))},450))});var i=document.querySelectorAll(".md-nav__item--nested > .md-nav__link");[].forEach.call(i,function(e){var t=e.nextElementSibling;t.style.maxHeight=t.getBoundingClientRect().height+"px",e.addEventListener("click",function(){var e=t.getBoundingClientRect().height;e?(t.style.maxHeight=e+"px",requestAnimationFrame(function(){t.classList.add("md-nav--transitioning"),t.style.maxHeight="0px"})):!function(){t.style.maxHeight="",t.classList.add("md-nav--toggled");var e=t.getBoundingClientRect().height;t.classList.remove("md-nav--toggled"),t.style.maxHeight="0px",requestAnimationFrame(function(){t.classList.add("md-nav--transitioning"),t.style.maxHeight=e+"px"})}()}),t.addEventListener("transitionend",function(e){e.target.classList.remove("md-nav--transitioning"),e.target.getBoundingClientRect().height>0&&(e.target.style.maxHeight="100%")})}),fetch("https://api.github.com/repos/squidfunk/mkdocs-material").then(function(e){return e.json()}).then(function(e){var t=e.stargazers_count,n=e.forks_count,i=document.querySelectorAll(".md-source__facts");[].forEach.call(i,function(e){var i=document.createElement("li");i.className="md-source__fact md-source__fact--hidden",i.innerText=t+" Stars",e.appendChild(i),setTimeout(function(e){e.classList.remove("md-source__fact--hidden")},100,i),i=document.createElement("li"),i.className="md-source__fact md-source__fact--hidden",i.innerText=n+" Forks",e.appendChild(i),setTimeout(function(e){e.classList.remove("md-source__fact--hidden")},500,i)})})["catch"](function(){}),fetch("/mkdocs/search_index.json").then(function(e){return e.json()}).then(function(t){var n=(0,u["default"])(function(){(void 0).field("title",{boost:10}),(void 0).field("text"),(void 0).ref("location")}),i={};t.docs.forEach(function(e){e.text=e.text.replace(/\s(\.,\:)\s/gi,function(e,t){return t+" "}),e.location=window.baseUrl+e.location,i[e.location]=e,n.add(e)});var o=document.getElementById("query");o.addEventListener("keyup",function(){for(var t=document.querySelector(".md-search-result__list");t.firstChild;)t.removeChild(t.firstChild);var o=n.search(e.value);o.forEach(function(e){var n=i[e.ref],o=document.createElement("a");o.classList.add("md-search-result__link"),o.href=n.location;var r=document.createElement("li");r.classList.add("md-search-result__item"),r.appendChild(o);var s=document.createElement("div");s.classList.add("md-search-result__title"),s.innerHTML=n.title,o.appendChild(s);var a=document.createElement("p");a.classList.add("md-search-result__description"),a.innerHTML=n.text,o.appendChild(a),t.appendChild(r)});var r=document.querySelector(".md-search-result__meta");r.innerHTML=o.length+" search result"+(1!==o.length?"s":"")})})["catch"](function(){})}),e.exports=t["default"]},function(e,t,n){var i;!function(){"use strict";/**
|
|
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
|
|
*
|
|
* @codingstandard ftlabs-jsv2
|
|
* @copyright The Financial Times Limited [All Rights Reserved]
|
|
* @license MIT License (see LICENSE.txt)
|
|
*/
|
|
function o(e,t){function n(e,t){return function(){return e.apply(t,arguments)}}var i;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,this.tapTimeout=t.tapTimeout||700,!o.notNeeded(e)){for(var r=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],a=this,c=0,u=r.length;c<u;c++)a[r[c]]=n(a[r[c]],a);s&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,i){var o=Node.prototype.removeEventListener;"click"===t?o.call(e,t,n.hijacked||n,i):o.call(e,t,n,i)},e.addEventListener=function(t,n,i){var o=Node.prototype.addEventListener;"click"===t?o.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),i):o.call(e,t,n,i)}),"function"==typeof e.onclick&&(i=e.onclick,e.addEventListener("click",function(e){i(e)},!1),e.onclick=null)}}var r=navigator.userAgent.indexOf("Windows Phone")>=0,s=navigator.userAgent.indexOf("Android")>0&&!r,a=/iP(ad|hone|od)/.test(navigator.userAgent)&&!r,c=a&&/OS 4_\d(_\d)?/.test(navigator.userAgent),u=a&&/OS [6-7]_\d/.test(navigator.userAgent),l=navigator.userAgent.indexOf("BB10")>0;o.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(a&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)},o.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!s;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},o.prototype.sendClick=function(e,t){var n,i;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),i=t.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(e),!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},o.prototype.determineEventType=function(e){return s&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},o.prototype.focus=function(e){var t;a&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},o.prototype.updateScrollParent=function(e){var t,n;if(t=e.fastClickScrollParent,!t||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},o.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e},o.prototype.onTouchStart=function(e){var t,n,i;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],a){if(i=window.getSelection(),i.rangeCount&&!i.isCollapsed)return!0;if(!c){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},o.prototype.touchHasMoved=function(e){var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n},o.prototype.onTouchMove=function(e){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0)},o.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},o.prototype.onTouchEnd=function(e){var t,n,i,o,r,l=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(e.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,u&&(r=e.changedTouches[0],l=document.elementFromPoint(r.pageX-window.pageXOffset,r.pageY-window.pageYOffset)||l,l.fastClickScrollParent=this.targetElement.fastClickScrollParent),i=l.tagName.toLowerCase(),"label"===i){if(t=this.findControl(l)){if(this.focus(l),s)return!1;l=t}}else if(this.needsFocus(l))return e.timeStamp-n>100||a&&window.top!==window&&"input"===i?(this.targetElement=null,!1):(this.focus(l),this.sendClick(l,e),a&&"select"===i||(this.targetElement=null,e.preventDefault()),!1);return!(!a||c||(o=l.fastClickScrollParent,!o||o.fastClickLastScrollTop===o.scrollTop))||(this.needsClick(l)||(e.preventDefault(),this.sendClick(l,e)),!1)},o.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},o.prototype.onMouse=function(e){return!this.targetElement||(!!e.forwardedTouchEvent||(!e.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1))))},o.prototype.onClick=function(e){var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail||(t=this.onMouse(e),t||(this.targetElement=null),t)},o.prototype.destroy=function(){var e=this.layer;s&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},o.notNeeded=function(e){var t,n,i,o;if("undefined"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!s)return!0;if(t=document.querySelector("meta[name=viewport]")){if(t.content.indexOf("user-scalable=no")!==-1)return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(l&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(t.content.indexOf("user-scalable=no")!==-1)return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.touchAction||(o=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],!!(o>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(t.content.indexOf("user-scalable=no")!==-1||document.documentElement.scrollWidth<=window.outerWidth)))||("none"===e.style.touchAction||"manipulation"===e.style.touchAction))},o.attach=function(e,t){return new o(e,t)},i=function(){return o}.call(t,n,t,e),!(void 0!==i&&(e.exports=i))}()},function(e,t,n){var i,o;!function(){var r=function(e){var t=new r.Index;return t.pipeline.add(r.trimmer,r.stopWordFilter,r.stemmer),e&&e.call(t,t),t};r.version="0.7.1",/*!
|
|
* lunr.utils
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.utils={},r.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),r.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},/*!
|
|
* lunr.EventEmitter
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.EventEmitter=function(){this.events={}},r.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},r.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);this.events[e].splice(n,1),this.events[e].length||delete this.events[e]}},r.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)})}},r.EventEmitter.prototype.hasHandler=function(e){return e in this.events},/*!
|
|
* lunr.tokenizer
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.tokenizer=function(e){return arguments.length&&null!=e&&void 0!=e?Array.isArray(e)?e.map(function(e){return r.utils.asString(e).toLowerCase()}):e.toString().trim().toLowerCase().split(r.tokenizer.seperator):[]},r.tokenizer.seperator=/[\s\-]+/,r.tokenizer.load=function(e){var t=this.registeredFunctions[e];if(!t)throw new Error("Cannot load un-registered function: "+e);return t},r.tokenizer.label="default",r.tokenizer.registeredFunctions={"default":r.tokenizer},r.tokenizer.registerFunction=function(e,t){t in this.registeredFunctions&&r.utils.warn("Overwriting existing tokenizer: "+t),e.label=t,this.registeredFunctions[t]=e},/*!
|
|
* lunr.Pipeline
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.Pipeline=function(){this._stack=[]},r.Pipeline.registeredFunctions={},r.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&r.utils.warn("Overwriting existing registered function: "+t),e.label=t,r.Pipeline.registeredFunctions[e.label]=e},r.Pipeline.warnIfFunctionNotRegistered=function(e){var t=e.label&&e.label in this.registeredFunctions;t||r.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},r.Pipeline.load=function(e){var t=new r.Pipeline;return e.forEach(function(e){var n=r.Pipeline.registeredFunctions[e];if(!n)throw new Error("Cannot load un-registered function: "+e);t.add(n)}),t},r.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){r.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},r.Pipeline.prototype.after=function(e,t){r.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n+=1,this._stack.splice(n,0,t)},r.Pipeline.prototype.before=function(e,t){r.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,t)},r.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},r.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._stack.length,o=0;o<n;o++){for(var r=e[o],s=0;s<i&&(r=this._stack[s](r,o,e),void 0!==r&&""!==r);s++);void 0!==r&&""!==r&&t.push(r)}return t},r.Pipeline.prototype.reset=function(){this._stack=[]},r.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return r.Pipeline.warnIfFunctionNotRegistered(e),e.label})},/*!
|
|
* lunr.Vector
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},r.Vector.Node=function(e,t,n){this.idx=e,this.val=t,this.next=n},r.Vector.prototype.insert=function(e,t){this._magnitude=void 0;var n=this.list;if(!n)return this.list=new r.Vector.Node(e,t,n),this.length++;if(e<n.idx)return this.list=new r.Vector.Node(e,t,n),this.length++;for(var i=n,o=n.next;void 0!=o;){if(e<o.idx)return i.next=new r.Vector.Node(e,t,o),this.length++;i=o,o=o.next}return i.next=new r.Vector.Node(e,t,o),this.length++},r.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e,t=this.list,n=0;t;)e=t.val,n+=e*e,t=t.next;return this._magnitude=Math.sqrt(n)},r.Vector.prototype.dot=function(e){for(var t=this.list,n=e.list,i=0;t&&n;)t.idx<n.idx?t=t.next:t.idx>n.idx?n=n.next:(i+=t.val*n.val,t=t.next,n=n.next);return i},r.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},/*!
|
|
* lunr.SortedSet
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.SortedSet=function(){this.length=0,this.elements=[]},r.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},r.SortedSet.prototype.add=function(){var e,t;for(e=0;e<arguments.length;e++)t=arguments[e],~this.indexOf(t)||this.elements.splice(this.locationFor(t),0,t);this.length=this.elements.length},r.SortedSet.prototype.toArray=function(){return this.elements.slice()},r.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},r.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},r.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;){if(r===e)return o;r<e&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},r.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)r<e&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:r<e?o+1:void 0},r.SortedSet.prototype.intersect=function(e){for(var t=new r.SortedSet,n=0,i=0,o=this.length,s=e.length,a=this.elements,c=e.elements;;){if(n>o-1||i>s-1)break;a[n]!==c[i]?a[n]<c[i]?n++:a[n]>c[i]&&i++:(t.add(a[n]),n++,i++)}return t},r.SortedSet.prototype.clone=function(){var e=new r.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},r.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o<r.length;o++)i.add(r[o]);return i},r.SortedSet.prototype.toJSON=function(){return this.toArray()},/*!
|
|
* lunr.Index
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.Index=function(){this._fields=[],this._ref="id",this.pipeline=new r.Pipeline,this.documentStore=new r.Store,this.tokenStore=new r.TokenStore,this.corpusTokens=new r.SortedSet,this.eventEmitter=new r.EventEmitter,this.tokenizerFn=r.tokenizer,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},r.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},r.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},r.Index.load=function(e){e.version!==r.version&&r.utils.warn("version mismatch: current "+r.version+" importing "+e.version);var t=new this;return t._fields=e.fields,t._ref=e.ref,t.tokenizer=r.tokenizer.load(e.tokenizer),t.documentStore=r.Store.load(e.documentStore),t.tokenStore=r.TokenStore.load(e.tokenStore),t.corpusTokens=r.SortedSet.load(e.corpusTokens),t.pipeline=r.Pipeline.load(e.pipeline),t},r.Index.prototype.field=function(e,t){var t=t||{},n={name:e,boost:t.boost||1};return this._fields.push(n),this},r.Index.prototype.ref=function(e){return this._ref=e,this},r.Index.prototype.tokenizer=function(e){var t=e.label&&e.label in r.tokenizer.registeredFunctions;return t||r.utils.warn("Function is not a registered tokenizer. This may cause problems when serialising the index"),this.tokenizerFn=e,this},r.Index.prototype.add=function(e,t){var n={},i=new r.SortedSet,o=e[this._ref],t=void 0===t||t;this._fields.forEach(function(t){var o=this.pipeline.run(this.tokenizerFn(e[t.name]));n[t.name]=o;for(var r=0;r<o.length;r++){var s=o[r];i.add(s),this.corpusTokens.add(s)}},this),this.documentStore.set(o,i);for(var s=0;s<i.length;s++){for(var a=i.elements[s],c=0,u=0;u<this._fields.length;u++){var l=this._fields[u],d=n[l.name],h=d.length;if(h){for(var f=0,p=0;p<h;p++)d[p]===a&&f++;c+=f/h*l.boost}}this.tokenStore.add(a,{ref:o,tf:c})}t&&this.eventEmitter.emit("add",e,this)},r.Index.prototype.remove=function(e,t){var n=e[this._ref],t=void 0===t||t;if(this.documentStore.has(n)){var i=this.documentStore.get(n);this.documentStore.remove(n),i.forEach(function(e){this.tokenStore.remove(e,n)},this),t&&this.eventEmitter.emit("remove",e,this)}},r.Index.prototype.update=function(e,t){var t=void 0===t||t;this.remove(e,!1),this.add(e,!1),t&&this.eventEmitter.emit("update",e,this)},r.Index.prototype.idf=function(e){var t="@"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,t))return this._idfCache[t];var n=this.tokenStore.count(e),i=1;return n>0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[t]=i},r.Index.prototype.search=function(e){var t=this.pipeline.run(this.tokenizerFn(e)),n=new r.Vector,i=[],o=this._fields.reduce(function(e,t){return e+t.boost},0),s=t.some(function(e){return this.tokenStore.has(e)},this);if(!s)return[];t.forEach(function(e,t,s){var a=1/s.length*this._fields.length*o,c=this,u=this.tokenStore.expand(e).reduce(function(t,i){var o=c.corpusTokens.indexOf(i),s=c.idf(i),u=1,l=new r.SortedSet;if(i!==e){var d=Math.max(3,i.length-e.length);u=1/Math.log(d)}o>-1&&n.insert(o,a*s*u);for(var h=c.tokenStore.get(i),f=Object.keys(h),p=f.length,m=0;m<p;m++)l.add(h[f[m]].ref);return t.union(l)},new r.SortedSet);i.push(u)},this);var a=i.reduce(function(e,t){return e.intersect(t)});return a.map(function(e){return{ref:e,score:n.similarity(this.documentVector(e))}},this).sort(function(e,t){return t.score-e.score})},r.Index.prototype.documentVector=function(e){for(var t=this.documentStore.get(e),n=t.length,i=new r.Vector,o=0;o<n;o++){var s=t.elements[o],a=this.tokenStore.get(s)[e].tf,c=this.idf(s);i.insert(this.corpusTokens.indexOf(s),a*c)}return i},r.Index.prototype.toJSON=function(){return{version:r.version,fields:this._fields,ref:this._ref,tokenizer:this.tokenizerFn.label,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},r.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},/*!
|
|
* lunr.Store
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.Store=function(){this.store={},this.length=0},r.Store.load=function(e){var t=new this;return t.length=e.length,t.store=Object.keys(e.store).reduce(function(t,n){return t[n]=r.SortedSet.load(e.store[n]),t},{}),t},r.Store.prototype.set=function(e,t){this.has(e)||this.length++,this.store[e]=t},r.Store.prototype.get=function(e){return this.store[e]},r.Store.prototype.has=function(e){return e in this.store},r.Store.prototype.remove=function(e){this.has(e)&&(delete this.store[e],this.length--)},r.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},/*!
|
|
* lunr.stemmer
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
|
*/
|
|
r.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},t={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",o=n+"[^aeiouy]*",r=i+"[aeiou]*",s="^("+o+")?"+r+o,a="^("+o+")?"+r+o+"("+r+")?$",c="^("+o+")?"+r+o+r+o,u="^("+o+")?"+i,l=new RegExp(s),d=new RegExp(c),h=new RegExp(a),f=new RegExp(u),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,y=/.$/,w=/(at|bl|iz)$/,k=new RegExp("([^aeiouylsz])\\1$"),_=new RegExp("^"+o+i+"[^aeiouwxy]$"),S=/^(.+?[^aeiou])y$/,E=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,b=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,x=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,T=/^(.+?)(s|t)(ion)$/,C=/^(.+?)e$/,O=/ll$/,L=new RegExp("^"+o+i+"[^aeiouwxy]$"),P=function(n){var i,o,r,s,a,c,u;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=g,s.test(n)){var P=s.exec(n);s=l,s.test(P[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var P=a.exec(n);i=P[1],a=f,a.test(i)&&(n=i,a=w,c=k,u=_,a.test(n)?n+="e":c.test(n)?(s=y,n=n.replace(s,"")):u.test(n)&&(n+="e"))}if(s=S,s.test(n)){var P=s.exec(n);i=P[1],n=i+"i"}if(s=E,s.test(n)){var P=s.exec(n);i=P[1],o=P[2],s=l,s.test(i)&&(n=i+e[o])}if(s=b,s.test(n)){var P=s.exec(n);i=P[1],o=P[2],s=l,s.test(i)&&(n=i+t[o])}if(s=x,a=T,s.test(n)){var P=s.exec(n);i=P[1],s=d,s.test(i)&&(n=i)}else if(a.test(n)){var P=a.exec(n);i=P[1]+P[2],a=d,a.test(i)&&(n=i)}if(s=C,s.test(n)){var P=s.exec(n);i=P[1],s=d,a=h,c=L,(s.test(i)||a.test(i)&&!c.test(i))&&(n=i)}return s=O,a=d,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return P}(),r.Pipeline.registerFunction(r.stemmer,"stemmer"),/*!
|
|
* lunr.stopWordFilter
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.generateStopWordFilter=function(e){var t=e.reduce(function(e,t){return e[t]=t,e},{});return function(e){if(e&&t[e]!==e)return e}},r.stopWordFilter=r.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),r.Pipeline.registerFunction(r.stopWordFilter,"stopWordFilter"),/*!
|
|
* lunr.trimmer
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
*/
|
|
r.trimmer=function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")},r.Pipeline.registerFunction(r.trimmer,"trimmer"),/*!
|
|
* lunr.stemmer
|
|
* Copyright (C) 2016 Oliver Nightingale
|
|
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
|
*/
|
|
r.TokenStore=function(){this.root={docs:{}},this.length=0},r.TokenStore.load=function(e){var t=new this;return t.root=e.root,t.length=e.length,t},r.TokenStore.prototype.add=function(e,t,n){var n=n||this.root,i=e.charAt(0),o=e.slice(1);return i in n||(n[i]={docs:{}}),0===o.length?(n[i].docs[t.ref]=t,void(this.length+=1)):this.add(o,t,n[i])},r.TokenStore.prototype.has=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e.charAt(n)])return!1;t=t[e.charAt(n)]}return!0},r.TokenStore.prototype.getNode=function(e){if(!e)return{};for(var t=this.root,n=0;n<e.length;n++){if(!t[e.charAt(n)])return{};t=t[e.charAt(n)]}return t},r.TokenStore.prototype.get=function(e,t){return this.getNode(e,t).docs||{}},r.TokenStore.prototype.count=function(e,t){return Object.keys(this.get(e,t)).length},r.TokenStore.prototype.remove=function(e,t){if(e){for(var n=this.root,i=0;i<e.length;i++){if(!(e.charAt(i)in n))return;n=n[e.charAt(i)]}delete n.docs[t]}},r.TokenStore.prototype.expand=function(e,t){var n=this.getNode(e),i=n.docs||{},t=t||[];return Object.keys(i).length&&t.push(e),Object.keys(n).forEach(function(n){"docs"!==n&&t.concat(this.expand(e+n,t))},this),t},r.TokenStore.prototype.toJSON=function(){return{root:this.root,length:this.length}},function(r,s){i=s,o="function"==typeof i?i.call(t,n,t,e):i,!(void 0!==o&&(e.exports=o))}(this,function(){return r})}()},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(4),a=i(s),c=function(){function e(){o(this,e)}return r(e,[{key:"initialize",value:function(){var e=window.matchMedia("(min-width: 1200px)"),t=new a["default"].Position("[data-md-sidebar=primary]"),n=function(){e.matches?t.listen():t.unlisten()};n();var i=new a["default"].Position("[data-md-sidebar=secondary]");i.listen(),window.addEventListener("resize",n);var o=new a["default"].Marker("[data-md-sidebar=secondary] .md-nav__link");o.listen()}}]),e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),r=i(o),s=n(7),a=i(s);t["default"]={Marker:r["default"],Position:a["default"]},e.exports=t["default"]},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(6),u=i(c),l=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.els_="string"==typeof e?document.querySelectorAll(e):e,n.index_=0,n.offset_=window.pageYOffset,n.anchors_=[].map.call(n.els_,function(e){return document.querySelector(e.hash)}),n}return s(t,e),a(t,[{key:"update",value:function(){if(this.offset_<=window.pageYOffset)for(var e=this.index_+1;e<this.els_.length&&this.anchors_[e].offsetTop<=window.pageYOffset;e++)e>0&&(this.els_[e-1].dataset.mdMarked=!0),this.index_=e;else for(var t=this.index_;t>=0;t--){if(!(this.anchors_[t].offsetTop>window.pageYOffset)){this.index_=t;break}t>0&&delete this.els_[t-1].dataset.mdMarked}this.offset_=window.pageYOffset}},{key:"reset",value:function(){[].forEach.call(this.els_,function(e){delete e.dataset.mdMarked})}}]),t}(u["default"]);t["default"]=l,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(){var t=this;n(this,e),this.handler_=function(e){window.requestAnimationFrame(function(){t.update(e)})}}return i(e,[{key:"update",value:function(){throw new Error("update(): not implemented")}},{key:"reset",value:function(){throw new Error("reset(): not implemented")}},{key:"listen",value:function(){var e=this;["scroll","resize","orientationchange"].forEach(function(t){window.addEventListener(t,e.handler_,!1)}),this.update()}},{key:"unlisten",value:function(){var e=this;["scroll","resize","orientationchange"].forEach(function(t){window.removeEventListener(t,e.handler_,!1)}),this.reset()}}]),e}();t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(6),u=i(c),l=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.el_="string"==typeof e?document.querySelector(e):e,n.inner_=n.el_.parentNode,n.outer_=n.el_.parentNode.parentNode,n.height_=0,n}return s(t,e),a(t,[{key:"update",value:function(){var e=this.inner_.getBoundingClientRect(),t=this.outer_.offsetTop,n=e.top+window.pageYOffset,i=e.bottom+window.pageYOffset,o=window.pageYOffset,r=window.pageYOffset+window.innerHeight,s=n-o,a=window.innerHeight-Math.max(r-i,0)-Math.max(s,t);a!==this.height_&&(this.el_.style.height=(this.height_=a)+"px"),s<t?this.el_.dataset.mdLocked||(this.el_.dataset.mdLocked=!0):this.el_.dataset.mdLocked&&delete this.el_.dataset.mdLocked}},{key:"reset",value:function(){delete this.el_.dataset.mdLocked,this.el_.style.height="",this.height_=0}}]),t}(u["default"]);t["default"]=l,e.exports=t["default"]}]); |