mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 01:45:15 +00:00
120 lines
133 KiB
JavaScript
120 lines
133 KiB
JavaScript
|
function copyToClipboard(e){const t=document.createElement("textarea");t.value=e.textContent.replace(/\n$/,""),document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function setupCodeCopy(){$("pre.highlight").prepend('<div class="copy-clipboard"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>Copy to Clipboard</title><path d="M18 6v-6h-18v18h6v6h18v-18h-6zm-12 10h-4v-14h14v4h-10v10zm16 6h-14v-14h14v14z"></path></svg></div>'),$(".copy-clipboard").on("click",function(){copyToClipboard(this.parentNode.children[1])})}function adjustLanguageSelectorWidth(){const e=$(".dark-box > .lang-selector");e.width(e.parent().width())}!function(){if("ontouchstart"in window){var e,t,n,r,i,o,s={};e=function(e,t){return Math.abs(e[0]-t[0])>5||Math.abs(e[1]-t[1])>5},t=function(e){this.startXY=[e.touches[0].clientX,e.touches[0].clientY],this.threshold=!1},n=function(t){if(this.threshold)return!1;this.threshold=e(this.startXY,[t.touches[0].clientX,t.touches[0].clientY])},r=function(t){if(!this.threshold&&!e(this.startXY,[t.changedTouches[0].clientX,t.changedTouches[0].clientY])){var n=t.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),r.simulated=!0,t.target.dispatchEvent(r)}},i=function(e){var t=Date.now(),n=t-s.time,r=e.clientX,i=e.clientY,a=[Math.abs(s.x-r),Math.abs(s.y-i)],u=o(e.target,"A")||e.target,l=u.nodeName,c="A"===l,f=window.navigator.standalone&&c&&e.target.getAttribute("href");if(s.time=t,s.x=r,s.y=i,(!e.simulated&&(n<500||n<1500&&a[0]<50&&a[1]<50)||f)&&(e.preventDefault(),e.stopPropagation(),!f))return!1;f&&(window.location=u.getAttribute("href")),u&&u.classList&&(u.classList.add("energize-focus"),window.setTimeout(function(){u.classList.remove("energize-focus")},150))},o=function(e,t){for(var n=e;n!==document.body;){if(!n||n.nodeName===t)return n;n=n.parentNode}return null},document.addEventListener("touchstart",t,!1),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",r,!1),document.addEventListener("click",i,!0)}}(),/*!
|
||
|
* jQuery JavaScript Library v3.6.0
|
||
|
* https://jquery.com/
|
||
|
*
|
||
|
* Includes Sizzle.js
|
||
|
* https://sizzlejs.com/
|
||
|
*
|
||
|
* Copyright OpenJS Foundation and other contributors
|
||
|
* Released under the MIT license
|
||
|
* https://jquery.org/license
|
||
|
*
|
||
|
* Date: 2021-03-02T17:08Z
|
||
|
*/
|
||
|
function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t,n){n=n||we;var r,i,o=n.createElement("script");if(o.text=e,t)for(r in Te)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function r(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?pe[he.call(e)]||"object":typeof e}function i(e){var t=!!e&&"length"in e&&e.length,n=r(e);return!xe(e)&&!be(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function o(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function s(e,t,n){return xe(t)?Ce.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?Ce.grep(e,function(e){return e===t!==n}):"string"!=typeof t?Ce.grep(e,function(e){return de.call(t,e)>-1!==n}):Ce.filter(t,e,n)}function a(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function u(e){var t={};return Ce.each(e.match(Pe)||[],function(e,n){t[n]=!0}),t}function l(e){return e}function c(e){throw e}function f(e,t,n,r){var i;try{e&&xe(i=e.promise)?i.call(e).done(t).fail(n):e&&xe(i=e.then)?i.call(e,t,n):t.apply(undefined,[e].slice(r))}catch(e){n.apply(undefined,[e])}}function d(){we.removeEventListener("DOMContentLoaded",d),e.removeEventListener("load",d),Ce.ready()}function p(e,t){return t.toUpperCase()}function h(e){return e.replace(Fe,"ms-").replace($e,p)}function g(){this.expando=Ce.expando+g.uid++}function m(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Be.test(e)?JSON.parse(e):e)}function y(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(We,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=m(n)}catch(e){}Me.set(e,t,n)}else n=undefined;return n}function v(e,t,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return Ce.css(e,t,"")},u=a(),l=n&&n[3]||(Ce.cssNumber[t]?"":"px"),c=e.nodeType&&(Ce.cssNumber[t]||"px"!==l&&+u)&&Ve.exec(Ce.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;s--;)Ce.style(e,t,c+l),(1-o)*(1-(o=a()/u||.5))<=0&&(s=0),c/=o;c*=2,Ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function x(e){var t,n=e.ownerDocument,r=e.nodeName,i=Ke[r];return i||(t=n.body.appendChild(n.createElement(r)),i=Ce.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Ke[r]=i,i)}function b(e,t){for(var n,r,i=[],o=0,s=e.length;o<s;o++)r=e[o],r.style&&(n=r.style.display,t?("none"===n&&(i[o]=He.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&Je(r)&&(i[o]=x(r))):"none"!==n&&(i[o]="none",He.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}function w(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],t===undefined||t&&o(e,t)?Ce.merge([e],n):n}function T(e,t){for(var n=0,r=e.length;n<r;n++)He.set(e[n],"globalEval",!t||He.get(t[n],"globalEval"))}function E(e,t,n,i,o){for(var s,a,u,l,c,f,d=t.createDocumentFragment(),p=[],h=0,g=e.length;h<g;h++)if((s=e[h])||0===s)if("object"===r(s))Ce.merge(p,s.nodeType?[s]:s);else if(rt.test(s)){for(a=a||d.appendChild(t.createElement("div")),u=(et.exec(s)||["",""])[1].toLowerCase(),l=nt[u]||nt._default,a.innerHTML=l[1]+Ce.htmlPrefilter(s)+l[2],f=l[0];f--;)a=a.lastChild;Ce.merge(p,a.childNodes),a=d.firstChild,a.textContent=""}else p.push(t.createTextNode(s));for(d.textContent="",h=0;s=p[h++];)if(i&&Ce.inArray(s,i)>-1)o&&o.push(s);else if(c=Ye(s),a=w(d.appendChild(s),"script"),c&&T(a),n)for(f=0;s=a[f++];)tt.test(s.type||"")&&n.push(s);return d}function C(){return!0}function k(){return!1}function S(e,t){return e===L()==("focus"===t)}function L(){try{return we.activeElement}catch(e){}}function j(e,t,n,r,i,o){var s,a;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=undefined);for(a in t)j(e,a
|
||
|
* Sizzle CSS Selector Engine v2.3.6
|
||
|
* https://sizzlejs.com/
|
||
|
*
|
||
|
* Copyright JS Foundation and other contributors
|
||
|
* Released under the MIT license
|
||
|
* https://js.foundation/
|
||
|
*
|
||
|
* Date: 2021-02-16
|
||
|
*/
|
||
|
function(e){function t(e,t,n,r){var i,o,s,a,u,l,c,d=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&(I(t),t=t||O,Q)){if(11!==h&&(u=xe.exec(e)))if(i=u[1]){if(9===h){if(!(s=t.getElementById(i)))return n;if(s.id===i)return n.push(s),n}else if(d&&(s=d.getElementById(i))&&$(t,s)&&s.id===i)return n.push(s),n}else{if(u[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&T.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(i)),n}if(T.qsa&&!U[e+" "]&&(!R||!R.test(e))&&(1!==h||"object"!==t.nodeName.toLowerCase())){if(c=e,d=t,1===h&&(fe.test(e)||ce.test(e))){for(d=be.test(e)&&f(t.parentNode)||t,d===t&&T.scope||((a=t.getAttribute("id"))?a=a.replace(Ee,Ce):t.setAttribute("id",a=_)),l=S(e),o=l.length;o--;)l[o]=(a?"#"+a:":scope")+" "+p(l[o]);c=l.join(",")}try{return Z.apply(n,d.querySelectorAll(c)),n}catch(t){U(e,!0)}finally{a===_&&t.removeAttribute("id")}}}return j(e.replace(ue,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>E.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[_]=!0,e}function i(e){var t=O.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)E.attrHandle[n[r]]=t}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function f(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=t.next,o=i||r,s=n&&"parentNode"===o,a=B++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,d=[M,a];if(u){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(f=t[_]||(t[_]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===M&&l[1]===a)return d[2]=l[2];if(c[o]=d,d[2]=e(t,n,u))return!0}return!1}}function g(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;i<o;i++)t(e,n[i],r);return r}function y(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),l&&t.push(a)));return s}function v(e,t,n,i,o,s){return i&&!i[_]&&(i=v(i)),o&&!o[_]&&(o=v(o,s)),r(function(r,s,a,u){var l,c,f,d=[],p=[],h=s.length,g=r||m(t||"*",a.nodeType?[a]:a,[]),v=!e||!r&&t?g:y(g,d,e,a,u),x=n?o||(r?e:h||i)?[]:s:v;if(n&&n(v,x,a,u),i)for(l=y(x,p),i(l,[],a,u),c=l.length;c--;)(f=l[c])&&(x[p[c]]=!(v[p[c]]=f));if(r){if(o||e){if(o){for(l=[],c=x.length;c--;)(f=x[c])&&l.push(v[c]=f);o(null,x=[],l,u)}for(c=x.length;c--;)(f=x[c])&&(l=o?te(r,f):d[c])>-1&&(r[l]=!(s[l]=f))}}else x=y(x===s?x.splice(h,x.length):x),o?o(null,s,x,u):Z.apply(s,x)})}function x(e){for(var t,n,r,i=e.length,o=E.relative[e[0].type],s=o||E.relative[" "],a=o?1:0,u=h(function(e){return e===t},s,!0),l=h(function(e){return te(t,e)>-1},s,!0),c=[function(e,n,r){var i=!o&&(r||n!==N)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];a<i;a++)if(n=E.relative[e[a].type])c=[h(g(c),n)];else{if(n=E.filter[e[a].type].apply(null,e[a].matches),n[_]){for(r=++a;r<i&&!E.relative[e[r].type];r++);return v(a>1&&g(c),a>1&&p(e.slice(0,a-1).concat({value:" "===e[a-2].t
|
||
|
;nt.tbody=nt.tfoot=nt.colgroup=nt.caption=nt.thead,nt.th=nt.td,ve.option||(nt.optgroup=nt.option=[1,"<select multiple='multiple'>","</select>"]);var rt=/<|&#?\w+;/,it=/^([^.]*)(?:\.(.+)|)/;Ce.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,d,p,h,g,m=He.get(e);if(_e(e))for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&Ce.find.matchesSelector(Xe,i),n.guid||(n.guid=Ce.guid++),(u=m.events)||(u=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(t){return void 0!==Ce&&Ce.event.triggered!==t.type?Ce.event.dispatch.apply(e,arguments):undefined}),t=(t||"").match(Pe)||[""],l=t.length;l--;)a=it.exec(t[l])||[],p=g=a[1],h=(a[2]||"").split(".").sort(),p&&(f=Ce.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=Ce.event.special[p]||{},c=Ce.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&Ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||(d=u[p]=[],d.delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,s)||e.addEventListener&&e.addEventListener(p,s)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),Ce.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,d,p,h,g,m=He.hasData(e)&&He.get(e);if(m&&(u=m.events)){for(t=(t||"").match(Pe)||[""],l=t.length;l--;)if(a=it.exec(t[l])||[],p=g=a[1],h=(a[2]||"").split(".").sort(),p){for(f=Ce.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=u[p]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));s&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||Ce.removeEvent(e,p,m.handle),delete u[p])}else for(p in u)Ce.event.remove(e,p+t[l],n,r,!0);Ce.isEmptyObject(u)&&He.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=new Array(arguments.length),u=Ce.event.fix(e),l=(He.get(this,"events")||Object.create(null))[u.type]||[],c=Ce.event.special[u.type]||{};for(a[0]=u,t=1;t<arguments.length;t++)a[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(s=Ce.event.handlers.call(this,u,l),t=0;(i=s[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,(r=((Ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))!==undefined&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,s,a=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],s={},n=0;n<u;n++)r=t[n],i=r.selector+" ",s[i]===undefined&&(s[i]=r.needsContext?Ce(i,this).index(l)>-1:Ce.find(i,this,null,[l]).length),s[i]&&o.push(r);o.length&&a.push({elem:l,handlers:o})}return l=this,u<t.length&&a.push({elem:l,handlers:t.slice(u)}),a},addProp:function(e,t){Object.defineProperty(Ce.Event.prototype,e,{enumerable:!0,configurable:!0,get:xe(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[Ce.expando]?e:new Ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Ze.test(t.type)&&t.click&&o(t,"input")&&N(t,"click",C),!1},trigger:function(e){var t=this||e;return Ze.test(t.type)&&t.click&&o(t,"input")&&N(t,"click"),!0},_default:function(e){var t=e.target;return Ze.test(t.type)&&t.click&&o(t,"input")&&He.get(t,"click")||o(t,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},Ce.removeEvent=function(e,t,n){e.removeEventListener
|
||
|
return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},Ce.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Xt={0:200,1223:204},Yt=Ce.ajaxSettings.xhr();ve.cors=!!Yt&&"withCredentials"in Yt,ve.ajax=Yt=!!Yt,Ce.ajaxTransport(function(t){var n,r;if(ve.cors||Yt&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(s in i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Xt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=a.ontimeout=n("error"),a.onabort!==undefined?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),Ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),Ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return Ce.globalEval(e),e}}}),Ce.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),Ce.ajaxTransport("script",function(e){if(e.crossDomain||e.scriptAttrs){var t,n;return{send:function(r,i){t=Ce("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),we.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Gt=[],Jt=/(=)\?(?=&|$)|\?\?/;Ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||Ce.expando+"_"+Dt.guid++;return this[e]=!0,e}}),Ce.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(Jt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Jt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=xe(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Jt,"$1"+i):!1!==t.jsonp&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||Ce.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){o===undefined?Ce(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Gt.push(i)),s&&xe(o)&&o(s[0]),s=o=undefined}),"script"}),ve.createHTMLDocument=function(){var e=we.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),Ce.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var r,i,o;return t||(ve.createHTMLDocument?(t=we.implementation.createHTMLDocument(""),r=t.createElement("base"),r.href=we.location.href,t.head.appendChild(r)):t=we),i=Ne.exec(e),o=!n&&[],i?[t.createElement(i[1])]:(i=E([e],t,o),o&&o.length&&Ce(o).remove(),Ce.merge([],i.childNodes))},Ce.fn.load=function(e,t,n){var r,i,o,s=this,a=e.indexOf(" ");return a>-1&&(r=K(e.slice(a)),e=e.slice(0,a)),xe(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&Ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?Ce("<div>").append(Ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},Ce.expr.pseudos.animated=function(e){return Ce.grep(Ce.timers,function(t){return e===t.elem}).length},Ce.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=Ce.css(e,"position"),f=Ce(e),d={};"static"===c&&(e.style.position="relative"),a=f.offset
|
||
|
* imagesLoaded PACKAGED v4.1.4
|
||
|
* JavaScript is all like "You images are done yet or what?"
|
||
|
* MIT License
|
||
|
*/
|
||
|
function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},r=n[e]=n[e]||[];return-1==r.indexOf(t)&&r.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=n.indexOf(t);return-1!=r&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var r=this._onceEvents&&this._onceEvents[e],i=0;i<n.length;i++){var o=n[i];r&&r[o]&&(this.off(e,o),delete r[o]),o.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(n){return t(e,n)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return Array.isArray(e)?e:"object"==typeof e&&"number"==typeof e.length?l.call(e):[e]}function i(e,t,o){if(!(this instanceof i))return new i(e,t,o);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=r(s),this.options=n({},this.options),"function"==typeof t?o=t:n(this.options,t),o&&this.on("always",o),this.getImages(),a&&(this.jqDeferred=new a.Deferred),void setTimeout(this.check.bind(this))):void u.error("Bad element for imagesLoaded "+(s||e))}function o(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var a=e.jQuery,u=e.console,l=Array.prototype.slice;i.prototype=Object.create(t.prototype),i.prototype.options={},i.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},i.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&c[t]){for(var n=e.querySelectorAll("img"),r=0;r<n.length;r++){var i=n[r];this.addImage(i)}if("string"==typeof this.options.background){var o=e.querySelectorAll(this.options.background);for(r=0;r<o.length;r++){var s=o[r];this.addElementBackgroundImages(s)}}}};var c={1:!0,9:!0,11:!0};return i.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var n=/url\((['"])?(.*?)\1\)/gi,r=n.exec(t.backgroundImage);null!==r;){var i=r&&r[2];i&&this.addBackground(i,e),r=n.exec(t.backgroundImage)}},i.prototype.addImage=function(e){var t=new o(e);this.images.push(t)},i.prototype.addBackground=function(e,t){var n=new s(e,t);this.images.push(n)},i.prototype.check=function(){function e(e,n,r){setTimeout(function(){t.progress(e,n,r)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},i.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&u&&u.log("progress: "+n,e,t)},i.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},o.prototype=Object.create(t.prototype),o.prototype.check=function(){return this.getIsImageComplete()?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.
|
||
|
* lunr.utils
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.utils={},e.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),e.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},e.utils.clone=function(e){if(null===e||e===undefined)return e;for(var t=Object.create(null),n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];if(Array.isArray(o))t[i]=o.slice();else{if("string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o)throw new TypeError("clone is not deep and does not support nested objects");t[i]=o}}return t},e.FieldRef=function(e,t,n){this.docRef=e,this.fieldName=t,this._stringValue=n},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){var n=t.indexOf(e.FieldRef.joiner);if(-1===n)throw"malformed field ref string";var r=t.slice(0,n),i=t.slice(n+1);return new e.FieldRef(i,r,t)},e.FieldRef.prototype.toString=function(){return this._stringValue==undefined&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue},/*!
|
||
|
* lunr.Set
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},e.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},e.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},e.Set.prototype.contains=function(e){return!!this.elements[e]},e.Set.prototype.intersect=function(t){var n,r,i,o=[];if(t===e.Set.complete)return this;if(t===e.Set.empty)return t;this.length<t.length?(n=this,r=t):(n=t,r=this),i=Object.keys(n.elements);for(var s=0;s<i.length;s++){var a=i[s];a in r.elements&&o.push(a)}return new e.Set(o)},e.Set.prototype.union=function(t){return t===e.Set.complete?e.Set.complete:t===e.Set.empty?this:new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)))},e.idf=function(e,t){var n=0;for(var r in e)"_index"!=r&&(n+=Object.keys(e[r]).length);var i=(t-n+.5)/(n+.5);return Math.log(1+Math.abs(i))},e.Token=function(e,t){this.str=e||"",this.metadata=t||{}},e.Token.prototype.toString=function(){return this.str},e.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},e.Token.prototype.clone=function(t){return t=t||function(e){return e},new e.Token(t(this.str,this.metadata),this.metadata)},/*!
|
||
|
* lunr.tokenizer
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.tokenizer=function(t,n){if(null==t||t==undefined)return[];if(Array.isArray(t))return t.map(function(t){return new e.Token(e.utils.asString(t).toLowerCase(),e.utils.clone(n))});for(var r=t.toString().toLowerCase(),i=r.length,o=[],s=0,a=0;s<=i;s++){var u=r.charAt(s),l=s-a;if(u.match(e.tokenizer.separator)||s==i){if(l>0){var c=e.utils.clone(n)||{};c.position=[a,l],c.index=o.length,o.push(new e.Token(r.slice(a,s),c))}a=s+1}}return o},e.tokenizer.separator=/[\s\-]+/,/*!
|
||
|
* lunr.Pipeline
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){t.label&&t.label in this.registeredFunctions||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(t){var r=e.Pipeline.registeredFunctions[t];if(!r)throw new Error("Cannot load unregistered function: "+t);n.add(r)}),n},e.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,n=0;n<t;n++){for(var r=this._stack[n],i=[],o=0;o<e.length;o++){var s=r(e[o],o,e);if(null!==s&&void 0!==s&&""!==s)if(Array.isArray(s))for(var a=0;a<s.length;a++)i.push(s[a]);else i.push(s)}e=i}return e},e.Pipeline.prototype.runString=function(t,n){var r=new e.Token(t,n);return this.run([r]).map(function(e){return e.toString()})},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})},/*!
|
||
|
* lunr.Vector
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.Vector=function(e){this._magnitude=0,this.elements=e||[]},e.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,n=this.elements.length/2,r=n-t,i=Math.floor(r/2),o=this.elements[2*i];r>1&&(o<e&&(t=i),o>e&&(n=i),o!=e);)r=n-t,i=t+Math.floor(r/2),o=this.elements[2*i];return o==e?2*i:o>e?2*i:o<e?2*(i+1):void 0},e.Vector.prototype.insert=function(e,t){this.upsert(e,t,function(){throw"duplicate index"})},e.Vector.prototype.upsert=function(e,t,n){this._magnitude=0;var r=this.positionForIndex(e);this.elements[r]==e?this.elements[r+1]=n(this.elements[r+1],t):this.elements.splice(r,0,e,t)},e.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,n=1;n<t;n+=2){var r=this.elements[n];e+=r*r}return this._magnitude=Math.sqrt(e)},e.Vector.prototype.dot=function(e){for(var t=0,n=this.elements,r=e.elements,i=n.length,o=r.length,s=0,a=0,u=0,l=0;u<i&&l<o;)s=n[u],a=r[l],s<a?u+=2:s>a?l+=2:s==a&&(t+=n[u+1]*r[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,n=0;t<this.elements.length;t+=2,n++)e[n]=this.elements[t];return e},e.Vector.prototype.toJSON=function(){return this.elements},/*!
|
||
|
* lunr.stemmer
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
||
|
*/
|
||
|
e.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]",r="[aeiouy]",i=n+"[^aeiouy]*",o=r+"[aeiou]*",s="^("+i+")?"+o+i,a="^("+i+")?"+o+i+"("+o+")?$",u="^("+i+")?"+o+i+o+i,l="^("+i+")?"+r,c=new RegExp(s),f=new RegExp(u),d=new RegExp(a),p=new RegExp(l),h=/^(.+?)(ss|i)es$/,g=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,y=/^(.+?)(ed|ing)$/,v=/.$/,x=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),w=new RegExp("^"+i+r+"[^aeiouwxy]$"),T=/^(.+?[^aeiou])y$/,E=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,C=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,k=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,S=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,j=/ll$/,N=new RegExp("^"+i+r+"[^aeiouwxy]$"),A=function(n){var r,i,o,s,a,u,l;if(n.length<3)return n;if(o=n.substr(0,1),"y"==o&&(n=o.toUpperCase()+n.substr(1)),s=h,a=g,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=m,a=y,s.test(n)){var A=s.exec(n);s=c,s.test(A[1])&&(s=v,n=n.replace(s,""))}else if(a.test(n)){var A=a.exec(n);r=A[1],a=p,a.test(r)&&(n=r,a=x,u=b,l=w,a.test(n)?n+="e":u.test(n)?(s=v,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=T,s.test(n)){var A=s.exec(n);r=A[1],n=r+"i"}if(s=E,s.test(n)){var A=s.exec(n);r=A[1],i=A[2],s=c,s.test(r)&&(n=r+e[i])}if(s=C,s.test(n)){var A=s.exec(n);r=A[1],i=A[2],s=c,s.test(r)&&(n=r+t[i])}if(s=k,a=S,s.test(n)){var A=s.exec(n);r=A[1],s=f,s.test(r)&&(n=r)}else if(a.test(n)){var A=a.exec(n);r=A[1]+A[2],a=f,a.test(r)&&(n=r)}if(s=L,s.test(n)){var A=s.exec(n);r=A[1],s=f,a=d,u=N,(s.test(r)||a.test(r)&&!u.test(r))&&(n=r)}return s=j,a=f,s.test(n)&&a.test(n)&&(s=v,n=n.replace(s,"")),"y"==o&&(n=o.toLowerCase()+n.substr(1)),n};return function(e){return e.update(A)}}(),e.Pipeline.registerFunction(e.stemmer,"stemmer"),/*!
|
||
|
* lunr.stopWordFilter
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.generateStopWordFilter=function(e){var t=e.reduce(function(e,t){return e[t]=t,e},{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},e.stopWordFilter=e.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"]),e.Pipeline.registerFunction(e.stopWordFilter,"stopWordFilter"),/*!
|
||
|
* lunr.trimmer
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.trimmer=function(e){return e.update(function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")})},e.Pipeline.registerFunction(e.trimmer,"trimmer"),/*!
|
||
|
* lunr.TokenSet
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.TokenSet=function(){this["final"]=!1,this.edges={},this.id=e.TokenSet._nextId,e.TokenSet._nextId+=1},e.TokenSet._nextId=1,e.TokenSet.fromArray=function(t){for(var n=new e.TokenSet.Builder,r=0,i=t.length;r<i;r++)n.insert(t[r]);return n.finish(),n.root},e.TokenSet.fromClause=function(t){return"editDistance"in t?e.TokenSet.fromFuzzyString(t.term,t.editDistance):e.TokenSet.fromString(t.term)},e.TokenSet.fromFuzzyString=function(t,n){for(var r=new e.TokenSet,i=[{node:r,editsRemaining:n,str:t}];i.length;){var o=i.pop();if(o.str.length>0){var s,a=o.str.charAt(0);a in o.node.edges?s=o.node.edges[a]:(s=new e.TokenSet,o.node.edges[a]=s),1==o.str.length&&(s["final"]=!0),i.push({node:s,editsRemaining:o.editsRemaining,str:o.str.slice(1)})}if(0!=o.editsRemaining){if("*"in o.node.edges)var u=o.node.edges["*"];else{var u=new e.TokenSet;o.node.edges["*"]=u}if(0==o.str.length&&(u["final"]=!0),i.push({node:u,editsRemaining:o.editsRemaining-1,str:o.str}),o.str.length>1&&i.push({node:o.node,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)}),1==o.str.length&&(o.node["final"]=!0),o.str.length>=1){if("*"in o.node.edges)var l=o.node.edges["*"];else{var l=new e.TokenSet;o.node.edges["*"]=l}1==o.str.length&&(l["final"]=!0),i.push({node:l,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)})}if(o.str.length>1){var c,f=o.str.charAt(0),d=o.str.charAt(1);d in o.node.edges?c=o.node.edges[d]:(c=new e.TokenSet,o.node.edges[d]=c),1==o.str.length&&(c["final"]=!0),i.push({node:c,editsRemaining:o.editsRemaining-1,str:f+o.str.slice(2)})}}}return r},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,r=n,i=0,o=t.length;i<o;i++){var s=t[i],a=i==o-1;if("*"==s)n.edges[s]=n,n["final"]=a;else{var u=new e.TokenSet;u["final"]=a,n.edges[s]=u,n=u}}return r},e.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var n=t.pop(),r=Object.keys(n.node.edges),i=r.length;n.node["final"]&&(n.prefix.charAt(0),e.push(n.prefix));for(var o=0;o<i;o++){var s=r[o];t.push({prefix:n.prefix.concat(s),node:n.node.edges[s]})}}return e},e.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this["final"]?"1":"0",t=Object.keys(this.edges).sort(),n=t.length,r=0;r<n;r++){var i=t[r];e=e+i+this.edges[i].id}return e},e.TokenSet.prototype.intersect=function(t){for(var n=new e.TokenSet,r=undefined,i=[{qNode:t,output:n,node:this}];i.length;){r=i.pop();for(var o=Object.keys(r.qNode.edges),s=o.length,a=Object.keys(r.node.edges),u=a.length,l=0;l<s;l++)for(var c=o[l],f=0;f<u;f++){var d=a[f];if(d==c||"*"==c){var p=r.node.edges[d],h=r.qNode.edges[c],g=p["final"]&&h["final"],m=undefined;d in r.output.edges?(m=r.output.edges[d],m["final"]=m["final"]||g):(m=new e.TokenSet,m["final"]=g,r.output.edges[d]=m),i.push({qNode:h,output:m,node:p})}}}return n},e.TokenSet.Builder=function(){this.previousWord="",this.root=new e.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},e.TokenSet.Builder.prototype.insert=function(t){var n,r=0;if(t<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<t.length&&i<this.previousWord.length&&t[i]==this.previousWord[i];i++)r++;this.minimize(r),n=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var i=r;i<t.length;i++){var o=new e.TokenSet,s=t[i];n.edges[s]=o,this.uncheckedNodes.push({parent:n,"char":s,child:o}),n=o}n["final"]=!0,this.previousWord=t},e.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},e.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var n=this.uncheckedNodes[t],r=n.child.toString();r in this.minimizedNodes?n.parent.edges[n["char"]]=this.minimizedNodes[r]:(n.child._str=r,this.minimizedNodes[r]=n.child),this.uncheckedNodes.pop()}},/*!
|
||
|
* lunr.Index
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(n){new e.QueryParser(t,n).parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),r=Object.create(null),i=Object.create(null),o=Object.create(null),s=Object.create(null),a=Object.create(null),u=0;u<this.fields.length;u++)i[this.fields[u]]=new e.Vector;t.call(n,n);for(var u=0;u<n.clauses.length;u++){var l=n.clauses[u],c=null,f=e.Set.empty;c=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var d=0;d<c.length;d++){var p=c[d];l.term=p;var h=e.TokenSet.fromClause(l),g=this.tokenSet.intersect(h).toArray();if(0===g.length&&l.presence===e.Query.presence.REQUIRED){for(var m=0;m<l.fields.length;m++){var y=l.fields[m];s[y]=e.Set.empty}break}for(var v=0;v<g.length;v++)for(var x=g[v],b=this.invertedIndex[x],w=b._index,m=0;m<l.fields.length;m++){var y=l.fields[m],T=b[y],E=Object.keys(T),C=x+"/"+y,k=new e.Set(E);if(l.presence==e.Query.presence.REQUIRED&&(f=f.union(k),s[y]===undefined&&(s[y]=e.Set.complete)),l.presence!=e.Query.presence.PROHIBITED){if(i[y].upsert(w,l.boost,function(e,t){return e+t}),!o[C]){for(var S=0;S<E.length;S++){var L,j=E[S],N=new e.FieldRef(j,y),A=T[j];(L=r[N])===undefined?r[N]=new e.MatchData(x,y,A):L.add(x,y,A)}o[C]=!0}}else a[y]===undefined&&(a[y]=e.Set.empty),a[y]=a[y].union(k)}}if(l.presence===e.Query.presence.REQUIRED)for(var m=0;m<l.fields.length;m++){var y=l.fields[m];s[y]=s[y].intersect(f)}}for(var D=e.Set.complete,I=e.Set.empty,u=0;u<this.fields.length;u++){var y=this.fields[u];s[y]&&(D=D.intersect(s[y])),a[y]&&(I=I.union(a[y]))}var O=Object.keys(r),P=[],Q=Object.create(null);if(n.isNegated()){O=Object.keys(this.fieldVectors);for(var u=0;u<O.length;u++){var N=O[u],R=e.FieldRef.fromString(N);r[N]=new e.MatchData}}for(var u=0;u<O.length;u++){var R=e.FieldRef.fromString(O[u]),q=R.docRef;if(D.contains(q)&&!I.contains(q)){var F,$=this.fieldVectors[R],_=i[R.fieldName].similarity($);if((F=Q[q])!==undefined)F.score+=_,F.matchData.combine(r[R]);else{var H={ref:q,score:_,matchData:r[R]};Q[q]=H,P.push(H)}}}return P.sort(function(e,t){return t.score-e.score})},e.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(e){return[e,this.invertedIndex[e]]},this),n=Object.keys(this.fieldVectors).map(function(e){return[e,this.fieldVectors[e].toJSON()]},this);return{version:e.version,fields:this.fields,fieldVectors:n,invertedIndex:t,pipeline:this.pipeline.toJSON()}},e.Index.load=function(t){var n={},r={},i=t.fieldVectors,o=Object.create(null),s=t.invertedIndex,a=new e.TokenSet.Builder,u=e.Pipeline.load(t.pipeline);t.version!=e.version&&e.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+e.version+"' does not match serialized index '"+t.version+"'");for(var l=0;l<i.length;l++){var c=i[l],f=c[0],d=c[1];r[f]=new e.Vector(d)}for(var l=0;l<s.length;l++){var c=s[l],p=c[0],h=c[1];a.insert(p),o[p]=h}return a.finish(),n.fields=t.fields,n.fieldVectors=r,n.invertedIndex=o,n.tokenSet=a.root,n.pipeline=u,new e.Index(n)},/*!
|
||
|
* lunr.Builder
|
||
|
* Copyright (C) 2020 Oliver Nightingale
|
||
|
*/
|
||
|
e.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=e.tokenizer,this.pipeline=new e.Pipeline,this.searchPipeline=new e.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},e.Builder.prototype.ref=function(e){this._ref=e},e.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},e.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,n){var r=t[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var o=0;o<i.length;o++){var s=i[o],a=this._fields[s].extractor,u=a?a(t):t[s],l=this.tokenizer(u,{fields:[s]}),c=this.pipeline.run(l),f=new e.FieldRef(r,s),d=Object.create(null);this.fieldTermFrequencies[f]=d,this.fieldLengths[f]=0,this.fieldLengths[f]+=c.length;for(var p=0;p<c.length;p++){var h=c[p];if(d[h]==undefined&&(d[h]=0),d[h]+=1,this.invertedIndex[h]==undefined){var g=Object.create(null);g._index=this.termIndex,this.termIndex+=1;for(var m=0;m<i.length;m++)g[i[m]]=Object.create(null);this.invertedIndex[h]=g}this.invertedIndex[h][s][r]==undefined&&(this.invertedIndex[h][s][r]=Object.create(null));for(var y=0;y<this.metadataWhitelist.length;y++){var v=this.metadataWhitelist[y],x=h.metadata[v];this.invertedIndex[h][s][r][v]==undefined&&(this.invertedIndex[h][s][r][v]=[]),this.invertedIndex[h][s][r][v].push(x)}}}},e.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),n=t.length,r={},i={},o=0;o<n;o++){var s=e.FieldRef.fromString(t[o]),a=s.fieldName;i[a]||(i[a]=0),i[a]+=1,r[a]||(r[a]=0),r[a]+=this.fieldLengths[s]}for(var u=Object.keys(this._fields),o=0;o<u.length;o++){var l=u[o];r[l]=r[l]/i[l]}this.averageFieldLength=r},e.Builder.prototype.createFieldVectors=function(){for(var t={},n=Object.keys(this.fieldTermFrequencies),r=n.length,i=Object.create(null),o=0;o<r;o++){for(var s=e.FieldRef.fromString(n[o]),a=s.fieldName,u=this.fieldLengths[s],l=new e.Vector,c=this.fieldTermFrequencies[s],f=Object.keys(c),d=f.length,p=this._fields[a].boost||1,h=this._documents[s.docRef].boost||1,g=0;g<d;g++){var m,y,v,x=f[g],b=c[x],w=this.invertedIndex[x]._index;i[x]===undefined?(m=e.idf(this.invertedIndex[x],this.documentCount),i[x]=m):m=i[x],y=m*((this._k1+1)*b)/(this._k1*(1-this._b+this._b*(u/this.averageFieldLength[a]))+b),y*=p,y*=h,v=Math.round(1e3*y)/1e3,l.insert(w,v)}t[s]=l}this.fieldVectors=t},e.Builder.prototype.createTokenSet=function(){this.tokenSet=e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},e.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new e.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},e.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},e.MatchData=function(e,t,n){for(var r=Object.create(null),i=Object.keys(n||{}),o=0;o<i.length;o++){var s=i[o];r[s]=n[s].slice()}this.metadata=Object.create(null),e!==undefined&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=r)},e.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),n=0;n<t.length;n++){var r=t[n],i=Object.keys(e.metadata[r]);this.metadata[r]==undefined&&(this.metadata[r]=Object.create(null));for(var o=0;o<i.length;o++){var s=i[o],a=Object.keys(e.metadata[r][s]);this.metadata[r][s]==undefined&&(this.metadata[r][s]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];this.metadata[r][s][l]==undefined?this.metadata[r][s][l]=e.metadata[r][s][l]:this.metadata[r][s][l]=this.metadata[r][s][l].concat(e.metadata[r][s][l])}}}},e.MatchData.prototype.add=function(e,t,n){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),
|
||
|
* jQuery Highlight plugin
|
||
|
*
|
||
|
* Based on highlight v3 by Johann Burkard
|
||
|
* http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
|
||
|
*
|
||
|
* Code a little bit refactored and cleaned (in my humble opinion).
|
||
|
* Most important changes:
|
||
|
* - has an option to highlight only entire words (wordsOnly - false by default),
|
||
|
* - has an option to be case sensitive (caseSensitive - false by default)
|
||
|
* - highlight element tag and class names can be specified in options
|
||
|
*
|
||
|
* Usage:
|
||
|
* // wrap every occurrance of text 'lorem' in content
|
||
|
* // with <span class='highlight'> (default options)
|
||
|
* $('#content').highlight('lorem');
|
||
|
*
|
||
|
* // search for and highlight more terms at once
|
||
|
* // so you can save some time on traversing DOM
|
||
|
* $('#content').highlight(['lorem', 'ipsum']);
|
||
|
* $('#content').highlight('lorem ipsum');
|
||
|
*
|
||
|
* // search only for entire word 'lorem'
|
||
|
* $('#content').highlight('lorem', { wordsOnly: true });
|
||
|
*
|
||
|
* // don't ignore case during search of term 'lorem'
|
||
|
* $('#content').highlight('lorem', { caseSensitive: true });
|
||
|
*
|
||
|
* // wrap every occurrance of term 'ipsum' in content
|
||
|
* // with <em class='important'>
|
||
|
* $('#content').highlight('ipsum', { element: 'em', className: 'important' });
|
||
|
*
|
||
|
* // remove default highlight
|
||
|
* $('#content').unhighlight();
|
||
|
*
|
||
|
* // remove custom highlight
|
||
|
* $('#content').unhighlight({ element: 'em', className: 'important' });
|
||
|
*
|
||
|
*
|
||
|
* Copyright (c) 2009 Bartek Szopka
|
||
|
*
|
||
|
* Licensed under MIT license.
|
||
|
*
|
||
|
*/
|
||
|
jQuery.extend({highlight:function(e,t,n,r){if(3===e.nodeType){var i=e.data.match(t);if(i){var o=document.createElement(n||"span");o.className=r||"highlight";var s=e.splitText(i.index);s.splitText(i[0].length);var a=s.cloneNode(!0);return o.appendChild(a),s.parentNode.replaceChild(o,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==r))for(var u=0;u<e.childNodes.length;u++)u+=jQuery.highlight(e.childNodes[u],t,n,r);return 0}}),jQuery.fn.unhighlight=function(e){var t={className:"highlight",element:"span"};return jQuery.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},jQuery.fn.highlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(jQuery.extend(n,t),e.constructor===String&&(e=[e]),e=jQuery.grep(e,function(e){return""!=e}),e=jQuery.map(e,function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}),0==e.length)return this;var r=n.caseSensitive?"":"i",i="("+e.join("|")+")";n.wordsOnly&&(i="\\b"+i+"\\b");var o=new RegExp(i,r);return this.each(function(){jQuery.highlight(this,o,n.element,n.className)})},function(){"use strict";function e(){u=lunr(function(){this.ref("id"),this.field("title",{boost:10}),this.field("body"),this.pipeline.add(lunr.trimmer,lunr.stopWordFilter);var e=this;$("h1, h2").each(function(){var t=$(this),n=t.nextUntil("h1, h2");e.add({id:t.prop("id"),title:t.text(),body:n.text()})})}),t()}function t(){u.tokenSet.toArray().length>5e3&&(c=300)}function n(){s=$(".content"),a=$(".search-results"),$("#input-search").on("keyup",function(e){!function(){return function(e,t){clearTimeout(f),f=setTimeout(e,t)}}()(function(){r(e)},c)})}function r(e){var t=$("#input-search")[0];if(o(),a.addClass("visible"),27===e.keyCode&&(t.value=""),t.value){var n=u.search(t.value).filter(function(e){return e.score>1e-4});n.length?(a.empty(),$.each(n,function(e,t){var n=document.getElementById(t.ref);a.append("<li><a href='#"+t.ref+"'>"+$(n).text()+"</a></li>")}),i.call(t)):(a.html("<li></li>"),$(".search-results li").text('No Results Found for "'+t.value+'"'))}else o(),a.removeClass("visible")}function i(){this.value&&s.highlight(this.value,l)}function o(){s.unhighlight(l)}var s,a,u,l={element:"span",className:"search-highlight"},c=0,f=0;$(e),$(n)}();
|