@gudhub/core 1.0.53 → 1.0.56

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.
@@ -107,22 +107,22 @@ export class FileManager {
107
107
  }
108
108
  }
109
109
 
110
- addFileToStorage(app_id, element_id, file) {
110
+ addFileToStorage(app_id, file) {
111
111
  const app = this.storage.getApp(app_id);
112
112
  if (app) {
113
113
  app.file_list.push(file);
114
114
  this.storage.updateApp(app);
115
- this.pipeService.emit("gh_file_upload", { app_id, item_id: file.item_id, element_id }, file);
115
+ this.pipeService.emit("gh_file_upload", { app_id, item_id: file.item_id, file_id: file.file_id }, file);
116
116
  }
117
117
  }
118
118
 
119
- addFilesToStorage(app_id, element_id, files) {
119
+ addFilesToStorage(app_id, files) {
120
120
  const app = this.storage.getApp(app_id);
121
121
  if (app) {
122
122
  app.file_list.push(...files);
123
123
  this.storage.updateApp(app);
124
124
  files.forEach(file => {
125
- this.pipeService.emit("gh_file_upload", { app_id, item_id: file.item_id, element_id }, file);
125
+ this.pipeService.emit("gh_file_upload", { app_id, item_id: file.item_id, file_id: file.file_id }, file);
126
126
  });
127
127
  }
128
128
  }
@@ -194,7 +194,7 @@ async getFiles(app_id, filesId = []) {
194
194
 
195
195
  async uploadFileFromString(fileObject) {
196
196
  const file = await this.uploadFileFromStringApi(fileObject);
197
- this.addFileToStorage(file.app_id, fileObject.element_id, file);
197
+ this.addFileToStorage(file.app_id, file);
198
198
  return file;
199
199
  }
200
200
 
@@ -30,5 +30,14 @@ describe("FILE MANAGER", function () {
30
30
  file.file.url.should.equals('https://gudhub.com/userdata/16259/811769.html');
31
31
  file.data.should.not.be.empty();
32
32
  });
33
+
34
+ it("UPLOAD FILE FROM STRING", async function() {
35
+ let fileToUpload = {"format":"html","source":"test","file_name":"document","extension":"html","app_id":"28818","item_id":"3103065","element_id":"679784"}
36
+
37
+ let file = await gudhub.uploadFileFromString(fileToUpload);
38
+
39
+ file.extension.should.equals('html');
40
+ file.url.should.equals('https://gudhub.com/userdata/28818/943217.html');
41
+ });
33
42
 
34
43
  });
@@ -75,7 +75,11 @@ export class GHConstructor {
75
75
  let returningObject = this.parseModule(module, module_id);
76
76
  if(!returningObject) return false;
77
77
  let obj;
78
- eval('obj = ' + returningObject);
78
+ try {
79
+ eval('obj = ' + returningObject);
80
+ } catch(error) {
81
+ console.log(`Error in ghconstructor (${module_id})`, error);
82
+ }
79
83
 
80
84
  let result = {
81
85
  type: module_id,
@@ -84,14 +88,14 @@ export class GHConstructor {
84
88
 
85
89
  getTemplate: function (ref, changeFieldName, displayFieldName, field_model, appId, itemId) {
86
90
  let displayFieldNameChecked = displayFieldName === 'false' ? false : true;
87
- return obj.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);
91
+ return angularModule.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);
88
92
  },
89
93
 
90
94
  //*************** GET DEFAULT VALUE ****************//
91
95
 
92
96
  getDefaultValue: function (fieldModel, valuesArray, itemsList, currentAppId) {
93
97
  return new Promise(async (resolve) => {
94
- let getValueFunction = obj.getDefaultValue;
98
+ let getValueFunction = angularModule.getDefaultValue;
95
99
  if (getValueFunction) {
96
100
  let value = await getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);
97
101
  resolve(value);
@@ -111,14 +115,14 @@ export class GHConstructor {
111
115
 
112
116
  filter: {
113
117
  getSearchOptions: function (fieldModel) {
114
- let d_type = obj;
118
+ let d_type = angularModule;
115
119
  if (d_type.filter && d_type.filter.getSearchOptions) {
116
- return obj.filter.getSearchOptions(fieldModel);
120
+ return angularModule.filter.getSearchOptions(fieldModel);
117
121
  }
118
122
  return [];
119
123
  },
120
124
  getDropdownValues: function () {
121
- let d_type = obj;
125
+ let d_type = angularModule;
122
126
  if (d_type.filter && d_type.filter.getDropdownValues) {
123
127
  return d_type.filter.getDropdownValues();
124
128
  } else {
@@ -152,7 +156,7 @@ export class GHConstructor {
152
156
 
153
157
  getInterpretatedValue: function (field_value, field_model, appId, itemId) {
154
158
  return new Promise(async (resolve) => {
155
- let getInterpretatedValueFunction = obj.getInterpretatedValue;
159
+ let getInterpretatedValueFunction = angularModule.getInterpretatedValue;
156
160
  if (getInterpretatedValueFunction) {
157
161
  let value = await getInterpretatedValueFunction(field_value, field_model, appId, itemId);
158
162
  resolve(value);
@@ -409,5 +409,9 @@ export default function generateModulesList(async_modules_path, file_server_url)
409
409
  name: "password_input",
410
410
  url: file_server_url + '/' + async_modules_path + "password_input_data.js"
411
411
  },
412
+ {
413
+ name: "vs_code",
414
+ url: file_server_url + '/' + async_modules_path + "vs_code_data.js"
415
+ },
412
416
  ]
413
417
  }
@@ -84,7 +84,7 @@ export default function(app) {
84
84
  });
85
85
 
86
86
  app.post('/file/upload', (req, res) => {
87
- res.status(200).send({status : 'created' });
87
+ res.status(200).send(data.file);
88
88
  });
89
89
 
90
90
  app.post('/file/update', (req, res) => {
@@ -106,6 +106,16 @@ export const data = {
106
106
  {"chunk_number":3,"items_list":[{"item_id":1905820,"trash":false,"index_number":14,"last_update":1609407843376,"fields":[{"field_id":1456,"element_id":1456,"field_value":"test","data_id":12321628,"history":[{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"},{"timestamp":1609407843376,"field_value":"test"}]},{"field_id":1446,"element_id":1446,"field_value":"8","data_id":12321630,"history":[{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"8"},{"timestamp":1609407843376,"field_value":"7"}]},{"field_id":1449,"element_id":1449,"field_value":"8","data_id":12321632,"history":[{"timestamp":1609407843376,"field_value":"7"},{"timestamp":1609407843376,"field_value":"6"},{"timestamp":1609407843376,"field_value":"5"},{"timestamp":1609407843376,"field_value":"4"},{"timestamp":1609407843376,"field_value":"3"},{"timestamp":1609407843376,"field_value":"2"},{"timestamp":1609407843376,"field_value":"1"}]},{"field_id":254058,"element_id":254058,"field_value":"16259.1064673","data_id":12321627,"history":[{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"},{"timestamp":1609407843376,"field_value":"16259.1064673"}]},{"field_id":1452,"element_id":1452,"field_value":"9","data_id":12321629,"history":[{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"},{"timestamp":1609407843376,"field_value":"9"}]},{"field_id":1455,"element_id":1455,"field_value":"1609407600000","data_id":12321626,"history":[{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"},{"timestamp":1609407843376,"field_value":"1609407600000"}]}]}]},
107
107
  {"chunk_number":4,"items_list":[{"item_id":1905820,"trash":false,"index_number":14,"last_update":1609408305967,"fields":[{"field_id":1456,"element_id":1456,"field_value":"g","data_id":12321628,"history":[{"timestamp":1609408305967,"field_value":"f"},{"timestamp":1609408305967,"field_value":"e"},{"timestamp":1609408305967,"field_value":"d"},{"timestamp":1609408305967,"field_value":"c"},{"timestamp":1609408305967,"field_value":"b"},{"timestamp":1609408305967,"field_value":"a"},{"timestamp":1609408305967,"field_value":"test"},{"timestamp":1609408305967,"field_value":"test"},{"timestamp":1609408305967,"field_value":"test"}]},{"field_id":1446,"element_id":1446,"field_value":"8","data_id":12321630,"history":[{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"},{"timestamp":1609408305967,"field_value":"8"}]},{"field_id":254058,"element_id":254058,"field_value":"16259.1064673","data_id":12321627,"history":[{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"},{"timestamp":1609408305967,"field_value":"16259.1064673"}]},{"field_id":1449,"element_id":1449,"field_value":"10","data_id":12321632,"history":[{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"10"},{"timestamp":1609408305967,"field_value":"9"}]},{"field_id":1452,"element_id":1452,"field_value":"0","data_id":12321629,"history":[{"timestamp":1609408305967,"field_value":"0"},{"timestamp":1609408305967,"field_value":"0"},{"timestamp":1609408305967,"field_value":"0"},{"timestamp":1609408305967,"field_value":"0"},{"timestamp":1609408305967,"field_value":"0"},{"timestamp":1609408305967,"field_value":"0"},{"timestamp":1609408305967,"field_value":"0"},{"timestamp":1609408305967,"field_value":"9"},{"timestamp":1609408305967,"field_value":"9"}]},{"field_id":1455,"element_id":1455,"field_value":"1609407600000","data_id":12321626,"history":[{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"},{"timestamp":1609408305967,"field_value":"1609407600000"}]}]}]},
108
108
  {"chunk_number":5,"items_list":[{"item_id":1905820,"trash":false,"index_number":14,"last_update":1609408309713,"fields":[{"field_id":1456,"element_id":1456,"field_value":"i","data_id":12321628,"history":[{"timestamp":1609408309713,"field_value":"h"}]},{"field_id":1446,"element_id":1446,"field_value":"8","data_id":12321630,"history":[{"timestamp":1609408309713,"field_value":"8"}]},{"field_id":1449,"element_id":1449,"field_value":"10","data_id":12321632,"history":[{"timestamp":1609408309713,"field_value":"10"}]},{"field_id":254058,"element_id":254058,"field_value":"16259.1064673","data_id":12321627,"history":[{"timestamp":1609408309713,"field_value":"16259.1064673"}]},{"field_id":1452,"element_id":1452,"field_value":"0","data_id":12321629,"history":[{"timestamp":1609408309713,"field_value":"0"}]},{"field_id":1455,"element_id":1455,"field_value":"1609407600000","data_id":12321626,"history":[{"timestamp":1609408309713,"field_value":"1609407600000"}]}]},{"item_id":1905824,"trash":false,"index_number":15,"last_update":1609408945563,"fields":[{"field_id":1456,"element_id":1456,"field_value":"t","data_id":12321654,"history":[{"timestamp":1609408945563,"field_value":"r"}]},{"field_id":254058,"element_id":254058,"field_value":"16259.1064673","data_id":12321651,"history":[{"timestamp":1609408945563,"field_value":"16259.1064673"},{"timestamp":1609408945563,"field_value":"16259.1064673"},{"timestamp":1609408945563,"field_value":"16259.1064673"},{"timestamp":1609408945563,"field_value":"16259.1064673"},{"timestamp":1609408945563,"field_value":"16259.1064673"},{"timestamp":1609408945563,"field_value":"16259.1064673"},{"timestamp":1609408945563,"field_value":"16259.1064673"}]},{"field_id":1452,"element_id":1452,"field_value":"4","data_id":12321653,"history":[{"timestamp":1609408945563,"field_value":"4"},{"timestamp":1609408945563,"field_value":"4"},{"timestamp":1609408945563,"field_value":"3"},{"timestamp":1609408945563,"field_value":"2"},{"timestamp":1609408945563,"field_value":"1"},{"timestamp":1609408945563,"field_value":"0"}]},{"field_id":1455,"element_id":1455,"field_value":"1609408860000","data_id":12321652,"history":[{"timestamp":1609408945563,"field_value":"1609408860000"},{"timestamp":1609408945563,"field_value":"1609408860000"},{"timestamp":1609408945563,"field_value":"1609408860000"},{"timestamp":1609408945563,"field_value":"1609408860000"},{"timestamp":1609408945563,"field_value":"1609408860000"},{"timestamp":1609408945563,"field_value":"1609408860000"},{"timestamp":1609408945563,"field_value":"1609408860000"}]}]}]}
109
- ]
109
+ ],
110
+
111
+ file: {
112
+ "app_id": 28818,
113
+ "extension": "html",
114
+ "file_id": 943217,
115
+ "file_name": "document",
116
+ "item_id": 3103065,
117
+ "last_update": 0,
118
+ "url": "https://gudhub.com/userdata/28818/943217.html"
119
+ }
110
120
 
111
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/core",
3
- "version": "1.0.53",
3
+ "version": "1.0.56",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -104,7 +104,7 @@ var t="function"==typeof Map&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t
104
104
  },{}],"E3xI":[function(require,module,exports) {
105
105
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipeService=void 0;var e=require("./utils.js");function r(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function t(e,r){for(var t=0;t<r.length;t++){var s=r[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function s(e,r,s){return r&&t(e.prototype,r),s&&t(e,s),Object.defineProperty(e,"prototype",{writable:!1}),e}var i=function(){function t(){r(this,t),this.subscribers={}}return s(t,[{key:"on",value:function(r,t,s){var i=this;return(0,e.checkParams)(r,t,s)&&r.split(" ").map(function(r){return r+":"+(0,e.createId)(t)}).forEach(function(e){i.subscribers[e]||(i.subscribers[e]=new Set),i.subscribers[e].add(s)}),this}},{key:"emit",value:function(r,t,s,i){var n=this;return r.split(" ").forEach(function(r){var u=r+":"+(0,e.createId)(t);n.subscribers[u]&&n.subscribers[u].forEach(function(e){e(null,s,i)})}),this}},{key:"onRoot",value:function(e,r,t){return this.on(e,r,t)}},{key:"destroy",value:function(r,t,s){var i=this;return r.split(" ").forEach(function(r){var n=r+":"+(0,e.createId)(t);i.subscribers[n]&&s&&i.subscribers[n].delete(s),i.subscribers[n]&&!s&&delete i.subscribers[n]}),this}}]),t}();exports.PipeService=i;
106
106
  },{"./utils.js":"Lc8J"}],"FJWL":[function(require,module,exports) {
107
- "use strict";function a(a,e){return[{name:"text",url:e+"/"+a+"text_data.js"},{name:"text_opt",url:e+"/"+a+"text_options_data.js"},{name:"number",url:e+"/"+a+"number_data.js"},{name:"task_board",url:e+"/"+a+"task_board_data.js"},{name:"visualizer",url:e+"/"+a+"visualizer_data.js"},{name:"enterprice_visualizer",url:e+"/"+a+"enterprice_visualizer_data.js"},{name:"email",url:e+"/"+a+"email_data.js"},{name:"date",url:e+"/"+a+"date_data.js"},{name:"radio_button",url:e+"/"+a+"radio_button_data.js"},{name:"radio_icon",url:e+"/"+a+"radio_icon_data.js"},{name:"twilio_phone",url:e+"/"+a+"twilio_phone_data.js"},{name:"twilio_autodialer",url:e+"/"+a+"twillio_autodialer_data.js"},{name:"color",url:e+"/"+a+"color_data.js"},{name:"charts",url:e+"/"+a+"charts_data.js"},{name:"funnel_chart",url:e+"/"+a+"funnel_chart_data.js"},{name:"add_items_from_template",url:e+"/"+a+"add_items_from_template_data.js"},{name:"item_ref",url:e+"/"+a+"itemRef_data.js"},{name:"data_ref",url:e+"/"+a+"data_ref_data.js"},{name:"table",url:e+"/"+a+"table_data.js"},{name:"tile",url:e+"/"+a+"tile_data.js"},{name:"file",url:e+"/"+a+"file_data.js"},{name:"image",url:e+"/"+a+"image_data.js"},{name:"text_editor",url:e+"/"+a+"text_editor_data.js"},{name:"tinymse",url:e+"/"+a+"tinymse_data.js"},{name:"duration",url:e+"/"+a+"duration_data.js"},{name:"user",url:e+"/"+a+"user_data.js"},{name:"app",url:e+"/"+a+"application_data.js"},{name:"field",url:e+"/"+a+"field_data.js"},{name:"available",url:e+"/"+a+"available_data.js"},{name:"view_list",url:e+"/"+a+"view_list_data.js"},{name:"calculator",url:e+"/"+a+"calculator_data.js"},{name:"calendar",url:e+"/"+a+"calendar_data.js"},{name:"string_join",url:e+"/"+a+"string_joiner_data.js"},{name:"signature",url:e+"/"+a+"signature_data.js"},{name:"schedule",url:e+"/"+a+"schedule_data.js"},{name:"auto_schedule",url:e+"/"+a+"auto_schedule_data.js"},{name:"sendEmail",url:e+"/"+a+"send_email_data.js"},{name:"boolean",url:e+"/"+a+"boolean_data.js"},{name:"product_gallery",url:e+"/"+a+"product_gallery_data.js"},{name:"online_inventory",url:e+"/"+a+"online_inventory_data.js"},{name:"3d_edges",url:e+"/"+a+"3d_edges_data.js"},{name:"color_list",url:e+"/"+a+"color_list_data.js"},{name:"go_to_link",url:e+"/"+a+"go_to_link_data.js"},{name:"go_to_view",url:e+"/"+a+"go_to_view_data.js"},{name:"range",url:e+"/"+a+"range_data.js"},{name:"barcode",url:e+"/"+a+"barcode_data.js"},{name:"item_remote_add",url:e+"/"+a+"item_remote_add_data.js"},{name:"item_remote_update",url:e+"/"+a+"item_remote_update_data.js"},{name:"timeline",url:e+"/"+a+"timeline_data.js"},{name:"delete_item",url:e+"/"+a+"delete_action.js"},{name:"print_doc",url:e+"/"+a+"print_doc_action.js"},{name:"open_item",url:e+"/"+a+"open_item_action.js"},{name:"edit_template",url:e+"/"+a+"edit_template_action.js"},{name:"open_app",url:e+"/"+a+"open_app_action.js"},{name:"user_settings",url:e+"/"+a+"user_settings_action.js"},{name:"app_sharing",url:e+"/"+a+"sharing_action.js"},{name:"app_constructor",url:e+"/"+a+"app_constructor_action.js"},{name:"export_csv",url:e+"/"+a+"export_csv.js"},{name:"import_csv",url:e+"/"+a+"import_csv.js"},{name:"add_items",url:e+"/"+a+"add_items_action.js"},{name:"update_items",url:e+"/"+a+"update_items_action.js"},{name:"install_app",url:e+"/"+a+"install_app_action.js"},{name:"search_action",url:e+"/"+a+"search_action.js"},{name:"filter_table",url:e+"/"+a+"filter_table_action.js"},{name:"slider",url:e+"/"+a+"slider_data.js"},{name:"clone_item",url:e+"/"+a+"clone_item_action.js"},{name:"close",url:e+"/"+a+"close_action.js"},{name:"phone",url:e+"/"+a+"phone_data.js"},{name:"link",url:e+"/"+a+"link_data.js"},{name:"sheduling",url:e+"/"+a+"sheduling_data.js"},{name:"qrcode",url:e+"/"+a+"qrcode_data.js"},{name:"graph2d",url:e+"/"+a+"graph2d_data.js"},{name:"quote_tool",url:e+"/"+a+"quote_tool_data.js"},{name:"cards",url:e+"/"+a+"cards_data.js"},{name:"jsonConstructor",url:e+"/"+a+"json_constructor_data.js"},{name:"button",url:e+"/"+a+"button_action.js"},{name:"filter_advanced",url:e+"/"+a+"filter_advanced_data.js"},{name:"code_editor",url:e+"/"+a+"code_editor_data.js"},{name:"icon",url:e+"/"+a+"icon_data.js"},{name:"quoteRequest",url:e+"/"+a+"quote_request_data.js"},{name:"view_container",url:e+"/"+a+"view_container_data.js"},{name:"element_ref",url:e+"/"+a+"element_ref_data.js"},{name:"quote_tool_objects_renderer",url:e+"/"+a+"quote_tool_objects_renderer_data.js"},{name:"quote_tool_objects_renderer_generator",url:e+"/"+a+"quote_tool_objects_renderer_generator_data.js"},{name:"trigger",url:e+"/"+a+"trigger_data.js"},{name:"voting",url:e+"/"+a+"voting_data.js"},{name:"view_tabs",url:e+"/"+a+"view_tabs.js"},{name:"filter_tabs",url:e+"/"+a+"filter_tabs.js"},{name:"gps_coords",url:e+"/"+a+"gps_coords.js"},{name:"google_map",url:e+"/"+a+"google_map_data.js"},{name:"data_migrations",url:e+"/"+a+"data_migrations.js"},{name:"additional_settings",url:e+"/"+a+"gh_additional_settings_data.js"},{name:"send_request",url:e+"/"+a+"send_request_data.js"},{name:"webcam",url:e+"/"+a+"webcam_data.js"},{name:"json_viewer",url:e+"/"+a+"json_viewer_data.js"},{name:"notifications",url:e+"/"+a+"notifications_data.js"},{name:"api",url:e+"/"+a+"api_data.js"},{name:"smart_input",url:e+"/"+a+"smart_input_data.js"},{name:"json_editor",url:e+"/"+a+"json_editor_data.js"},{name:"grapes_html_editor",url:e+"/"+a+"grapes_html_editor_data.js"},{name:"quiz",url:e+"/"+a+"quiz_data.js"},{name:"markdown_viewer",url:e+"/"+a+"markdown_viewer_data.js"},{name:"password_input",url:e+"/"+a+"password_input_data.js"}]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;
107
+ "use strict";function a(a,e){return[{name:"text",url:e+"/"+a+"text_data.js"},{name:"text_opt",url:e+"/"+a+"text_options_data.js"},{name:"number",url:e+"/"+a+"number_data.js"},{name:"task_board",url:e+"/"+a+"task_board_data.js"},{name:"visualizer",url:e+"/"+a+"visualizer_data.js"},{name:"enterprice_visualizer",url:e+"/"+a+"enterprice_visualizer_data.js"},{name:"email",url:e+"/"+a+"email_data.js"},{name:"date",url:e+"/"+a+"date_data.js"},{name:"radio_button",url:e+"/"+a+"radio_button_data.js"},{name:"radio_icon",url:e+"/"+a+"radio_icon_data.js"},{name:"twilio_phone",url:e+"/"+a+"twilio_phone_data.js"},{name:"twilio_autodialer",url:e+"/"+a+"twillio_autodialer_data.js"},{name:"color",url:e+"/"+a+"color_data.js"},{name:"charts",url:e+"/"+a+"charts_data.js"},{name:"funnel_chart",url:e+"/"+a+"funnel_chart_data.js"},{name:"add_items_from_template",url:e+"/"+a+"add_items_from_template_data.js"},{name:"item_ref",url:e+"/"+a+"itemRef_data.js"},{name:"data_ref",url:e+"/"+a+"data_ref_data.js"},{name:"table",url:e+"/"+a+"table_data.js"},{name:"tile",url:e+"/"+a+"tile_data.js"},{name:"file",url:e+"/"+a+"file_data.js"},{name:"image",url:e+"/"+a+"image_data.js"},{name:"text_editor",url:e+"/"+a+"text_editor_data.js"},{name:"tinymse",url:e+"/"+a+"tinymse_data.js"},{name:"duration",url:e+"/"+a+"duration_data.js"},{name:"user",url:e+"/"+a+"user_data.js"},{name:"app",url:e+"/"+a+"application_data.js"},{name:"field",url:e+"/"+a+"field_data.js"},{name:"available",url:e+"/"+a+"available_data.js"},{name:"view_list",url:e+"/"+a+"view_list_data.js"},{name:"calculator",url:e+"/"+a+"calculator_data.js"},{name:"calendar",url:e+"/"+a+"calendar_data.js"},{name:"string_join",url:e+"/"+a+"string_joiner_data.js"},{name:"signature",url:e+"/"+a+"signature_data.js"},{name:"schedule",url:e+"/"+a+"schedule_data.js"},{name:"auto_schedule",url:e+"/"+a+"auto_schedule_data.js"},{name:"sendEmail",url:e+"/"+a+"send_email_data.js"},{name:"boolean",url:e+"/"+a+"boolean_data.js"},{name:"product_gallery",url:e+"/"+a+"product_gallery_data.js"},{name:"online_inventory",url:e+"/"+a+"online_inventory_data.js"},{name:"3d_edges",url:e+"/"+a+"3d_edges_data.js"},{name:"color_list",url:e+"/"+a+"color_list_data.js"},{name:"go_to_link",url:e+"/"+a+"go_to_link_data.js"},{name:"go_to_view",url:e+"/"+a+"go_to_view_data.js"},{name:"range",url:e+"/"+a+"range_data.js"},{name:"barcode",url:e+"/"+a+"barcode_data.js"},{name:"item_remote_add",url:e+"/"+a+"item_remote_add_data.js"},{name:"item_remote_update",url:e+"/"+a+"item_remote_update_data.js"},{name:"timeline",url:e+"/"+a+"timeline_data.js"},{name:"delete_item",url:e+"/"+a+"delete_action.js"},{name:"print_doc",url:e+"/"+a+"print_doc_action.js"},{name:"open_item",url:e+"/"+a+"open_item_action.js"},{name:"edit_template",url:e+"/"+a+"edit_template_action.js"},{name:"open_app",url:e+"/"+a+"open_app_action.js"},{name:"user_settings",url:e+"/"+a+"user_settings_action.js"},{name:"app_sharing",url:e+"/"+a+"sharing_action.js"},{name:"app_constructor",url:e+"/"+a+"app_constructor_action.js"},{name:"export_csv",url:e+"/"+a+"export_csv.js"},{name:"import_csv",url:e+"/"+a+"import_csv.js"},{name:"add_items",url:e+"/"+a+"add_items_action.js"},{name:"update_items",url:e+"/"+a+"update_items_action.js"},{name:"install_app",url:e+"/"+a+"install_app_action.js"},{name:"search_action",url:e+"/"+a+"search_action.js"},{name:"filter_table",url:e+"/"+a+"filter_table_action.js"},{name:"slider",url:e+"/"+a+"slider_data.js"},{name:"clone_item",url:e+"/"+a+"clone_item_action.js"},{name:"close",url:e+"/"+a+"close_action.js"},{name:"phone",url:e+"/"+a+"phone_data.js"},{name:"link",url:e+"/"+a+"link_data.js"},{name:"sheduling",url:e+"/"+a+"sheduling_data.js"},{name:"qrcode",url:e+"/"+a+"qrcode_data.js"},{name:"graph2d",url:e+"/"+a+"graph2d_data.js"},{name:"quote_tool",url:e+"/"+a+"quote_tool_data.js"},{name:"cards",url:e+"/"+a+"cards_data.js"},{name:"jsonConstructor",url:e+"/"+a+"json_constructor_data.js"},{name:"button",url:e+"/"+a+"button_action.js"},{name:"filter_advanced",url:e+"/"+a+"filter_advanced_data.js"},{name:"code_editor",url:e+"/"+a+"code_editor_data.js"},{name:"icon",url:e+"/"+a+"icon_data.js"},{name:"quoteRequest",url:e+"/"+a+"quote_request_data.js"},{name:"view_container",url:e+"/"+a+"view_container_data.js"},{name:"element_ref",url:e+"/"+a+"element_ref_data.js"},{name:"quote_tool_objects_renderer",url:e+"/"+a+"quote_tool_objects_renderer_data.js"},{name:"quote_tool_objects_renderer_generator",url:e+"/"+a+"quote_tool_objects_renderer_generator_data.js"},{name:"trigger",url:e+"/"+a+"trigger_data.js"},{name:"voting",url:e+"/"+a+"voting_data.js"},{name:"view_tabs",url:e+"/"+a+"view_tabs.js"},{name:"filter_tabs",url:e+"/"+a+"filter_tabs.js"},{name:"gps_coords",url:e+"/"+a+"gps_coords.js"},{name:"google_map",url:e+"/"+a+"google_map_data.js"},{name:"data_migrations",url:e+"/"+a+"data_migrations.js"},{name:"additional_settings",url:e+"/"+a+"gh_additional_settings_data.js"},{name:"send_request",url:e+"/"+a+"send_request_data.js"},{name:"webcam",url:e+"/"+a+"webcam_data.js"},{name:"json_viewer",url:e+"/"+a+"json_viewer_data.js"},{name:"notifications",url:e+"/"+a+"notifications_data.js"},{name:"api",url:e+"/"+a+"api_data.js"},{name:"smart_input",url:e+"/"+a+"smart_input_data.js"},{name:"json_editor",url:e+"/"+a+"json_editor_data.js"},{name:"grapes_html_editor",url:e+"/"+a+"grapes_html_editor_data.js"},{name:"quiz",url:e+"/"+a+"quiz_data.js"},{name:"markdown_viewer",url:e+"/"+a+"markdown_viewer_data.js"},{name:"password_input",url:e+"/"+a+"password_input_data.js"},{name:"vs_code",url:e+"/"+a+"vs_code_data.js"}]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=a;
108
108
  },{}],"CSHe":[function(require,module,exports) {
109
109
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Storage=void 0;var t=e(require("./ModulesList.js"));function e(t){return t&&t.__esModule?t:{default:t}}function r(t){return s(t)||u(t)||i(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 i(t,e){if(t){if("string"==typeof t)return a(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)?a(t,e):void 0}}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function s(t){if(Array.isArray(t))return a(t)}function a(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 o(t,e,r,n,i,u,s){try{var a=t[u](s),o=a.value}catch(p){return void r(p)}a.done?e(o):Promise.resolve(o).then(n,i)}function p(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var u=t.apply(e,r);function s(t){o(u,n,i,s,a,"next",t)}function a(t){o(u,n,i,s,a,"throw",t)}s(void 0)})}}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach(function(e){f(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,r){return e&&v(t.prototype,e),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var y=function(){function e(r,n){h(this,e),this.apps_list=[],this.users_list=[],this.user={},this.modulesList=(0,t.default)(r,n)}return d(e,[{key:"getMainStorage",value:function(){return this}},{key:"getAppsList",value:function(){return this.apps_list}},{key:"getUser",value:function(){return this.user}},{key:"getUsersList",value:function(){return this.users_list}},{key:"getModulesList",value:function(){return this.modulesList}},{key:"getModuleUrl",value:function(t){return this.modulesList.find(function(e){return e.name==t}).url}},{key:"setUser",value:function(t){this.user=t,this.users_list.push(t)}},{key:"updateUser",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.avatar_128&&(t.avatar_128=t.avatar_128+"?"+(new Date).getTime()),t.avatar_512&&(t.avatar_512=t.avatar_512+"?"+(new Date).getTime()),this.user=l(l({},this.user),t),this.users_list=this.users_list.filter(function(e){return e.user_id!=t.user_id}),this.users_list.push(this.user)}},{key:"unsetUser",value:function(){this.user={}}},{key:"getApp",value:function(t){return this.apps_list.find(function(e){return e.app_id==t})}},{key:"unsetApps",value:function(){this.apps_list=[]}},{key:"updateApp",value:function(t){return this.apps_list=this.apps_list.map(function(e){return e.app_id==t.app_id?t:e}),this.apps_list}},{key:"deleteApp",value:function(t){return this.apps_list=this.apps_list.filter(function(e){return e.app_id!=t}),this.apps_list}},{key:"updateItemsInApp",value:function(){var t=p(regeneratorRuntime.mark(function t(e,r){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(r);case 2:return(n=t.sent)&&(n.items_list=updateItems(e,n.items_list,this.pipeService.emit.bind(this.pipeService),r),this.updateApp(n)),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"addItemsToApp",value:function(){var t=p(regeneratorRuntime.mark(function t(e,n){var i,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(n);case 2:return(i=t.sent)&&((u=i.items_list).push.apply(u,r(e)),this.updateApp(i),this.pipeService.emit("gh_items_update",{app_id:n},e)),t.abrupt("return",i);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItemsInApp",value:function(){var t=p(regeneratorRuntime.mark(function t(e,r){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(r);case 2:return(n=t.sent)&&(n.items_list=n.items_list.filter(function(t){return!e.find(function(e){return e.item_id==t.item_id})}),this.updateApp(n)),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()}]),e}();exports.Storage=y;
110
110
  },{"./ModulesList.js":"FJWL"}],"p58b":[function(require,module,exports) {
@@ -167,7 +167,7 @@ var e,t=arguments[3],n=require("process");!function(n){if("object"==typeof expor
167
167
  },{"./filter/filterPreparation.js":"DvAj","./filter/filter.js":"mbGN","./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","./interpretation/interpretation.js":"pMyP","./nested_list/nested_list.js":"S7Iy","./compare_items_lists_worker/compare_items_lists.worker.js":"xR4c","./json_constructor/json_constructor.js":"nKaW"}],"rK64":[function(require,module,exports) {
168
168
  "use strict";function e(e,t,r,n,u,a,s){try{var i=e[a](s),o=i.value}catch(c){return void r(c)}i.done?t(o):Promise.resolve(o).then(n,u)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(u,a){var s=t.apply(r,n);function i(t){e(s,u,a,i,o,"next",t)}function o(t){e(s,u,a,i,o,"throw",t)}i(void 0)})}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(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,n.key,n)}}function u(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Auth=void 0;var a=function(){function e(t,n){r(this,e),this.req=t,this.storage=n}return u(e,[{key:"login",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.username,r=e.password;return this.req.simplePost({url:"/auth/login",form:{username:t,password:r}})}},{key:"logout",value:function(e){return this.req.post({url:"/auth/logout",form:{token:e}})}},{key:"signup",value:function(e){return this.req.simplePost({url:"/auth/singup",form:{user:JSON.stringify(e)}})}},{key:"getUsersList",value:function(e){return this.req.get({url:"/auth/userlist",params:{keyword:e}})}},{key:"updateUserApi",value:function(e){return this.req.post({url:"/auth/updateuser",form:{user:JSON.stringify(e)}})}},{key:"updateToken",value:function(e){return this.req.simplePost({url:"/auth/login",form:{auth_key:e}})}},{key:"avatarUploadApi",value:function(e){return this.req.post({url:"/auth/avatar-upload",form:{image:e}})}},{key:"getUserByIdApi",value:function(e){return this.req.get({url:"/auth/getuserbyid",params:{id:e}})}},{key:"getVersion",value:function(){return this.req.get({url:"/version"})}},{key:"getUserFromStorage",value:function(e){return this.storage.getUsersList().find(function(t){return t.user_id==e})}},{key:"saveUserToStorage",value:function(e){var t=this.storage.getUsersList(),r=t.find(function(t){return t.user_id==e.user_id});return r||(t.push(e),e)}},{key:"getUserById",value:function(){var e=t(regeneratorRuntime.mark(function e(t){var r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.getUserFromStorage(t)){e.next=9;break}return e.next=4,this.getUserByIdApi(t);case 4:if(n=e.sent){e.next=7;break}return e.abrupt("return",null);case 7:(r=this.getUserFromStorage(t))||(this.saveUserToStorage(n),r=n);case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getToken",value:function(){var e=t(regeneratorRuntime.mark(function e(){var t,r,n,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=new Date(this.storage.getUser().expirydate),r=new Date,n=this.storage.getUser().accesstoken,!(t<r)&&n){e.next=9;break}return e.next=6,this.updateToken(this.storage.getUser().auth_key);case 6:u=e.sent,this.storage.updateUser(u),n=u.accesstoken;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"updateUser",value:function(){var e=t(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateUserApi(t);case 2:return r=e.sent,this.storage.updateUser(r),e.abrupt("return",r);case 5:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateAvatar",value:function(){var e=t(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.avatarUploadApi(t);case 2:return r=e.sent,this.storage.updateUser(r),e.abrupt("return",r);case 5:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()}]),e}();exports.Auth=a;
169
169
  },{}],"Htuh":[function(require,module,exports) {
170
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GHConstructor=void 0;var _axios=_interopRequireDefault(require("axios"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function asyncGeneratorStep(e,t,n,r,u,o,a){try{var c=e[o](a),i=c.value}catch(s){return void n(s)}c.done?t(i):Promise.resolve(i).then(r,u)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var o=e.apply(t,n);function a(e){asyncGeneratorStep(o,r,u,a,c,"next",e)}function c(e){asyncGeneratorStep(o,r,u,a,c,"throw",e)}a(void 0)})}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var $q={when:function(e){return new Promise(function(t){t(e)})}},GHConstructor=function(){function GHConstructor(){_classCallCheck(this,GHConstructor),this.cache=[],this.modulesQueue={},this.angularInjector}return _createClass(GHConstructor,[{key:"getInstance",value:function(e){var t=this;return new Promise(function(){var n=_asyncToGenerator(regeneratorRuntime.mark(function n(r){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!t.modulesQueue[e]){n.next=4;break}return n.abrupt("return",t.modulesQueue[e].then(function(){r(t.getCached(e))}));case 4:t.cache.find(function(t){return t.type===e})?r(t.getCached(e)):(t.modulesQueue[e]=t.createInstance(e),t.modulesQueue[e].then(function(){r(t.getCached(e))}));case 5:case"end":return n.stop()}},n)}));return function(e){return n.apply(this,arguments)}}())}},{key:"pupToCache",value:function(e){this.cache.push(e)}},{key:"getCached",value:function(e){return this.cache.find(function(t){return t.type===e})}},{key:"initAngularInjector",value:function(e){this.angularInjector=e}},{key:"createInstance",value:function(){var _createInstance=_asyncToGenerator(regeneratorRuntime.mark(function _callee5(module_id){var module_url,angularModule,module,returningObject,obj,result;return regeneratorRuntime.wrap(function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:return module_url=gudhub.storage.getModuleUrl(module_id),_context5.next=3,this.angularInjector.get(module_id);case 3:return angularModule=_context5.sent,_context5.next=6,_axios.default.get(module_url);case 6:if(module=_context5.sent,module=module.data,returningObject=this.parseModule(module,module_id),returningObject){_context5.next=11;break}return _context5.abrupt("return",!1);case 11:return eval("obj = "+returningObject),result={type:module_id,getTemplate:function(e,t,n,r,u,o){var a="false"!==n;return obj.getTemplate(e,t,a,r,u,o)},getDefaultValue:function(e,t,n,r){return new Promise(function(){var u=_asyncToGenerator(regeneratorRuntime.mark(function u(o){var a,c;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(a=obj.getDefaultValue)){u.next=8;break}return u.next=4,a(e,t,n,r);case 4:c=u.sent,o(c),u.next=9;break;case 8:o(null);case 9:case"end":return u.stop()}},u)}));return function(e){return u.apply(this,arguments)}}())},getSettings:function(e,t,n){return angularModule.getSettings(e,t,n)},filter:{getSearchOptions:function(e){var t=obj;return t.filter&&t.filter.getSearchOptions?obj.filter.getSearchOptions(e):[]},getDropdownValues:function(){var e=obj;return e.filter&&e.filter.getDropdownValues?e.filter.getDropdownValues():[]}},getInterpretation:function(e,t,n,r,u,o){return new Promise(function(){var a=_asyncToGenerator(regeneratorRuntime.mark(function a(c){var i,s,l;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return i=obj,a.next=3,i.getInterpretation(e,t,n,r,u,o);case 3:(s=a.sent)?(l=s.find(function(e){return e.id==r})||s.find(function(e){return"default"==e.id}),c({html:l.html})):c({html:"<span>error(from constructor)</span>"});case 5:case"end":return a.stop()}},a)}));return function(e){return a.apply(this,arguments)}}())},getInterpretatedValue:function(e,t,n,r){return new Promise(function(){var u=_asyncToGenerator(regeneratorRuntime.mark(function u(o){var a,c,i;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(a=obj.getInterpretatedValue)){u.next=8;break}return u.next=4,a(e,t,n,r);case 4:c=u.sent,o(c),u.next=12;break;case 8:return u.next=10,gudhub.getFieldValue(n,r,t.id);case 10:i=u.sent,o(i);case 12:case"end":return u.stop()}},u)}));return function(e){return u.apply(this,arguments)}}())},extendController:function(e){angularModule.getActionScope(e)},runAction:function(e){try{angularModule.runAction(e)}catch(t){}},getWindowScope:function(e){return angularModule.getWindowScope(e)},getWindowHTML:function(e){return angularModule.getWindowHTML(e)}},this.pupToCache(result),_context5.abrupt("return",result);case 15:case"end":return _context5.stop()}},_callee5,this)}));function createInstance(e){return _createInstance.apply(this,arguments)}return createInstance}()},{key:"parseModule",value:function(e,t){var n=e.indexOf(".factory('".concat(t,"',"));if(-1===n&&(n=e.indexOf('.factory("'.concat(t,'",'))),-1!==n){var r=e.substring(n,e.length),u=r.indexOf("return"),o=r.substring(u,r.length),a=o.indexOf("{");o=o.substring(a,o.length);for(var c=0,i=0,s=0,l=0;l<o.length;l++)if("{"===o[l]&&c++,"}"===o[l]&&i++,c===i&&l>=a){s=l;break}return o=o.substring(0,s+1)}return!1}}]),GHConstructor}();exports.GHConstructor=GHConstructor;
170
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GHConstructor=void 0;var _axios=_interopRequireDefault(require("axios"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function asyncGeneratorStep(e,t,n,r,u,o,a){try{var c=e[o](a),i=c.value}catch(s){return void n(s)}c.done?t(i):Promise.resolve(i).then(r,u)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var o=e.apply(t,n);function a(e){asyncGeneratorStep(o,r,u,a,c,"next",e)}function c(e){asyncGeneratorStep(o,r,u,a,c,"throw",e)}a(void 0)})}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var $q={when:function(e){return new Promise(function(t){t(e)})}},GHConstructor=function(){function GHConstructor(){_classCallCheck(this,GHConstructor),this.cache=[],this.modulesQueue={},this.angularInjector}return _createClass(GHConstructor,[{key:"getInstance",value:function(e){var t=this;return new Promise(function(){var n=_asyncToGenerator(regeneratorRuntime.mark(function n(r){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!t.modulesQueue[e]){n.next=4;break}return n.abrupt("return",t.modulesQueue[e].then(function(){r(t.getCached(e))}));case 4:t.cache.find(function(t){return t.type===e})?r(t.getCached(e)):(t.modulesQueue[e]=t.createInstance(e),t.modulesQueue[e].then(function(){r(t.getCached(e))}));case 5:case"end":return n.stop()}},n)}));return function(e){return n.apply(this,arguments)}}())}},{key:"pupToCache",value:function(e){this.cache.push(e)}},{key:"getCached",value:function(e){return this.cache.find(function(t){return t.type===e})}},{key:"initAngularInjector",value:function(e){this.angularInjector=e}},{key:"createInstance",value:function(){var _createInstance=_asyncToGenerator(regeneratorRuntime.mark(function _callee5(module_id){var module_url,angularModule,module,returningObject,obj,result;return regeneratorRuntime.wrap(function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:return module_url=gudhub.storage.getModuleUrl(module_id),_context5.next=3,this.angularInjector.get(module_id);case 3:return angularModule=_context5.sent,_context5.next=6,_axios.default.get(module_url);case 6:if(module=_context5.sent,module=module.data,returningObject=this.parseModule(module,module_id),returningObject){_context5.next=11;break}return _context5.abrupt("return",!1);case 11:try{eval("obj = "+returningObject)}catch(error){console.log("Error in ghconstructor (".concat(module_id,")"),error)}return result={type:module_id,getTemplate:function(e,t,n,r,u,o){var a="false"!==n;return angularModule.getTemplate(e,t,a,r,u,o)},getDefaultValue:function(e,t,n,r){return new Promise(function(){var u=_asyncToGenerator(regeneratorRuntime.mark(function u(o){var a,c;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(a=angularModule.getDefaultValue)){u.next=8;break}return u.next=4,a(e,t,n,r);case 4:c=u.sent,o(c),u.next=9;break;case 8:o(null);case 9:case"end":return u.stop()}},u)}));return function(e){return u.apply(this,arguments)}}())},getSettings:function(e,t,n){return angularModule.getSettings(e,t,n)},filter:{getSearchOptions:function(e){var t=angularModule;return t.filter&&t.filter.getSearchOptions?angularModule.filter.getSearchOptions(e):[]},getDropdownValues:function(){var e=angularModule;return e.filter&&e.filter.getDropdownValues?e.filter.getDropdownValues():[]}},getInterpretation:function(e,t,n,r,u,o){return new Promise(function(){var a=_asyncToGenerator(regeneratorRuntime.mark(function a(c){var i,s,l;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return i=obj,a.next=3,i.getInterpretation(e,t,n,r,u,o);case 3:(s=a.sent)?(l=s.find(function(e){return e.id==r})||s.find(function(e){return"default"==e.id}),c({html:l.html})):c({html:"<span>error(from constructor)</span>"});case 5:case"end":return a.stop()}},a)}));return function(e){return a.apply(this,arguments)}}())},getInterpretatedValue:function(e,t,n,r){return new Promise(function(){var u=_asyncToGenerator(regeneratorRuntime.mark(function u(o){var a,c,i;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(a=angularModule.getInterpretatedValue)){u.next=8;break}return u.next=4,a(e,t,n,r);case 4:c=u.sent,o(c),u.next=12;break;case 8:return u.next=10,gudhub.getFieldValue(n,r,t.id);case 10:i=u.sent,o(i);case 12:case"end":return u.stop()}},u)}));return function(e){return u.apply(this,arguments)}}())},extendController:function(e){angularModule.getActionScope(e)},runAction:function(e){try{angularModule.runAction(e)}catch(t){}},getWindowScope:function(e){return angularModule.getWindowScope(e)},getWindowHTML:function(e){return angularModule.getWindowHTML(e)}},this.pupToCache(result),_context5.abrupt("return",result);case 15:case"end":return _context5.stop()}},_callee5,this)}));function createInstance(e){return _createInstance.apply(this,arguments)}return createInstance}()},{key:"parseModule",value:function(e,t){var n=e.indexOf(".factory('".concat(t,"',"));if(-1===n&&(n=e.indexOf('.factory("'.concat(t,'",'))),-1!==n){var r=e.substring(n,e.length),u=r.indexOf("return"),o=r.substring(u,r.length),a=o.indexOf("{");o=o.substring(a,o.length);for(var c=0,i=0,s=0,l=0;l<o.length;l++)if("{"===o[l]&&c++,"}"===o[l]&&i++,c===i&&l>=a){s=l;break}return o=o.substring(0,s+1)}return!1}}]),GHConstructor}();exports.GHConstructor=GHConstructor;
171
171
  },{"axios":"O4Aa"}],"UV2u":[function(require,module,exports) {
172
172
  "use strict";function e(o){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(o)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.IS_WEB=void 0;var o=!["undefined"==typeof window?"undefined":e(window),"undefined"==typeof document?"undefined":e(document)].includes("undefined");exports.IS_WEB=o;
173
173
  },{}],"q0my":[function(require,module,exports) {
@@ -177,7 +177,7 @@ var e,t=arguments[3],n=require("process");!function(n){if("object"==typeof expor
177
177
  },{"../utils.js":"EgeI"}],"PoPF":[function(require,module,exports) {
178
178
  "use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){r(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r,n,i,u,a){try{var o=e[u](a),s=o.value}catch(p){return void r(p)}o.done?t(s):Promise.resolve(s).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(i,u){var a=e.apply(t,r);function o(e){n(a,i,u,o,s,"next",e)}function s(e){n(a,i,u,o,s,"throw",e)}o(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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,n.key,n)}}function o(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FieldProcessor=void 0;var s=function(){function e(t,r,n,i,a){u(this,e),this.storage=t,this.req=r,this.appProcessor=n,this.itemProcessor=i,this.pipeService=a,this.fieldListeners()}return o(e,[{key:"deleteFieldApi",value:function(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}},{key:"updatedFieldApi",value:function(){var e=i(regeneratorRuntime.mark(function e(r){var n,i,u,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,this.appProcessor.getApp(r);case 3:return i=e.sent,u={app_id:r,app_name:i.app_name,group_id:i.group_id,icon:i.icon,field_list:i.field_list.map(function(e){return e.field_id==n.field_id?t(t({},e),n):e}),views_list:i.views_list},e.abrupt("return",this.appProcessor.updateApp(u));case 6:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setFieldValueApi",value:function(e,t,r,n){var i=[{item_id:t,fields:[{field_id:r,field_value:n}]}];return this.itemProcessor.updateItems(e,i)}},{key:"deleteFieldInStorage",value:function(e,t){var r=this.storage.getApp(e);r.field_list=r.field_list.filter(function(e){return e.file_id!=t}),r.items_list=r.items_list.map(function(e){return e.fields=e.fields.filter(function(e){return e.field_id!=t}),e}),this.storage.updateApp(r)}},{key:"updateFieldInStorage",value:function(e,r){var n=this.storage.getApp(e);return n.field_list=n.field_list.map(function(e){return e.field_id==r.field_id?t(t({},e),r):e}),this.storage.updateApp(n),r}},{key:"updateFieldValue",value:function(e,t,r,n){var i=this.storage.getApp(e);i.items_list.forEach(function(e){e.item_id==t&&e.fields.forEach(function(e){e.field_id==r&&(e.field_value=n)})}),this.storage.updateApp(i)}},{key:"getField",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(t);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",n.field_list.find(function(e){return e.field_id==r}));case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldModels",value:function(){var e=i(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(t);case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",r.field_list);case 6:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateField",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&r){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.updatedFieldApi(t,r);case 4:return n=e.sent,e.abrupt("return",this.updateFieldInStorage(t,n));case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteField",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deleteFieldApi(r);case 2:return e.abrupt("return",this.deleteFieldInStorage(t,r));case 3:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldValue",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r,n){var i,u,a,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=null,e.next=3,this.appProcessor.getApp(t);case 3:return(u=e.sent)&&(a=u.items_list.find(function(e){return e.item_id==r}))&&(o=a.fields.find(function(e){return e.field_id==n}))&&(i=o.field_value),e.abrupt("return",i);case 6:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"setFieldValue",value:function(){var e=i(regeneratorRuntime.mark(function e(t,r,n,i){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&r&&n){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.setFieldValueApi(t,r,n,i);case 4:this.updateFieldValue(t,r,n,i);case 5:case"end":return e.stop()}},e,this)}));return function(t,r,n,i){return e.apply(this,arguments)}}()},{key:"fieldListeners",value:function(){var e=this;this.pipeService.onRoot("gh_value_get",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n.app_id&&n.item_id&&n.field_id)){t.next=5;break}return t.next=3,e.getFieldValue(n.app_id,n.item_id,n.field_id);case 3:i=t.sent,e.pipeService.emit("gh_value_get",n,i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_value_set",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n.item_id&&(e.setFieldValue(n.app_id,n.item_id,n.field_id,n.new_value),delete n.new_value);case 1:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_get",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.getField(n.app_id,n.field_id);case 3:i=t.sent,e.pipeService.emit("gh_model_get",n,i),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Field model: ",t.t0);case 10:case"end":return t.stop()}},t,null,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_update",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.updateField(n.app_id,n.field_model);case 2:i=t.sent,e.pipeService.emit("gh_model_update",{app_id:n.app_id,field_id:n.field_id},i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_models_get",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getFieldModels(n.app_id);case 2:i=t.sent,e.pipeService.emit("gh_models_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_delete",{},function(){var t=i(regeneratorRuntime.mark(function t(r,n){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deleteField(n.app_id,n.field_id);case 2:i=t.sent,e.pipeService.emit("gh_model_delete",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}())}}]),e}();exports.FieldProcessor=s;
179
179
  },{}],"XUT2":[function(require,module,exports) {
180
- "use strict";function e(e){return i(e)||n(e)||t(e)||r()}function r(){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 t(e,r){if(e){if("string"==typeof e)return a(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,r):void 0}}function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function i(e){if(Array.isArray(e))return a(e)}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function u(e,r,t,n,i,a,u){try{var o=e[a](u),s=o.value}catch(p){return void t(p)}o.done?r(s):Promise.resolve(s).then(n,i)}function o(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function o(e){u(a,n,i,o,s,"next",e)}function s(e){u(a,n,i,o,s,"throw",e)}o(void 0)})}}function s(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function p(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,r,t){return r&&p(e.prototype,r),t&&p(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileManager=void 0;var l=function(){function r(e,t,n,i){s(this,r),this.storage=e,this.pipeService=t,this.req=n,this.appProcessor=i}return c(r,[{key:"uploadFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n){var i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i={"file-0":r,app_id:t,item_id:n},e.next=4,this.req.post({url:"/file/formupload",form:i});case 4:return a=e.sent,e.abrupt("return",a);case 8:return e.prev=8,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,this,[[0,8]])}));return function(r,t,n){return e.apply(this,arguments)}}()},{key:"uploadFileFromStringApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/file/upload",form:{file:JSON.stringify(r)}});case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(r){return e.apply(this,arguments)}}()},{key:"updateFileFromStringApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n,i,a){var u,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u={file_name:n,extension:i,file_id:t,format:a,source:r},e.next=4,this.req.post({url:"/file/update",form:{file:JSON.stringify(u)}});case 4:return o=e.sent,e.abrupt("return",o);case 8:return e.prev=8,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,this,[[0,8]])}));return function(r,t,n,i,a){return e.apply(this,arguments)}}()},{key:"duplicateFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(r)}}));case 1:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"downloadFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isFileExists(r,t);case 2:if(!e.sent){e.next=12;break}return e.next=5,this.getFile(r,t);case 5:return n=e.sent,e.next=8,this.req.get({url:n.url+"?timestamp="+n.last_update,externalResource:!0});case 8:return i=e.sent,e.abrupt("return",{file:n,data:i,type:"file"});case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"duplicateFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t,n=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.duplicateFileApi(r);case 2:return(t=e.sent).forEach(function(e){n.addFileToStorage(e.app_id,e)}),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"deleteFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.get({url:"/file/delete?file_id=".concat(r)});case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(r){return e.apply(this,arguments)}}()},{key:"addFileToStorage",value:function(e,r,t){var n=this.storage.getApp(e);n&&(n.file_list.push(t),this.storage.updateApp(n),this.pipeService.emit("gh_file_upload",{app_id:e,item_id:t.item_id,element_id:r},t))}},{key:"addFilesToStorage",value:function(r,t,n){var i,a=this,u=this.storage.getApp(r);u&&((i=u.file_list).push.apply(i,e(n)),this.storage.updateApp(u),n.forEach(function(e){a.pipeService.emit("gh_file_upload",{app_id:r,item_id:e.item_id,element_id:t},e)}))}},{key:"deleteFileFromStorage",value:function(e,r){var t,n=this.storage.getApp(r);n&&(n.file_list=n.file_list.filter(function(r){return r.file_id!=e||(t=r,!1)}),this.storage.updateApp(n),this.pipeService.emit("gh_file_delete",{file_id:e},t))}},{key:"updateFileInStorage",value:function(e,r,t){var n=this.storage.getApp(r);n&&(n.file_list=n.file_list.map(function(r){return r.file_id==e?t:r}),this.storage.updateApp(n),this.pipeService.emit("gh_file_update",{file_id:e}))}},{key:"getFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(r);case 2:return n=e.sent,e.abrupt("return",new Promise(function(e,r){var i=n.file_list.find(function(e){return e.file_id==t});e(i||"")}));case 4:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"getFiles",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t,n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>1&&void 0!==i[1]?i[1]:[],e.next=3,this.appProcessor.getApp(r);case 3:return n=e.sent,e.abrupt("return",new Promise(function(e,r){var i=n.file_list.filter(function(e){return t.some(function(r){return r==e.file_id})});e(i||"")}));case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"uploadFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadFileApi(r,t,n);case 2:return i=e.sent,this.addFileToStorage(t,i),e.abrupt("return",i);case 5:case"end":return e.stop()}},e,this)}));return function(r,t,n){return e.apply(this,arguments)}}()},{key:"uploadFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadFileFromStringApi(r);case 2:return t=e.sent,this.addFileToStorage(t.app_id,r.element_id,t),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"updateFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n,i,a){var u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateFileFromStringApi(r,t,n,i,a);case 2:return u=e.sent,this.updateFileInStorage(t,u.app_id,u),e.abrupt("return",u);case 5:case"end":return e.stop()}},e,this)}));return function(r,t,n,i,a){return e.apply(this,arguments)}}()},{key:"deleteFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deleteFileApi(r);case 2:return this.deleteFileFromStorage(r,t),e.abrupt("return",!0);case 4:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"isFileExists",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,!Boolean(t)){e.next=12;break}return e.next=4,this.getFile(r,t);case 4:if(i=e.sent,!Boolean(i)){e.next=9;break}return e.abrupt("return",n.test(i.url));case 9:return e.abrupt("return",!1);case 10:e.next=13;break;case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()}]),r}();exports.FileManager=l;
180
+ "use strict";function e(e){return i(e)||n(e)||t(e)||r()}function r(){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 t(e,r){if(e){if("string"==typeof e)return a(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,r):void 0}}function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function i(e){if(Array.isArray(e))return a(e)}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function u(e,r,t,n,i,a,u){try{var o=e[a](u),s=o.value}catch(p){return void t(p)}o.done?r(s):Promise.resolve(s).then(n,i)}function o(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function o(e){u(a,n,i,o,s,"next",e)}function s(e){u(a,n,i,o,s,"throw",e)}o(void 0)})}}function s(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function p(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,r,t){return r&&p(e.prototype,r),t&&p(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileManager=void 0;var l=function(){function r(e,t,n,i){s(this,r),this.storage=e,this.pipeService=t,this.req=n,this.appProcessor=i}return c(r,[{key:"uploadFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n){var i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i={"file-0":r,app_id:t,item_id:n},e.next=4,this.req.post({url:"/file/formupload",form:i});case 4:return a=e.sent,e.abrupt("return",a);case 8:return e.prev=8,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,this,[[0,8]])}));return function(r,t,n){return e.apply(this,arguments)}}()},{key:"uploadFileFromStringApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.post({url:"/file/upload",form:{file:JSON.stringify(r)}});case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(r){return e.apply(this,arguments)}}()},{key:"updateFileFromStringApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n,i,a){var u,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u={file_name:n,extension:i,file_id:t,format:a,source:r},e.next=4,this.req.post({url:"/file/update",form:{file:JSON.stringify(u)}});case 4:return o=e.sent,e.abrupt("return",o);case 8:return e.prev=8,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}},e,this,[[0,8]])}));return function(r,t,n,i,a){return e.apply(this,arguments)}}()},{key:"duplicateFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(r)}}));case 1:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"downloadFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isFileExists(r,t);case 2:if(!e.sent){e.next=12;break}return e.next=5,this.getFile(r,t);case 5:return n=e.sent,e.next=8,this.req.get({url:n.url+"?timestamp="+n.last_update,externalResource:!0});case 8:return i=e.sent,e.abrupt("return",{file:n,data:i,type:"file"});case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"duplicateFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t,n=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.duplicateFileApi(r);case 2:return(t=e.sent).forEach(function(e){n.addFileToStorage(e.app_id,e)}),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"deleteFileApi",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.get({url:"/file/delete?file_id=".concat(r)});case 3:return t=e.sent,e.abrupt("return",t);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(r){return e.apply(this,arguments)}}()},{key:"addFileToStorage",value:function(e,r){var t=this.storage.getApp(e);t&&(t.file_list.push(r),this.storage.updateApp(t),this.pipeService.emit("gh_file_upload",{app_id:e,item_id:r.item_id,file_id:r.file_id},r))}},{key:"addFilesToStorage",value:function(r,t){var n,i=this,a=this.storage.getApp(r);a&&((n=a.file_list).push.apply(n,e(t)),this.storage.updateApp(a),t.forEach(function(e){i.pipeService.emit("gh_file_upload",{app_id:r,item_id:e.item_id,file_id:e.file_id},e)}))}},{key:"deleteFileFromStorage",value:function(e,r){var t,n=this.storage.getApp(r);n&&(n.file_list=n.file_list.filter(function(r){return r.file_id!=e||(t=r,!1)}),this.storage.updateApp(n),this.pipeService.emit("gh_file_delete",{file_id:e},t))}},{key:"updateFileInStorage",value:function(e,r,t){var n=this.storage.getApp(r);n&&(n.file_list=n.file_list.map(function(r){return r.file_id==e?t:r}),this.storage.updateApp(n),this.pipeService.emit("gh_file_update",{file_id:e}))}},{key:"getFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(r);case 2:return n=e.sent,e.abrupt("return",new Promise(function(e,r){var i=n.file_list.find(function(e){return e.file_id==t});e(i||"")}));case 4:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"getFiles",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t,n,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>1&&void 0!==i[1]?i[1]:[],e.next=3,this.appProcessor.getApp(r);case 3:return n=e.sent,e.abrupt("return",new Promise(function(e,r){var i=n.file_list.filter(function(e){return t.some(function(r){return r==e.file_id})});e(i||"")}));case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"uploadFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadFileApi(r,t,n);case 2:return i=e.sent,this.addFileToStorage(t,i),e.abrupt("return",i);case 5:case"end":return e.stop()}},e,this)}));return function(r,t,n){return e.apply(this,arguments)}}()},{key:"uploadFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadFileFromStringApi(r);case 2:return t=e.sent,this.addFileToStorage(t.app_id,t),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)}));return function(r){return e.apply(this,arguments)}}()},{key:"updateFileFromString",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t,n,i,a){var u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateFileFromStringApi(r,t,n,i,a);case 2:return u=e.sent,this.updateFileInStorage(t,u.app_id,u),e.abrupt("return",u);case 5:case"end":return e.stop()}},e,this)}));return function(r,t,n,i,a){return e.apply(this,arguments)}}()},{key:"deleteFile",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deleteFileApi(r);case 2:return this.deleteFileFromStorage(r,t),e.abrupt("return",!0);case 4:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()},{key:"isFileExists",value:function(){var e=o(regeneratorRuntime.mark(function e(r,t){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,!Boolean(t)){e.next=12;break}return e.next=4,this.getFile(r,t);case 4:if(i=e.sent,!Boolean(i)){e.next=9;break}return e.abrupt("return",n.test(i.url));case 9:return e.abrupt("return",!1);case 10:e.next=13;break;case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}},e,this)}));return function(r,t){return e.apply(this,arguments)}}()}]),r}();exports.FileManager=l;
181
181
  },{}],"KHGc":[function(require,module,exports) {
182
182
  "use strict";function e(e,t,r,n,u,a,i){try{var s=e[a](i),o=s.value}catch(c){return void r(c)}s.done?t(o):Promise.resolve(o).then(n,u)}function t(t){return function(){var r=this,n=arguments;return new Promise(function(u,a){var i=t.apply(r,n);function s(t){e(i,u,a,s,o,"next",t)}function o(t){e(i,u,a,s,o,"throw",t)}s(void 0)})}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(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,n.key,n)}}function u(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChunksManager=void 0;var a=function(){function e(t,n,u,a){r(this,e),this.storage=t,this.pipeService=n,this.req=u,this.util=a,this.itemListeners()}return u(e,[{key:"getChunkApi",value:function(){var e=t(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.simpleGet({url:"/api/get-items-chunk/".concat(t,"/").concat(r)});case 3:return n=e.sent,e.abrupt("return",n);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getLastChunkApi",value:function(){var e=t(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.req.simpleGet({url:"/api/get-last-items-chunk/".concat(t)});case 3:return r=e.sent,e.abrupt("return",r);case 7:return e.prev=7,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return",null);case 11:case"end":return e.stop()}},e,this,[[0,7]])}));return function(t){return e.apply(this,arguments)}}()},{key:"getChunk",value:function(e,t){return this.getChunkApi(e,t)}},{key:"getChunks",value:function(){var e=t(regeneratorRuntime.mark(function e(t,r){var n,u=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!r){e.next=5;break}return e.next=4,Promise.all(r.map(function(e){return u.getChunkApi(t,e)}));case 4:n=e.sent;case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getLastChunk",value:function(){var e=t(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getLastChunkApi(t);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"itemListeners",value:function(){}},{key:"getApp",value:function(){var e=t(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",null);case 2:if(r=this.getAppFromStorage(t)){e.next=16;break}if(!this.getAppPromises[t]){e.next=6;break}return e.abrupt("return",this.getAppPromises[t]);case 6:return this.getAppPromises[t]=this.getAppApi(t),e.next=9,this.getAppPromises[t];case 9:if(!(r=e.sent)){e.next=15;break}this.saveAppInStorage(r),this.ws.addSubscription(t),e.next=16;break;case 15:return e.abrupt("return",null);case 16:return e.abrupt("return",r);case 17:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()}]),e}();exports.ChunksManager=a;
183
183
  },{}],"K1Gs":[function(require,module,exports) {