daux.io/daux_libraries/search.min.js
2020-02-07 22:16:48 +01:00

3 lines
32 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function n(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var h,c,u,a,f,d={},p=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function g(t,e){for(var n in e)t[n]=e[n];return t}function y(t){var e=t.parentNode;e&&e.removeChild(t)}function v(t,e,n){var i,r=arguments,s={};for(i in e)"key"!==i&&"ref"!==i&&(s[i]=e[i]);if(arguments.length>3)for(n=[n],i=3;i<arguments.length;i++)n.push(r[i]);if(null!=n&&(s.children=n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===s[i]&&(s[i]=t.defaultProps[i]);return m(t,s,e&&e.key,e&&e.ref)}function m(t,e,n,i){var r={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0};return h.vnode&&h.vnode(r),r}function b(t){return t.children}function w(t,e){this.props=t,this.context=e}function k(t,e){if(null==e)return t.__?k(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?k(t):null}function x(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return x(t)}}function S(t){(!t.__d&&(t.__d=!0)&&1===c.push(t)||a!==h.debounceRendering)&&((a=h.debounceRendering)||u)(O)}function O(){var t,e,n,i,r,s,o;for(c.sort((function(t,e){return e.__v.__b-t.__v.__b}));t=c.pop();)t.__d&&(n=void 0,i=void 0,s=(r=(e=t).__v).__e,(o=e.__P)&&(n=[],i=N(o,r,g({},r),e.__n,void 0!==o.ownerSVGElement,null,n,null==s?k(r):s),T(n,r),i!=s&&x(r)))}function C(t,e,n,i,r,s,o,l,h){var c,u,a,f,_,g,v,m=n&&n.__k||p,b=m.length;if(l==d&&(l=null!=s?s[0]:b?k(n,0):null),c=0,e.__k=P(e.__k,(function(n){if(null!=n){if(n.__=e,n.__b=e.__b+1,null===(a=m[c])||a&&n.key==a.key&&n.type===a.type)m[c]=void 0;else for(u=0;u<b;u++){if((a=m[u])&&n.key==a.key&&n.type===a.type){m[u]=void 0;break}a=null}if(f=N(t,n,a=a||d,i,r,s,o,l,h),(u=n.ref)&&a.ref!=u&&(v||(v=[]),a.ref&&v.push(a.ref,null,n),v.push(u,n.__c||f,n)),null!=f){var p;if(null==g&&(g=f),void 0!==n.__d)p=n.__d,n.__d=void 0;else if(s==a||f!=l||null==f.parentNode){t:if(null==l||l.parentNode!==t)t.appendChild(f),p=null;else{for(_=l,u=0;(_=_.nextSibling)&&u<b;u+=2)if(_==f)break t;t.insertBefore(f,l),p=l}"option"==e.type&&(t.value="")}l=void 0!==p?p:f.nextSibling,"function"==typeof e.type&&(e.__d=l)}}return c++,n})),e.__e=g,null!=s&&"function"!=typeof e.type)for(c=s.length;c--;)null!=s[c]&&y(s[c]);for(c=b;c--;)null!=m[c]&&U(m[c],m[c]);if(v)for(c=0;c<v.length;c++)E(v[c],v[++c],v[++c])}function P(t,e,n){if(null==n&&(n=[]),null==t||"boolean"==typeof t)e&&n.push(e(null));else if(Array.isArray(t))for(var i=0;i<t.length;i++)P(t[i],e,n);else n.push(e?e("string"==typeof t||"number"==typeof t?m(null,t,null,null):null!=t.__e||null!=t.__c?m(t.type,t.props,t.key,null):t):t);return n}function j(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]="number"==typeof n&&!1===_.test(e)?n+"px":null==n?"":n}function L(t,e,n,i,r){var s,o,l,h,c;if(r?"className"===e&&(e="class"):"class"===e&&(e="className"),"key"===e||"children"===e);else if("style"===e)if(s=t.style,"string"==typeof n)s.cssText=n;else{if("string"==typeof i&&(s.cssText="",i=null),i)for(o in i)n&&o in n||j(s,o,"");if(n)for(l in n)i&&n[l]===i[l]||j(s,l,n[l])}else"o"===e[0]&&"n"===e[1]?(h=e!==(e=e.replace(/Capture$/,"")),c=e.toLowerCase(),e=(c in t?c:e).slice(2),n?(i||t.addEventListener(e,R,h),(t.l||(t.l={}))[e]=n):t.removeEventListener(e,R,h)):"list"!==e&&"tagName"!==e&&"form"!==e&&"type"!==e&&"size"!==e&&!r&&e in t?t[e]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==e&&(e!==(e=e.replace(/^xlink:?/,""))?null==n||!1===n?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),n):null==n||!1===n?t.removeAttribute(e):t.setAttribute(e,n))}function R(t){this.l[t.type](h.event?h.event(t):t)}function N(t,e,n,i,r,s,o,l,c){var u,a,f,d,p,_,y,v,m,k,x=e.type;if(void 0!==e.constructor)return null;(u=h.__b)&&u(e);try{t:if("function"==typeof x){if(v=e.props,m=(u=x.contextType)&&i[u.__c],k=u?m?m.props.value:u.__:i,n.__c?y=(a=e.__c=n.__c).__=a.__E:("prototype"in x&&x.prototype.render?e.__c=a=new x(v,k):(e.__c=a=new w(v,k),a.constructor=x,a.render=I),m&&m.sub(a),a.props=v,a.state||(a.state={}),a.context=k,a.__n=i,f=a.__d=!0,a.__h=[]),null==a.__s&&(a.__s=a.state),null!=x.getDerivedStateFromProps&&(a.__s==a.state&&(a.__s=g({},a.__s)),g(a.__s,x.getDerivedStateFromProps(v,a.__s))),d=a.props,p=a.state,f)null==x.getDerivedStateFromProps&&null!=a.componentWillMount&&a.componentWillMount(),null!=a.componentDidMount&&a.__h.push(a.componentDidMount);else{if(null==x.getDerivedStateFromProps&&v!==d&&null!=a.componentWillReceiveProps&&a.componentWillReceiveProps(v,k),!a.__e&&null!=a.shouldComponentUpdate&&!1===a.shouldComponentUpdate(v,a.__s,k)){for(a.props=v,a.state=a.__s,a.__d=!1,a.__v=e,e.__e=n.__e,e.__k=n.__k,a.__h.length&&o.push(a),u=0;u<e.__k.length;u++)e.__k[u]&&(e.__k[u].__=e);break t}null!=a.componentWillUpdate&&a.componentWillUpdate(v,a.__s,k),null!=a.componentDidUpdate&&a.__h.push((function(){a.componentDidUpdate(d,p,_)}))}a.context=k,a.props=v,a.state=a.__s,(u=h.__r)&&u(e),a.__d=!1,a.__v=e,a.__P=t,u=a.render(a.props,a.state,a.context),e.__k=null!=u&&u.type==b&&null==u.key?u.props.children:u,null!=a.getChildContext&&(i=g(g({},i),a.getChildContext())),f||null==a.getSnapshotBeforeUpdate||(_=a.getSnapshotBeforeUpdate(d,p)),C(t,e,n,i,r,s,o,l,c),a.base=e.__e,a.__h.length&&o.push(a),y&&(a.__E=a.__=null),a.__e=!1}else e.__e=D(n.__e,e,n,i,r,s,o,c);(u=h.diffed)&&u(e)}catch(t){h.__e(t,e,n)}return e.__e}function T(t,e){h.__c&&h.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){h.__e(t,e.__v)}}))}function D(t,e,n,i,r,s,o,l){var h,c,u,a,f,_=n.props,g=e.props;if(r="svg"===e.type||r,null==t&&null!=s)for(h=0;h<s.length;h++)if(null!=(c=s[h])&&(null===e.type?3===c.nodeType:c.localName===e.type)){t=c,s[h]=null;break}if(null==t){if(null===e.type)return document.createTextNode(g);t=r?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type,g.is&&{is:g.is}),s=null}if(null===e.type)null!=s&&(s[s.indexOf(t)]=null),_!==g&&t.data!=g&&(t.data=g);else if(e!==n){if(null!=s&&(s[s.indexOf(t)]=null,s=p.slice.call(t.childNodes)),u=(_=n.props||d).dangerouslySetInnerHTML,a=g.dangerouslySetInnerHTML,!l){if(_===d)for(_={},f=0;f<t.attributes.length;f++)_[t.attributes[f].name]=t.attributes[f].value;(a||u)&&(a&&u&&a.__html==u.__html||(t.innerHTML=a&&a.__html||""))}(function(t,e,n,i,r){var s;for(s in n)s in e||L(t,s,null,n[s],i);for(s in e)r&&"function"!=typeof e[s]||"value"===s||"checked"===s||n[s]===e[s]||L(t,s,e[s],n[s],i)})(t,g,_,r,l),e.__k=e.props.children,a||C(t,e,n,i,"foreignObject"!==e.type&&r,s,o,d,l),l||("value"in g&&void 0!==g.value&&g.value!==t.value&&(t.value=null==g.value?"":g.value),"checked"in g&&void 0!==g.checked&&g.checked!==t.checked&&(t.checked=g.checked))}return t}function E(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){h.__e(t,n)}}function U(t,e,n){var i,r,s;if(h.unmount&&h.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||E(i,null,e)),n||"function"==typeof t.type||(n=null!=(r=t.__e)),t.__e=t.__d=void 0,null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){h.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&U(i[s],e,n);null!=r&&y(r)}function I(t,e,n){return this.constructor(t,n)}function M(t,e,n){var i,r,s;h.__&&h.__(t,e),r=(i=n===f)?null:n&&n.__k||e.__k,t=v(b,null,[t]),s=[],N(e,(i?e:n||e).__k=t,r||d,d,void 0!==e.ownerSVGElement,n&&!i?[n]:r?null:p.slice.call(e.childNodes),s,n||d,i),T(s,t)}h={__e:function(t,e){for(var n,i;e=e.__;)if((n=e.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(i=!0,n.setState(n.constructor.getDerivedStateFromError(t))),null!=n.componentDidCatch&&(i=!0,n.componentDidCatch(t)),i)return S(n.__E=n)}catch(e){t=e}throw t}},w.prototype.setState=function(t,e){var n;n=this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof t&&(t=t(n,this.props)),t&&g(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),S(this))},w.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),S(this))},w.prototype.render=b,c=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=d;var A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var W=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){!function(e,n,i){let r;(r=i.define)&&r.amd?r([],(function(){return n})):(r=i.modules)?r["FlexSearch".toLowerCase()]=n:t.exports=n}(0,function t(e){function n(t,e){const n=e?e.id:t&&t.id;this.id=n||0===n?n:L++,this.init(t,e),o(this,"index",(function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)})),o(this,"length",(function(){return this.index.length}))}function i(t,e,n,i){return this.u!==this.g&&(this.o=this.o.concat(n),this.u++,i&&this.o.length>=i&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(e,this.o),this.F&&this.F(this.o))),this}function r(t,e){const n=t.length,i=m(e),r=[];for(let s=0,o=0;s<n;s++){const n=t[s];(i&&e(n)||!i&&!e[n])&&(r[o++]=n)}return r}function s(t,e,n,i,r,s,o,l,h,c){let u;if(n=g(n,o?0:r,l,s,e,h,c),l&&(l=n.page,u=n.next,n=n.result),o)e=this.where(o,null,r,n);else{for(e=n,n=this.l,r=e.length,s=Array(r),o=0;o<r;o++)s[o]=n[e[o]];e=s}return n=e,i&&(m(i)||(T=i.split(":"),1<T.length?i=p:(T=T[0],i=d)),n.sort(i)),n=_(l,u,n),this.cache&&this.j.set(t,n),n}function o(t,e,n){Object.defineProperty(t,e,{get:n})}function l(t){return new RegExp(t,"g")}function h(t,e){for(let n=0;n<e.length;n+=2)t=t.replace(e[n],e[n+1]);return t}function c(t,e,n,i,r,s,o,l){return e[n]?e[n]:(r=r?(l-(o||l/1.5))*s+(o||l/1.5)*r:s,e[n]=r,r>=o&&((t=(t=t[l-(r+.5>>0)])[n]||(t[n]=[]))[t.length]=i),r)}function u(t,e){if(t){const n=Object.keys(t);for(let i=0,r=n.length;i<r;i++){const r=n[i],s=t[r];if(s)for(let n=0,i=s.length;n<i;n++){if(s[n]===e){1===i?delete t[r]:s.splice(n,1);break}b(s[n])&&u(s[n],e)}}}}function a(t){let e="",n="";var i="";for(let r=0;r<t.length;r++){const s=t[r];s!==n&&(r&&"h"===s?(i="a"===i||"e"===i||"i"===i||"o"===i||"u"===i||"y"===i,(("a"===n||"e"===n||"i"===n||"o"===n||"u"===n||"y"===n)&&i||" "===n)&&(e+=s)):e+=s),i=r===t.length-1?"":t[r+1],n=s}return e}function f(t,e){return 0>(t=t.length-e.length)?1:t?-1:0}function d(t,e){return(t=t[T])<(e=e[T])?-1:t>e?1:0}function p(t,e){const n=T.length;for(let i=0;i<n;i++)t=t[T[i]],e=e[T[i]];return t<e?-1:t>e?1:0}function _(t,e,n){return t?{page:t,next:e?""+e:null,result:n}:n}function g(t,e,n,i,r,s,o){let l,h=[];if(!0===n){n="0";var c=""}else c=n&&n.split(":");const u=t.length;if(1<u){const m=x(),b=[];let k,S;var a,f=0;let O;var d=!0;let C,P,j,L,R,N,T=0;if(c&&(2===c.length?(L=c,c=!1):c=R=parseInt(c[0],10)),o){for(k=x();f<u;f++)if("not"===r[f])for(S=t[f],O=S.length,a=0;a<O;a++)k["@"+S[a]]=1;else j=f+1;if(w(j))return _(n,l,h);f=0}else P=y(r)&&r;for(;f<u;f++){const y=f===(j||u)-1;if(!P||!f)if((a=P||r&&r[f])&&"and"!==a){if("or"!==a)continue;N=!1}else N=s=!0;if(S=t[f],O=S.length){if(d){if(!C){C=S;continue}var p=C.length;for(a=0;a<p;a++){var g="@"+(d=C[a]);o&&k[g]||(m[g]=1,s||(h[T++]=d))}C=null,d=!1}for(g=!1,a=0;a<O;a++){var v="@"+(p=S[a]);const t=s?m[v]||0:f;if(!(!t&&!i||o&&k[v]||!s&&m[v]))if(t===f){if(y){if((!R||--R<T)&&(h[T++]=p,e&&T===e))return _(n,T+(c||0),h)}else m[v]=f+1;g=!0}else i&&((v=b[t]||(b[t]=[]))[v.length]=p)}if(N&&!g&&!i)break}else if(N&&!i)return _(n,l,S)}if(C)if(f=C.length,o)for(a=c?parseInt(c,10):0;a<f;a++)k["@"+(t=C[a])]||(h[T++]=t);else h=C;if(i)for(T=h.length,L?(f=parseInt(L[0],10)+1,a=parseInt(L[1],10)+1):(f=b.length,a=0);f--;)if(p=b[f]){for(O=p.length;a<O;a++)if(i=p[a],(!o||!k["@"+i])&&(h[T++]=i,e&&T===e))return _(n,f+":"+a,h);a=0}}else!u||r&&"not"===r[0]||(h=t[0],c&&(c=parseInt(c[0],10)));return e&&(o=h.length,c&&c>o&&(c=0),l=(c=c||0)+e,l<o?h=h.slice(c,l):(l=0,c&&(h=h.slice(c)))),_(n,l,h)}function y(t){return"string"==typeof t}function v(t){return t.constructor===Array}function m(t){return"function"==typeof t}function b(t){return"object"==typeof t}function w(t){return void 0===t}function k(t){const e=Array(t);for(let n=0;n<t;n++)e[n]=x();return e}function x(){return Object.create(null)}function S(){let t,e;self.onmessage=function(n){if(n=n.data)if(n.search){const i=e.search(n.content,n.threshold?{limit:n.limit,threshold:n.threshold,where:n.where}:n.limit);self.postMessage({id:t,content:n.content,limit:n.limit,result:i})}else n.add?e.add(n.id,n.content):n.update?e.update(n.id,n.content):n.remove?e.remove(n.id):n.clear?e.clear():n.info?((n=e.info()).worker=t,console.log(n)):n.register&&(t=n.id,n.options.cache=!1,n.options.async=!1,n.options.worker=!1,e=new Function(n.register.substring(n.register.indexOf("{")+1,n.register.lastIndexOf("}")))(),e=new e(n.options))}}function O(n,i,r,s){n=e("flexsearch","id"+n,S,(function(t){(t=t.data)&&t.result&&s(t.id,t.content,t.result,t.limit,t.where,t.cursor,t.suggest)}),i);const o=t.toString();return r.id=i,n.postMessage({register:o,options:r,id:i}),n}const C={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},P={memory:{encode:"extra",f:"strict",threshold:0,b:1},speed:{encode:"icase",f:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",f:"full",threshold:1,b:3},score:{encode:"extra",f:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",f:"strict",threshold:8,b:9,depth:1}},j=[];let L=0;const R={},N={};let T;n.create=function(t,e){return new n(t,e)},n.registerMatcher=function(t){for(const e in t)t.hasOwnProperty(e)&&j.push(l(e),t[e]);return this},n.registerEncoder=function(t,e){return E[t]=e.bind(E),this},n.registerLanguage=function(t,e){return R[t]=e.filter,N[t]=e.stemmer,this},n.encode=function(t,e){return E[t](e)},n.prototype.init=function(t,e){if(this.v=[],e){var r=e.preset;t=e}else t||(t=C),r=t.preset;if(e={},y(t)?(e=P[t],t={}):r&&(e=P[r]),r=t.worker)if("undefined"==typeof Worker)t.worker=!1,this.m=null;else{var s=parseInt(r,10)||4;this.C=-1,this.u=0,this.o=[],this.F=null,this.m=Array(s);for(var o=0;o<s;o++)this.m[o]=O(this.id,o,t,i.bind(this))}if(this.f=t.tokenize||e.f||this.f||C.f,this.split=w(r=t.split)?this.split||C.split:y(r)?l(r):r,this.D=t.rtl||this.D||C.D,this.async="undefined"==typeof Promise||w(r=t.async)?this.async||C.async:r,this.g=w(r=t.worker)?this.g||C.g:r,this.threshold=w(r=t.threshold)?e.threshold||this.threshold||C.threshold:r,this.b=w(r=t.resolution)?r=e.b||this.b||C.b:r,r<=this.threshold&&(this.b=this.threshold+1),this.depth="strict"!==this.f||w(r=t.depth)?e.depth||this.depth||C.depth:r,this.w=(r=w(r=t.encode)?e.encode||C.encode:r)&&E[r]&&E[r].bind(E)||(m(r)?r:this.w||!1),(r=t.matcher)&&this.addMatcher(r),r=(e=t.lang)||t.filter){if(y(r)&&(r=R[r]),v(r)){s=this.w,o=x();for(var h=0;h<r.length;h++){var c=s?s(r[h]):r[h];o[c]=1}r=o}this.filter=r}if(r=e||t.stemmer){var u;for(u in e=y(r)?N[r]:r,s=this.w,o=[],e)e.hasOwnProperty(u)&&(h=s?s(u):u,o.push(l(h+"($|\\W)"),s?s(e[u]):e[u]));this.stemmer=u=o}if(this.a=o=(r=t.doc)?function t(e){const n=x();for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];v(r)?n[i]=r.slice(0):b(r)?n[i]=t(r):n[i]=r}return n}(r):this.a||C.a,this.i=k(this.b-(this.threshold||0)),this.h=x(),this.c=x(),o){if(this.l=x(),t.doc=null,u=o.index={},e=o.keys=[],s=o.field,h=o.tag,c=o.store,v(o.id)||(o.id=o.id.split(":")),c){var a=x();if(y(c))a[c]=1;else if(v(c))for(let t=0;t<c.length;t++)a[c[t]]=1;else b(c)&&(a=c);o.store=a}if(h){if(this.G=x(),c=x(),s)if(y(s))c[s]=t;else if(v(s))for(a=0;a<s.length;a++)c[s[a]]=t;else b(s)&&(c=s);for(v(h)||(o.tag=h=[h]),s=0;s<h.length;s++)this.G[h[s]]=x();this.I=h,s=c}if(s){let i;for(v(s)||(b(s)?(i=s,o.field=s=Object.keys(s)):o.field=s=[s]),o=0;o<s.length;o++)v(h=s[o])||(i&&(t=i[h]),e[o]=h,s[o]=h.split(":")),u[h]=new n(t)}t.doc=r}return this.B=!0,this.j=!!(this.cache=r=w(r=t.cache)?this.cache||C.cache:r)&&new U(r),this},n.prototype.encode=function(t){return t&&(j.length&&(t=h(t,j)),this.v.length&&(t=h(t,this.v)),this.w&&(t=this.w(t)),this.stemmer&&(t=h(t,this.stemmer))),t},n.prototype.addMatcher=function(t){const e=this.v;for(const n in t)t.hasOwnProperty(n)&&e.push(l(n),t[n]);return this},n.prototype.add=function(t,e,n,i,s){if(this.a&&b(t))return this.A("add",t,e);if(e&&y(e)&&(t||0===t)){var o="@"+t;if(this.c[o]&&!i)return this.update(t,e);if(this.g)return++this.C>=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:t,content:e}),this.c[o]=""+this.C,n&&n(),this;if(!s){if(this.async&&"function"!=typeof importScripts){let r=this;return o=new Promise((function(n){setTimeout((function(){r.add(t,e,null,i,!0),r=null,n()}))})),n?(o.then(n),this):o}if(n)return this.add(t,e,null,i,!0),n(),this}if(!(e=this.encode(e)).length)return this;s=m(n=this.f)?n(e):e.split(this.split),this.filter&&(s=r(s,this.filter));const d=x();d._ctx=x();const p=s.length,_=this.threshold,g=this.depth,y=this.b,v=this.i,b=this.D;for(let e=0;e<p;e++){var l=s[e];if(l){var h=l.length,u=(b?e+1:p-e)/p,a="";switch(n){case"reverse":case"both":for(var f=h;--f;)c(v,d,a=l[f]+a,t,b?1:(h-f)/h,u,_,y-1);a="";case"forward":for(f=0;f<h;f++)c(v,d,a+=l[f],t,b?(f+1)/h:1,u,_,y-1);break;case"full":for(f=0;f<h;f++){const e=(b?f+1:h-f)/h;for(let n=h;n>f;n--)c(v,d,a=l.substring(f,n),t,e,u,_,y-1)}break;default:if(h=c(v,d,l,t,1,u,_,y-1),g&&1<p&&h>=_)for(h=d._ctx[l]||(d._ctx[l]=x()),l=this.h[l]||(this.h[l]=k(y-(_||0))),0>(u=e-g)&&(u=0),(a=e+g+1)>p&&(a=p);u<a;u++)u!==e&&c(l,h,s[u],t,0,y-(u<e?e-u:u-e),_,y-1)}}}this.c[o]=1,this.B=!1}return this},n.prototype.A=function(t,e,n){if(v(e)){var i=e.length;if(i--){for(var r=0;r<i;r++)this.A(t,e[r]);return this.A(t,e[i],n)}}else{var s,o=this.a.index,l=this.a.keys,h=this.a.tag;r=this.a.store;var c=this.a.id;i=e;for(var u=0;u<c.length;u++)i=i[c[u]];if("remove"===t&&(delete this.l[i],c=l.length,c--)){for(e=0;e<c;e++)o[l[e]].remove(i);return o[l[c]].remove(i,n)}if(h){for(s=0;s<h.length;s++){var a=h[s],f=e;for(c=a.split(":"),u=0;u<c.length;u++)f=f[c[u]];f="@"+f}s=(s=this.G[a])[f]||(s[f]=[])}for(let r=0,s=(c=this.a.field).length;r<s;r++){for(a=c[r],h=e,f=0;f<a.length;f++)h=h[a[f]];a=o[l[r]],f="add"===t?a.add:a.update,r===s-1?f.call(a,i,h,n):f.call(a,i,h)}if(r){for(n=Object.keys(r),t=x(),o=0;o<n.length;o++)if(r[l=n[o]]){let n,i;for(l=l.split(":"),c=0;c<l.length;c++)n=(n||e)[h=l[c]],i=(i||t)[h]=n}e=t}s&&(s[s.length]=e),this.l[i]=e}return this},n.prototype.update=function(t,e,n){return this.a&&b(t)?this.A("update",t,e):(this.c["@"+t]&&y(e)&&(this.remove(t),this.add(t,e,n,!0)),this)},n.prototype.remove=function(t,e,n){if(this.a&&b(t))return this.A("remove",t,e);var i="@"+t;if(this.c[i]){if(this.g)return this.m[this.c[i]].postMessage({remove:!0,id:t}),delete this.c[i],e&&e(),this;if(!n){if(this.async&&"function"!=typeof importScripts){let n=this;return i=new Promise((function(e){setTimeout((function(){n.remove(t,null,!0),n=null,e()}))})),e?(i.then(e),this):i}if(e)return this.remove(t,null,!0),e(),this}for(e=0;e<this.b-(this.threshold||0);e++)u(this.i[e],t);this.depth&&u(this.h,t),delete this.c[i],this.B=!1}return this},n.prototype.search=function(t,e,n,i){if(b(e)){if(v(e))for(var o=0;o<e.length;o++)e[o].query=t;else e.query=t;t=e,e=1e3}else e&&m(e)?(n=e,e=1e3):e||0===e||(e=1e3);if(!this.g){var l=[],h=t;if(b(t)&&!v(t)){n||(n=t.callback)&&(h.callback=null);var c=t.sort,u=t.page;e=t.limit,O=t.threshold;var a=t.suggest;t=t.query}if(this.a){O=this.a.index;const r=h.where;var d=h.bool||"or",p=h.field;let f,g,m=d;if(p)v(p)||(p=[p]);else if(v(h)){var _=h;p=[],m=[];for(var w=0;w<h.length;w++)o=(i=h[w]).bool||d,p[w]=i.field,m[w]=o,"not"===o?f=!0:"and"===o&&(g=!0)}else p=this.a.keys;for(d=p.length,w=0;w<d;w++)_&&(h=_[w]),u&&!y(h)&&(h.page=null,h.limit=0),l[w]=O[p[w]].search(h,0);if(n)return n(s.call(this,t,m,l,c,e,a,r,u,g,f));if(this.async){const n=this;return new Promise((function(i){Promise.all(l).then((function(o){i(s.call(n,t,m,o,c,e,a,r,u,g,f))}))}))}return s.call(this,t,m,l,c,e,a,r,u,g,f)}if(O||(O=this.threshold||0),!i){if(this.async&&"function"!=typeof importScripts){let t=this;return O=new Promise((function(n){setTimeout((function(){n(t.search(h,e,null,!0)),t=null}))})),n?(O.then(n),this):O}if(n)return n(this.search(h,e,null,!0)),this}if(!t||!y(t))return l;if(h=t,this.cache)if(this.B){if(n=this.j.get(t))return n}else this.j.clear(),this.B=!0;if(!(h=this.encode(h)).length)return l;n=m(n=this.f)?n(h):h.split(this.split),this.filter&&(n=r(n,this.filter)),_=n.length,i=!0,o=[];var k=x(),S=0;if(1<_&&(this.depth&&"strict"===this.f?d=!0:n.sort(f)),!d||(w=this.h)){const t=this.b;for(;S<_;S++){let e=n[S];if(e){if(d){if(!p)if(w[e])p=e,k[e]=1;else if(!a)return l;if(a&&S===_-1&&!o.length)d=!1,e=p||e,k[e]=0;else if(!p)continue}if(!k[e]){const n=[];let r=!1,s=0;const l=d?w[p]:this.i;if(l){let i;for(let o=0;o<t-O;o++)(i=l[o]&&l[o][e])&&(n[s++]=i,r=!0)}if(r)p=e,o[o.length]=1<s?n.concat.apply([],n):n[0];else if(!a){i=!1;break}k[e]=1}}}}else i=!1;return i&&(l=g(o,e,u,a)),this.cache&&this.j.set(t,l),l}this.F=n,this.u=0,this.o=[];for(var O=0;O<this.g;O++)this.m[O].postMessage({search:!0,limit:e,content:t})},n.prototype.find=function(t,e){return this.where(t,e,1)[0]||null},n.prototype.where=function(t,e,n,i){const r=this.l,s=[];let o,l=0;var h;let c;if(b(t)){n||(n=e);var u=Object.keys(t),a=u.length;if(o=!1,1===a&&"id"===u[0])return[r[t.id]];if((h=this.I)&&!i)for(var f=0;f<h.length;f++){var d=h[f],p=t[d];if(!w(p)){if(c=this.G[d]["@"+p],0==--a)return c;u.splice(u.indexOf(d),1),delete t[d];break}}for(h=Array(a),f=0;f<a;f++)h[f]=u[f].split(":")}else{if(m(t)){for(n=(e=i||Object.keys(r)).length,u=0;u<n;u++)t(a=r[e[u]])&&(s[l++]=a);return s}if(w(e))return[r[t]];if("id"===t)return[r[e]];u=[t],a=1,h=[t.split(":")],o=!0}for(f=(i=c||i||Object.keys(r)).length,d=0;d<f;d++){p=c?i[d]:r[i[d]];let f=!0;for(let n=0;n<a;n++){o||(e=t[u[n]]);const i=h[n],r=i.length;let s=p;if(1<r)for(let t=0;t<r;t++)s=s[i[t]];else s=s[i[0]];if(s!==e){f=!1;break}}if(f&&(s[l++]=p,n&&l===n))break}return s},n.prototype.info=function(){if(!this.g)return{id:this.id,items:this.length,cache:!(!this.cache||!this.cache.s)&&this.cache.s.length,matcher:j.length+(this.v?this.v.length:0),worker:this.g,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.f};for(let t=0;t<this.g;t++)this.m[t].postMessage({info:!0,id:this.id})},n.prototype.clear=function(){return this.destroy().init()},n.prototype.destroy=function(){if(this.cache&&(this.j.clear(),this.j=null),this.i=this.h=this.c=null,this.a){const t=this.a.keys;for(let e=0;e<t.length;e++)this.a.index[t[e]].destroy();this.a=this.l=null}return this},n.prototype.export=function(t){const e=!t||w(t.serialize)||t.serialize;if(this.a){const e=!t||w(t.doc)||t.doc;var n=!t||w(t.index)||t.index;t=[];let i=0;if(n)for(n=this.a.keys;i<n.length;i++){const e=this.a.index[n[i]];t[i]=[e.i,e.h,Object.keys(e.c)]}e&&(t[i]=this.l)}else t=[this.i,this.h,Object.keys(this.c)];return e&&(t=JSON.stringify(t)),t},n.prototype.import=function(t,e){(!e||w(e.serialize)||e.serialize)&&(t=JSON.parse(t));const n=x();if(this.a){var i=!e||w(e.doc)||e.doc,r=0;if(!e||w(e.index)||e.index){const i=(e=this.a.keys).length;for(var s=t[0][2];r<s.length;r++)n[s[r]]=1;for(r=0;r<i;r++){s=this.a.index[e[r]];const i=t[r];i&&(s.i=i[0],s.h=i[1],s.c=n)}}i&&(this.l=b(i)?i:t[r])}else{for(i=t[2],r=0;r<i.length;r++)n[i[r]]=1;this.i=t[0],this.h=t[1],this.c=n}};const D=function(){const t=l("\\s+"),e=l("[^a-z0-9 ]"),n=[l("[-/]")," ",e,"",t," "];return function(t){return a(h(t.toLowerCase(),n))}}(),E={icase:function(t){return t.toLowerCase()},simple:function(){const t=l("\\s+"),e=l("[^a-z0-9 ]"),n=l("[-/]"),i=[l("[àáâãäå]"),"a",l("[èéêë]"),"e",l("[ìíîï]"),"i",l("[òóôõöő]"),"o",l("[ùúûüű]"),"u",l("[ýŷÿ]"),"y",l("ñ"),"n",l("[çc]"),"k",l("ß"),"s",l(" & ")," and ",n," ",e,"",t," "];return function(t){return" "===(t=h(t.toLowerCase(),i))?"":t}}(),advanced:function(){const t=l("ae"),e=l("ai"),n=l("ay"),i=l("ey"),r=l("oe"),s=l("ue"),o=l("ie"),c=l("sz"),u=l("zs"),f=l("ck"),d=l("cc"),p=[t,"a",e,"ei",n,"ei",i,"ei",r,"o",s,"u",o,"i",c,"s",u,"s",l("sh"),"s",f,"k",d,"k",l("th"),"t",l("dt"),"t",l("ph"),"f",l("pf"),"f",l("ou"),"o",l("uo"),"u"];return function(t,e){return t?(2<(t=this.simple(t)).length&&(t=h(t,p)),e||1<t.length&&(t=a(t)),t):t}}(),extra:function(){const t=[l("p"),"b",l("z"),"s",l("[cgq]"),"k",l("n"),"m",l("d"),"t",l("[vw]"),"f",l("[aeiouy]"),""];return function(e){if(!e)return e;if(1<(e=this.advanced(e,!0)).length){e=e.split(" ");for(let n=0;n<e.length;n++){const i=e[n];1<i.length&&(e[n]=i[0]+h(i.substring(1),t))}e=a(e=e.join(" "))}return e}}(),balance:D},U=function(){function t(t){this.clear(),this.H=!0!==t&&t}return t.prototype.clear=function(){this.cache=x(),this.count=x(),this.index=x(),this.s=[]},t.prototype.set=function(t,e){if(this.H&&w(this.cache[t])){let n=this.s.length;if(n===this.H){n--;const t=this.s[n];delete this.cache[t],delete this.count[t],delete this.index[t]}this.index[t]=n,this.s[n]=t,this.count[t]=-1,this.cache[t]=e,this.get(t)}else this.cache[t]=e},t.prototype.get=function(t){const e=this.cache[t];if(this.H&&e){var n=++this.count[t];const e=this.index;let r=e[t];if(0<r){const s=this.s;for(var i=r;this.count[s[--r]]<=n&&-1!==r;);if(r++,r!==i){for(n=i;n>r;n--)i=s[n-1],s[n]=i,e[i]=n;s[r]=t,e[t]=r}}}return e},t}();return n}(function(){const t={},e="undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL;return function(n,i,r,s,o){return r=e?URL.createObjectURL(new Blob(["("+r.toString()+")()"],{type:"text/javascript"})):n+".min.js",t[n+="-"+i]||(t[n]=[]),t[n][o]=new Worker(r),t[n][o].onmessage=s,t[n][o]}}()),A)})),z=window.searchTranslation,B=z.Link_previous,F=z.Link_next,H=z.Search_no_results,q=z.Search_one_character_or_more,G=z.Search_one_result,$=z.Search_results,J=z.Search_should_be_x_or_more,V=z.Search_too_short,K=B,Q=F,X=H,Y=q,Z=G,tt=$,et=J,nt=V;function it(t){var e,n=t.counter,i=t.start,r=t.settings,s=t.onPageSelect,o=Math.ceil(n/r.show),l=i/r.show;e=l<=2?Math.min(o,3):Math.min(o,l+2);for(var h=[],c=function(t){t===l?h.push(v("li",{className:"current"},t+1)):h.push(v("li",null,v("a",{className:"SearchResults__footer__link",onClick:function(){return s(t*r.show)}},t+1)))},u=0;u<e;u++)c(u);return v("div",{className:"SearchResults__footer"},v("ul",{className:"SearchResults__footer__links Pager"},i>0&&v("li",{className:"Pager--prev"},v("a",{className:"SearchResults__footer__link",onClick:function(){return s(i-r.show)}},K)),h,l+1!==o&&v("li",{className:"Pager--next"},v("a",{className:"SearchResults__footer__link",onClick:function(){return s(i+r.show)}},Q))))}function rt(t){var e,n=t.settings,i=t.item;return i.text&&(e=i.text.split(" ").slice(0,n.descriptiveWords).join(" "),i.text.length<e.length&&"."!==e.charAt(e.length-1)&&(e+=" ...")),v("div",{className:"SearchResult"},v("div",{className:"SearchResults__title"},v("a",{href:n.base_url+i.url},i.title)),n.showURL&&v("div",{className:"SearchResults__url"},v("a",{href:n.base_url+i.url},i.url.toLowerCase().replace(/https?:\/\//g,""))),e&&v("div",{className:"SearchResults__text"},e))}var st=function(e){function i(e){var n;return t(this,i),(n=l(this,s(i).call(this,e))).handleClose=function(){n.props.onClose()},n.scrollTop=function(){n.resultRef&&(n.resultRef.scrollTop=0)},n.handlePaginate=function(t){n.setState({start:t},n.scrollTop)},n.handleChange=function(t){n.setState({search:t.target.value,start:0},n.scrollTop),n.props.settings.field.value=t.target.value},n.state={search:n.props.settings.field.value||"",start:0},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(i,w),n(i,[{key:"getResults",value:function(){var t=this.props.settings,e=this.state.start,n=[],i=0,r=[];if(this.state.search.length<t.minimumLength)return n.push(nt),n.push(1===t.minimumLength?Y:et.replace("!min",t.minimumLength)),{warnings:n,counter:i,results:r,start:e};var s=this.props.onSearch(this.state.search);return 0===(i=s.length)?(n.push(X),{warnings:n,counter:i,results:r,start:e}):(t.showTitleCount&&this.props.onTitleChange("(".concat(i,")")),{warnings:n,counter:i,results:r=s.filter((function(n,i){return i>=e&&i<t.show+e})),start:e})}},{key:"render",value:function(){var t=this,e=this.props.settings,n=this.getResults(),i=n.warnings,r=n.counter,s=n.results,o=n.start;return v("div",null,v("div",{className:"SearchResultsBackdrop"}),v("div",{className:"SearchResults",ref:function(e){return t.resultRef=e}},v("input",{className:"Search__field",placeholder:"Search...",autoComplete:"on",autoSave:"text_search",type:"search",value:this.state.search,onInput:this.handleChange}),v("button",{className:"SearchResults__close",onClick:this.handleClose},"×"),v("div",{className:"SearchResults__count"},1===r?Z:tt.replace("!count",r)),i.map((function(t){return v("div",{key:t,className:"SearchResults__warning"},t)})),s.map((function(t){return v(rt,{key:t.title,item:t,settings:e})})),r>e.show&&v(it,{counter:r,start:o,settings:e,onPageSelect:this.handlePaginate})))}}]),i}(),ot=document.title;function lt(t){var e=new RegExp("[?|&]".concat(t,"=([^&;]+?)(&|#|;|$)")).exec(window.location.search);return decodeURIComponent((e&&e[1]||"").replace(/\+/g,"%20"))||null}var ht=function(){function e(n){var s=this;t(this,e),this.keyUpHandler=function(t){27===t.which&&s.handleClose()},this.handleClose=function(){document.title=ot,document.removeEventListener("keyup",s.keyUpHandler),document.body.classList.remove("with-search"),M(null,s.resultContainer),s.resultContainer=null},this.settings=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({field:document.getElementById("search_input"),show:10,showURL:!0,showTitleCount:!0,minimumLength:3,descriptiveWords:25,highlightTerms:!0,highlightEveryTerm:!1,contentLocation:"daux_search_index.json"},n),this.searchIndex={pages:[]}}return n(e,[{key:"loadData",value:function(){var t=this;return this.loadingPromise||(this.loadingPromise=fetch(this.settings.base_url+this.settings.contentLocation).then((function(t){return t.json()})).then((function(e){t.searchIndex=new W({doc:{id:"url",field:["title","text","tags"]}});var n=e.pages;if(window.searchLanguage){var i="".concat(window.searchLanguage,"/");n=n.filter((function(t){return 0===t.url.indexOf(i)}))}t.searchIndex.add(n)}))),this.loadingPromise}},{key:"run",value:function(){var t=this;lt("q")&&(this.settings.field.value=lt("q"),this.loadData().then((function(){t.displaySearch()}))),this.settings.field.addEventListener("keyup",(function(e){t.loadData(),13===parseInt(e.keyCode,10)&&t.loadData().then((function(){t.displaySearch()}))}))}},{key:"displaySearch",value:function(){var t=this;this.resultContainer||(this.resultContainer=document.createElement("div"),document.body.appendChild(this.resultContainer)),document.addEventListener("keyup",this.keyUpHandler),M(v(st,{onSearch:function(e){return t.searchIndex.search(e)},onClose:this.handleClose,onTitleChange:function(t){document.title="".concat(t," ").concat(ot)},settings:this.settings}),this.resultContainer),document.body.classList.add("with-search"),document.body.scrollTop=0}}]),e}();window.search=function(t){new ht(t).run()};
//# sourceMappingURL=search.min.js.map