@qubit-ltd/json 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/json.cjs +188 -20
  2. package/dist/json.cjs.map +1 -1
  3. package/dist/json.min.cjs +1 -1
  4. package/dist/json.min.cjs.map +1 -1
  5. package/dist/json.min.mjs +1 -1
  6. package/dist/json.min.mjs.map +1 -1
  7. package/dist/json.mjs +188 -20
  8. package/dist/json.mjs.map +1 -1
  9. package/doc/api/Json.html +42 -0
  10. package/doc/api/LosslessNumber.html +3 -3
  11. package/doc/api/data/search.json +1 -1
  12. package/doc/api/global.html +3 -3
  13. package/doc/api/index.html +4 -4
  14. package/doc/api/scripts/core.js +719 -726
  15. package/doc/api/scripts/core.min.js +23 -23
  16. package/doc/api/scripts/resize.js +90 -90
  17. package/doc/api/scripts/search.js +267 -265
  18. package/doc/api/scripts/search.min.js +5 -5
  19. package/doc/api/scripts/third-party/Apache-License-2.0.txt +202 -202
  20. package/doc/api/scripts/third-party/fuse.js +1749 -9
  21. package/doc/api/scripts/third-party/hljs-line-num-original.js +367 -369
  22. package/doc/api/scripts/third-party/hljs-line-num.js +1 -1
  23. package/doc/api/scripts/third-party/hljs-original.js +5260 -5171
  24. package/doc/api/scripts/third-party/hljs.js +1 -1
  25. package/doc/api/scripts/third-party/popper.js +1287 -5
  26. package/doc/api/scripts/third-party/tippy.js +1499 -1
  27. package/doc/api/scripts/third-party/tocbot.js +757 -672
  28. package/doc/api/scripts/third-party/tocbot.min.js +1 -1
  29. package/doc/api/styles/clean-jsdoc-theme-base.css +1257 -1159
  30. package/doc/api/styles/clean-jsdoc-theme-dark.css +412 -412
  31. package/doc/api/styles/clean-jsdoc-theme-light.css +482 -482
  32. package/doc/api/styles/clean-jsdoc-theme-scrollbar.css +29 -29
  33. package/doc/api/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -1
  34. package/doc/api/styles/clean-jsdoc-theme.min.css +1 -1
  35. package/doc/json.min.visualization.html +15 -15
  36. package/doc/json.visualization.html +15 -15
  37. package/package.json +20 -20
