@gudhub/core 1.1.23 → 1.1.24
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.
|
@@ -53,7 +53,8 @@ export function getDate({ type, date = 0, match = true } = {}, itemTime) {
|
|
|
53
53
|
|
|
54
54
|
case "week":
|
|
55
55
|
const weekStart = newDate.getDate() - newDate.getDay();
|
|
56
|
-
const
|
|
56
|
+
const daysToEnd = date == -2 ? 13 : 6;
|
|
57
|
+
const weekEnd = weekStart + daysToEnd;
|
|
57
58
|
const weekDayStart = newDate.setDate(weekStart + date * 7);
|
|
58
59
|
const weekDayEnd = newDate.setDate(weekEnd + date * 7);
|
|
59
60
|
|
package/package.json
CHANGED
package/umd/library.min.js
CHANGED
|
@@ -118,7 +118,7 @@ var t="function"==typeof Map&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t
|
|
|
118
118
|
},{}],"jqRt":[function(require,module,exports) {
|
|
119
119
|
"use strict";function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)}function t(e,n){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,n)}function n(e){var t=o();return function(){var n,i=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return r(this,n)}}function r(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e){return l(e)||h(e)||u(e)||s()}function s(){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 u(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e){if(Array.isArray(e))return f(e)}function f(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 d(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 v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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 m(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function k(e){return(k="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})(e)}function M(e){return Array.isArray?Array.isArray(e):"[object Array]"===I(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var b=1/0;function x(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-b?"-0":t}function w(e){return null==e?"":x(e)}function L(e){return"string"==typeof e}function _(e){return"number"==typeof e}function S(e){return!0===e||!1===e||A(e)&&"[object Boolean]"==I(e)}function O(e){return"object"===k(e)}function A(e){return O(e)&&null!==e}function j(e){return null!=e}function E(e){return!e.trim().length}function I(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var C="Extended search is not available",R="Incorrect 'index' type",$=function(e){return"Invalid value for key ".concat(e)},N=function(e){return"Pattern length exceeds max of ".concat(e,".")},P=function(e){return"Missing ".concat(e," property in key")},F=function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")},W=Object.prototype.hasOwnProperty,T=function(){function e(t){var n=this;y(this,e),this._keys=[],this._keyMap={};var r=0;t.forEach(function(e){var t=D(e);r+=t.weight,n._keys.push(t),n._keyMap[t.id]=t,r+=t.weight}),this._keys.forEach(function(e){e.weight/=r})}return m(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 D(e){var t=null,n=null,r=null,i=1;if(L(e)||M(e))r=e,t=z(e),n=K(e);else{if(!W.call(e,"name"))throw new Error(P("name"));var o=e.name;if(r=o,W.call(e,"weight")&&(i=e.weight)<=0)throw new Error(F(o));t=z(o),n=K(o)}return{path:t,id:n,weight:i,src:r}}function z(e){return M(e)?e:e.split(".")}function K(e){return M(e)?e.join("."):e}function q(e,t){var n=[],r=!1;return function e(t,i,o){if(j(t))if(i[o]){var c=t[i[o]];if(!j(c))return;if(o===i.length-1&&(L(c)||_(c)||S(c)))n.push(w(c));else if(M(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,L(t)?t.split("."):t,0),r?n:n[0]}var B={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},H={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}},J={location:0,threshold:.6,distance:100},U={useExtendedSearch:!1,getFn:q,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},V=v(v(v(v({},H),B),J),U),Q=/[^ ]+/g;function G(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(Q).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);return n.set(i,c),c},clear:function(){n.clear()}}}var X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,r=void 0===n?V.getFn:n,i=t.fieldNormWeight,o=void 0===i?V.fieldNormWeight:i;y(this,e),this.norm=G(o,3),this.getFn=r,this.isCreated=!1,this.setIndexRecords()}return m(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,L(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();L(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(j(e)&&!E(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(j(o))if(M(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var c=t.pop(),a=c.nestedArrIndex,s=c.value;if(j(s))if(L(s)&&!E(s)){var u={v:s,i:a,n:n.norm.get(s)};e.push(u)}else M(s)&&s.forEach(function(e,n){t.push({nestedArrIndex:n,value:e})})}r.$[i]=e}();else if(!E(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 Y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?V.getFn:r,o=n.fieldNormWeight,c=void 0===o?V.fieldNormWeight:o,a=new X({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(D)),a.setSources(t),a.create(),a}function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?V.getFn:n,i=t.fieldNormWeight,o=void 0===i?V.fieldNormWeight:i,c=e.keys,a=e.records,s=new X({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s}function ee(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?V.distance:s,h=t.ignoreLocation,l=void 0===h?V.ignoreLocation:h,f=r/e.length;if(l)return f;var d=Math.abs(a-o);return u?f+d/u:d?1:f}function te(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V.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}var ne=32;function re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?V.location:i,c=r.distance,a=void 0===c?V.distance:c,s=r.threshold,u=void 0===s?V.threshold:s,h=r.findAllMatches,l=void 0===h?V.findAllMatches:h,f=r.minMatchCharLength,d=void 0===f?V.minMatchCharLength:f,v=r.includeMatches,g=void 0===v?V.includeMatches:v,y=r.ignoreLocation,p=void 0===y?V.ignoreLocation:y;if(t.length>ne)throw new Error(N(ne));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,w=b,L=d>1||g,_=L?Array(M):[];(m=e.indexOf(t,w))>-1;){var S=ee(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(S,x),w=m+k,L)for(var O=0;O<k;)_[m+O]=1,O+=1}w=-1;for(var A=[],j=1,E=k+M,I=1<<k-1,C=0;C<k;C+=1){for(var R=0,$=E;R<$;){ee(t,{errors:C,currentLocation:b+$,expectedLocation:b,distance:a,ignoreLocation:p})<=x?R=$:E=$,$=Math.floor((E-R)/2+R)}E=$;var P=Math.max(1,b-$+1),F=l?M:Math.min(b+$,M)+k,W=Array(F+2);W[F+1]=(1<<C)-1;for(var T=F;T>=P;T-=1){var D=T-1,z=n[e.charAt(D)];if(L&&(_[D]=+!!z),W[T]=(W[T+1]<<1|1)&z,C&&(W[T]|=(A[T+1]|A[T])<<1|1|A[T+1]),W[T]&I&&(j=ee(t,{errors:C,currentLocation:D,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=j,(w=D)<=b)break;P=Math.max(1,2*b-w)}}if(ee(t,{errors:C+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=W}var K={isMatch:w>=0,score:Math.max(.001,j)};if(L){var q=te(_,d);q.length?g&&(K.indices=q):K.isMatch=!1}return K}function ie(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 oe=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.location,o=void 0===i?V.location:i,c=r.threshold,a=void 0===c?V.threshold:c,s=r.distance,u=void 0===s?V.distance:s,h=r.includeMatches,l=void 0===h?V.includeMatches:h,f=r.findAllMatches,d=void 0===f?V.findAllMatches:f,v=r.minMatchCharLength,g=void 0===v?V.minMatchCharLength:v,p=r.isCaseSensitive,m=void 0===p?V.isCaseSensitive:p,k=r.ignoreLocation,M=void 0===k?V.ignoreLocation:k;if(y(this,e),this.options={location:o,threshold:a,distance:u,includeMatches:l,findAllMatches:d,minMatchCharLength:g,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){n.chunks.push({pattern:e,alphabet:ie(e),startIndex:t})},x=this.pattern.length;if(x>ne){for(var w=0,L=x%ne,_=x-L;w<_;)b(this.pattern.substr(w,ne),w),w+=ne;if(L){var S=x-ne;b(this.pattern.substr(S),S)}}else b(this.pattern,0)}}return m(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,s=o.distance,u=o.threshold,h=o.findAllMatches,l=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=re(e,n,i,{location:c+o,distance:s,threshold:u,findAllMatches:h,minMatchCharLength:l,includeMatches:r,ignoreLocation:f}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(a(d),a(k)))});var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),ce=function(){function e(t){y(this,e),this.pattern=t}return m(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return ae(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return ae(e,this.singleRegex)}}]),e}();function ae(e,t){var n=e.match(t);return n?n[1]:null}var se=function(t){e(i,ce);var r=n(i);function i(e){return y(this,i),r.call(this,e)}return m(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}(),ue=function(t){e(i,ce);var r=n(i);function i(e){return y(this,i),r.call(this,e)}return m(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}(),he=function(t){e(i,ce);var r=n(i);function i(e){return y(this,i),r.call(this,e)}return m(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}(),le=function(t){e(i,ce);var r=n(i);function i(e){return y(this,i),r.call(this,e)}return m(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}(),fe=function(t){e(i,ce);var r=n(i);function i(e){return y(this,i),r.call(this,e)}return m(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}(),de=function(t){e(i,ce);var r=n(i);function i(e){return y(this,i),r.call(this,e)}return m(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}(),ve=function(t){e(i,ce);var r=n(i);function i(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.location,c=void 0===o?V.location:o,a=n.threshold,s=void 0===a?V.threshold:a,u=n.distance,h=void 0===u?V.distance:u,l=n.includeMatches,f=void 0===l?V.includeMatches:l,d=n.findAllMatches,v=void 0===d?V.findAllMatches:d,g=n.minMatchCharLength,p=void 0===g?V.minMatchCharLength:g,m=n.isCaseSensitive,k=void 0===m?V.isCaseSensitive:m,M=n.ignoreLocation,b=void 0===M?V.ignoreLocation:M;return y(this,i),(t=r.call(this,e))._bitapSearch=new oe(e,{location:c,threshold:s,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),t}return m(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}(),ge=function(t){e(i,ce);var r=n(i);function i(e){return y(this,i),r.call(this,e)}return m(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}(),ye=[se,ge,he,le,de,fe,ue,ve],pe=ye.length,me=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/,ke="|";function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split(ke).map(function(e){for(var n=e.trim().split(me).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<pe;){var u=ye[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<pe;){var l=ye[s],f=l.isSingleMatch(c);if(f){r.push(new l(f,t));break}}}return r})}var be=new Set([ve.type,ge.type]),xe=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.isCaseSensitive,i=void 0===r?V.isCaseSensitive:r,o=n.includeMatches,c=void 0===o?V.includeMatches:o,a=n.minMatchCharLength,s=void 0===a?V.minMatchCharLength:a,u=n.ignoreLocation,h=void 0===u?V.ignoreLocation:u,l=n.findAllMatches,f=void 0===l?V.findAllMatches:l,d=n.location,v=void 0===d?V.location:d,g=n.threshold,p=void 0===g?V.threshold:g,m=n.distance,k=void 0===m?V.distance:m;y(this,e),this.query=null,this.options={isCaseSensitive:i,includeMatches:c,minMatchCharLength:s,findAllMatches:f,ignoreLocation:h,location:v,threshold:p,distance:k},this.pattern=i?t:t.toLowerCase(),this.query=Me(this.pattern,this.options)}return m(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,s=0,u=t.length;s<u;s+=1){var h=t[s];o.length=0,i=0;for(var l=0,f=h.length;l<f;l+=1){var d=h[l],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;be.has(m)?o=[].concat(a(o),a(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}(),we=[];function Le(){we.push.apply(we,arguments)}function _e(e,t){for(var n=0,r=we.length;n<r;n+=1){var i=we[n];if(i.condition(e,t))return new i(e,t)}return new oe(e,t)}var Se={AND:"$and",OR:"$or"},Oe={PATH:"$path",PATTERN:"$val"},Ae=function(e){return!(!e[Se.AND]&&!e[Se.OR])},je=function(e){return!!e[Oe.PATH]},Ee=function(e){return!M(e)&&O(e)&&!Ae(e)},Ie=function(e){return g({},Se.AND,Object.keys(e).map(function(t){return g({},t,e[t])}))};function Ce(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n;return Ae(e)||(e=Ie(e)),function e(n){var i=Object.keys(n),o=je(n);if(!o&&i.length>1&&!Ae(n))return e(Ie(n));if(Ee(n)){var c=o?n[Oe.PATH]:i[0],a=o?n[Oe.PATTERN]:n[c];if(!L(a))throw new Error($(c));var s={keyId:K(c),pattern:a};return r&&(s.searcher=_e(a,t)),s}var u={children:[],operator:i[0]};return i.forEach(function(t){var r=n[t];M(r)&&r.forEach(function(t){u.children.push(e(t))})}),u}(e)}function Re(e,t){var n=t.ignoreFieldNorm,r=void 0===n?V.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 $e(e,t){var n=e.matches;t.matches=[],j(n)&&n.forEach(function(e){if(j(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 Ne(e,t){t.score=e.score}function Pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?V.includeMatches:r,o=n.includeScore,c=void 0===o?V.includeScore:o,a=[];return i&&a.push($e),c&&a.push(Ne),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 Fe=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;y(this,e),this.options=v(v({},V),n),this.options.useExtendedSearch,this._keyStore=new T(this.options.keys),this.setCollection(t,r)}return m(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof X))throw new Error(R);this._myIndex=t||Y(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){j(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]:{}).limit,n=void 0===t?-1:t,r=this.options,i=r.includeMatches,o=r.includeScore,c=r.shouldSort,a=r.sortFn,s=r.ignoreFieldNorm,u=L(e)?L(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Re(u,{ignoreFieldNorm:s}),c&&u.sort(a),_(n)&&n>-1&&(u=u.slice(0,n)),Pe(u,this._docs,{includeMatches:i,includeScore:o})}},{key:"_searchStringList",value:function(e){var t=_e(e,this.options),n=this._myIndex.records,r=[];return n.forEach(function(e){var n=e.v,i=e.i,o=e.n;if(j(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=Ce(e,this.options),r=this._myIndex.records,i={},o=[];return r.forEach(function(e){var r=e.$,c=e.i;if(j(r)){var s=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,s=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return s&&s.length?[{idx:i,item:r,matches:s}]:[]}for(var u=[],h=0,l=n.children.length;h<l;h+=1){var f=e(n.children[h],r,i);if(f.length)u.push.apply(u,a(f));else if(n.operator===Se.AND)return[]}return u}(n,r,c);s.length&&(i[c]||(i[c]={idx:c,item:r,matches:[]},o.push(i[c])),s.forEach(function(e){var t,n=e.matches;(t=i[c].matches).push.apply(t,a(n))}))}}),o}},{key:"_searchObjectList",value:function(e){var t=this,n=_e(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(j(r)){var s=[];i.forEach(function(e,i){s.push.apply(s,a(t._findMatches({key:e,value:r[i],searcher:n})))}),s.length&&c.push({idx:o,item:r,matches:s})}}),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!j(n))return[];var i=[];if(M(n))n.forEach(function(e){var n=e.v,o=e.i,c=e.n;if(j(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}();exports.default=Fe,Fe.version="6.5.3",Fe.createIndex=Y,Fe.parseIndex=Z,Fe.config=V,Fe.parseQuery=Ce,Le(xe);
|
|
120
120
|
},{}],"zsiC":[function(require,module,exports) {
|
|
121
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDate=c,exports.getDistanceFromLatLonInKm=l,exports.isSimilarStrings=g,exports.searchValue=d;var e=t(require("fuse.js"));function t(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return i(e)||u(e,t)||a(e,t)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);u=!0);}catch(l){i=!0,a=l}finally{try{u||null==r.return||r.return()}finally{if(i)throw a}}return o}}function i(e){if(Array.isArray(e))return e}function l(e,t){var n=r(e.split(":"),3),a=n[0],o=n[1],u=n[2],i=r(t.split(":"),2),l=i[0],c=i[1],f=s(l-a),h=s(c-o),d=Math.sin(f/2)*Math.sin(f/2)+Math.cos(s(a))*Math.cos(s(l))*Math.sin(h/2)*Math.sin(h/2),v=6371*(2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d)));return Number(u)>=v}function s(e){return e*(Math.PI/180)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type,n=e.date,a=void 0===n?0:n,o=e.match,u=void 0===o||o,i=arguments.length>1?arguments[1]:void 0;if(!i&&t)return!1;var l=new Date,s=!0;switch(t){case"day":var c=h(a),d=h(a+1);s=c<=i&&i<d;break;case"days":if(a<0){var v=h(1);s=h(-6)<=i&&i<v}else{var g=h(),y=h(7);s=g<=i&&i<y}break;case"day_week":s=a===new Date(i).getDay();break;case"week":var w=l.getDate()-l.getDay(),p=w+6,b=r(f(l.setDate(w+7*a),l.setDate(p+7*a)),2),D=b[0],m=b[1];s=D<=i&&i<=m;break;case"month":if(l.getFullYear()!==new Date(i).getFullYear())return!1;s=l.getMonth()+a===new Date(i).getMonth();break;case"year":s=l.getFullYear()+a===new Date(i).getFullYear();break;default:return!0}return u?s:!s}function f(e,t){return[new Date(e),new Date(t)]}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e).valueOf()}function d(e,t){if(e&&e.length)return t?e.filter(function(e){return e.fields.find(function(e){return e.index_value&&-1!==e.index_value.toLowerCase().indexOf(t.toLowerCase())})}):e}var v=new e.default([]);function g(e,t){return v.setCollection(t),Boolean(v.search(e).length)}
|
|
121
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDate=c,exports.getDistanceFromLatLonInKm=l,exports.isSimilarStrings=g,exports.searchValue=d;var e=t(require("fuse.js"));function t(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return i(e)||u(e,t)||a(e,t)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);u=!0);}catch(l){i=!0,a=l}finally{try{u||null==r.return||r.return()}finally{if(i)throw a}}return o}}function i(e){if(Array.isArray(e))return e}function l(e,t){var n=r(e.split(":"),3),a=n[0],o=n[1],u=n[2],i=r(t.split(":"),2),l=i[0],c=i[1],f=s(l-a),h=s(c-o),d=Math.sin(f/2)*Math.sin(f/2)+Math.cos(s(a))*Math.cos(s(l))*Math.sin(h/2)*Math.sin(h/2),v=6371*(2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d)));return Number(u)>=v}function s(e){return e*(Math.PI/180)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type,n=e.date,a=void 0===n?0:n,o=e.match,u=void 0===o||o,i=arguments.length>1?arguments[1]:void 0;if(!i&&t)return!1;var l=new Date,s=!0;switch(t){case"day":var c=h(a),d=h(a+1);s=c<=i&&i<d;break;case"days":if(a<0){var v=h(1);s=h(-6)<=i&&i<v}else{var g=h(),y=h(7);s=g<=i&&i<y}break;case"day_week":s=a===new Date(i).getDay();break;case"week":var w=l.getDate()-l.getDay(),p=w+(-2==a?13:6),b=r(f(l.setDate(w+7*a),l.setDate(p+7*a)),2),D=b[0],m=b[1];s=D<=i&&i<=m;break;case"month":if(l.getFullYear()!==new Date(i).getFullYear())return!1;s=l.getMonth()+a===new Date(i).getMonth();break;case"year":s=l.getFullYear()+a===new Date(i).getFullYear();break;default:return!0}return u?s:!s}function f(e,t){return[new Date(e),new Date(t)]}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e).valueOf()}function d(e,t){if(e&&e.length)return t?e.filter(function(e){return e.fields.find(function(e){return e.index_value&&-1!==e.index_value.toLowerCase().indexOf(t.toLowerCase())})}):e}var v=new e.default([]);function g(e,t){return v.setCollection(t),Boolean(v.search(e).length)}
|
|
122
122
|
},{"fuse.js":"jqRt"}],"mbGN":[function(require,module,exports) {
|
|
123
123
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=b;var e=require("./utils.js");function t(e){return(t="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})(e)}function n(e,t){return c(e)||o(e,t)||u(e,t)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function i(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 o(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,i=[],o=!0,c=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(a){c=!0,u=a}finally{try{o||null==n.return||n.return()}finally{if(c)throw u}}return i}}function c(e){if(Array.isArray(e))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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=y();return function(){var n,r=_(e);if(t){var u=_(this).constructor;n=Reflect.construct(r,arguments,u)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(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 p(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(e,t){var n=new j,r=new k;return e&&e.length?e.filter(function(e){return t.filter(function(e){return e.valuesArray.length}).every(function(t){var u=e.fields.find(function(e){return t.field_id==e.field_id});return n.setStrategy(t.search_type).setEntity(u&&null!=u.field_value?u.field_value:null).setFilterValues(t.valuesArray),r.check(n)})}):[]}var k=function(){function t(){g(this,t)}return p(t,[{key:"changeBehavior",value:function(t){switch(t){case"contain_or":this._checkFn=function(e,t){return t.some(function(t){return e.some(function(e){return-1!==e.indexOf(t)})})};break;case"contain_and":this._checkFn=function(e,t){return t.every(function(t){return e.some(function(e){return-1!==e.indexOf(t)})})};break;case"not_contain_or":this._checkFn=function(e,t){return t.some(function(t){return e.every(function(e){return-1===e.indexOf(t)})})};break;case"not_contain_and":this._checkFn=function(e,t){return t.every(function(t){return e.every(function(e){return-1===e.indexOf(t)})})};break;case"equal_or":this._checkFn=function(e,t){return!!e.length&&e.some(function(e){return t.some(function(t){return e==t})})};break;case"equal_and":this._checkFn=function(e,t){if(!e.length)return!1;for(var n=new Set(t);e.length&&n.size;){var r=e.pop();n.has(r)&&n.delete(r)}return!n.size};break;case"not_equal_or":this._checkFn=function(e,t){if(!e.length)return!0;for(var n=new Set(t);e.length&&n.size;){var r=e.pop();if(!n.has(r))return!0}return!1};break;case"not_equal_and":this._checkFn=function(e,t){for(var n=new Set(t);e.length&&n.size;){var r=e.pop();if(n.has(r))return!1}return!0};break;case"bigger":this._checkFn=function(e,t){return t.some(function(t){return e.every(function(e){return e>t})})};break;case"lower":this._checkFn=function(e,t){return t.some(function(t){return e.every(function(e){return e<t})})};break;case"range":this._checkFn=function(e,t){return t.some(function(t){return e.every(function(e){return t.start<=e&&e<t.end})})};break;case"value":this._checkFn=function(e,t){return t.some(function(t){return e.some(function(e){return e==t})})};break;case"search":this._checkFn=function(t,n){return n.some(function(n){return(0,e.isSimilarStrings)(n,t)})};break;case"phone_equal_or":this._checkFn=function(e,t){return!!e.length&&t.some(function(t){return e.some(function(e){return-1!==e.replace(/[^0-9]/g,"").indexOf(t.replace(/[^0-9]/g,""))})})};break;case"distance":this._checkFn=function(t,n){return n.some(function(n){return t.some(function(t){return(0,e.getDistanceFromLatLonInKm)(n,t)})})};break;case"date_in":case"date_out":this._checkFn=function(t,n){return n.some(function(n){return t.some(function(t){return(0,e.getDate)(n,t)})})};break;case"recurring_date":this._checkFn=function(e,t){return t.some(function(t){return e.some(function(e){return gudhub.checkRecurringDate(e,t)})})}}return this}},{key:"check",value:function(e){return this.changeBehavior(e.getCheckOption())._checkFn(e.getEntity(),e.getFilterValues())}}]),t}(),d=function(){function e(){g(this,e)}return p(e,[{key:"convert",value:function(e){return[Number(e)]}},{key:"convertFilterValue",value:function(e){return Number(e)}}]),e}(),m=function(e){a(n,d);var t=f(n);function n(){return g(this,n),t.apply(this,arguments)}return p(n,[{key:"convertFilterValue",value:function(e){return{start:Number(e.split(":")[0]),end:Number(e.split(":")[1])}}}]),n}(),S=function(){function e(){g(this,e)}return p(e,[{key:"convert",value:function(e){return String(null!=e?e:"").toLowerCase().split(",")}},{key:"convertFilterValue",value:function(e){return 0===e?"0":String(e||"").toLowerCase()}}]),e}(),w=function(e){a(r,d);var t=f(r);function r(){return g(this,r),t.apply(this,arguments)}return p(r,[{key:"convertFilterValue",value:function(e){var t=n(e.split(":"),3),r=t[0],u=t[1],i=t[2];return{type:r,date:Number(u),match:!!Number(i)}}}]),r}(),F=function(){function e(){g(this,e)}return p(e,[{key:"convert",value:function(e){return[String(Boolean(e))]}},{key:"convertFilterValue",value:function(e){return String(e)}}]),e}(),O=function(){function e(){g(this,e)}return p(e,[{key:"convert",value:function(e){return[Number(e)]}},{key:"convertFilterValue",value:function(e){return String(e)}}]),e}(),j=function(){function e(){g(this,e),this._strategies={stringStrategy:new S,numberStrategy:new d,booleanStrategy:new F,rangeStrategy:new m,dateStrategy:new w,recurringDateStrategy:new O}}return p(e,[{key:"setStrategy",value:function(e){switch(this._checkOption=e,e){case"contain_or":case"contain_and":case"not_contain_or":case"not_contain_and":case"equal_or":case"equal_and":case"not_equal_or":case"not_equal_and":case"phone_equal_or":case"distance":case"search":this._currentStrategy=this._strategies.stringStrategy;break;case"bigger":case"lower":this._currentStrategy=this._strategies.numberStrategy;break;case"range":this._currentStrategy=this._strategies.rangeStrategy;break;case"date_in":case"date_out":this._currentStrategy=this._strategies.dateStrategy;break;case"value":this._currentStrategy=this._strategies.booleanStrategy;break;case"recurring_date":this._currentStrategy=this._strategies.recurringDateStrategy}return this}},{key:"setEntity",value:function(e){return this._entity=this._currentStrategy.convert(e),this}},{key:"getEntity",value:function(){return this._entity}},{key:"setFilterValues",value:function(e){var t=this,n=Array.isArray(e)?e:[e];return this._filterValues=n.map(function(e){return t._currentStrategy.convertFilterValue(e)}),this}},{key:"getFilterValues",value:function(){return this._filterValues}},{key:"getCheckOption",value:function(){return this._checkOption}}]),e}();
|
|
124
124
|
},{"./utils.js":"zsiC"}],"h8f7":[function(require,module,exports) {
|