@gudhub/core 1.1.72 → 1.1.73
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.
|
@@ -8,7 +8,7 @@ export async function filterPreparation(
|
|
|
8
8
|
|
|
9
9
|
const objectMethod = {
|
|
10
10
|
variableMethodcurrent_app() {
|
|
11
|
-
return [variables.current_app_id];
|
|
11
|
+
return [variables.current_app_id || variables.app_id];
|
|
12
12
|
},
|
|
13
13
|
variableMethodelement_app() {
|
|
14
14
|
return [variables.element_app_id];
|
|
@@ -56,6 +56,7 @@ export async function filterPreparation(
|
|
|
56
56
|
// Should be fixed: modification of filters_list valuesArray
|
|
57
57
|
switch (filter.input_type) {
|
|
58
58
|
case "variable":
|
|
59
|
+
filter.valuesArray = [];
|
|
59
60
|
for(const filterValue of filter?.input_value.split(',')) {
|
|
60
61
|
const functionName =
|
|
61
62
|
filter.input_type + "Method" + filterValue;
|
|
@@ -78,7 +79,7 @@ export async function filterPreparation(
|
|
|
78
79
|
break;
|
|
79
80
|
case "field":
|
|
80
81
|
const field_value = await fieldMethod({
|
|
81
|
-
app_id: variables.current_app_id,
|
|
82
|
+
app_id: variables.current_app_id || variables.app_id,
|
|
82
83
|
item_id: variables.item_id,
|
|
83
84
|
field_id: filter.input_value,
|
|
84
85
|
});
|
package/package.json
CHANGED
package/umd/library.min.js
CHANGED
|
@@ -114,7 +114,7 @@ var t="function"==typeof Map&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t
|
|
|
114
114
|
},{"ws":"p58b"}],"TPH7":[function(require,module,exports) {
|
|
115
115
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wss_url=exports.server_url=exports.port=exports.file_server_url=exports.automation_modules_path=exports.async_modules_path=void 0;var e="https://gudhub.com/GudHub_Test";exports.server_url=e;var s="wss://gudhub.com/GudHub/ws/app/";exports.wss_url=s;var r="build/latest/async_modules_node/";exports.async_modules_path=r;var t="build/latest/automation_modules/";exports.automation_modules_path=t;var o="https://gudhub.com";exports.file_server_url=o;var u=9e3;exports.port=u;
|
|
116
116
|
},{}],"DvAj":[function(require,module,exports) {
|
|
117
|
-
"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){e=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(M){f=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),u=new O(n||[]);return i(a,"_invoke",{value:L(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(M){return{type:"throw",arg:M}}}r.wrap=s;var p={};function v(){}function y(){}function d(){}var m={};f(m,u,function(){return this});var g=Object.getPrototypeOf,b=g&&g(g(j([])));b&&b!==n&&o.call(b,u)&&(m=b);var w=d.prototype=v.prototype=Object.create(m);function _(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function x(e,r){var n;i(this,"_invoke",{value:function(i,a){function u(){return new r(function(n,u){!function n(i,a,u,c){var l=h(e[i],e,a);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==t(s)&&o.call(s,"__await")?r.resolve(s.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):r.resolve(s).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,c)})}c(l.arg)}(i,a,n,u)})}return n=n?n.then(u,u):u()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return A()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=E(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=h(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function j(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:A}}function A(){return{value:void 0,done:!0}}return y.prototype=d,i(w,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:y,configurable:!0}),y.displayName=f(d,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},_(x.prototype),f(x.prototype,c,function(){return this}),r.AsyncIterator=x,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new x(s(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(w),f(w,l,"Generator"),f(w,u,function(){return this}),f(w,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=j,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},r}function r(t){return i(t)||o(t)||u(t)||n()}function n(){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 o(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function i(t){if(Array.isArray(t))return c(t)}function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=u(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(l){return void r(l)}u.done?e(c):Promise.resolve(c).then(n,o)}function f(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){l(i,n,o,a,u,"next",t)}function u(t){l(i,n,o,a,u,"throw",t)}a(void 0)})}}function s(t,e,r){return h.apply(this,arguments)}function h(){return(h=f(e().mark(function t(n,o,i){var u,c,l,f,s,h,p,v,y,d,m,g,b,w,_,x=arguments;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(_=function(t){return new Promise(function(e){i.on("gh_value_get",t,function r(n,o){i.destroy("gh_value_get",t,r),e(o)}).emit("gh_value_get",{},t)})},u=x.length>3&&void 0!==x[3]?x[3]:{},c=[],l={variableMethodcurrent_app:function(){return[u.current_app_id]},variableMethodelement_app:function(){return[u.element_app_id]},variableMethodcurrent_item:function(){return["".concat(u.current_app_id||u.app_id,".").concat(u.item_id)]},variableMethoduser_id:function(){return[o.getUser().user_id]},variableMethoduser_email:function(t){return[o.getUser().username]},variableMethodtoday:function(t){var e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);return[r.valueOf().toString()+":"+n.valueOf().toString()]},variableMethodvariable:function(t){return[u[t]]}},!n){t.next=39;break}f=a(n),t.prev=6,f.s();case 8:if((s=f.n()).done){t.next=31;break}if(!(h=s.value)){t.next=28;break}t.t0=h.input_type,t.next="variable"===t.t0?14:"field"===t.t0?18:24;break;case 14:p=a(null==h?void 0:h.input_value.split(","));try{for(p.s();!(v=p.n()).done;)y=v.value,d=h.input_type+"Method"+y,"function"==typeof(m=l[d])?h.valuesArray?(g=h.valuesArray).push.apply(g,r(m())):h.valuesArray=m():h.valuesArray?(b=h.valuesArray).push.apply(b,r(l.variableMethodvariable(y))):h.valuesArray=l.variableMethodvariable(y)}catch(e){p.e(e)}finally{p.f()}return c.push(h),t.abrupt("break",26);case 18:return t.next=20,_({app_id:u.current_app_id,item_id:u.item_id,field_id:h.input_value});case 20:return null!=(w=t.sent)&&h.valuesArray.push(w),c.push(h),t.abrupt("break",26);case 24:return c.push(h),t.abrupt("break",26);case 26:t.next=29;break;case 28:c.push(h);case 29:t.next=8;break;case 31:t.next=36;break;case 33:t.prev=33,t.t1=t.catch(6),f.e(t.t1);case 36:return t.prev=36,f.f(),t.finish(36);case 39:return t.abrupt("return",c);case 40:case"end":return t.stop()}},t,null,[[6,33,36,39]])}))).apply(this,arguments)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.filterPreparation=s;
|
|
117
|
+
"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){e=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(M){f=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),u=new A(n||[]);return i(a,"_invoke",{value:L(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(M){return{type:"throw",arg:M}}}r.wrap=s;var p={};function v(){}function y(){}function d(){}var m={};f(m,u,function(){return this});var g=Object.getPrototypeOf,b=g&&g(g(O([])));b&&b!==n&&o.call(b,u)&&(m=b);var w=d.prototype=v.prototype=Object.create(m);function _(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function x(e,r){var n;i(this,"_invoke",{value:function(i,a){function u(){return new r(function(n,u){!function n(i,a,u,c){var l=h(e[i],e,a);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==t(s)&&o.call(s,"__await")?r.resolve(s.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):r.resolve(s).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,c)})}c(l.arg)}(i,a,n,u)})}return n=n?n.then(u,u):u()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=E(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=h(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:j}}function j(){return{value:void 0,done:!0}}return y.prototype=d,i(w,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:y,configurable:!0}),y.displayName=f(d,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},_(x.prototype),f(x.prototype,c,function(){return this}),r.AsyncIterator=x,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new x(s(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(w),f(w,l,"Generator"),f(w,u,function(){return this}),f(w,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},r}function r(t){return i(t)||o(t)||u(t)||n()}function n(){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 o(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function i(t){if(Array.isArray(t))return c(t)}function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=u(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(l){return void r(l)}u.done?e(c):Promise.resolve(c).then(n,o)}function f(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){l(i,n,o,a,u,"next",t)}function u(t){l(i,n,o,a,u,"throw",t)}a(void 0)})}}function s(t,e,r){return h.apply(this,arguments)}function h(){return(h=f(e().mark(function t(n,o,i){var u,c,l,f,s,h,p,v,y,d,m,g,b,w,_,x=arguments;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(_=function(t){return new Promise(function(e){i.on("gh_value_get",t,function r(n,o){i.destroy("gh_value_get",t,r),e(o)}).emit("gh_value_get",{},t)})},u=x.length>3&&void 0!==x[3]?x[3]:{},c=[],l={variableMethodcurrent_app:function(){return[u.current_app_id||u.app_id]},variableMethodelement_app:function(){return[u.element_app_id]},variableMethodcurrent_item:function(){return["".concat(u.current_app_id||u.app_id,".").concat(u.item_id)]},variableMethoduser_id:function(){return[o.getUser().user_id]},variableMethoduser_email:function(t){return[o.getUser().username]},variableMethodtoday:function(t){var e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);return[r.valueOf().toString()+":"+n.valueOf().toString()]},variableMethodvariable:function(t){return[u[t]]}},!n){t.next=40;break}f=a(n),t.prev=6,f.s();case 8:if((s=f.n()).done){t.next=32;break}if(!(h=s.value)){t.next=29;break}t.t0=h.input_type,t.next="variable"===t.t0?14:"field"===t.t0?19:25;break;case 14:h.valuesArray=[],p=a(null==h?void 0:h.input_value.split(","));try{for(p.s();!(v=p.n()).done;)y=v.value,d=h.input_type+"Method"+y,"function"==typeof(m=l[d])?h.valuesArray?(g=h.valuesArray).push.apply(g,r(m())):h.valuesArray=m():h.valuesArray?(b=h.valuesArray).push.apply(b,r(l.variableMethodvariable(y))):h.valuesArray=l.variableMethodvariable(y)}catch(e){p.e(e)}finally{p.f()}return c.push(h),t.abrupt("break",27);case 19:return t.next=21,_({app_id:u.current_app_id||u.app_id,item_id:u.item_id,field_id:h.input_value});case 21:return null!=(w=t.sent)&&h.valuesArray.push(w),c.push(h),t.abrupt("break",27);case 25:return c.push(h),t.abrupt("break",27);case 27:t.next=30;break;case 29:c.push(h);case 30:t.next=8;break;case 32:t.next=37;break;case 34:t.prev=34,t.t1=t.catch(6),f.e(t.t1);case 37:return t.prev=37,f.f(),t.finish(37);case 40:return t.abrupt("return",c);case 41:case"end":return t.stop()}},t,null,[[6,34,37,40]])}))).apply(this,arguments)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.filterPreparation=s;
|
|
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?Object.setPrototypeOf.bind():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"===b(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.bind():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=k(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,k(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){var t=M(e,"string");return"symbol"===b(t)?t:String(t)}function M(e,t){if("object"!==b(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function b(e){return(b="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 x(e){return Array.isArray?Array.isArray(e):"[object Array]"===R(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var w=1/0;function S(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-w?"-0":t}function L(e){return null==e?"":S(e)}function _(e){return"string"==typeof e}function O(e){return"number"==typeof e}function A(e){return!0===e||!1===e||E(e)&&"[object Boolean]"==R(e)}function j(e){return"object"===b(e)}function E(e){return j(e)&&null!==e}function I(e){return null!=e}function C(e){return!e.trim().length}function R(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var $="Extended search is not available",P="Incorrect 'index' type",N=function(e){return"Invalid value for key ".concat(e)},F=function(e){return"Pattern length exceeds max of ".concat(e,".")},W=function(e){return"Missing ".concat(e," property in key")},T=function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")},D=Object.prototype.hasOwnProperty,z=function(){function e(t){var n=this;y(this,e),this._keys=[],this._keyMap={};var r=0;t.forEach(function(e){var t=K(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 K(e){var t=null,n=null,r=null,i=1,o=null;if(_(e)||x(e))r=e,t=q(e),n=B(e);else{if(!D.call(e,"name"))throw new Error(W("name"));var c=e.name;if(r=c,D.call(e,"weight")&&(i=e.weight)<=0)throw new Error(T(c));t=q(c),n=B(c),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function q(e){return x(e)?e:e.split(".")}function B(e){return x(e)?e.join("."):e}function H(e,t){var n=[],r=!1;return function e(t,i,o){if(I(t))if(i[o]){var c=t[i[o]];if(!I(c))return;if(o===i.length-1&&(_(c)||O(c)||A(c)))n.push(L(c));else if(x(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,_(t)?t.split("."):t,0),r?n:n[0]}var J={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},U={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}},V={location:0,threshold:.6,distance:100},Q={useExtendedSearch:!1,getFn:H,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},G=v(v(v(v({},U),J),V),Q),X=/[^ ]+/g;function Y(){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(X).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 Z=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,r=void 0===n?G.getFn:n,i=t.fieldNormWeight,o=void 0===i?G.fieldNormWeight:i;y(this,e),this.norm=Y(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,_(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();_(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(I(e)&&!C(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=t.getFn?t.getFn(e):n.getFn(e,t.path);if(I(o))if(x(o)){for(var c=[],a=[{nestedArrIndex:-1,value:o}];a.length;){var s=a.pop(),u=s.nestedArrIndex,h=s.value;if(I(h))if(_(h)&&!C(h)){var l={v:h,i:u,n:n.norm.get(h)};c.push(l)}else x(h)&&h.forEach(function(e,t){a.push({nestedArrIndex:t,value:e})})}r.$[i]=c}else if(_(o)&&!C(o)){var f={v:o,n:n.norm.get(o)};r.$[i]=f}}),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?G.getFn:r,o=n.fieldNormWeight,c=void 0===o?G.fieldNormWeight:o,a=new Z({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(K)),a.setSources(t),a.create(),a}function te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?G.getFn:n,i=t.fieldNormWeight,o=void 0===i?G.fieldNormWeight:i,c=e.keys,a=e.records,s=new Z({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s}function ne(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?G.distance:s,h=t.ignoreLocation,l=void 0===h?G.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 re(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G.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 ie=32;function oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?G.location:i,c=r.distance,a=void 0===c?G.distance:c,s=r.threshold,u=void 0===s?G.threshold:s,h=r.findAllMatches,l=void 0===h?G.findAllMatches:h,f=r.minMatchCharLength,d=void 0===f?G.minMatchCharLength:f,v=r.includeMatches,g=void 0===v?G.includeMatches:v,y=r.ignoreLocation,p=void 0===y?G.ignoreLocation:y;if(t.length>ie)throw new Error(F(ie));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,w=b,S=d>1||g,L=S?Array(M):[];(m=e.indexOf(t,w))>-1;){var _=ne(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(_,x),w=m+k,S)for(var O=0;O<k;)L[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<$;){ne(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),N=l?M:Math.min(b+$,M)+k,W=Array(N+2);W[N+1]=(1<<C)-1;for(var T=N;T>=P;T-=1){var D=T-1,z=n[e.charAt(D)];if(S&&(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=ne(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(ne(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(S){var q=re(L,d);q.length?g&&(K.indices=q):K.isMatch=!1}return K}function ce(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 ae=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.location,o=void 0===i?G.location:i,c=r.threshold,a=void 0===c?G.threshold:c,s=r.distance,u=void 0===s?G.distance:s,h=r.includeMatches,l=void 0===h?G.includeMatches:h,f=r.findAllMatches,d=void 0===f?G.findAllMatches:f,v=r.minMatchCharLength,g=void 0===v?G.minMatchCharLength:v,p=r.isCaseSensitive,m=void 0===p?G.isCaseSensitive:p,k=r.ignoreLocation,M=void 0===k?G.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:ce(e),startIndex:t})},x=this.pattern.length;if(x>ie){for(var w=0,S=x%ie,L=x-S;w<L;)b(this.pattern.substr(w,ie),w),w+=ie;if(S){var _=x-ie;b(this.pattern.substr(_),_)}}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=oe(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}(),se=function(){function e(t){y(this,e),this.pattern=t}return m(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return ue(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return ue(e,this.singleRegex)}}]),e}();function ue(e,t){var n=e.match(t);return n?n[1]:null}var he=function(t){e(i,se);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}(),le=function(t){e(i,se);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}(),fe=function(t){e(i,se);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}(),de=function(t){e(i,se);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}(),ve=function(t){e(i,se);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}(),ge=function(t){e(i,se);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}(),ye=function(t){e(i,se);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?G.location:o,a=n.threshold,s=void 0===a?G.threshold:a,u=n.distance,h=void 0===u?G.distance:u,l=n.includeMatches,f=void 0===l?G.includeMatches:l,d=n.findAllMatches,v=void 0===d?G.findAllMatches:d,g=n.minMatchCharLength,p=void 0===g?G.minMatchCharLength:g,m=n.isCaseSensitive,k=void 0===m?G.isCaseSensitive:m,M=n.ignoreLocation,b=void 0===M?G.ignoreLocation:M;return y(this,i),(t=r.call(this,e))._bitapSearch=new ae(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}(),pe=function(t){e(i,se);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}(),me=[he,pe,fe,de,ge,ve,le,ye],ke=me.length,Me=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,be="|";function xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split(be).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<ke;){var u=me[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<ke;){var l=me[s],f=l.isSingleMatch(c);if(f){r.push(new l(f,t));break}}}return r})}var we=new Set([ye.type,pe.type]),Se=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.isCaseSensitive,i=void 0===r?G.isCaseSensitive:r,o=n.includeMatches,c=void 0===o?G.includeMatches:o,a=n.minMatchCharLength,s=void 0===a?G.minMatchCharLength:a,u=n.ignoreLocation,h=void 0===u?G.ignoreLocation:u,l=n.findAllMatches,f=void 0===l?G.findAllMatches:l,d=n.location,v=void 0===d?G.location:d,g=n.threshold,p=void 0===g?G.threshold:g,m=n.distance,k=void 0===m?G.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=xe(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;we.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}(),Le=[];function _e(){Le.push.apply(Le,arguments)}function Oe(e,t){for(var n=0,r=Le.length;n<r;n+=1){var i=Le[n];if(i.condition(e,t))return new i(e,t)}return new ae(e,t)}var Ae={AND:"$and",OR:"$or"},je={PATH:"$path",PATTERN:"$val"},Ee=function(e){return!(!e[Ae.AND]&&!e[Ae.OR])},Ie=function(e){return!!e[je.PATH]},Ce=function(e){return!x(e)&&j(e)&&!Ee(e)},Re=function(e){return g({},Ae.AND,Object.keys(e).map(function(t){return g({},t,e[t])}))};function $e(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n;return Ee(e)||(e=Re(e)),function e(n){var i=Object.keys(n),o=Ie(n);if(!o&&i.length>1&&!Ee(n))return e(Re(n));if(Ce(n)){var c=o?n[je.PATH]:i[0],a=o?n[je.PATTERN]:n[c];if(!_(a))throw new Error(N(c));var s={keyId:B(c),pattern:a};return r&&(s.searcher=Oe(a,t)),s}var u={children:[],operator:i[0]};return i.forEach(function(t){var r=n[t];x(r)&&r.forEach(function(t){u.children.push(e(t))})}),u}(e)}function Pe(e,t){var n=t.ignoreFieldNorm,r=void 0===n?G.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 Ne(e,t){var n=e.matches;t.matches=[],I(n)&&n.forEach(function(e){if(I(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 Fe(e,t){t.score=e.score}function We(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?G.includeMatches:r,o=n.includeScore,c=void 0===o?G.includeScore:o,a=[];return i&&a.push(Ne),c&&a.push(Fe),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 Te=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({},G),n),this.options.useExtendedSearch,this._keyStore=new z(this.options.keys),this.setCollection(t,r)}return m(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof Z))throw new Error(P);this._myIndex=t||ee(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){I(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=_(e)?_(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Pe(u,{ignoreFieldNorm:s}),c&&u.sort(a),O(n)&&n>-1&&(u=u.slice(0,n)),We(u,this._docs,{includeMatches:i,includeScore:o})}},{key:"_searchStringList",value:function(e){var t=Oe(e,this.options),n=this._myIndex.records,r=[];return n.forEach(function(e){var n=e.v,i=e.i,o=e.n;if(I(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=$e(e,this.options),r=this._myIndex.records,i={},o=[];return r.forEach(function(e){var r=e.$,c=e.i;if(I(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===Ae.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=Oe(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(I(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(!I(n))return[];var i=[];if(x(n))n.forEach(function(e){var n=e.v,o=e.i,c=e.n;if(I(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=Te,Te.version="6.6.2",Te.createIndex=ee,Te.parseIndex=te,Te.config=G,Te.parseQuery=$e,_e(Se);
|
|
120
120
|
},{}],"zsiC":[function(require,module,exports) {
|