@gudhub/core 1.1.151 → 1.1.152

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.
@@ -0,0 +1 @@
1
+ {"sessionId":"5235d71a-3348-478a-938c-e64ad14d702e","pid":34431,"procStart":"Mon Aug 17 14:19:22 2026","acquiredAt":1786977461449}
@@ -43,8 +43,8 @@ export class Utils {
43
43
  );
44
44
  }
45
45
 
46
- filter(items, filter_list) {
47
- return filter(items, filter_list);
46
+ filter(items, filter_list, trash = false) {
47
+ return filter(items, filter_list, trash);
48
48
  }
49
49
 
50
50
  mergeFilters(src, dest) {
@@ -63,7 +63,8 @@ export class Utils {
63
63
  item_id,
64
64
  field_group = "",
65
65
  search,
66
- search_params
66
+ search_params,
67
+ trash = false
67
68
  ) {
68
69
  const modified_filters_list = await this.prefilter(
69
70
  filters_list,
@@ -73,7 +74,7 @@ export class Utils {
73
74
  item_id
74
75
  }
75
76
  );
76
- const itemsList = this.filter(items, modified_filters_list);
77
+ const itemsList = this.filter(items, modified_filters_list, trash);
77
78
  const newItems = this.group(field_group, itemsList);
78
79
  return newItems
79
80
  .filter((newItem) => {
@@ -1,13 +1,13 @@
1
1
  import { getDate, getDistanceFromLatLonInKm, isSimilarStrings } from "./utils.js";
2
2
 
3
- export default function (items, filters) {
3
+ export default function (items, filters, trash = false) {
4
4
  const itemsFilter = new ItemsFilter();
5
5
 
6
6
  if (!items || !items.length) {
7
7
  return [];
8
8
  }
9
9
 
10
- return itemsFilter.filter(filters, items);
10
+ return itemsFilter.filter(filters, items, trash);
11
11
  }
12
12
 
13
13
  class Checker {
@@ -311,7 +311,7 @@ class ItemsFilter {
311
311
 
312
312
  }
313
313
 
314
- filter(filters, items) {
314
+ filter(filters, items, trash = false) {
315
315
  const allFiltersAndStrategy = this.checkIfAllFiltersHaveAndStrategy(filters);
316
316
 
317
317
  const filteredItems = [];
@@ -322,12 +322,12 @@ class ItemsFilter {
322
322
  const shouldCheckTrash = items.some(item =>
323
323
  Object.prototype.hasOwnProperty.call(item, 'trash')
324
324
  );
325
-
326
- for (let item of items) {
327
- if (shouldCheckTrash && item.trash == true) {
328
- continue;
329
- }
330
325
 
326
+ const baseItems = (!trash && shouldCheckTrash)
327
+ ? items.filter((item) => item.trash != true)
328
+ : items;
329
+
330
+ for (let item of baseItems) {
331
331
  let result = true;
332
332
 
333
333
  for (let i = 0; i < activeFilters.length; i++) {
@@ -377,7 +377,7 @@ class ItemsFilter {
377
377
  if (filteredItems.length || filters.length && !filteredItems.length) {
378
378
  return filteredItems;
379
379
  } else {
380
- return items;
380
+ return baseItems;
381
381
  }
382
382
  }
383
383
 
@@ -135,7 +135,27 @@ import { app_8263 } from '../../../fake_server/fake_server_data/app_8263.js';
135
135
  console.log('Average time for filter with and strategy: ', totalTime);
136
136
 
137
137
  });
138
-
138
+
139
+ it('TRASH / should exclude trashed items by default', function() {
140
+ const filteredItems = gudhub.filter(app_8263.items_list, []);
141
+ filteredItems.some((item) => item.item_id === 999999).should.equal(false);
142
+ });
143
+
144
+ it('TRASH / should include trashed items when trash=true', function() {
145
+ const filteredItems = gudhub.filter(app_8263.items_list, [], true);
146
+ filteredItems.some((item) => item.item_id === 999999).should.equal(true);
147
+ });
148
+
149
+ it('GET FILTERED ITEMS / TRASH / should exclude trashed items by default', async function() {
150
+ const filteredItems = await gudhub.getFilteredItems(app_8263.items_list, []);
151
+ filteredItems.some((item) => item.item_id === 999999).should.equal(false);
152
+ });
153
+
154
+ it('GET FILTERED ITEMS / TRASH / should include trashed items when trash=true', async function() {
155
+ const filteredItems = await gudhub.getFilteredItems(app_8263.items_list, [], {}, true);
156
+ filteredItems.some((item) => item.item_id === 999999).should.equal(true);
157
+ });
158
+
139
159
  });
140
160
 
141
161
 
package/GUDHUB/gudhub.js CHANGED
@@ -200,8 +200,8 @@ export class GudHub {
200
200
  }
201
201
 
202
202
  //============ FILTER ==========//
203
- filter(items, filter_list) {
204
- return this.util.filter(items, filter_list);
203
+ filter(items, filter_list, trash = false) {
204
+ return this.util.filter(items, filter_list, trash);
205
205
  }
206
206
 
207
207
  //============ MERGE FILTERS ==========//
@@ -216,7 +216,7 @@ export class GudHub {
216
216
 
217
217
  //============ GET FILTERED ITEMS ==========//
218
218
  //it returns items with applyed filter
219
- getFilteredItems(items, filters_list, options = {}) {
219
+ getFilteredItems(items, filters_list, options = {}, trash=false) {
220
220
  return this.util.getFilteredItems(
221
221
  items,
222
222
  filters_list,
@@ -225,7 +225,8 @@ export class GudHub {
225
225
  options.item_id,
226
226
  options.field_group,
227
227
  options.search,
228
- options.search_params
228
+ options.search_params,
229
+ trash
229
230
  );
230
231
  }
231
232
 
@@ -3272,6 +3272,26 @@ export const app_8263 = {
3272
3272
  ]
3273
3273
  }
3274
3274
  ]
3275
+ },
3276
+ {
3277
+ "item_id": 999999,
3278
+ "trash": true,
3279
+ "index_number": 99999,
3280
+ "last_update": 1526623585000,
3281
+ "fields": [
3282
+ {
3283
+ "field_id": 96608,
3284
+ "element_id": 96608,
3285
+ "field_value": "(405) 390-8453",
3286
+ "data_id": 9999001
3287
+ },
3288
+ {
3289
+ "field_id": 96606,
3290
+ "element_id": 96606,
3291
+ "field_value": "Trashed Company",
3292
+ "data_id": 9999002
3293
+ }
3294
+ ]
3275
3295
  }
3276
3296
  ],
3277
3297
  "field_list": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/core",
3
- "version": "1.1.151",
3
+ "version": "1.1.152",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -236,7 +236,7 @@ var t=arguments[3],e="function"==typeof Map&&Map.prototype,r=Object.getOwnProper
236
236
  },{}],"zsiC":[function(require,module,exports) {
237
237
  "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={}.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=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,i=[],l=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw a}}return i}}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(),b=w+(-2==a?13:6),D=r(f(l.setDate(w+7*a),(new Date).setDate(b+7*a)),2),m=D[0],p=D[1];s=m<=i&&i<=p;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)}
238
238
  },{"fuse.js":"jqRt"}],"mbGN":[function(require,module,exports) {
239
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=m;var e=require("./utils.js");function t(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function n(e,t){return a(e)||i(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 o(e,t);var n={}.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)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,o,i,a=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){s=!0,u=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw u}}return a}}function a(e){if(Array.isArray(e))return e}function c(e,t,n){return t=h(t),s(e,l()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}function s(e,t){if(t&&("object"==g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(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&&v(e,t)}function v(e,t){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function g(e){return(g="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 b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(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,d(r.key),r)}}function p(e,t,n){return t&&_(e.prototype,t),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=k(e,"string");return"symbol"==g(t)?t:t+""}function k(e,t){if("object"!=g(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e,t){var n=new q;return e&&e.length?n.filter(t,e):[]}var S=function(){return p(function e(){b(this,e)},[{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())}}])}(),w=function(){return p(function e(){b(this,e)},[{key:"convert",value:function(e){return[Number(e)]}},{key:"convertFilterValue",value:function(e){return Number(e)}}])}(),F=function(e){function t(){return b(this,t),c(this,t,arguments)}return y(t,w),p(t,[{key:"convertFilterValue",value:function(e){return{start:Number(e.split(":")[0]),end:Number(e.split(":")[1])}}}])}(),O=function(){return p(function e(){b(this,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()}}])}(),j=function(e){function t(){return b(this,t),c(this,t,arguments)}return y(t,w),p(t,[{key:"convertFilterValue",value:function(e){var t=n(e.split(":"),3),r=t[0],u=t[1],o=t[2];return{type:r,date:Number(u),match:!!Number(o)}}}])}(),A=function(){return p(function e(){b(this,e)},[{key:"convert",value:function(e){return[String(Boolean(e))]}},{key:"convertFilterValue",value:function(e){return String(e)}}])}(),V=function(){return p(function e(){b(this,e)},[{key:"convert",value:function(e){return[Number(e)]}},{key:"convertFilterValue",value:function(e){return String(e)}}])}(),P=function(){return p(function e(){b(this,e),this._strategies={stringStrategy:new O,numberStrategy:new w,booleanStrategy:new A,rangeStrategy:new F,dateStrategy:new j,recurringDateStrategy:new V}},[{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}}])}(),q=function(){return p(function e(){b(this,e)},[{key:"filter",value:function(e,n){var r,u=this.checkIfAllFiltersHaveAndStrategy(e),o=[],i=e.filter(function(e){return e.valuesArray.length}),a=n.some(function(e){return Object.prototype.hasOwnProperty.call(e,"trash")}),c=t(n);try{for(c.s();!(r=c.n()).done;){var s=r.value;if(!a||1!=s.trash){for(var f=!0,l=function(){var e=i[h],t=s.fields.find(function(t){return e.field_id==t.field_id}),n=new P,r=new S;switch(n.setStrategy(e.search_type).setEntity(t&&null!=t.field_value?t.field_value:null).setFilterValues(e.valuesArray),e.boolean_strategy){case"and":f=f&&r.check(n);break;case"or":f=f||r.check(n);break;default:f=f&&r.check(n)}if(!f&&u)return 1},h=0;h<i.length&&!l();h++);f&&o.push(s)}}}catch(y){c.e(y)}finally{c.f()}return o.length||e.length&&!o.length?o:n}},{key:"checkIfAllFiltersHaveAndStrategy",value:function(e){return e.every(function(e){return!e.boolean_strategy||"and"==e.boolean_strategy})}}])}();
239
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=m;var e=require("./utils.js");function t(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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,c=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw i}}}}function n(e,t){return c(e)||i(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 o(e,t);var n={}.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)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,o,i,c=[],a=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);a=!0);}catch(e){s=!0,u=e}finally{try{if(!a&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw u}}return c}}function c(e){if(Array.isArray(e))return e}function a(e,t,n){return t=h(t),s(e,l()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}function s(e,t){if(t&&("object"==g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(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&&v(e,t)}function v(e,t){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function g(e){return(g="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 b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(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,d(r.key),r)}}function p(e,t,n){return t&&_(e.prototype,t),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=k(e,"string");return"symbol"==g(t)?t:t+""}function k(e,t){if("object"!=g(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new q;return e&&e.length?r.filter(t,e,n):[]}var S=function(){return p(function e(){b(this,e)},[{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())}}])}(),w=function(){return p(function e(){b(this,e)},[{key:"convert",value:function(e){return[Number(e)]}},{key:"convertFilterValue",value:function(e){return Number(e)}}])}(),F=function(e){function t(){return b(this,t),a(this,t,arguments)}return y(t,w),p(t,[{key:"convertFilterValue",value:function(e){return{start:Number(e.split(":")[0]),end:Number(e.split(":")[1])}}}])}(),O=function(){return p(function e(){b(this,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()}}])}(),j=function(e){function t(){return b(this,t),a(this,t,arguments)}return y(t,w),p(t,[{key:"convertFilterValue",value:function(e){var t=n(e.split(":"),3),r=t[0],u=t[1],o=t[2];return{type:r,date:Number(u),match:!!Number(o)}}}])}(),A=function(){return p(function e(){b(this,e)},[{key:"convert",value:function(e){return[String(Boolean(e))]}},{key:"convertFilterValue",value:function(e){return String(e)}}])}(),V=function(){return p(function e(){b(this,e)},[{key:"convert",value:function(e){return[Number(e)]}},{key:"convertFilterValue",value:function(e){return String(e)}}])}(),P=function(){return p(function e(){b(this,e),this._strategies={stringStrategy:new O,numberStrategy:new w,booleanStrategy:new A,rangeStrategy:new F,dateStrategy:new j,recurringDateStrategy:new V}},[{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}}])}(),q=function(){return p(function e(){b(this,e)},[{key:"filter",value:function(e,n){var r,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.checkIfAllFiltersHaveAndStrategy(e),i=[],c=e.filter(function(e){return e.valuesArray.length}),a=n.some(function(e){return Object.prototype.hasOwnProperty.call(e,"trash")}),s=!u&&a?n.filter(function(e){return 1!=e.trash}):n,f=t(s);try{for(f.s();!(r=f.n()).done;){for(var l=r.value,h=!0,y=function(){var e=c[v],t=l.fields.find(function(t){return e.field_id==t.field_id}),n=new P,r=new S;switch(n.setStrategy(e.search_type).setEntity(t&&null!=t.field_value?t.field_value:null).setFilterValues(e.valuesArray),e.boolean_strategy){case"and":h=h&&r.check(n);break;case"or":h=h||r.check(n);break;default:h=h&&r.check(n)}if(!h&&o)return 1},v=0;v<c.length&&!y();v++);h&&i.push(l)}}catch(g){f.e(g)}finally{f.f()}return i.length||e.length&&!i.length?i:s}},{key:"checkIfAllFiltersHaveAndStrategy",value:function(e){return e.every(function(e){return!e.boolean_strategy||"and"==e.boolean_strategy})}}])}();
240
240
  },{"./utils.js":"zsiC"}],"LXWr":[function(require,module,exports) {
241
241
  "use strict";function e(e,r){var i=[],t=[];if(e.length>0?e.forEach(function(e){t.push(e)}):t=r,t.length>0){t.forEach(function(e,f){for(var n=0;n<r.length;n++)e.field_id==r[n].field_id&&(i.push(e.field_id),t[f]=gudhub.mergeObjects(r[n],e))});for(var f=0;f<r.length;f++)i.includes(r[f].field_id)||t.push(r[f])}return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeFilters=e;
242
242
  },{}],"h8f7":[function(require,module,exports) {
@@ -303,7 +303,7 @@ function o(e){return module.exports=o="function"==typeof Symbol&&"symbol"==typeo
303
303
  },{}],"Owq4":[function(require,module,exports) {
304
304
  "use strict";function e(e,t){if(!e||!e.length)return[];if(!e[0].fields.length)return e;var r=t&&t.sort_field_id||e[0].fields[0].field_id;function s(e){for(var t=null,s=0;s<e.fields.length;s++)if(e.fields[s].field_id==r){t=e.fields[s].field_value;break}return t}return e.sort(function(e,t){var r=s(e),d=s(t);return null===r?-1:null===d?1:/^\d+$/.test(r)&&/^\d+$/.test(d)?Number(r)<Number(d)?-1:1:/^\d+$/.test(r)||/^\d+$/.test(d)?/^\d+$/.test(r)?-1:1:r.toLowerCase()>d.toLowerCase()?1:-1}),t&&t.descending?e.reverse():e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.sortItems=e;
305
305
  },{}],"mWlG":[function(require,module,exports) {
306
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Utils=void 0;var e=require("./filter/filterPreparation.js"),t=b(require("./filter/filter.js")),r=require("./filter/mergeFilters.js"),n=require("./json_to_items/json_to_items.js"),i=require("./merge_compare_items/merge_compare_items.js"),o=require("./filter/group.js"),u=require("./filter/utils.js"),s=b(require("./populate_items/populate_items.js")),l=require("./get_date/get_date.js"),a=require("./merge_objects/merge_objects.js"),c=require("./merge_chunks/merge_chunks.js"),f=require("./nested_list/nested_list.js"),p=b(require("./MergeFields/MergeFields.js")),m=b(require("./ItemsSelection/ItemsSelection.js")),v=require("./compare_items_lists_worker/compare_items_lists.worker.js"),y=require("./json_constructor/json_constructor.js"),h=b(require("./AppsTemplateService/AppsTemplateService.js")),d=require("./FIleHelper/FileHelper.js"),g=require("./compareObjects/compareObjects.js"),j=require("./dynamicPromiseAll/dynamicPromiseAll.js"),k=require("./filter/sortItems.js");function b(e){return e&&e.__esModule?e:{default:e}}function _(e){return(_="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 I(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var l=n&&n.prototype instanceof s?n:s,a=Object.create(l.prototype);return w(a,"_invoke",function(r,n,i){var o,s,l,a=0,c=i||[],f=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return o=t,s=0,l=e,p.n=r,u}};function m(r,n){for(s=r,l=n,t=0;!f&&a&&!i&&t<c.length;t++){var i,o=c[t],m=p.p,v=o[2];r>3?(i=v===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((i=r<2&&m<o[1])?(s=0,p.v=n,p.n=o[1]):m<v&&(i=r<3||o[0]>n||n>v)&&(o[4]=r,o[5]=n,p.n=v,s=0))}if(i||r>1)return u;throw f=!0,n}return function(i,c,v){if(a>1)throw TypeError("Generator is already running");for(f&&1===c&&m(c,v),s=c,l=v;(t=s<2?e:l)||!f;){o||(s?s<3?(s>1&&(p.n=-1),m(s,l)):p.n=l:p.v=l);try{if(a=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=p.n<0)?l:r.call(n,p))!==u)break}catch(t){o=e,s=1,l=t}finally{a=1}}return{value:t,done:f}}}(r,i,o),!0),a}var u={};function s(){}function l(){}function a(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(w(t={},n,function(){return this}),t),f=a.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,w(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return l.prototype=a,w(f,"constructor",a),w(a,"constructor",l),l.displayName="GeneratorFunction",w(a,i,"GeneratorFunction"),w(f),w(f,i,"Generator"),w(f,n,function(){return this}),w(f,"toString",function(){return"[object Generator]"}),(I=function(){return{w:o,m:p}})()}function w(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(w=function(e,t,r,n){function o(t,r){w(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,n)}function S(e,t,r,n,i,o,u){try{var s=e[o](u),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function F(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function u(e){S(o,n,i,u,s,"next",e)}function s(e){S(o,n,i,u,s,"throw",e)}u(void 0)})}}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P(n.key),n)}}function O(e,t,r){return t&&q(e.prototype,t),r&&q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function P(e){var t=A(e,"string");return"symbol"==_(t)?t:t+""}function A(e,t){if("object"!=_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=exports.Utils=function(){return O(function e(t){T(this,e),this.gudhub=t,this.MergeFields=new p.default(t),this.ItemsSelection=new m.default(t),this.AppsTemplateService=new h.default(t),this.FileHelper=new d.FileHelper(t)},[{key:"prefilter",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,e.filterPreparation)(t,this.gudhub.storage,this.gudhub.pipeService,r)}},{key:"filter",value:function(e,r){return(0,t.default)(e,r)}},{key:"mergeFilters",value:function(e,t){return(0,r.mergeFilters)(e,t)}},{key:"group",value:function(e,t){return(0,o.group)(e,t)}},{key:"getFilteredItems",value:function(){var e=F(I().m(function e(){var t,r,n,i,o,s,l,a,c,f,p,m=arguments;return I().w(function(e){for(;;)switch(e.n){case 0:return t=m.length>0&&void 0!==m[0]?m[0]:[],r=m.length>1&&void 0!==m[1]?m[1]:[],n=m.length>2?m[2]:void 0,i=m.length>3?m[3]:void 0,o=m.length>4?m[4]:void 0,s=m.length>5&&void 0!==m[5]?m[5]:"",l=m.length>6?m[6]:void 0,a=m.length>7?m[7]:void 0,e.n=1,this.prefilter(r,{element_app_id:n,app_id:i,item_id:o});case 1:return c=e.v,f=this.filter(t,c),p=this.group(s,f),e.a(2,p.filter(function(e){return!l||1===(0,u.searchValue)([e],l).length}).filter(function(e){return!a||1===(0,u.searchValue)([e],a).length}))}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"jsonToItems",value:function(e,t){return(0,n.jsonToItems)(e,t)}},{key:"getDate",value:function(e){return(0,l.getDate)(e)}},{key:"checkRecurringDate",value:function(e,t){return(0,l.checkRecurringDate)(e,t)}},{key:"populateItems",value:function(e,t,r){return(0,s.default)(e,t,r)}},{key:"populateWithDate",value:function(e,t){return(0,l.populateWithDate)(e,t)}},{key:"populateWithItemRef",value:function(e,t,r,n,o,u){return(0,i.populateWithItemRef)(e,t,r,n,o,u)}},{key:"compareItems",value:function(e,t,r){return(0,i.compareItems)(e,t,r)}},{key:"mergeItems",value:function(e,t,r){return(0,i.mergeItems)(e,t,r)}},{key:"mergeObjects",value:function(e,t,r){return(0,a.mergeObjects)(e,t,r)}},{key:"makeNestedList",value:function(e,t,r,n,i){return(0,f.makeNestedList)(e,t,r,n,i)}},{key:"mergeChunks",value:function(e){return(0,c.mergeChunks)(e)}},{key:"mergeFieldLists",value:function(e,t){return this.MergeFields.mergeFieldLists(e,t)}},{key:"createFieldsListToView",value:function(e,t){return this.MergeFields.createFieldsListToView(e,t)}},{key:"createFieldsListToViewWithDataType",value:function(e,t){return this.MergeFields.createFieldsListToViewWithDataType(e,t)}},{key:"selectItems",value:function(e,t){return this.ItemsSelection.selectItems(e,t)}},{key:"getSelectedItems",value:function(e){return this.ItemsSelection.getSelectedItems(e)}},{key:"clearSelectedItems",value:function(e){return this.ItemsSelection.clearSelectedItems(e)}},{key:"isItemSelected",value:function(e,t){return this.ItemsSelection.isItemSelected(e,t)}},{key:"jsonConstructor",value:function(e,t,r,n){return(0,y.compiler)(e,t,this,r,n)}},{key:"fileInstallerHelper",value:function(e,t,r,n,i,o){return this.FileHelper.fileInstallerHelper(e,t,r,n,i,o)}},{key:"createAppsFromTemplate",value:function(e,t,r,n,i,o){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,n,i,o)}},{key:"createApps",value:function(e){return this.AppsTemplateService.createApps(e)}},{key:"createItems",value:function(e,t){return this.AppsTemplateService.createItems(e,t)}},{key:"compareObjects",value:function(e,t){return(0,g.compareObjects)(e,t)}},{key:"compareAppsItemsLists",value:function(e,t,r){var n=new Blob([(0,v.compare_items_lists_Worker)()],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",function(e){var t=e.data.diff;r(t)})}},{key:"dynamicPromiseAll",value:function(e){return(0,j.dynamicPromiseAll)(e)}},{key:"sortItems",value:function(e,t){return(0,k.sortItems)(e,t)}},{key:"debounce",value:function(e,t){var r;return function(){for(var n=this,i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];clearTimeout(r),r=setTimeout(function(){e.apply(n,o)},t)}}}])}();
306
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Utils=void 0;var e=require("./filter/filterPreparation.js"),t=b(require("./filter/filter.js")),r=require("./filter/mergeFilters.js"),n=require("./json_to_items/json_to_items.js"),i=require("./merge_compare_items/merge_compare_items.js"),o=require("./filter/group.js"),u=require("./filter/utils.js"),s=b(require("./populate_items/populate_items.js")),l=require("./get_date/get_date.js"),a=require("./merge_objects/merge_objects.js"),c=require("./merge_chunks/merge_chunks.js"),f=require("./nested_list/nested_list.js"),p=b(require("./MergeFields/MergeFields.js")),m=b(require("./ItemsSelection/ItemsSelection.js")),v=require("./compare_items_lists_worker/compare_items_lists.worker.js"),y=require("./json_constructor/json_constructor.js"),h=b(require("./AppsTemplateService/AppsTemplateService.js")),d=require("./FIleHelper/FileHelper.js"),g=require("./compareObjects/compareObjects.js"),j=require("./dynamicPromiseAll/dynamicPromiseAll.js"),k=require("./filter/sortItems.js");function b(e){return e&&e.__esModule?e:{default:e}}function _(e){return(_="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 I(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var l=n&&n.prototype instanceof s?n:s,a=Object.create(l.prototype);return w(a,"_invoke",function(r,n,i){var o,s,l,a=0,c=i||[],f=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return o=t,s=0,l=e,p.n=r,u}};function m(r,n){for(s=r,l=n,t=0;!f&&a&&!i&&t<c.length;t++){var i,o=c[t],m=p.p,v=o[2];r>3?(i=v===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((i=r<2&&m<o[1])?(s=0,p.v=n,p.n=o[1]):m<v&&(i=r<3||o[0]>n||n>v)&&(o[4]=r,o[5]=n,p.n=v,s=0))}if(i||r>1)return u;throw f=!0,n}return function(i,c,v){if(a>1)throw TypeError("Generator is already running");for(f&&1===c&&m(c,v),s=c,l=v;(t=s<2?e:l)||!f;){o||(s?s<3?(s>1&&(p.n=-1),m(s,l)):p.n=l:p.v=l);try{if(a=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=p.n<0)?l:r.call(n,p))!==u)break}catch(t){o=e,s=1,l=t}finally{a=1}}return{value:t,done:f}}}(r,i,o),!0),a}var u={};function s(){}function l(){}function a(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(w(t={},n,function(){return this}),t),f=a.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,w(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return l.prototype=a,w(f,"constructor",a),w(a,"constructor",l),l.displayName="GeneratorFunction",w(a,i,"GeneratorFunction"),w(f),w(f,i,"Generator"),w(f,n,function(){return this}),w(f,"toString",function(){return"[object Generator]"}),(I=function(){return{w:o,m:p}})()}function w(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(w=function(e,t,r,n){function o(t,r){w(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,n)}function S(e,t,r,n,i,o,u){try{var s=e[o](u),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function F(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function u(e){S(o,n,i,u,s,"next",e)}function s(e){S(o,n,i,u,s,"throw",e)}u(void 0)})}}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P(n.key),n)}}function O(e,t,r){return t&&q(e.prototype,t),r&&q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function P(e){var t=A(e,"string");return"symbol"==_(t)?t:t+""}function A(e,t){if("object"!=_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=exports.Utils=function(){return O(function e(t){T(this,e),this.gudhub=t,this.MergeFields=new p.default(t),this.ItemsSelection=new m.default(t),this.AppsTemplateService=new h.default(t),this.FileHelper=new d.FileHelper(t)},[{key:"prefilter",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,e.filterPreparation)(t,this.gudhub.storage,this.gudhub.pipeService,r)}},{key:"filter",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,t.default)(e,r,n)}},{key:"mergeFilters",value:function(e,t){return(0,r.mergeFilters)(e,t)}},{key:"group",value:function(e,t){return(0,o.group)(e,t)}},{key:"getFilteredItems",value:function(){var e=F(I().m(function e(){var t,r,n,i,o,s,l,a,c,f,p,m,v=arguments;return I().w(function(e){for(;;)switch(e.n){case 0:return t=v.length>0&&void 0!==v[0]?v[0]:[],r=v.length>1&&void 0!==v[1]?v[1]:[],n=v.length>2?v[2]:void 0,i=v.length>3?v[3]:void 0,o=v.length>4?v[4]:void 0,s=v.length>5&&void 0!==v[5]?v[5]:"",l=v.length>6?v[6]:void 0,a=v.length>7?v[7]:void 0,c=v.length>8&&void 0!==v[8]&&v[8],e.n=1,this.prefilter(r,{element_app_id:n,app_id:i,item_id:o});case 1:return f=e.v,p=this.filter(t,f,c),m=this.group(s,p),e.a(2,m.filter(function(e){return!l||1===(0,u.searchValue)([e],l).length}).filter(function(e){return!a||1===(0,u.searchValue)([e],a).length}))}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"jsonToItems",value:function(e,t){return(0,n.jsonToItems)(e,t)}},{key:"getDate",value:function(e){return(0,l.getDate)(e)}},{key:"checkRecurringDate",value:function(e,t){return(0,l.checkRecurringDate)(e,t)}},{key:"populateItems",value:function(e,t,r){return(0,s.default)(e,t,r)}},{key:"populateWithDate",value:function(e,t){return(0,l.populateWithDate)(e,t)}},{key:"populateWithItemRef",value:function(e,t,r,n,o,u){return(0,i.populateWithItemRef)(e,t,r,n,o,u)}},{key:"compareItems",value:function(e,t,r){return(0,i.compareItems)(e,t,r)}},{key:"mergeItems",value:function(e,t,r){return(0,i.mergeItems)(e,t,r)}},{key:"mergeObjects",value:function(e,t,r){return(0,a.mergeObjects)(e,t,r)}},{key:"makeNestedList",value:function(e,t,r,n,i){return(0,f.makeNestedList)(e,t,r,n,i)}},{key:"mergeChunks",value:function(e){return(0,c.mergeChunks)(e)}},{key:"mergeFieldLists",value:function(e,t){return this.MergeFields.mergeFieldLists(e,t)}},{key:"createFieldsListToView",value:function(e,t){return this.MergeFields.createFieldsListToView(e,t)}},{key:"createFieldsListToViewWithDataType",value:function(e,t){return this.MergeFields.createFieldsListToViewWithDataType(e,t)}},{key:"selectItems",value:function(e,t){return this.ItemsSelection.selectItems(e,t)}},{key:"getSelectedItems",value:function(e){return this.ItemsSelection.getSelectedItems(e)}},{key:"clearSelectedItems",value:function(e){return this.ItemsSelection.clearSelectedItems(e)}},{key:"isItemSelected",value:function(e,t){return this.ItemsSelection.isItemSelected(e,t)}},{key:"jsonConstructor",value:function(e,t,r,n){return(0,y.compiler)(e,t,this,r,n)}},{key:"fileInstallerHelper",value:function(e,t,r,n,i,o){return this.FileHelper.fileInstallerHelper(e,t,r,n,i,o)}},{key:"createAppsFromTemplate",value:function(e,t,r,n,i,o){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,n,i,o)}},{key:"createApps",value:function(e){return this.AppsTemplateService.createApps(e)}},{key:"createItems",value:function(e,t){return this.AppsTemplateService.createItems(e,t)}},{key:"compareObjects",value:function(e,t){return(0,g.compareObjects)(e,t)}},{key:"compareAppsItemsLists",value:function(e,t,r){var n=new Blob([(0,v.compare_items_lists_Worker)()],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",function(e){var t=e.data.diff;r(t)})}},{key:"dynamicPromiseAll",value:function(e){return(0,j.dynamicPromiseAll)(e)}},{key:"sortItems",value:function(e,t){return(0,k.sortItems)(e,t)}},{key:"debounce",value:function(e,t){var r;return function(){for(var n=this,i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];clearTimeout(r),r=setTimeout(function(){e.apply(n,o)},t)}}}])}();
307
307
  },{"./filter/filterPreparation.js":"DvAj","./filter/filter.js":"mbGN","./filter/mergeFilters.js":"LXWr","./json_to_items/json_to_items.js":"UCDv","./merge_compare_items/merge_compare_items.js":"xDLX","./filter/group.js":"VgUi","./filter/utils.js":"zsiC","./populate_items/populate_items.js":"EzAv","./get_date/get_date.js":"VzfS","./merge_objects/merge_objects.js":"EE1j","./merge_chunks/merge_chunks.js":"AMYJ","./nested_list/nested_list.js":"S7Iy","./MergeFields/MergeFields.js":"vno1","./ItemsSelection/ItemsSelection.js":"DfIi","./compare_items_lists_worker/compare_items_lists.worker.js":"xR4c","./json_constructor/json_constructor.js":"nKaW","./AppsTemplateService/AppsTemplateService.js":"zqOZ","./FIleHelper/FileHelper.js":"E7yc","./compareObjects/compareObjects.js":"AefJ","./dynamicPromiseAll/dynamicPromiseAll.js":"ndUf","./filter/sortItems.js":"Owq4"}],"rK64":[function(require,module,exports) {
308
308
  "use strict";function t(r){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})(r)}function r(){var t,n,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",i=o.toStringTag||"@@toStringTag";function a(r,o,u,i){var a=o&&o.prototype instanceof c?o:c,f=Object.create(a.prototype);return e(f,"_invoke",function(r,e,o){var u,i,a,c=0,f=o||[],p=!1,l={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(r,e){return u=r,i=0,a=t,l.n=e,s}};function h(r,e){for(i=r,a=e,n=0;!p&&c&&!o&&n<f.length;n++){var o,u=f[n],h=l.p,v=u[2];r>3?(o=v===e)&&(a=u[(i=u[4])?5:(i=3,3)],u[4]=u[5]=t):u[0]<=h&&((o=r<2&&h<u[1])?(i=0,l.v=e,l.n=u[1]):h<v&&(o=r<3||u[0]>e||e>v)&&(u[4]=r,u[5]=e,l.n=v,i=0))}if(o||r>1)return s;throw p=!0,e}return function(o,f,v){if(c>1)throw TypeError("Generator is already running");for(p&&1===f&&h(f,v),i=f,a=v;(n=i<2?t:a)||!p;){u||(i?i<3?(i>1&&(l.n=-1),h(i,a)):l.n=a:l.v=a);try{if(c=2,u){if(i||(o="next"),n=u[o]){if(!(n=n.call(u,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,i<2&&(i=0)}else 1===i&&(n=u.return)&&n.call(u),i<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),i=1);u=t}else if((n=(p=l.n<0)?a:r.call(e,l))!==s)break}catch(n){u=t,i=1,a=n}finally{c=1}}return{value:n,done:p}}}(r,u,i),!0),f}var s={};function c(){}function f(){}function p(){}n=Object.getPrototypeOf;var l=[][u]?n(n([][u]())):(e(n={},u,function(){return this}),n),h=p.prototype=c.prototype=Object.create(l);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,e(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return f.prototype=p,e(h,"constructor",p),e(p,"constructor",f),f.displayName="GeneratorFunction",e(p,i,"GeneratorFunction"),e(h),e(h,i,"Generator"),e(h,u,function(){return this}),e(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:v}})()}function e(t,r,n,o){var u=Object.defineProperty;try{u({},"",{})}catch(t){u=0}(e=function(t,r,n,o){function i(r,n){e(t,r,function(t){return this._invoke(r,n,t)})}r?u?u(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(i("next",0),i("throw",1),i("return",2))})(t,r,n,o)}function n(t,r,e,n,o,u,i){try{var a=t[u](i),s=a.value}catch(t){return void e(t)}a.done?r(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise(function(o,u){var i=t.apply(r,e);function a(t){n(i,o,u,a,s,"next",t)}function s(t){n(i,o,u,a,s,"throw",t)}a(void 0)})}}function u(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function i(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function a(t,r,e){return r&&i(t.prototype,r),e&&i(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(r){var e=c(r,"string");return"symbol"==t(e)?e:e+""}function c(r,e){if("object"!=t(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var o=n.call(r,e||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Auth=void 0;var f=exports.Auth=function(){return a(function t(r,e){u(this,t),this.req=r,this.storage=e},[{key:"login",value:function(){var t=o(r().m(function t(){var e,n,o,u,i,a,s=arguments;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return e=s.length>0&&void 0!==s[0]?s[0]:{},n=e.username,o=e.password,t.p=1,t.n=2,this.loginApi(n,o);case 2:return u=t.v,this.storage.updateUser(u),t.a(2,u);case 3:return t.p=3,a=t.v,t.a(2,{error:(null===(i=a.response)||void 0===i?void 0:i.data)||a.message})}},t,this,[[1,3]])}));return function(){return t.apply(this,arguments)}}()},{key:"loginWithToken",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.loginWithTokenApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"logout",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.logoutApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"signup",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.signupApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateToken",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.updateTokenApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateUser",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.updateUserApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateAvatar",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.avatarUploadApi(e);case 1:return n=t.v,this.storage.updateUser(n),t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getUsersList",value:function(){var t=o(r().m(function t(e){var n;return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getUsersListApi(e);case 1:return n=t.v,t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"loginApi",value:function(){var t=o(r().m(function t(e,n){var o,u,i,a;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{username:e,password:n}});case 1:return o=t.v,t.a(2,o);case 2:return t.p=2,a=t.v,console.log(a),t.a(2,{status:null===(u=a.response)||void 0===u?void 0:u.status,message:null===(i=a.response)||void 0===i?void 0:i.data})}},t,this,[[0,2]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"loginWithTokenApi",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login?accesstoken=").concat(e)});case 1:return n=t.v,t.a(2,n);case 2:t.p=2,o=t.v,console.log(o);case 3:return t.a(2)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()},{key:"updateTokenApi",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{auth_key:e}});case 1:return n=t.v,t.a(2,n);case 2:t.p=2,o=t.v,console.log(o);case 3:return t.a(2)}},t,this,[[0,2]])}));return function(r){return t.apply(this,arguments)}}()},{key:"logoutApi",value:function(t){return this.req.post({url:"/auth/logout",form:{token:t}})}},{key:"signupApi",value:function(t){return this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/singup"),form:{user:JSON.stringify(t)}})}},{key:"getUsersListApi",value:function(t){return this.req.get({url:"/auth/userlist",params:{keyword:t}})}},{key:"updateUserApi",value:function(t){return this.req.post({url:"/auth/updateuser",form:{user:JSON.stringify(t)}})}},{key:"avatarUploadApi",value:function(t){return this.req.post({url:"/auth/avatar-upload",form:{image:t}})}},{key:"getUserByIdApi",value:function(t){return this.req.get({url:"/auth/getuserbyid",params:{id:t}})}},{key:"getVersion",value:function(){return this.req.get({url:"/version"})}},{key:"getUserFromStorage",value:function(t){return this.storage.getUsersList().find(function(r){return r.user_id==t})}},{key:"saveUserToStorage",value:function(t){var r=this.storage.getUsersList(),e=r.find(function(r){return r.user_id==t.user_id});return e||(r.push(t),t)}},{key:"getUserById",value:function(){var t=o(r().m(function t(e){var n,o;return r().w(function(t){for(;;)switch(t.n){case 0:if(n=this.getUserFromStorage(e)){t.n=3;break}return t.n=1,this.getUserByIdApi(e);case 1:if(o=t.v){t.n=2;break}return t.a(2,null);case 2:(n=this.getUserFromStorage(e))||(this.saveUserToStorage(o),n=o);case 3:return t.a(2,n)}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getToken",value:function(){var t=o(r().m(function t(){var e,n,o,u;return r().w(function(t){for(;;)switch(t.n){case 0:if(e=new Date(this.storage.getUser().expirydate),n=new Date,o=this.storage.getUser().accesstoken,!(e<n)&&o){t.n=2;break}return t.n=1,this.updateToken(this.storage.getUser().auth_key);case 1:u=t.v,this.storage.updateUser(u),o=u.accesstoken;case 2:return t.a(2,o)}},t,this)}));return function(){return t.apply(this,arguments)}}()}])}();