@@ -1,9 +1,1749 @@
1
- /**
2
- * Fuse.js v6.4.6 - Lightweight fuzzy-search (http://fusejs.io)
3
- *
4
- * Copyright (c) 2021 Kiro Risk (http://kiro.me)
5
- * All Rights Reserved. Apache Software License 2.0
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- */
9
- var e,t;e=this,t=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){return Array.isArray?Array.isArray(e):"[object Array]"===b(e)}function g(e){return"string"==typeof e}function y(e){return"number"==typeof e}function p(e){return!0===e||!1===e||function(e){return m(e)&&null!==e}(e)&&"[object Boolean]"==b(e)}function m(t){return"object"===e(t)}function k(e){return null!=e}function M(e){return!e.trim().length}function b(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var x=function(e){return"Invalid value for key ".concat(e)},L=function(e){return"Pattern length exceeds max of ".concat(e,".")},S=Object.prototype.hasOwnProperty,w=function(){function e(n){var r=this;t(this,e),this._keys=[],this._keyMap={};var i=0;n.forEach((function(e){var t=_(e);i+=t.weight,r._keys.push(t),r._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return r(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function _(e){var t=null,n=null,r=null,i=1;if(g(e)||v(e))r=e,t=O(e),n=j(e);else{if(!S.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var o=e.name;if(r=o,S.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(o));t=O(o),n=j(o)}return{path:t,id:n,weight:i,src:r}}function O(e){return v(e)?e:e.split(".")}function j(e){return v(e)?e.join("."):e}var A=c({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}},{},{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i,o){if(k(t))if(i[o]){var c=t[i[o]];if(!k(c))return;if(o===i.length-1&&(g(c)||y(c)||p(c)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(c));else if(v(c)){r=!0;for(var a=0,s=c.length;a<s;a+=1)e(c[a],i,o+1)}else i.length&&e(c,i,o+1)}else n.push(t)}(e,g(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),I=/[^ ]+/g;function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map,n=Math.pow(10,e);return{get:function(e){var r=e.match(I).length;if(t.has(r))return t.get(r);var i=1/Math.sqrt(r),o=parseFloat(Math.round(i*n)/n);return t.set(r,o),o},clear:function(){t.clear()}}}var E=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?A.getFn:r;t(this,e),this.norm=C(3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return r(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(k(e)&&!M(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,i){var o=n.getFn(e,t.path);if(k(o))if(v(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var c=t.pop(),a=c.nestedArrIndex,s=c.value;if(k(s))if(g(s)&&!M(s)){var u={v:s,i:a,n:n.norm.get(s)};e.push(u)}else v(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();else if(!M(o)){var c={v:o,n:n.norm.get(o)};r.$[i]=c}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function $(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?A.getFn:r,o=new E({getFn:i});return o.setKeys(e.map(_)),o.setSources(t),o.create(),o}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?A.distance:s,h=t.ignoreLocation,f=void 0===h?A.ignoreLocation:h,l=r/e.length;if(f)return l;var d=Math.abs(a-o);return u?l+d/u:d?1:l}function F(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o<c;o+=1){var a=e[o];a&&-1===r?r=o:a||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function P(e){for(var t={},n=0,r=e.length;n<r;n+=1){var i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var N=function(){function e(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?A.location:o,a=i.threshold,s=void 0===a?A.threshold:a,u=i.distance,h=void 0===u?A.distance:u,f=i.includeMatches,l=void 0===f?A.includeMatches:f,d=i.findAllMatches,v=void 0===d?A.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?A.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?A.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?A.ignoreLocation:k;if(t(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:l,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){r.chunks.push({pattern:e,alphabet:P(e),startIndex:t})},x=this.pattern.length;if(x>32){for(var L=0,S=x%32,w=x-S;L<w;)b(this.pattern.substr(L,32),L),L+=32;if(S){var _=x-32;b(this.pattern.substr(_),_)}}else b(this.pattern,0)}}return r(e,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var i={isMatch:!0,score:0};return r&&(i.indices=[[0,e.length-1]]),i}var o=this.options,c=o.location,a=o.distance,s=o.threshold,u=o.findAllMatches,h=o.minMatchCharLength,f=o.ignoreLocation,d=[],v=0,g=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?A.location:i,c=r.distance,a=void 0===c?A.distance:c,s=r.threshold,u=void 0===s?A.threshold:s,h=r.findAllMatches,f=void 0===h?A.findAllMatches:h,l=r.minMatchCharLength,d=void 0===l?A.minMatchCharLength:l,v=r.includeMatches,g=void 0===v?A.includeMatches:v,y=r.ignoreLocation,p=void 0===y?A.ignoreLocation:y;if(t.length>32)throw new Error(L(32));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,S=b,w=d>1||g,_=w?Array(M):[];(m=e.indexOf(t,S))>-1;){var O=R(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),S=m+k,w)for(var j=0;j<k;)_[m+j]=1,j+=1}S=-1;for(var I=[],C=1,E=k+M,$=1<<k-1,P=0;P<k;P+=1){for(var N=0,D=E;N<D;){var z=R(t,{errors:P,currentLocation:b+D,expectedLocation:b,distance:a,ignoreLocation:p});z<=x?N=D:E=D,D=Math.floor((E-N)/2+N)}E=D;var K=Math.max(1,b-D+1),q=f?M:Math.min(b+D,M)+k,W=Array(q+2);W[q+1]=(1<<P)-1;for(var J=q;J>=K;J-=1){var T=J-1,U=n[e.charAt(T)];if(w&&(_[T]=+!!U),W[J]=(W[J+1]<<1|1)&U,P&&(W[J]|=(I[J+1]|I[J])<<1|1|I[J+1]),W[J]&$&&(C=R(t,{errors:P,currentLocation:T,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(S=T)<=b)break;K=Math.max(1,2*b-S)}}var V=R(t,{errors:P+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p});if(V>x)break;I=W}var B={isMatch:S>=0,score:Math.max(.001,C)};if(w){var G=F(_,d);G.length?g&&(B.indices=G):B.isMatch=!1}return B}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:f}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(l(d),l(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),D=function(){function e(n){t(this,e),this.pattern=n}return r(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return z(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return z(e,this.singleRegex)}}]),e}();function z(e,t){var n=e.match(t);return n?n[1]:null}var K=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),i}(D),q=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),i}(D),W=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),i}(D),J=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),i}(D),T=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),i}(D),U=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),i}(D),V=function(e){a(i,e);var n=f(i);function i(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?A.location:c,s=o.threshold,u=void 0===s?A.threshold:s,h=o.distance,f=void 0===h?A.distance:h,l=o.includeMatches,d=void 0===l?A.includeMatches:l,v=o.findAllMatches,g=void 0===v?A.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?A.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?A.isCaseSensitive:m,M=o.ignoreLocation,b=void 0===M?A.ignoreLocation:M;return t(this,i),(r=n.call(this,e))._bitapSearch=new N(e,{location:a,threshold:u,distance:f,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),r}return r(i,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),i}(D),B=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),i}(D),G=[K,B,W,J,U,T,q,V],H=G.length,Q=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Q).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i<o;i+=1){for(var c=n[i],a=!1,s=-1;!a&&++s<H;){var u=G[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<H;){var f=G[s],l=f.isSingleMatch(c);if(l){r.push(new f(l,t));break}}}return r}))}var Y=new Set([V.type,B.type]),Z=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.isCaseSensitive,o=void 0===i?A.isCaseSensitive:i,c=r.includeMatches,a=void 0===c?A.includeMatches:c,s=r.minMatchCharLength,u=void 0===s?A.minMatchCharLength:s,h=r.ignoreLocation,f=void 0===h?A.ignoreLocation:h,l=r.findAllMatches,d=void 0===l?A.findAllMatches:l,v=r.location,g=void 0===v?A.location:v,y=r.threshold,p=void 0===y?A.threshold:y,m=r.distance,k=void 0===m?A.distance:m;t(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:f,location:g,threshold:p,distance:k},this.pattern=o?n:n.toLowerCase(),this.query=X(this.pattern,this.options)}return r(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a<s;a+=1){var u=t[a];o.length=0,i=0;for(var h=0,f=u.length;h<f;h+=1){var d=u[h],v=d.search(e),g=v.isMatch,y=v.indices,p=v.score;if(!g){c=0,i=0,o.length=0;break}if(i+=1,c+=p,r){var m=d.constructor.type;Y.has(m)?o=[].concat(l(o),l(y)):o.push(y)}}if(i){var k={isMatch:!0,score:c/i};return r&&(k.indices=o),k}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){return t.useExtendedSearch}}]),e}(),ee=[];function te(e,t){for(var n=0,r=ee.length;n<r;n+=1){var i=ee[n];if(i.condition(e,t))return new i(e,t)}return new N(e,t)}var ne="$and",re="$or",ie="$path",oe="$val",ce=function(e){return!(!e[ne]&&!e[re])},ae=function(e){return!!e[ie]},se=function(e){return!v(e)&&m(e)&&!ce(e)},ue=function(e){return i({},ne,Object.keys(e).map((function(t){return i({},t,e[t])})))};function he(e,t){var n=t.ignoreFieldNorm,r=void 0===n?A.ignoreFieldNorm:n;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,i=e.norm,o=e.score,c=n?n.weight:null;t*=Math.pow(0===o&&c?Number.EPSILON:o,(c||1)*(r?1:i))})),e.score=t}))}function fe(e,t){var n=e.matches;t.matches=[],k(n)&&n.forEach((function(e){if(k(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function le(e,t){t.score=e.score}function de(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?A.includeMatches:r,o=n.includeScore,c=void 0===o?A.includeScore:o,a=[];return i&&a.push(fe),c&&a.push(le),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}var ve=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;t(this,e),this.options=c({},A,{},r),this.options.useExtendedSearch,this._keyStore=new w(this.options.keys),this.setCollection(n,i)}return r(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof E))throw new Error("Incorrect 'index' type");this._myIndex=t||$(this.options.keys,this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,t.push(i))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return he(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),de(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=te(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(k(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.auto,i=void 0===r||r,o=function e(n){var r=Object.keys(n),o=ae(n);if(!o&&r.length>1&&!ce(n))return e(ue(n));if(se(n)){var c=o?n[ie]:r[0],a=o?n[oe]:n[c];if(!g(a))throw new Error(x(c));var s={keyId:j(c),pattern:a};return i&&(s.searcher=te(a,t)),s}var u={children:[],operator:r[0]};return r.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return ce(e)||(e=ue(e)),o(e)}(e,this.options),r=this._myIndex.records,i={},o=[];return r.forEach((function(e){var r=e.$,c=e.i;if(k(r)){var a=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}switch(n.operator){case ne:for(var s=[],u=0,h=n.children.length;u<h;u+=1){var f=e(n.children[u],r,i);if(!f.length)return[];s.push.apply(s,l(f))}return s;case re:for(var d=[],v=0,g=n.children.length;v<g;v+=1){var y=e(n.children[v],r,i);if(y.length){d.push.apply(d,l(y));break}}return d}}(n,r,c);a.length&&(i[c]||(i[c]={idx:c,item:r,matches:[]},o.push(i[c])),a.forEach((function(e){var t,n=e.matches;(t=i[c].matches).push.apply(t,l(n))})))}})),o}},{key:"_searchObjectList",value:function(e){var t=this,n=te(e,this.options),r=this._myIndex,i=r.keys,o=r.records,c=[];return o.forEach((function(e){var r=e.$,o=e.i;if(k(r)){var a=[];i.forEach((function(e,i){a.push.apply(a,l(t._findMatches({key:e,value:r[i],searcher:n})))})),a.length&&c.push({idx:o,item:r,matches:a})}})),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!k(n))return[];var i=[];if(v(n))n.forEach((function(e){var n=e.v,o=e.i,c=e.n;if(k(n)){var a=r.searchIn(n),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:n,idx:o,norm:c,indices:h})}}));else{var o=n.v,c=n.n,a=r.searchIn(o),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:o,norm:c,indices:h})}return i}}]),e}();return ve.version="6.4.6",ve.createIndex=$,ve.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?A.getFn:n,i=e.keys,o=e.records,c=new E({getFn:r});return c.setKeys(i),c.setIndexRecords(o),c},ve.config=A,function(){ee.push.apply(ee,arguments)}(Z),ve},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Fuse=t();
1
+ /**
2
+ * Fuse.js v6.4.6 - Lightweight fuzzy-search (http://fusejs.io)
3
+ *
4
+ * Copyright (c) 2021 Kiro Risk (http://kiro.me)
5
+ * All Rights Reserved. Apache Software License 2.0
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ */
9
+ var e, t;
10
+ (e = this),
11
+ (t = function () {
12
+ function e(t) {
13
+ return (e =
14
+ typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
15
+ ? function (e) {
16
+ return typeof e;
17
+ }
18
+ : function (e) {
19
+ return e &&
20
+ typeof Symbol == "function" &&
21
+ e.constructor === Symbol &&
22
+ e !== Symbol.prototype
23
+ ? "symbol"
24
+ : typeof e;
25
+ })(t);
26
+ }
27
+ function t(e, t) {
28
+ if (!(e instanceof t))
29
+ throw new TypeError("Cannot call a class as a function");
30
+ }
31
+ function n(e, t) {
32
+ for (var n = 0; n < t.length; n++) {
33
+ var r = t[n];
34
+ (r.enumerable = r.enumerable || !1),
35
+ (r.configurable = !0),
36
+ "value" in r && (r.writable = !0),
37
+ Object.defineProperty(e, r.key, r);
38
+ }
39
+ }
40
+ function r(e, t, r) {
41
+ return t && n(e.prototype, t), r && n(e, r), e;
42
+ }
43
+ function i(e, t, n) {
44
+ return (
45
+ t in e
46
+ ? Object.defineProperty(e, t, {
47
+ value: n,
48
+ enumerable: !0,
49
+ configurable: !0,
50
+ writable: !0,
51
+ })
52
+ : (e[t] = n),
53
+ e
54
+ );
55
+ }
56
+ function o(e, t) {
57
+ var n = Object.keys(e);
58
+ if (Object.getOwnPropertySymbols) {
59
+ var r = Object.getOwnPropertySymbols(e);
60
+ t &&
61
+ (r = r.filter(function (t) {
62
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
63
+ })),
64
+ n.push.apply(n, r);
65
+ }
66
+ return n;
67
+ }
68
+ function c(e) {
69
+ for (var t = 1; t < arguments.length; t++) {
70
+ var n = arguments[t] != null ? arguments[t] : {};
71
+ t % 2
72
+ ? o(Object(n), !0).forEach(function (t) {
73
+ i(e, t, n[t]);
74
+ })
75
+ : Object.getOwnPropertyDescriptors
76
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
77
+ : o(Object(n)).forEach(function (t) {
78
+ Object.defineProperty(
79
+ e,
80
+ t,
81
+ Object.getOwnPropertyDescriptor(n, t)
82
+ );
83
+ });
84
+ }
85
+ return e;
86
+ }
87
+ function a(e, t) {
88
+ if (typeof t != "function" && t !== null)
89
+ throw new TypeError(
90
+ "Super expression must either be null or a function"
91
+ );
92
+ (e.prototype = Object.create(t && t.prototype, {
93
+ constructor: { value: e, writable: !0, configurable: !0 },
94
+ })),
95
+ t && u(e, t);
96
+ }
97
+ function s(e) {
98
+ return (s = Object.setPrototypeOf
99
+ ? Object.getPrototypeOf
100
+ : function (e) {
101
+ return e.__proto__ || Object.getPrototypeOf(e);
102
+ })(e);
103
+ }
104
+ function u(e, t) {
105
+ return (u =
106
+ Object.setPrototypeOf ||
107
+ function (e, t) {
108
+ return (e.__proto__ = t), e;
109
+ })(e, t);
110
+ }
111
+ function h(e, t) {
112
+ return !t || (typeof t != "object" && typeof t != "function")
113
+ ? (function (e) {
114
+ if (void 0 === e)
115
+ throw new ReferenceError(
116
+ "this hasn't been initialised - super() hasn't been called"
117
+ );
118
+ return e;
119
+ })(e)
120
+ : t;
121
+ }
122
+ function f(e) {
123
+ var t = (function () {
124
+ if (typeof Reflect == "undefined" || !Reflect.construct) return !1;
125
+ if (Reflect.construct.sham) return !1;
126
+ if (typeof Proxy == "function") return !0;
127
+ try {
128
+ return (
129
+ Date.prototype.toString.call(
130
+ Reflect.construct(Date, [], function () {})
131
+ ),
132
+ !0
133
+ );
134
+ } catch (e) {
135
+ return !1;
136
+ }
137
+ })();
138
+ return function () {
139
+ var n,
140
+ r = s(e);
141
+ if (t) {
142
+ var i = s(this).constructor;
143
+ n = Reflect.construct(r, arguments, i);
144
+ } else n = r.apply(this, arguments);
145
+ return h(this, n);
146
+ };
147
+ }
148
+ function l(e) {
149
+ return (
150
+ (function (e) {
151
+ if (Array.isArray(e)) return d(e);
152
+ })(e) ||
153
+ (function (e) {
154
+ if (typeof Symbol != "undefined" && Symbol.iterator in Object(e))
155
+ return Array.from(e);
156
+ })(e) ||
157
+ (function (e, t) {
158
+ if (e) {
159
+ if (typeof e == "string") return d(e, t);
160
+ var n = Object.prototype.toString.call(e).slice(8, -1);
161
+ return (
162
+ n === "Object" && e.constructor && (n = e.constructor.name),
163
+ n === "Map" || n === "Set"
164
+ ? Array.from(e)
165
+ : n === "Arguments" ||
166
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
167
+ ? d(e, t)
168
+ : void 0
169
+ );
170
+ }
171
+ })(e) ||
172
+ (function () {
173
+ throw new TypeError(
174
+ "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
175
+ );
176
+ })()
177
+ );
178
+ }
179
+ function d(e, t) {
180
+ (t == null || t > e.length) && (t = e.length);
181
+ for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
182
+ return r;
183
+ }
184
+ function v(e) {
185
+ return Array.isArray ? Array.isArray(e) : b(e) === "[object Array]";
186
+ }
187
+ function g(e) {
188
+ return typeof e == "string";
189
+ }
190
+ function y(e) {
191
+ return typeof e == "number";
192
+ }
193
+ function p(e) {
194
+ return (
195
+ !0 === e ||
196
+ !1 === e ||
197
+ ((function (e) {
198
+ return m(e) && e !== null;
199
+ })(e) &&
200
+ b(e) == "[object Boolean]")
201
+ );
202
+ }
203
+ function m(t) {
204
+ return e(t) === "object";
205
+ }
206
+ function k(e) {
207
+ return e != null;
208
+ }
209
+ function M(e) {
210
+ return !e.trim().length;
211
+ }
212
+ function b(e) {
213
+ return e == null
214
+ ? void 0 === e
215
+ ? "[object Undefined]"
216
+ : "[object Null]"
217
+ : Object.prototype.toString.call(e);
218
+ }
219
+ var x = function (e) {
220
+ return "Invalid value for key ".concat(e);
221
+ },
222
+ L = function (e) {
223
+ return "Pattern length exceeds max of ".concat(e, ".");
224
+ },
225
+ S = Object.prototype.hasOwnProperty,
226
+ w = (function () {
227
+ function e(n) {
228
+ var r = this;
229
+ t(this, e), (this._keys = []), (this._keyMap = {});
230
+ var i = 0;
231
+ n.forEach(function (e) {
232
+ var t = _(e);
233
+ (i += t.weight),
234
+ r._keys.push(t),
235
+ (r._keyMap[t.id] = t),
236
+ (i += t.weight);
237
+ }),
238
+ this._keys.forEach(function (e) {
239
+ e.weight /= i;
240
+ });
241
+ }
242
+ return (
243
+ r(e, [
244
+ {
245
+ key: "get",
246
+ value: function (e) {
247
+ return this._keyMap[e];
248
+ },
249
+ },
250
+ {
251
+ key: "keys",
252
+ value: function () {
253
+ return this._keys;
254
+ },
255
+ },
256
+ {
257
+ key: "toJSON",
258
+ value: function () {
259
+ return JSON.stringify(this._keys);
260
+ },
261
+ },
262
+ ]),
263
+ e
264
+ );
265
+ })();
266
+ function _(e) {
267
+ var t = null,
268
+ n = null,
269
+ r = null,
270
+ i = 1;
271
+ if (g(e) || v(e)) (r = e), (t = O(e)), (n = j(e));
272
+ else {
273
+ if (!S.call(e, "name"))
274
+ throw new Error(
275
+ (function (e) {
276
+ return "Missing ".concat(e, " property in key");
277
+ })("name")
278
+ );
279
+ var o = e.name;
280
+ if (((r = o), S.call(e, "weight") && (i = e.weight) <= 0))
281
+ throw new Error(
282
+ (function (e) {
283
+ return "Property 'weight' in key '".concat(
284
+ e,
285
+ "' must be a positive integer"
286
+ );
287
+ })(o)
288
+ );
289
+ (t = O(o)), (n = j(o));
290
+ }
291
+ return { path: t, id: n, weight: i, src: r };
292
+ }
293
+ function O(e) {
294
+ return v(e) ? e : e.split(".");
295
+ }
296
+ function j(e) {
297
+ return v(e) ? e.join(".") : e;
298
+ }
299
+ var A = c(
300
+ {},
301
+ {
302
+ isCaseSensitive: !1,
303
+ includeScore: !1,
304
+ keys: [],
305
+ shouldSort: !0,
306
+ sortFn: function (e, t) {
307
+ return e.score === t.score
308
+ ? e.idx < t.idx
309
+ ? -1
310
+ : 1
311
+ : e.score < t.score
312
+ ? -1
313
+ : 1;
314
+ },
315
+ },
316
+ {},
317
+ { includeMatches: !1, findAllMatches: !1, minMatchCharLength: 1 },
318
+ {},
319
+ { location: 0, threshold: 0.6, distance: 100 },
320
+ {},
321
+ {
322
+ useExtendedSearch: !1,
323
+ getFn: function (e, t) {
324
+ var n = [],
325
+ r = !1;
326
+ return (
327
+ (function e(t, i, o) {
328
+ if (k(t))
329
+ if (i[o]) {
330
+ var c = t[i[o]];
331
+ if (!k(c)) return;
332
+ if (o === i.length - 1 && (g(c) || y(c) || p(c)))
333
+ n.push(
334
+ (function (e) {
335
+ return e == null
336
+ ? ""
337
+ : (function (e) {
338
+ if (typeof e == "string") return e;
339
+ var t = String(e);
340
+ return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
341
+ })(e);
342
+ })(c)
343
+ );
344
+ else if (v(c)) {
345
+ r = !0;
346
+ for (var a = 0, s = c.length; a < s; a += 1)
347
+ e(c[a], i, o + 1);
348
+ } else i.length && e(c, i, o + 1);
349
+ } else n.push(t);
350
+ })(e, g(t) ? t.split(".") : t, 0),
351
+ r ? n : n[0]
352
+ );
353
+ },
354
+ ignoreLocation: !1,
355
+ ignoreFieldNorm: !1,
356
+ }
357
+ ),
358
+ I = /[^ ]+/g;
359
+ function C() {
360
+ var e =
361
+ arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 3,
362
+ t = new Map(),
363
+ n = 10 ** e;
364
+ return {
365
+ get: function (e) {
366
+ var r = e.match(I).length;
367
+ if (t.has(r)) return t.get(r);
368
+ var i = 1 / Math.sqrt(r),
369
+ o = parseFloat(Math.round(i * n) / n);
370
+ return t.set(r, o), o;
371
+ },
372
+ clear: function () {
373
+ t.clear();
374
+ },
375
+ };
376
+ }
377
+ var E = (function () {
378
+ function e() {
379
+ var n =
380
+ arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
381
+ r = n.getFn,
382
+ i = void 0 === r ? A.getFn : r;
383
+ t(this, e),
384
+ (this.norm = C(3)),
385
+ (this.getFn = i),
386
+ (this.isCreated = !1),
387
+ this.setIndexRecords();
388
+ }
389
+ return (
390
+ r(e, [
391
+ {
392
+ key: "setSources",
393
+ value: function () {
394
+ var e =
395
+ arguments.length > 0 && void 0 !== arguments[0]
396
+ ? arguments[0]
397
+ : [];
398
+ this.docs = e;
399
+ },
400
+ },
401
+ {
402
+ key: "setIndexRecords",
403
+ value: function () {
404
+ var e =
405
+ arguments.length > 0 && void 0 !== arguments[0]
406
+ ? arguments[0]
407
+ : [];
408
+ this.records = e;
409
+ },
410
+ },
411
+ {
412
+ key: "setKeys",
413
+ value: function () {
414
+ var e = this,
415
+ t =
416
+ arguments.length > 0 && void 0 !== arguments[0]
417
+ ? arguments[0]
418
+ : [];
419
+ (this.keys = t),
420
+ (this._keysMap = {}),
421
+ t.forEach(function (t, n) {
422
+ e._keysMap[t.id] = n;
423
+ });
424
+ },
425
+ },
426
+ {
427
+ key: "create",
428
+ value: function () {
429
+ var e = this;
430
+ !this.isCreated &&
431
+ this.docs.length &&
432
+ ((this.isCreated = !0),
433
+ g(this.docs[0])
434
+ ? this.docs.forEach(function (t, n) {
435
+ e._addString(t, n);
436
+ })
437
+ : this.docs.forEach(function (t, n) {
438
+ e._addObject(t, n);
439
+ }),
440
+ this.norm.clear());
441
+ },
442
+ },
443
+ {
444
+ key: "add",
445
+ value: function (e) {
446
+ var t = this.size();
447
+ g(e) ? this._addString(e, t) : this._addObject(e, t);
448
+ },
449
+ },
450
+ {
451
+ key: "removeAt",
452
+ value: function (e) {
453
+ this.records.splice(e, 1);
454
+ for (var t = e, n = this.size(); t < n; t += 1)
455
+ this.records[t].i -= 1;
456
+ },
457
+ },
458
+ {
459
+ key: "getValueForItemAtKeyId",
460
+ value: function (e, t) {
461
+ return e[this._keysMap[t]];
462
+ },
463
+ },
464
+ {
465
+ key: "size",
466
+ value: function () {
467
+ return this.records.length;
468
+ },
469
+ },
470
+ {
471
+ key: "_addString",
472
+ value: function (e, t) {
473
+ if (k(e) && !M(e)) {
474
+ var n = { v: e, i: t, n: this.norm.get(e) };
475
+ this.records.push(n);
476
+ }
477
+ },
478
+ },
479
+ {
480
+ key: "_addObject",
481
+ value: function (e, t) {
482
+ var n = this,
483
+ r = { i: t, $: {} };
484
+ this.keys.forEach(function (t, i) {
485
+ var o = n.getFn(e, t.path);
486
+ if (k(o))
487
+ if (v(o))
488
+ !(function () {
489
+ for (
490
+ var e = [], t = [{ nestedArrIndex: -1, value: o }];
491
+ t.length;
492
+
493
+ ) {
494
+ var c = t.pop(),
495
+ a = c.nestedArrIndex,
496
+ s = c.value;
497
+ if (k(s))
498
+ if (g(s) && !M(s)) {
499
+ var u = { v: s, i: a, n: n.norm.get(s) };
500
+ e.push(u);
501
+ } else
502
+ v(s) &&
503
+ s.forEach(function (e, n) {
504
+ t.push({ nestedArrIndex: n, value: e });
505
+ });
506
+ }
507
+ r.$[i] = e;
508
+ })();
509
+ else if (!M(o)) {
510
+ var c = { v: o, n: n.norm.get(o) };
511
+ r.$[i] = c;
512
+ }
513
+ }),
514
+ this.records.push(r);
515
+ },
516
+ },
517
+ {
518
+ key: "toJSON",
519
+ value: function () {
520
+ return { keys: this.keys, records: this.records };
521
+ },
522
+ },
523
+ ]),
524
+ e
525
+ );
526
+ })();
527
+ function $(e, t) {
528
+ var n =
529
+ arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
530
+ r = n.getFn,
531
+ i = void 0 === r ? A.getFn : r,
532
+ o = new E({ getFn: i });
533
+ return o.setKeys(e.map(_)), o.setSources(t), o.create(), o;
534
+ }
535
+ function R(e) {
536
+ var t =
537
+ arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
538
+ n = t.errors,
539
+ r = void 0 === n ? 0 : n,
540
+ i = t.currentLocation,
541
+ o = void 0 === i ? 0 : i,
542
+ c = t.expectedLocation,
543
+ a = void 0 === c ? 0 : c,
544
+ s = t.distance,
545
+ u = void 0 === s ? A.distance : s,
546
+ h = t.ignoreLocation,
547
+ f = void 0 === h ? A.ignoreLocation : h,
548
+ l = r / e.length;
549
+ if (f) return l;
550
+ var d = Math.abs(a - o);
551
+ return u ? l + d / u : d ? 1 : l;
552
+ }
553
+ function F() {
554
+ for (
555
+ var e =
556
+ arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
557
+ t =
558
+ arguments.length > 1 && void 0 !== arguments[1]
559
+ ? arguments[1]
560
+ : A.minMatchCharLength,
561
+ n = [],
562
+ r = -1,
563
+ i = -1,
564
+ o = 0,
565
+ c = e.length;
566
+ o < c;
567
+ o += 1
568
+ ) {
569
+ var a = e[o];
570
+ a && r === -1
571
+ ? (r = o)
572
+ : a ||
573
+ r === -1 ||
574
+ ((i = o - 1) - r + 1 >= t && n.push([r, i]), (r = -1));
575
+ }
576
+ return e[o - 1] && o - r >= t && n.push([r, o - 1]), n;
577
+ }
578
+ function P(e) {
579
+ for (var t = {}, n = 0, r = e.length; n < r; n += 1) {
580
+ var i = e.charAt(n);
581
+ t[i] = (t[i] || 0) | (1 << (r - n - 1));
582
+ }
583
+ return t;
584
+ }
585
+ var N = (function () {
586
+ function e(n) {
587
+ var r = this,
588
+ i =
589
+ arguments.length > 1 && void 0 !== arguments[1]
590
+ ? arguments[1]
591
+ : {},
592
+ o = i.location,
593
+ c = void 0 === o ? A.location : o,
594
+ a = i.threshold,
595
+ s = void 0 === a ? A.threshold : a,
596
+ u = i.distance,
597
+ h = void 0 === u ? A.distance : u,
598
+ f = i.includeMatches,
599
+ l = void 0 === f ? A.includeMatches : f,
600
+ d = i.findAllMatches,
601
+ v = void 0 === d ? A.findAllMatches : d,
602
+ g = i.minMatchCharLength,
603
+ y = void 0 === g ? A.minMatchCharLength : g,
604
+ p = i.isCaseSensitive,
605
+ m = void 0 === p ? A.isCaseSensitive : p,
606
+ k = i.ignoreLocation,
607
+ M = void 0 === k ? A.ignoreLocation : k;
608
+ if (
609
+ (t(this, e),
610
+ (this.options = {
611
+ location: c,
612
+ threshold: s,
613
+ distance: h,
614
+ includeMatches: l,
615
+ findAllMatches: v,
616
+ minMatchCharLength: y,
617
+ isCaseSensitive: m,
618
+ ignoreLocation: M,
619
+ }),
620
+ (this.pattern = m ? n : n.toLowerCase()),
621
+ (this.chunks = []),
622
+ this.pattern.length)
623
+ ) {
624
+ var b = function (e, t) {
625
+ r.chunks.push({ pattern: e, alphabet: P(e), startIndex: t });
626
+ },
627
+ x = this.pattern.length;
628
+ if (x > 32) {
629
+ for (var L = 0, S = x % 32, w = x - S; L < w; )
630
+ b(this.pattern.substr(L, 32), L), (L += 32);
631
+ if (S) {
632
+ var _ = x - 32;
633
+ b(this.pattern.substr(_), _);
634
+ }
635
+ } else b(this.pattern, 0);
636
+ }
637
+ }
638
+ return (
639
+ r(e, [
640
+ {
641
+ key: "searchIn",
642
+ value: function (e) {
643
+ var t = this.options,
644
+ n = t.isCaseSensitive,
645
+ r = t.includeMatches;
646
+ if ((n || (e = e.toLowerCase()), this.pattern === e)) {
647
+ var i = { isMatch: !0, score: 0 };
648
+ return r && (i.indices = [[0, e.length - 1]]), i;
649
+ }
650
+ var o = this.options,
651
+ c = o.location,
652
+ a = o.distance,
653
+ s = o.threshold,
654
+ u = o.findAllMatches,
655
+ h = o.minMatchCharLength,
656
+ f = o.ignoreLocation,
657
+ d = [],
658
+ v = 0,
659
+ g = !1;
660
+ this.chunks.forEach(function (t) {
661
+ var n = t.pattern,
662
+ i = t.alphabet,
663
+ o = t.startIndex,
664
+ y = (function (e, t, n) {
665
+ var r =
666
+ arguments.length > 3 && void 0 !== arguments[3]
667
+ ? arguments[3]
668
+ : {},
669
+ i = r.location,
670
+ o = void 0 === i ? A.location : i,
671
+ c = r.distance,
672
+ a = void 0 === c ? A.distance : c,
673
+ s = r.threshold,
674
+ u = void 0 === s ? A.threshold : s,
675
+ h = r.findAllMatches,
676
+ f = void 0 === h ? A.findAllMatches : h,
677
+ l = r.minMatchCharLength,
678
+ d = void 0 === l ? A.minMatchCharLength : l,
679
+ v = r.includeMatches,
680
+ g = void 0 === v ? A.includeMatches : v,
681
+ y = r.ignoreLocation,
682
+ p = void 0 === y ? A.ignoreLocation : y;
683
+ if (t.length > 32) throw new Error(L(32));
684
+ for (
685
+ var m,
686
+ k = t.length,
687
+ M = e.length,
688
+ b = Math.max(0, Math.min(o, M)),
689
+ x = u,
690
+ S = b,
691
+ w = d > 1 || g,
692
+ _ = w ? Array(M) : [];
693
+ (m = e.indexOf(t, S)) > -1;
694
+
695
+ ) {
696
+ var O = R(t, {
697
+ currentLocation: m,
698
+ expectedLocation: b,
699
+ distance: a,
700
+ ignoreLocation: p,
701
+ });
702
+ if (((x = Math.min(O, x)), (S = m + k), w))
703
+ for (var j = 0; j < k; ) (_[m + j] = 1), (j += 1);
704
+ }
705
+ S = -1;
706
+ for (
707
+ var I = [], C = 1, E = k + M, $ = 1 << (k - 1), P = 0;
708
+ P < k;
709
+ P += 1
710
+ ) {
711
+ for (var N = 0, D = E; N < D; ) {
712
+ var z = R(t, {
713
+ errors: P,
714
+ currentLocation: b + D,
715
+ expectedLocation: b,
716
+ distance: a,
717
+ ignoreLocation: p,
718
+ });
719
+ z <= x ? (N = D) : (E = D),
720
+ (D = Math.floor((E - N) / 2 + N));
721
+ }
722
+ E = D;
723
+ var K = Math.max(1, b - D + 1),
724
+ q = f ? M : Math.min(b + D, M) + k,
725
+ W = Array(q + 2);
726
+ W[q + 1] = (1 << P) - 1;
727
+ for (var J = q; J >= K; J -= 1) {
728
+ var T = J - 1,
729
+ U = n[e.charAt(T)];
730
+ if (
731
+ (w && (_[T] = Number(Boolean(U))),
732
+ (W[J] = ((W[J + 1] << 1) | 1) & U),
733
+ P &&
734
+ (W[J] |= ((I[J + 1] | I[J]) << 1) | 1 | I[J + 1]),
735
+ W[J] & $ &&
736
+ (C = R(t, {
737
+ errors: P,
738
+ currentLocation: T,
739
+ expectedLocation: b,
740
+ distance: a,
741
+ ignoreLocation: p,
742
+ })) <= x)
743
+ ) {
744
+ if (((x = C), (S = T) <= b)) break;
745
+ K = Math.max(1, 2 * b - S);
746
+ }
747
+ }
748
+ var V = R(t, {
749
+ errors: P + 1,
750
+ currentLocation: b,
751
+ expectedLocation: b,
752
+ distance: a,
753
+ ignoreLocation: p,
754
+ });
755
+ if (V > x) break;
756
+ I = W;
757
+ }
758
+ var B = { isMatch: S >= 0, score: Math.max(0.001, C) };
759
+ if (w) {
760
+ var G = F(_, d);
761
+ G.length ? g && (B.indices = G) : (B.isMatch = !1);
762
+ }
763
+ return B;
764
+ })(e, n, i, {
765
+ location: c + o,
766
+ distance: a,
767
+ threshold: s,
768
+ findAllMatches: u,
769
+ minMatchCharLength: h,
770
+ includeMatches: r,
771
+ ignoreLocation: f,
772
+ }),
773
+ p = y.isMatch,
774
+ m = y.score,
775
+ k = y.indices;
776
+ p && (g = !0),
777
+ (v += m),
778
+ p && k && (d = [].concat(l(d), l(k)));
779
+ });
780
+ var y = { isMatch: g, score: g ? v / this.chunks.length : 1 };
781
+ return g && r && (y.indices = d), y;
782
+ },
783
+ },
784
+ ]),
785
+ e
786
+ );
787
+ })(),
788
+ D = (function () {
789
+ function e(n) {
790
+ t(this, e), (this.pattern = n);
791
+ }
792
+ return (
793
+ r(
794
+ e,
795
+ [{ key: "search", value: function () {} }],
796
+ [
797
+ {
798
+ key: "isMultiMatch",
799
+ value: function (e) {
800
+ return z(e, this.multiRegex);
801
+ },
802
+ },
803
+ {
804
+ key: "isSingleMatch",
805
+ value: function (e) {
806
+ return z(e, this.singleRegex);
807
+ },
808
+ },
809
+ ]
810
+ ),
811
+ e
812
+ );
813
+ })();
814
+ function z(e, t) {
815
+ var n = e.match(t);
816
+ return n ? n[1] : null;
817
+ }
818
+ var K = (function (e) {
819
+ a(i, e);
820
+ var n = f(i);
821
+ function i(e) {
822
+ return t(this, i), n.call(this, e);
823
+ }
824
+ return (
825
+ r(
826
+ i,
827
+ [
828
+ {
829
+ key: "search",
830
+ value: function (e) {
831
+ var t = e === this.pattern;
832
+ return {
833
+ isMatch: t,
834
+ score: t ? 0 : 1,
835
+ indices: [0, this.pattern.length - 1],
836
+ };
837
+ },
838
+ },
839
+ ],
840
+ [
841
+ {
842
+ key: "type",
843
+ get: function () {
844
+ return "exact";
845
+ },
846
+ },
847
+ {
848
+ key: "multiRegex",
849
+ get: function () {
850
+ return /^="(.*)"$/;
851
+ },
852
+ },
853
+ {
854
+ key: "singleRegex",
855
+ get: function () {
856
+ return /^=(.*)$/;
857
+ },
858
+ },
859
+ ]
860
+ ),
861
+ i
862
+ );
863
+ })(D),
864
+ q = (function (e) {
865
+ a(i, e);
866
+ var n = f(i);
867
+ function i(e) {
868
+ return t(this, i), n.call(this, e);
869
+ }
870
+ return (
871
+ r(
872
+ i,
873
+ [
874
+ {
875
+ key: "search",
876
+ value: function (e) {
877
+ var t = e.indexOf(this.pattern) === -1;
878
+ return {
879
+ isMatch: t,
880
+ score: t ? 0 : 1,
881
+ indices: [0, e.length - 1],
882
+ };
883
+ },
884
+ },
885
+ ],
886
+ [
887
+ {
888
+ key: "type",
889
+ get: function () {
890
+ return "inverse-exact";
891
+ },
892
+ },
893
+ {
894
+ key: "multiRegex",
895
+ get: function () {
896
+ return /^!"(.*)"$/;
897
+ },
898
+ },
899
+ {
900
+ key: "singleRegex",
901
+ get: function () {
902
+ return /^!(.*)$/;
903
+ },
904
+ },
905
+ ]
906
+ ),
907
+ i
908
+ );
909
+ })(D),
910
+ W = (function (e) {
911
+ a(i, e);
912
+ var n = f(i);
913
+ function i(e) {
914
+ return t(this, i), n.call(this, e);
915
+ }
916
+ return (
917
+ r(
918
+ i,
919
+ [
920
+ {
921
+ key: "search",
922
+ value: function (e) {
923
+ var t = e.startsWith(this.pattern);
924
+ return {
925
+ isMatch: t,
926
+ score: t ? 0 : 1,
927
+ indices: [0, this.pattern.length - 1],
928
+ };
929
+ },
930
+ },
931
+ ],
932
+ [
933
+ {
934
+ key: "type",
935
+ get: function () {
936
+ return "prefix-exact";
937
+ },
938
+ },
939
+ {
940
+ key: "multiRegex",
941
+ get: function () {
942
+ return /^\^"(.*)"$/;
943
+ },
944
+ },
945
+ {
946
+ key: "singleRegex",
947
+ get: function () {
948
+ return /^\^(.*)$/;
949
+ },
950
+ },
951
+ ]
952
+ ),
953
+ i
954
+ );
955
+ })(D),
956
+ J = (function (e) {
957
+ a(i, e);
958
+ var n = f(i);
959
+ function i(e) {
960
+ return t(this, i), n.call(this, e);
961
+ }
962
+ return (
963
+ r(
964
+ i,
965
+ [
966
+ {
967
+ key: "search",
968
+ value: function (e) {
969
+ var t = !e.startsWith(this.pattern);
970
+ return {
971
+ isMatch: t,
972
+ score: t ? 0 : 1,
973
+ indices: [0, e.length - 1],
974
+ };
975
+ },
976
+ },
977
+ ],
978
+ [
979
+ {
980
+ key: "type",
981
+ get: function () {
982
+ return "inverse-prefix-exact";
983
+ },
984
+ },
985
+ {
986
+ key: "multiRegex",
987
+ get: function () {
988
+ return /^!\^"(.*)"$/;
989
+ },
990
+ },
991
+ {
992
+ key: "singleRegex",
993
+ get: function () {
994
+ return /^!\^(.*)$/;
995
+ },
996
+ },
997
+ ]
998
+ ),
999
+ i
1000
+ );
1001
+ })(D),
1002
+ T = (function (e) {
1003
+ a(i, e);
1004
+ var n = f(i);
1005
+ function i(e) {
1006
+ return t(this, i), n.call(this, e);
1007
+ }
1008
+ return (
1009
+ r(
1010
+ i,
1011
+ [
1012
+ {
1013
+ key: "search",
1014
+ value: function (e) {
1015
+ var t = e.endsWith(this.pattern);
1016
+ return {
1017
+ isMatch: t,
1018
+ score: t ? 0 : 1,
1019
+ indices: [e.length - this.pattern.length, e.length - 1],
1020
+ };
1021
+ },
1022
+ },
1023
+ ],
1024
+ [
1025
+ {
1026
+ key: "type",
1027
+ get: function () {
1028
+ return "suffix-exact";
1029
+ },
1030
+ },
1031
+ {
1032
+ key: "multiRegex",
1033
+ get: function () {
1034
+ return /^"(.*)"\$$/;
1035
+ },
1036
+ },
1037
+ {
1038
+ key: "singleRegex",
1039
+ get: function () {
1040
+ return /^(.*)\$$/;
1041
+ },
1042
+ },
1043
+ ]
1044
+ ),
1045
+ i
1046
+ );
1047
+ })(D),
1048
+ U = (function (e) {
1049
+ a(i, e);
1050
+ var n = f(i);
1051
+ function i(e) {
1052
+ return t(this, i), n.call(this, e);
1053
+ }
1054
+ return (
1055
+ r(
1056
+ i,
1057
+ [
1058
+ {
1059
+ key: "search",
1060
+ value: function (e) {
1061
+ var t = !e.endsWith(this.pattern);
1062
+ return {
1063
+ isMatch: t,
1064
+ score: t ? 0 : 1,
1065
+ indices: [0, e.length - 1],
1066
+ };
1067
+ },
1068
+ },
1069
+ ],
1070
+ [
1071
+ {
1072
+ key: "type",
1073
+ get: function () {
1074
+ return "inverse-suffix-exact";
1075
+ },
1076
+ },
1077
+ {
1078
+ key: "multiRegex",
1079
+ get: function () {
1080
+ return /^!"(.*)"\$$/;
1081
+ },
1082
+ },
1083
+ {
1084
+ key: "singleRegex",
1085
+ get: function () {
1086
+ return /^!(.*)\$$/;
1087
+ },
1088
+ },
1089
+ ]
1090
+ ),
1091
+ i
1092
+ );
1093
+ })(D),
1094
+ V = (function (e) {
1095
+ a(i, e);
1096
+ var n = f(i);
1097
+ function i(e) {
1098
+ var r,
1099
+ o =
1100
+ arguments.length > 1 && void 0 !== arguments[1]
1101
+ ? arguments[1]
1102
+ : {},
1103
+ c = o.location,
1104
+ a = void 0 === c ? A.location : c,
1105
+ s = o.threshold,
1106
+ u = void 0 === s ? A.threshold : s,
1107
+ h = o.distance,
1108
+ f = void 0 === h ? A.distance : h,
1109
+ l = o.includeMatches,
1110
+ d = void 0 === l ? A.includeMatches : l,
1111
+ v = o.findAllMatches,
1112
+ g = void 0 === v ? A.findAllMatches : v,
1113
+ y = o.minMatchCharLength,
1114
+ p = void 0 === y ? A.minMatchCharLength : y,
1115
+ m = o.isCaseSensitive,
1116
+ k = void 0 === m ? A.isCaseSensitive : m,
1117
+ M = o.ignoreLocation,
1118
+ b = void 0 === M ? A.ignoreLocation : M;
1119
+ return (
1120
+ t(this, i),
1121
+ ((r = n.call(this, e))._bitapSearch = new N(e, {
1122
+ location: a,
1123
+ threshold: u,
1124
+ distance: f,
1125
+ includeMatches: d,
1126
+ findAllMatches: g,
1127
+ minMatchCharLength: p,
1128
+ isCaseSensitive: k,
1129
+ ignoreLocation: b,
1130
+ })),
1131
+ r
1132
+ );
1133
+ }
1134
+ return (
1135
+ r(
1136
+ i,
1137
+ [
1138
+ {
1139
+ key: "search",
1140
+ value: function (e) {
1141
+ return this._bitapSearch.searchIn(e);
1142
+ },
1143
+ },
1144
+ ],
1145
+ [
1146
+ {
1147
+ key: "type",
1148
+ get: function () {
1149
+ return "fuzzy";
1150
+ },
1151
+ },
1152
+ {
1153
+ key: "multiRegex",
1154
+ get: function () {
1155
+ return /^"(.*)"$/;
1156
+ },
1157
+ },
1158
+ {
1159
+ key: "singleRegex",
1160
+ get: function () {
1161
+ return /^(.*)$/;
1162
+ },
1163
+ },
1164
+ ]
1165
+ ),
1166
+ i
1167
+ );
1168
+ })(D),
1169
+ B = (function (e) {
1170
+ a(i, e);
1171
+ var n = f(i);
1172
+ function i(e) {
1173
+ return t(this, i), n.call(this, e);
1174
+ }
1175
+ return (
1176
+ r(
1177
+ i,
1178
+ [
1179
+ {
1180
+ key: "search",
1181
+ value: function (e) {
1182
+ for (
1183
+ var t, n = 0, r = [], i = this.pattern.length;
1184
+ (t = e.indexOf(this.pattern, n)) > -1;
1185
+
1186
+ )
1187
+ (n = t + i), r.push([t, n - 1]);
1188
+ var o = Boolean(r.length);
1189
+ return { isMatch: o, score: o ? 0 : 1, indices: r };
1190
+ },
1191
+ },
1192
+ ],
1193
+ [
1194
+ {
1195
+ key: "type",
1196
+ get: function () {
1197
+ return "include";
1198
+ },
1199
+ },
1200
+ {
1201
+ key: "multiRegex",
1202
+ get: function () {
1203
+ return /^'"(.*)"$/;
1204
+ },
1205
+ },
1206
+ {
1207
+ key: "singleRegex",
1208
+ get: function () {
1209
+ return /^'(.*)$/;
1210
+ },
1211
+ },
1212
+ ]
1213
+ ),
1214
+ i
1215
+ );
1216
+ })(D),
1217
+ G = [K, B, W, J, U, T, q, V],
1218
+ H = G.length,
1219
+ Q = / +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;
1220
+ function X(e) {
1221
+ var t =
1222
+ arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1223
+ return e.split("|").map(function (e) {
1224
+ for (
1225
+ var n = e
1226
+ .trim()
1227
+ .split(Q)
1228
+ .filter(function (e) {
1229
+ return e && Boolean(e.trim());
1230
+ }),
1231
+ r = [],
1232
+ i = 0,
1233
+ o = n.length;
1234
+ i < o;
1235
+ i += 1
1236
+ ) {
1237
+ for (var c = n[i], a = !1, s = -1; !a && ++s < H; ) {
1238
+ var u = G[s],
1239
+ h = u.isMultiMatch(c);
1240
+ h && (r.push(new u(h, t)), (a = !0));
1241
+ }
1242
+ if (!a)
1243
+ for (s = -1; ++s < H; ) {
1244
+ var f = G[s],
1245
+ l = f.isSingleMatch(c);
1246
+ if (l) {
1247
+ r.push(new f(l, t));
1248
+ break;
1249
+ }
1250
+ }
1251
+ }
1252
+ return r;
1253
+ });
1254
+ }
1255
+ var Y = new Set([V.type, B.type]),
1256
+ Z = (function () {
1257
+ function e(n) {
1258
+ var r =
1259
+ arguments.length > 1 && void 0 !== arguments[1]
1260
+ ? arguments[1]
1261
+ : {},
1262
+ i = r.isCaseSensitive,
1263
+ o = void 0 === i ? A.isCaseSensitive : i,
1264
+ c = r.includeMatches,
1265
+ a = void 0 === c ? A.includeMatches : c,
1266
+ s = r.minMatchCharLength,
1267
+ u = void 0 === s ? A.minMatchCharLength : s,
1268
+ h = r.ignoreLocation,
1269
+ f = void 0 === h ? A.ignoreLocation : h,
1270
+ l = r.findAllMatches,
1271
+ d = void 0 === l ? A.findAllMatches : l,
1272
+ v = r.location,
1273
+ g = void 0 === v ? A.location : v,
1274
+ y = r.threshold,
1275
+ p = void 0 === y ? A.threshold : y,
1276
+ m = r.distance,
1277
+ k = void 0 === m ? A.distance : m;
1278
+ t(this, e),
1279
+ (this.query = null),
1280
+ (this.options = {
1281
+ isCaseSensitive: o,
1282
+ includeMatches: a,
1283
+ minMatchCharLength: u,
1284
+ findAllMatches: d,
1285
+ ignoreLocation: f,
1286
+ location: g,
1287
+ threshold: p,
1288
+ distance: k,
1289
+ }),
1290
+ (this.pattern = o ? n : n.toLowerCase()),
1291
+ (this.query = X(this.pattern, this.options));
1292
+ }
1293
+ return (
1294
+ r(
1295
+ e,
1296
+ [
1297
+ {
1298
+ key: "searchIn",
1299
+ value: function (e) {
1300
+ var t = this.query;
1301
+ if (!t) return { isMatch: !1, score: 1 };
1302
+ var n = this.options,
1303
+ r = n.includeMatches;
1304
+ e = n.isCaseSensitive ? e : e.toLowerCase();
1305
+ for (
1306
+ var i = 0, o = [], c = 0, a = 0, s = t.length;
1307
+ a < s;
1308
+ a += 1
1309
+ ) {
1310
+ var u = t[a];
1311
+ (o.length = 0), (i = 0);
1312
+ for (var h = 0, f = u.length; h < f; h += 1) {
1313
+ var d = u[h],
1314
+ v = d.search(e),
1315
+ g = v.isMatch,
1316
+ y = v.indices,
1317
+ p = v.score;
1318
+ if (!g) {
1319
+ (c = 0), (i = 0), (o.length = 0);
1320
+ break;
1321
+ }
1322
+ if (((i += 1), (c += p), r)) {
1323
+ var m = d.constructor.type;
1324
+ Y.has(m) ? (o = [].concat(l(o), l(y))) : o.push(y);
1325
+ }
1326
+ }
1327
+ if (i) {
1328
+ var k = { isMatch: !0, score: c / i };
1329
+ return r && (k.indices = o), k;
1330
+ }
1331
+ }
1332
+ return { isMatch: !1, score: 1 };
1333
+ },
1334
+ },
1335
+ ],
1336
+ [
1337
+ {
1338
+ key: "condition",
1339
+ value: function (e, t) {
1340
+ return t.useExtendedSearch;
1341
+ },
1342
+ },
1343
+ ]
1344
+ ),
1345
+ e
1346
+ );
1347
+ })(),
1348
+ ee = [];
1349
+ function te(e, t) {
1350
+ for (var n = 0, r = ee.length; n < r; n += 1) {
1351
+ var i = ee[n];
1352
+ if (i.condition(e, t)) return new i(e, t);
1353
+ }
1354
+ return new N(e, t);
1355
+ }
1356
+ var ne = "$and",
1357
+ re = "$or",
1358
+ ie = "$path",
1359
+ oe = "$val",
1360
+ ce = function (e) {
1361
+ return !(!e[ne] && !e[re]);
1362
+ },
1363
+ ae = function (e) {
1364
+ return Boolean(e[ie]);
1365
+ },
1366
+ se = function (e) {
1367
+ return !v(e) && m(e) && !ce(e);
1368
+ },
1369
+ ue = function (e) {
1370
+ return i(
1371
+ {},
1372
+ ne,
1373
+ Object.keys(e).map(function (t) {
1374
+ return i({}, t, e[t]);
1375
+ })
1376
+ );
1377
+ };
1378
+ function he(e, t) {
1379
+ var n = t.ignoreFieldNorm,
1380
+ r = void 0 === n ? A.ignoreFieldNorm : n;
1381
+ e.forEach(function (e) {
1382
+ var t = 1;
1383
+ e.matches.forEach(function (e) {
1384
+ var n = e.key,
1385
+ i = e.norm,
1386
+ o = e.score,
1387
+ c = n ? n.weight : null;
1388
+ t *= (o === 0 && c ? Number.EPSILON : o) ** ((c || 1) * (r ? 1 : i));
1389
+ }),
1390
+ (e.score = t);
1391
+ });
1392
+ }
1393
+ function fe(e, t) {
1394
+ var n = e.matches;
1395
+ (t.matches = []),
1396
+ k(n) &&
1397
+ n.forEach(function (e) {
1398
+ if (k(e.indices) && e.indices.length) {
1399
+ var n = { indices: e.indices, value: e.value };
1400
+ e.key && (n.key = e.key.src),
1401
+ e.idx > -1 && (n.refIndex = e.idx),
1402
+ t.matches.push(n);
1403
+ }
1404
+ });
1405
+ }
1406
+ function le(e, t) {
1407
+ t.score = e.score;
1408
+ }
1409
+ function de(e, t) {
1410
+ var n =
1411
+ arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
1412
+ r = n.includeMatches,
1413
+ i = void 0 === r ? A.includeMatches : r,
1414
+ o = n.includeScore,
1415
+ c = void 0 === o ? A.includeScore : o,
1416
+ a = [];
1417
+ return (
1418
+ i && a.push(fe),
1419
+ c && a.push(le),
1420
+ e.map(function (e) {
1421
+ var n = e.idx,
1422
+ r = { item: t[n], refIndex: n };
1423
+ return (
1424
+ a.length &&
1425
+ a.forEach(function (t) {
1426
+ t(e, r);
1427
+ }),
1428
+ r
1429
+ );
1430
+ })
1431
+ );
1432
+ }
1433
+ var ve = (function () {
1434
+ function e(n) {
1435
+ var r =
1436
+ arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
1437
+ i = arguments.length > 2 ? arguments[2] : void 0;
1438
+ t(this, e),
1439
+ (this.options = c({}, A, {}, r)),
1440
+ this.options.useExtendedSearch,
1441
+ (this._keyStore = new w(this.options.keys)),
1442
+ this.setCollection(n, i);
1443
+ }
1444
+ return (
1445
+ r(e, [
1446
+ {
1447
+ key: "setCollection",
1448
+ value: function (e, t) {
1449
+ if (((this._docs = e), t && !(t instanceof E)))
1450
+ throw new Error("Incorrect 'index' type");
1451
+ this._myIndex =
1452
+ t ||
1453
+ $(this.options.keys, this._docs, { getFn: this.options.getFn });
1454
+ },
1455
+ },
1456
+ {
1457
+ key: "add",
1458
+ value: function (e) {
1459
+ k(e) && (this._docs.push(e), this._myIndex.add(e));
1460
+ },
1461
+ },
1462
+ {
1463
+ key: "remove",
1464
+ value: function () {
1465
+ for (
1466
+ var e =
1467
+ arguments.length > 0 && void 0 !== arguments[0]
1468
+ ? arguments[0]
1469
+ : function () {
1470
+ return !1;
1471
+ },
1472
+ t = [],
1473
+ n = 0,
1474
+ r = this._docs.length;
1475
+ n < r;
1476
+ n += 1
1477
+ ) {
1478
+ var i = this._docs[n];
1479
+ e(i, n) && (this.removeAt(n), (n -= 1), (r -= 1), t.push(i));
1480
+ }
1481
+ return t;
1482
+ },
1483
+ },
1484
+ {
1485
+ key: "removeAt",
1486
+ value: function (e) {
1487
+ this._docs.splice(e, 1), this._myIndex.removeAt(e);
1488
+ },
1489
+ },
1490
+ {
1491
+ key: "getIndex",
1492
+ value: function () {
1493
+ return this._myIndex;
1494
+ },
1495
+ },
1496
+ {
1497
+ key: "search",
1498
+ value: function (e) {
1499
+ var t =
1500
+ arguments.length > 1 && void 0 !== arguments[1]
1501
+ ? arguments[1]
1502
+ : {},
1503
+ n = t.limit,
1504
+ r = void 0 === n ? -1 : n,
1505
+ i = this.options,
1506
+ o = i.includeMatches,
1507
+ c = i.includeScore,
1508
+ a = i.shouldSort,
1509
+ s = i.sortFn,
1510
+ u = i.ignoreFieldNorm,
1511
+ h = g(e)
1512
+ ? g(this._docs[0])
1513
+ ? this._searchStringList(e)
1514
+ : this._searchObjectList(e)
1515
+ : this._searchLogical(e);
1516
+ return (
1517
+ he(h, { ignoreFieldNorm: u }),
1518
+ a && h.sort(s),
1519
+ y(r) && r > -1 && (h = h.slice(0, r)),
1520
+ de(h, this._docs, { includeMatches: o, includeScore: c })
1521
+ );
1522
+ },
1523
+ },
1524
+ {
1525
+ key: "_searchStringList",
1526
+ value: function (e) {
1527
+ var t = te(e, this.options),
1528
+ n = this._myIndex.records,
1529
+ r = [];
1530
+ return (
1531
+ n.forEach(function (e) {
1532
+ var n = e.v,
1533
+ i = e.i,
1534
+ o = e.n;
1535
+ if (k(n)) {
1536
+ var c = t.searchIn(n),
1537
+ a = c.isMatch,
1538
+ s = c.score,
1539
+ u = c.indices;
1540
+ a &&
1541
+ r.push({
1542
+ item: n,
1543
+ idx: i,
1544
+ matches: [{ score: s, value: n, norm: o, indices: u }],
1545
+ });
1546
+ }
1547
+ }),
1548
+ r
1549
+ );
1550
+ },
1551
+ },
1552
+ {
1553
+ key: "_searchLogical",
1554
+ value: function (e) {
1555
+ var t = this,
1556
+ n = (function (e, t) {
1557
+ var n =
1558
+ arguments.length > 2 && void 0 !== arguments[2]
1559
+ ? arguments[2]
1560
+ : {},
1561
+ r = n.auto,
1562
+ i = void 0 === r || r,
1563
+ o = function e(n) {
1564
+ var r = Object.keys(n),
1565
+ o = ae(n);
1566
+ if (!o && r.length > 1 && !ce(n)) return e(ue(n));
1567
+ if (se(n)) {
1568
+ var c = o ? n[ie] : r[0],
1569
+ a = o ? n[oe] : n[c];
1570
+ if (!g(a)) throw new Error(x(c));
1571
+ var s = { keyId: j(c), pattern: a };
1572
+ return i && (s.searcher = te(a, t)), s;
1573
+ }
1574
+ var u = { children: [], operator: r[0] };
1575
+ return (
1576
+ r.forEach(function (t) {
1577
+ var r = n[t];
1578
+ v(r) &&
1579
+ r.forEach(function (t) {
1580
+ u.children.push(e(t));
1581
+ });
1582
+ }),
1583
+ u
1584
+ );
1585
+ };
1586
+ return ce(e) || (e = ue(e)), o(e);
1587
+ })(e, this.options),
1588
+ r = this._myIndex.records,
1589
+ i = {},
1590
+ o = [];
1591
+ return (
1592
+ r.forEach(function (e) {
1593
+ var r = e.$,
1594
+ c = e.i;
1595
+ if (k(r)) {
1596
+ var a = (function e(n, r, i) {
1597
+ if (!n.children) {
1598
+ var o = n.keyId,
1599
+ c = n.searcher,
1600
+ a = t._findMatches({
1601
+ key: t._keyStore.get(o),
1602
+ value: t._myIndex.getValueForItemAtKeyId(r, o),
1603
+ searcher: c,
1604
+ });
1605
+ return a && a.length
1606
+ ? [{ idx: i, item: r, matches: a }]
1607
+ : [];
1608
+ }
1609
+ switch (n.operator) {
1610
+ case ne:
1611
+ for (
1612
+ var s = [], u = 0, h = n.children.length;
1613
+ u < h;
1614
+ u += 1
1615
+ ) {
1616
+ var f = e(n.children[u], r, i);
1617
+ if (!f.length) return [];
1618
+ s.push.apply(s, l(f));
1619
+ }
1620
+ return s;
1621
+ case re:
1622
+ for (
1623
+ var d = [], v = 0, g = n.children.length;
1624
+ v < g;
1625
+ v += 1
1626
+ ) {
1627
+ var y = e(n.children[v], r, i);
1628
+ if (y.length) {
1629
+ d.push.apply(d, l(y));
1630
+ break;
1631
+ }
1632
+ }
1633
+ return d;
1634
+ }
1635
+ })(n, r, c);
1636
+ a.length &&
1637
+ (i[c] ||
1638
+ ((i[c] = { idx: c, item: r, matches: [] }),
1639
+ o.push(i[c])),
1640
+ a.forEach(function (e) {
1641
+ var t,
1642
+ n = e.matches;
1643
+ (t = i[c].matches).push.apply(t, l(n));
1644
+ }));
1645
+ }
1646
+ }),
1647
+ o
1648
+ );
1649
+ },
1650
+ },
1651
+ {
1652
+ key: "_searchObjectList",
1653
+ value: function (e) {
1654
+ var t = this,
1655
+ n = te(e, this.options),
1656
+ r = this._myIndex,
1657
+ i = r.keys,
1658
+ o = r.records,
1659
+ c = [];
1660
+ return (
1661
+ o.forEach(function (e) {
1662
+ var r = e.$,
1663
+ o = e.i;
1664
+ if (k(r)) {
1665
+ var a = [];
1666
+ i.forEach(function (e, i) {
1667
+ a.push.apply(
1668
+ a,
1669
+ l(t._findMatches({ key: e, value: r[i], searcher: n }))
1670
+ );
1671
+ }),
1672
+ a.length && c.push({ idx: o, item: r, matches: a });
1673
+ }
1674
+ }),
1675
+ c
1676
+ );
1677
+ },
1678
+ },
1679
+ {
1680
+ key: "_findMatches",
1681
+ value: function (e) {
1682
+ var t = e.key,
1683
+ n = e.value,
1684
+ r = e.searcher;
1685
+ if (!k(n)) return [];
1686
+ var i = [];
1687
+ if (v(n))
1688
+ n.forEach(function (e) {
1689
+ var n = e.v,
1690
+ o = e.i,
1691
+ c = e.n;
1692
+ if (k(n)) {
1693
+ var a = r.searchIn(n),
1694
+ s = a.isMatch,
1695
+ u = a.score,
1696
+ h = a.indices;
1697
+ s &&
1698
+ i.push({
1699
+ score: u,
1700
+ key: t,
1701
+ value: n,
1702
+ idx: o,
1703
+ norm: c,
1704
+ indices: h,
1705
+ });
1706
+ }
1707
+ });
1708
+ else {
1709
+ var o = n.v,
1710
+ c = n.n,
1711
+ a = r.searchIn(o),
1712
+ s = a.isMatch,
1713
+ u = a.score,
1714
+ h = a.indices;
1715
+ s &&
1716
+ i.push({ score: u, key: t, value: o, norm: c, indices: h });
1717
+ }
1718
+ return i;
1719
+ },
1720
+ },
1721
+ ]),
1722
+ e
1723
+ );
1724
+ })();
1725
+ return (
1726
+ (ve.version = "6.4.6"),
1727
+ (ve.createIndex = $),
1728
+ (ve.parseIndex = function (e) {
1729
+ var t =
1730
+ arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
1731
+ n = t.getFn,
1732
+ r = void 0 === n ? A.getFn : n,
1733
+ i = e.keys,
1734
+ o = e.records,
1735
+ c = new E({ getFn: r });
1736
+ return c.setKeys(i), c.setIndexRecords(o), c;
1737
+ }),
1738
+ (ve.config = A),
1739
+ (function () {
1740
+ ee.push.apply(ee, arguments);
1741
+ })(Z),
1742
+ ve
1743
+ );
1744
+ }),
1745
+ typeof exports == "object" && typeof module != "undefined"
1746
+ ? (module.exports = t())
1747
+ : typeof define == "function" && define.amd
1748
+ ? define(t)
1749
+ : ((e = e || self).Fuse = t());