309
309
  },{}],"UV2u":[function(require,module,exports) {
@@ -345,7 +345,7 @@ var t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export
345
345
  },{}],"quyV":[function(require,module,exports) {
346
346
  "use strict";function t(){var e,n,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.toStringTag||"@@toStringTag";function a(t,o,i,u){var a=o&&o.prototype instanceof f?o:f,s=Object.create(a.prototype);return r(s,"_invoke",function(t,r,o){var i,u,a,f=0,s=o||[],p=!1,l={p:0,n:0,v:e,a:y,f:y.bind(e,4),d:function(t,r){return i=t,u=0,a=e,l.n=r,c}};function y(t,r){for(u=t,a=r,n=0;!p&&f&&!o&&n<s.length;n++){var o,i=s[n],y=l.p,b=i[2];t>3?(o=b===r)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=y&&((o=t<2&&y<i[1])?(u=0,l.v=r,l.n=i[1]):y<b&&(o=t<3||i[0]>r||r>b)&&(i[4]=t,i[5]=r,l.n=b,u=0))}if(o||t>1)return c;throw p=!0,r}return function(o,s,b){if(f>1)throw TypeError("Generator is already running");for(p&&1===s&&y(s,b),u=s,a=b;(n=u<2?e:a)||!p;){i||(u?u<3?(u>1&&(l.n=-1),y(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(o="next"),n=i[o]){if(!(n=n.call(i,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,u<2&&(u=0)}else 1===u&&(n=i.return)&&n.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((n=(p=l.n<0)?a:t.call(r,l))!==c)break}catch(n){i=e,u=1,a=n}finally{f=1}}return{value:n,done:p}}}(t,i,u),!0),s}var c={};function f(){}function s(){}function p(){}n=Object.getPrototypeOf;var l=[][i]?n(n([][i]())):(r(n={},i,function(){return this}),n),y=p.prototype=f.prototype=Object.create(l);function b(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,r(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t}return s.prototype=p,r(y,"constructor",p),r(p,"constructor",s),s.displayName="GeneratorFunction",r(p,u,"GeneratorFunction"),r(y),r(y,u,"Generator"),r(y,i,function(){return this}),r(y,"toString",function(){return"[object Generator]"}),(t=function(){return{w:a,m:b}})()}function r(t,e,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}(r=function(t,e,n,o){function u(e,n){r(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[e]=n:(u("next",0),u("throw",1),u("return",2))})(t,e,n,o)}function e(t){return(e="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})(t)}function n(t,r,e,n,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void e(t)}a.done?r(c):Promise.resolve(c).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise(function(o,i){var u=t.apply(r,e);function a(t){n(u,o,i,a,c,"next",t)}function c(t){n(u,o,i,a,c,"throw",t)}a(void 0)})}}function i(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function u(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function a(t,r,e){return r&&u(t.prototype,r),e&&u(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var r=f(t,"string");return"symbol"==e(r)?r:r+""}function f(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketEmitter=void 0;var s=exports.WebSocketEmitter=function(){return a(function t(r){i(this,t),this.gudhub=r},[{key:"emitToUser",value:function(){var r=o(t().m(function r(n,o){var i,u;return t().w(function(t){for(;;)switch(t.n){case 0:return i={user_id:n,data:"object"===e(o)?JSON.stringify(o):o},t.n=1,this.gudhub.req.post({url:"/ws/emit-to-user",form:i});case 1:return u=t.v,t.a(2,u)}},r,this)}));return function(t,e){return r.apply(this,arguments)}}()},{key:"broadcastToAppSubscribers",value:function(){var r=o(t().m(function r(e,n,o){var i,u;return t().w(function(t){for(;;)switch(t.n){case 0:return i={app_id:e,data:JSON.stringify({data_type:n,data:o})},t.n=1,this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:i});case 1:return u=t.v,t.a(2,u)}},r,this)}));return function(t,e,n){return r.apply(this,arguments)}}()}])}();
347
347
  },{}],"U9gy":[function(require,module,exports) {
348
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GudHub=void 0;var e=require("./gudhub-https-service.js"),t=require("./PipeService/PipeService.js"),r=require("./Storage/Storage.js"),i=require("./WebSocket/WebSocket.js"),n=require("./config.js"),o=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),s=require("./GHConstructor/ghconstructor.js"),a=require("./AppProcessor/AppProcessor.js"),c=require("./ItemProcessor/ItemProcessor.js"),l=require("./FieldProcessor/FieldProcessor.js"),p=require("./FileManager/FileManager.js"),h=require("./ChunksManager/ChunksManager.js"),f=require("./DocumentManager/DocumentManager.js"),d=require("./GHConstructor/interpritate.js"),v=require("./consts.js"),g=require("./WebSocket/WebsocketHandler.js"),y=require("./Utils/sharing/GroupSharing.js"),k=require("./Utils/sharing/GroupInvitation.js"),m=require("./Utils/sharing/Sharing.js"),b=require("./WebSocket/WebSocketEmitter.js");function S(e){return(S="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 w(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function o(r,i,n,o){var a=i&&i.prototype instanceof s?i:s,c=Object.create(a.prototype);return P(c,"_invoke",function(r,i,n){var o,s,a,c=0,l=n||[],p=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return o=t,s=0,a=e,h.n=r,u}};function f(r,i){for(s=r,a=i,t=0;!p&&c&&!n&&t<l.length;t++){var n,o=l[t],f=h.p,d=o[2];r>3?(n=d===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((n=r<2&&f<o[1])?(s=0,h.v=i,h.n=o[1]):f<d&&(n=r<3||o[0]>i||i>d)&&(o[4]=r,o[5]=i,h.n=d,s=0))}if(n||r>1)return u;throw p=!0,i}return function(n,l,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,d),s=l,a=d;(t=s<2?e:a)||!p;){o||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(c=2,o){if(s||(n="next"),t=o[n]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);o=e}else if((t=(p=h.n<0)?a:r.call(i,h))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:p}}}(r,n,o),!0),c}var u={};function s(){}function a(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(P(t={},i,function(){return this}),t),p=c.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,P(e,n,"GeneratorFunction")),e.prototype=Object.create(p),e}return a.prototype=c,P(p,"constructor",c),P(c,"constructor",a),a.displayName="GeneratorFunction",P(c,n,"GeneratorFunction"),P(p),P(p,n,"Generator"),P(p,i,function(){return this}),P(p,"toString",function(){return"[object Generator]"}),(w=function(){return{w:o,m:h}})()}function P(e,t,r,i){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}(P=function(e,t,r,i){function o(t,r){P(e,t,function(e){return this._invoke(t,r,e)})}t?n?n(e,t,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,i)}function F(e,t,r,i,n,o,u){try{var s=e[o](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(i,n)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function u(e){F(o,i,n,u,s,"next",e)}function s(e){F(o,i,n,u,s,"throw",e)}u(void 0)})}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,q(i.key),i)}}function W(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(e){var t=A(e,"string");return"symbol"==S(t)?t:t+""}function A(e,t){if("object"!=S(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=S(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var M=exports.GudHub=function(){return W(function v(S){var w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:n.server_url,wss_url:n.wss_url,node_server_url:n.node_server_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:n.async_modules_path,file_server_url:n.file_server_url,automation_modules_path:n.automation_modules_path,accesstoken:this.accesstoken,expirydate:this.expirydate};_(this,v),this.config=w,this.ghconstructor=new s.GHConstructor(this),this.interpritate=new d.Interpritate(this),this.pipeService=new t.PipeService,this.storage=new r.Storage(w.async_modules_path,w.file_server_url,w.automation_modules_path),this.util=new o.Utils(this),this.req=new e.GudHubHttpsService(w.server_url),this.auth=new u.Auth(this.req,this.storage),this.sharing=new m.Sharing(this,this.req),this.groupSharing=new y.GroupSharing(this,this.req,this.pipeService),this.groupInvitation=new k.GroupInvitation(this,this.req),S?this.storage.setUser({auth_key:S}):w.accesstoken&&w.expirydate&&this.storage.setUser({accesstoken:w.accesstoken,expirydate:w.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new i.WebSocketApi(w.wss_url,this.auth),this.chunksManager=new h.ChunksManager(this.storage,this.pipeService,this.req,this.util),this.appProcessor=new a.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,w.activateSW),this.itemProcessor=new c.ItemProcessor(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new l.FieldProcessor(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new p.FileManager(this.storage,this.pipeService,this.req,this.appProcessor,this.fieldProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),this.websocketsemitter=new b.WebSocketEmitter(this),w.initWebsocket&&this.ws.initWebSocket(g.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor));w.activateSW&&this.activateSW(w.swLink)},[{key:"activateSW",value:function(){var e=I(w().m(function e(t){var r,i;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(v.IS_WEB&&"serviceWorker"in window.navigator)){e.n=5;break}return e.p=1,e.n=2,window.navigator.serviceWorker.register(t);case 2:(r=e.v).update().then(function(){return console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}).catch(function(){return console.warn("SW ->>> Service worker is not updated")}),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",r),e.n=4;break;case 3:e.p=3,i=e.v,console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",i);case 4:e.n=6;break;case 5:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 6:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t,r){return this.pipeService.on(e,t,r),this}},{key:"emit",value:function(e,t,r,i){return this.pipeService.emit(e,t,r,i),this}},{key:"destroy",value:function(e,t,r){return this.pipeService.destroy(e,t,r),this}},{key:"prefilter",value:function(e,t){return this.util.prefilter(e,t)}},{key:"debounce",value:function(e,t){return this.util.debounce(e,t)}},{key:"emitToUser",value:function(e,t){return this.websocketsemitter.emitToUser(e,t)}},{key:"broadcastToAppSubscribers",value:function(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}},{key:"getInterpretation",value:function(e,t,r,i,n,o,u){return this.interpritate.getInterpretation(e,t,r,i,n,o,u)}},{key:"getInterpretationById",value:function(e,t,r,i,n,o){return this.interpritate.getInterpretationById(e,t,r,i,n,o)}},{key:"filter",value:function(e,t){return this.util.filter(e,t)}},{key:"mergeFilters",value:function(e,t){return this.util.mergeFilters(e,t)}},{key:"group",value:function(e,t){return this.util.group(e,t)}},{key:"getFilteredItems",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}},{key:"sortItems",value:function(e,t){return this.util.sortItems(e,t)}},{key:"jsonToItems",value:function(e,t){return this.util.jsonToItems(e,t)}},{key:"getDate",value:function(e){return this.util.getDate(e)}},{key:"populateWithDate",value:function(e,t){return this.util.populateWithDate(e,t)}},{key:"checkRecurringDate",value:function(e,t){return this.util.checkRecurringDate(e,t)}},{key:"populateItems",value:function(e,t,r){return this.util.populateItems(e,t,r)}},{key:"populateWithItemRef",value:function(e,t,r,i,n,o){return this.util.populateWithItemRef(e,t,r,i,n,o)}},{key:"compareItems",value:function(e,t,r){return this.util.compareItems(e,t,r)}},{key:"mergeItems",value:function(e,t,r){return this.util.mergeItems(e,t,r)}},{key:"mergeObjects",value:function(e,t){return this.util.mergeObjects(e,t)}},{key:"makeNestedList",value:function(e,t,r,i,n){return this.util.makeNestedList(e,t,r,i,n)}},{key:"jsonConstructor",value:function(e,t,r,i){return this.util.jsonConstructor(e,t,r,i)}},{key:"getAppsList",value:function(){return this.appProcessor.getAppsList()}},{key:"getAppInfo",value:function(e){return this.appProcessor.getAppInfo(e)}},{key:"deleteApp",value:function(e){return this.appProcessor.deleteApp(e)}},{key:"getApp",value:function(e){return this.appProcessor.getApp(e)}},{key:"updateApp",value:function(e){return this.appProcessor.updateApp(e)}},{key:"updateAppInfo",value:function(e){return this.appProcessor.updateAppInfo(e)}},{key:"createNewApp",value:function(e){return this.appProcessor.createNewApp(e)}},{key:"getItems",value:function(e){return this.itemProcessor.getItems(e)}},{key:"getItem",value:function(){var e=I(w().m(function e(t,r){var i;return w().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getItems(t);case 1:if(!(i=e.v)){e.n=2;break}return e.a(2,i.find(function(e){return e.item_id==r}));case 2:return e.a(2)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"addNewItems",value:function(e,t){return this.itemProcessor.addNewItems(e,t)}},{key:"updateItems",value:function(e,t){return this.itemProcessor.updateItems(e,t)}},{key:"deleteItems",value:function(e,t){return this.itemProcessor.deleteItems(e,t)}},{key:"restoreItems",value:function(e,t){return this.itemProcessor.restoreItems(e,t)}},{key:"getField",value:function(e,t){return this.fieldProcessor.getField(e,t)}},{key:"getFieldIdByNameSpace",value:function(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}},{key:"getFieldModels",value:function(e){return this.fieldProcessor.getFieldModels(e)}},{key:"updateField",value:function(e,t){return this.fieldProcessor.updateField(e,t)}},{key:"deleteField",value:function(e,t){return this.fieldProcessor.deleteField(e,t)}},{key:"getFieldValue",value:function(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}},{key:"setFieldValue",value:function(e,t,r,i){return this.fieldProcessor.setFieldValue(e,t,r,i)}},{key:"getFile",value:function(e,t){return this.fileManager.getFile(e,t)}},{key:"getFiles",value:function(e,t){return this.fileManager.getFiles(e,t)}},{key:"uploadFile",value:function(e,t,r){return this.fileManager.uploadFile(e,t,r)}},{key:"uploadFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.uploadFileFromString(e,t,r,i,n,o,u)}},{key:"uploadFileFromStringWithSetValue",value:function(e){return this.fileManager.uploadFileFromStringWithSetValue(e)}},{key:"updateFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.updateFileFromString(e,t,r,i,n,o,u)}},{key:"deleteFile",value:function(e,t){return this.fileManager.deleteFile(e,t)}},{key:"duplicateFile",value:function(e){return this.fileManager.duplicateFile(e)}},{key:"downloadFileFromString",value:function(e,t){return this.fileManager.downloadFileFromString(e,t)}},{key:"createDocument",value:function(e){return this.documentManager.createDocument(e)}},{key:"getDocument",value:function(e){return this.documentManager.getDocument(e)}},{key:"getDocuments",value:function(e){return this.documentManager.getDocuments(e)}},{key:"deleteDocument",value:function(e){return this.documentManager.deleteDocument(e)}},{key:"login",value:function(e){return this.auth.login(e)}},{key:"loginWithToken",value:function(e){return this.auth.loginWithToken(e)}},{key:"logout",value:function(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}},{key:"signup",value:function(e){return this.auth.signup(e)}},{key:"getUsersList",value:function(e){return this.auth.getUsersList(e)}},{key:"updateToken",value:function(e){return this.auth.updateToken(e)}},{key:"avatarUploadApi",value:function(e){return this.auth.avatarUploadApi(e)}},{key:"getVersion",value:function(){return this.auth.getVersion()}},{key:"getUserById",value:function(e){return this.auth.getUserById(e)}},{key:"getToken",value:function(){return this.auth.getToken()}},{key:"updateUser",value:function(e){return this.auth.updateUser(e)}},{key:"updateAvatar",value:function(e){return this.auth.updateAvatar(e)}}])}();
348
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GudHub=void 0;var e=require("./gudhub-https-service.js"),t=require("./PipeService/PipeService.js"),r=require("./Storage/Storage.js"),i=require("./WebSocket/WebSocket.js"),n=require("./config.js"),o=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),s=require("./GHConstructor/ghconstructor.js"),a=require("./AppProcessor/AppProcessor.js"),c=require("./ItemProcessor/ItemProcessor.js"),l=require("./FieldProcessor/FieldProcessor.js"),p=require("./FileManager/FileManager.js"),h=require("./ChunksManager/ChunksManager.js"),f=require("./DocumentManager/DocumentManager.js"),d=require("./GHConstructor/interpritate.js"),v=require("./consts.js"),g=require("./WebSocket/WebsocketHandler.js"),y=require("./Utils/sharing/GroupSharing.js"),k=require("./Utils/sharing/GroupInvitation.js"),m=require("./Utils/sharing/Sharing.js"),b=require("./WebSocket/WebSocketEmitter.js");function S(e){return(S="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 w(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function o(r,i,n,o){var a=i&&i.prototype instanceof s?i:s,c=Object.create(a.prototype);return P(c,"_invoke",function(r,i,n){var o,s,a,c=0,l=n||[],p=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return o=t,s=0,a=e,h.n=r,u}};function f(r,i){for(s=r,a=i,t=0;!p&&c&&!n&&t<l.length;t++){var n,o=l[t],f=h.p,d=o[2];r>3?(n=d===i)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((n=r<2&&f<o[1])?(s=0,h.v=i,h.n=o[1]):f<d&&(n=r<3||o[0]>i||i>d)&&(o[4]=r,o[5]=i,h.n=d,s=0))}if(n||r>1)return u;throw p=!0,i}return function(n,l,d){if(c>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,d),s=l,a=d;(t=s<2?e:a)||!p;){o||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(c=2,o){if(s||(n="next"),t=o[n]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);o=e}else if((t=(p=h.n<0)?a:r.call(i,h))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:t,done:p}}}(r,n,o),!0),c}var u={};function s(){}function a(){}function c(){}t=Object.getPrototypeOf;var l=[][i]?t(t([][i]())):(P(t={},i,function(){return this}),t),p=c.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,P(e,n,"GeneratorFunction")),e.prototype=Object.create(p),e}return a.prototype=c,P(p,"constructor",c),P(c,"constructor",a),a.displayName="GeneratorFunction",P(c,n,"GeneratorFunction"),P(p),P(p,n,"Generator"),P(p,i,function(){return this}),P(p,"toString",function(){return"[object Generator]"}),(w=function(){return{w:o,m:h}})()}function P(e,t,r,i){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}(P=function(e,t,r,i){function o(t,r){P(e,t,function(e){return this._invoke(t,r,e)})}t?n?n(e,t,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[t]=r:(o("next",0),o("throw",1),o("return",2))})(e,t,r,i)}function F(e,t,r,i,n,o,u){try{var s=e[o](u),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(i,n)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function u(e){F(o,i,n,u,s,"next",e)}function s(e){F(o,i,n,u,s,"throw",e)}u(void 0)})}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,q(i.key),i)}}function W(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(e){var t=A(e,"string");return"symbol"==S(t)?t:t+""}function A(e,t){if("object"!=S(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=S(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var M=exports.GudHub=function(){return W(function v(S){var w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:n.server_url,wss_url:n.wss_url,node_server_url:n.node_server_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:n.async_modules_path,file_server_url:n.file_server_url,automation_modules_path:n.automation_modules_path,accesstoken:this.accesstoken,expirydate:this.expirydate};_(this,v),this.config=w,this.ghconstructor=new s.GHConstructor(this),this.interpritate=new d.Interpritate(this),this.pipeService=new t.PipeService,this.storage=new r.Storage(w.async_modules_path,w.file_server_url,w.automation_modules_path),this.util=new o.Utils(this),this.req=new e.GudHubHttpsService(w.server_url),this.auth=new u.Auth(this.req,this.storage),this.sharing=new m.Sharing(this,this.req),this.groupSharing=new y.GroupSharing(this,this.req,this.pipeService),this.groupInvitation=new k.GroupInvitation(this,this.req),S?this.storage.setUser({auth_key:S}):w.accesstoken&&w.expirydate&&this.storage.setUser({accesstoken:w.accesstoken,expirydate:w.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new i.WebSocketApi(w.wss_url,this.auth),this.chunksManager=new h.ChunksManager(this.storage,this.pipeService,this.req,this.util),this.appProcessor=new a.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,w.activateSW),this.itemProcessor=new c.ItemProcessor(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new l.FieldProcessor(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new p.FileManager(this.storage,this.pipeService,this.req,this.appProcessor,this.fieldProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),this.websocketsemitter=new b.WebSocketEmitter(this),w.initWebsocket&&this.ws.initWebSocket(g.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor));w.activateSW&&this.activateSW(w.swLink)},[{key:"activateSW",value:function(){var e=I(w().m(function e(t){var r,i;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(v.IS_WEB&&"serviceWorker"in window.navigator)){e.n=5;break}return e.p=1,e.n=2,window.navigator.serviceWorker.register(t);case 2:(r=e.v).update().then(function(){return console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}).catch(function(){return console.warn("SW ->>> Service worker is not updated")}),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",r),e.n=4;break;case 3:e.p=3,i=e.v,console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",i);case 4:e.n=6;break;case 5:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 6:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t,r){return this.pipeService.on(e,t,r),this}},{key:"emit",value:function(e,t,r,i){return this.pipeService.emit(e,t,r,i),this}},{key:"destroy",value:function(e,t,r){return this.pipeService.destroy(e,t,r),this}},{key:"prefilter",value:function(e,t){return this.util.prefilter(e,t)}},{key:"debounce",value:function(e,t){return this.util.debounce(e,t)}},{key:"emitToUser",value:function(e,t){return this.websocketsemitter.emitToUser(e,t)}},{key:"broadcastToAppSubscribers",value:function(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}},{key:"getInterpretation",value:function(e,t,r,i,n,o,u){return this.interpritate.getInterpretation(e,t,r,i,n,o,u)}},{key:"getInterpretationById",value:function(e,t,r,i,n,o){return this.interpritate.getInterpretationById(e,t,r,i,n,o)}},{key:"filter",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.util.filter(e,t,r)}},{key:"mergeFilters",value:function(e,t){return this.util.mergeFilters(e,t)}},{key:"group",value:function(e,t){return this.util.group(e,t)}},{key:"getFilteredItems",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params,i)}},{key:"sortItems",value:function(e,t){return this.util.sortItems(e,t)}},{key:"jsonToItems",value:function(e,t){return this.util.jsonToItems(e,t)}},{key:"getDate",value:function(e){return this.util.getDate(e)}},{key:"populateWithDate",value:function(e,t){return this.util.populateWithDate(e,t)}},{key:"checkRecurringDate",value:function(e,t){return this.util.checkRecurringDate(e,t)}},{key:"populateItems",value:function(e,t,r){return this.util.populateItems(e,t,r)}},{key:"populateWithItemRef",value:function(e,t,r,i,n,o){return this.util.populateWithItemRef(e,t,r,i,n,o)}},{key:"compareItems",value:function(e,t,r){return this.util.compareItems(e,t,r)}},{key:"mergeItems",value:function(e,t,r){return this.util.mergeItems(e,t,r)}},{key:"mergeObjects",value:function(e,t){return this.util.mergeObjects(e,t)}},{key:"makeNestedList",value:function(e,t,r,i,n){return this.util.makeNestedList(e,t,r,i,n)}},{key:"jsonConstructor",value:function(e,t,r,i){return this.util.jsonConstructor(e,t,r,i)}},{key:"getAppsList",value:function(){return this.appProcessor.getAppsList()}},{key:"getAppInfo",value:function(e){return this.appProcessor.getAppInfo(e)}},{key:"deleteApp",value:function(e){return this.appProcessor.deleteApp(e)}},{key:"getApp",value:function(e){return this.appProcessor.getApp(e)}},{key:"updateApp",value:function(e){return this.appProcessor.updateApp(e)}},{key:"updateAppInfo",value:function(e){return this.appProcessor.updateAppInfo(e)}},{key:"createNewApp",value:function(e){return this.appProcessor.createNewApp(e)}},{key:"getItems",value:function(e){return this.itemProcessor.getItems(e)}},{key:"getItem",value:function(){var e=I(w().m(function e(t,r){var i;return w().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getItems(t);case 1:if(!(i=e.v)){e.n=2;break}return e.a(2,i.find(function(e){return e.item_id==r}));case 2:return e.a(2)}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"addNewItems",value:function(e,t){return this.itemProcessor.addNewItems(e,t)}},{key:"updateItems",value:function(e,t){return this.itemProcessor.updateItems(e,t)}},{key:"deleteItems",value:function(e,t){return this.itemProcessor.deleteItems(e,t)}},{key:"restoreItems",value:function(e,t){return this.itemProcessor.restoreItems(e,t)}},{key:"getField",value:function(e,t){return this.fieldProcessor.getField(e,t)}},{key:"getFieldIdByNameSpace",value:function(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}},{key:"getFieldModels",value:function(e){return this.fieldProcessor.getFieldModels(e)}},{key:"updateField",value:function(e,t){return this.fieldProcessor.updateField(e,t)}},{key:"deleteField",value:function(e,t){return this.fieldProcessor.deleteField(e,t)}},{key:"getFieldValue",value:function(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}},{key:"setFieldValue",value:function(e,t,r,i){return this.fieldProcessor.setFieldValue(e,t,r,i)}},{key:"getFile",value:function(e,t){return this.fileManager.getFile(e,t)}},{key:"getFiles",value:function(e,t){return this.fileManager.getFiles(e,t)}},{key:"uploadFile",value:function(e,t,r){return this.fileManager.uploadFile(e,t,r)}},{key:"uploadFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.uploadFileFromString(e,t,r,i,n,o,u)}},{key:"uploadFileFromStringWithSetValue",value:function(e){return this.fileManager.uploadFileFromStringWithSetValue(e)}},{key:"updateFileFromString",value:function(e,t,r,i,n,o,u){return this.fileManager.updateFileFromString(e,t,r,i,n,o,u)}},{key:"deleteFile",value:function(e,t){return this.fileManager.deleteFile(e,t)}},{key:"duplicateFile",value:function(e){return this.fileManager.duplicateFile(e)}},{key:"downloadFileFromString",value:function(e,t){return this.fileManager.downloadFileFromString(e,t)}},{key:"createDocument",value:function(e){return this.documentManager.createDocument(e)}},{key:"getDocument",value:function(e){return this.documentManager.getDocument(e)}},{key:"getDocuments",value:function(e){return this.documentManager.getDocuments(e)}},{key:"deleteDocument",value:function(e){return this.documentManager.deleteDocument(e)}},{key:"login",value:function(e){return this.auth.login(e)}},{key:"loginWithToken",value:function(e){return this.auth.loginWithToken(e)}},{key:"logout",value:function(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}},{key:"signup",value:function(e){return this.auth.signup(e)}},{key:"getUsersList",value:function(e){return this.auth.getUsersList(e)}},{key:"updateToken",value:function(e){return this.auth.updateToken(e)}},{key:"avatarUploadApi",value:function(e){return this.auth.avatarUploadApi(e)}},{key:"getVersion",value:function(){return this.auth.getVersion()}},{key:"getUserById",value:function(e){return this.auth.getUserById(e)}},{key:"getToken",value:function(){return this.auth.getToken()}},{key:"updateUser",value:function(e){return this.auth.updateUser(e)}},{key:"updateAvatar",value:function(e){return this.auth.updateAvatar(e)}}])}();
349
349
  },{"./gudhub-https-service.js":"hDvy","./PipeService/PipeService.js":"E3xI","./Storage/Storage.js":"CSHe","./WebSocket/WebSocket.js":"pHMV","./config.js":"TPH7","./Utils/Utils.js":"mWlG","./Auth/Auth.js":"rK64","./GHConstructor/ghconstructor.js":"Htuh","./AppProcessor/AppProcessor.js":"q0my","./ItemProcessor/ItemProcessor.js":"UUd3","./FieldProcessor/FieldProcessor.js":"PoPF","./FileManager/FileManager.js":"XUT2","./ChunksManager/ChunksManager.js":"KHGc","./DocumentManager/DocumentManager.js":"K1Gs","./GHConstructor/interpritate.js":"X4Dt","./consts.js":"UV2u","./WebSocket/WebsocketHandler.js":"sPce","./Utils/sharing/GroupSharing.js":"LS0j","./Utils/sharing/GroupInvitation.js":"kPfD","./Utils/sharing/Sharing.js":"XaHW","./WebSocket/WebSocketEmitter.js":"quyV"}],"iRRN":[function(require,module,exports) {
350
350
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"GudHub",{enumerable:!0,get:function(){return e.GudHub}}),exports.default=void 0,require("regenerator-runtime/runtime.js");var e=require("./GUDHUB/gudhub.js"),r=exports.default=e.GudHub;
351
351
  },{"regenerator-runtime/runtime.js":"KA2S","./GUDHUB/gudhub.js":"U9gy"}]},{},["iRRN"], "GudHubLibrary")