@gudhub/core 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/GUDHUB/AppProcessor/AppProcessor.js +4 -13
  2. package/GUDHUB/Auth/Auth.js +0 -18
  3. package/GUDHUB/Auth/Auth.test.js +1 -11
  4. package/GUDHUB/ChunksManager/ChunksManager.js +1 -1
  5. package/GUDHUB/DataService/AppDataService.js +5 -0
  6. package/GUDHUB/DataService/CacheAPI/index.js +1 -0
  7. package/GUDHUB/DataService/ChunkDataService.js +5 -0
  8. package/GUDHUB/DataService/DataService.js +1 -0
  9. package/GUDHUB/DataService/IndexedDB/IndexedDBAppService.js +98 -0
  10. package/GUDHUB/{ChunksManager/DataService/IndexedDBCacheService.js → DataService/IndexedDB/IndexedDBChunkService.js} +30 -21
  11. package/GUDHUB/DataService/IndexedDB/IndexedDBService.js +7 -0
  12. package/GUDHUB/DataService/IndexedDB/appDataConf.js +7 -0
  13. package/GUDHUB/DataService/IndexedDB/chunkDataConf.js +7 -0
  14. package/GUDHUB/DataService/IndexedDB/consts.js +2 -0
  15. package/GUDHUB/DataService/IndexedDB/init.js +21 -0
  16. package/GUDHUB/DataService/export.js +48 -0
  17. package/GUDHUB/DataService/httpService/AppHttpService.js +31 -0
  18. package/GUDHUB/DataService/httpService/ChunkHttpService.js +32 -0
  19. package/GUDHUB/DataService/httpService/HttpService.js +1 -0
  20. package/GUDHUB/DataService/utils.js +34 -0
  21. package/GUDHUB/api/AppApi.js +14 -0
  22. package/GUDHUB/config.js +3 -0
  23. package/GUDHUB/gudhub.js +6 -19
  24. package/package.json +1 -1
  25. package/umd/library.min.js +42 -15
  26. package/umd/library.min.js.map +1 -1
  27. package/GUDHUB/ChunksManager/DataService/export.js +0 -13
  28. package/GUDHUB/ChunksManager/DataService/httpDataService.js +0 -21
  29. /package/GUDHUB/{ChunksManager → api}/ChunkApi.js +0 -0
@@ -140,7 +140,7 @@ var t=arguments[3],e="function"==typeof Map&&Map.prototype,r=Object.getOwnProper
140
140
  },{}],"pHMV":[function(require,module,exports) {
141
141
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketApi=void 0;var t=e(require("ws"));function e(t){return t&&t.__esModule?t:{default:t}}function r(){r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,i=Object.create(o.prototype),c=new P(n||[]);return a(i,"_invoke",{value:O(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var v="suspendedStart",y="suspendedYield",d="executing",w="completed",g={};function m(){}function b(){}function k(){}var x={};f(x,s,function(){return this});var E=Object.getPrototypeOf,L=E&&E(E(H([])));L&&L!==n&&o.call(L,s)&&(x=L);var _=k.prototype=m.prototype=Object.create(x);function S(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function T(t,e){function r(n,a,c,s){var u=p(t[n],t,a);if("throw"!==u.type){var h=u.arg,f=h.value;return f&&"object"==i(f)&&o.call(f,"__await")?e.resolve(f.__await).then(function(t){r("next",t,c,s)},function(t){r("throw",t,c,s)}):e.resolve(f).then(function(t){h.value=t,c(h)},function(t){return r("throw",t,c,s)})}s(u.arg)}var n;a(this,"_invoke",{value:function(t,o){function i(){return new e(function(e,n){r(t,o,e,n)})}return n=n?n.then(i,i):i()}})}function O(e,r,n){var o=v;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===w){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var s=j(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=w,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=p(e,r,n);if("normal"===u.type){if(o=n.done?w:y,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=w,n.method="throw",n.arg=u.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function H(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(i(e)+" is not iterable")}return b.prototype=k,a(_,"constructor",{value:k,configurable:!0}),a(k,"constructor",{value:b,configurable:!0}),b.displayName=f(k,h,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,f(t,h,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(T.prototype),f(T.prototype,u,function(){return this}),e.AsyncIterator=T,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new T(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},S(_),f(_,h,"Generator"),f(_,s,function(){return this}),f(_,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=H,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:H(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function n(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise(function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)})}}function i(t){return(i="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 a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(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,u(n.key),n)}}function s(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=h(t,"string");return"symbol"==i(e)?e:String(e)}function h(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=exports.WebSocketApi=function(){function e(t,r){a(this,e),this.websocket=null,this.connected=!1,this.queue=[],this.url=t,this.auth=r,this.heartBeatTimeStemp=1e13,this.ALLOWED_HEART_BEAT_DELEY=12e3,this.firstHeartBeat=!0,this.reload=!0,this.isBrowser=!["undefined"==typeof window?"undefined":i(window),"undefined"==typeof document?"undefined":i(document)].includes("undefined")}return s(e,[{key:"addSubscription",value:function(){var t=o(r().mark(function t(e){var n,o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.auth.getToken();case 2:n=t.sent,o="token=".concat(n,"/~/app_id=").concat(e),this.connected&&this.websocket.send(o),this.queue.push(e);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"onOpen",value:function(){var t=o(r().mark(function t(){var e,n=this;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.reload=!0,console.log("websocket opened"),this.connected=!0,t.next=5,this.auth.getToken();case 5:e=t.sent,this.queue.forEach(function(t){var r="token=".concat(e,"/~/app_id=").concat(t);n.websocket.send(r)});case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"onError",value:function(t){console.log("websocket error: ",t),this.websocket.close()}},{key:"onClose",value:function(){console.log("websocket close"),this.connected=!1;try{this.initWebSocket(this.onMassageHandler,this.refreshAppsHandler)}catch(t){console.log(t)}}},{key:"onMessage",value:function(){var t=o(r().mark(function t(e){var n,o,i,a;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=this.isBrowser?e.data:e).match(/HeartBeat/)){t.next=10;break}if(o=(new Date).getTime()-this.heartBeatTimeStemp,!(this.ALLOWED_HEART_BEAT_DELEY<o)){t.next=8;break}return t.next=6,this.onConnectionLost();case 6:t.next=10;break;case 8:this.websocket.send("HeartBeat"),this.heartBeatTimeStemp=(new Date).getTime();case 10:if(this.firstHeartBeat&&(this.connectionChecker(),this.firstHeartBeat=!1),!n.match(/[{}]/)){t.next=17;break}return i=JSON.parse(n),t.next=15,this.auth.getToken();case 15:a=t.sent,i.token!=a&&this.onMassageHandler(i);case 17:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"initWebSocket",value:function(e,r){this.onMassageHandler=e,this.refreshAppsHandler=r,this.isBrowser?(this.websocket=new WebSocket(this.url),this.websocket.onopen=this.onOpen.bind(this),this.websocket.onerror=this.onError.bind(this),this.websocket.onclose=this.onClose.bind(this),this.websocket.onmessage=this.onMessage.bind(this)):(this.websocket=new t.default(this.url),this.websocket.on("open",this.onOpen),this.websocket.on("error",this.onError),this.websocket.on("close",this.onClose),this.websocket.on("message",this.onMessage)),console.log("websocket initialized")}},{key:"connectionChecker",value:function(){var t=this;setInterval(o(r().mark(function e(){var n;return r().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(new Date).getTime()-t.heartBeatTimeStemp,!(t.ALLOWED_HEART_BEAT_DELEY<n)){e.next=4;break}return e.next=4,t.onConnectionLost();case 4:case"end":return e.stop()}},e)})),1e3)}},{key:"onConnectionLost",value:function(){var t=o(r().mark(function t(){return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.auth.getVersion();case 3:this.reload&&(this.reload=!1,console.log("Connected"),this.heartBeatTimeStemp=1e13,this.websocket.close()),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.log(t.t0);case 9:case"end":return t.stop()}},t,this,[[0,6]])}));return function(){return t.apply(this,arguments)}}()}]),e}();
142
142
  },{"ws":"p58b"}],"TPH7":[function(require,module,exports) {
143
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wss_url=exports.server_url=exports.port=exports.node_server_url=exports.file_server_url=exports.automation_modules_path=exports.async_modules_path=void 0;var e=exports.server_url="https://gudhub.com/GudHub_Test",s=exports.wss_url="wss://gudhub.com/GudHub/ws/app/",r=exports.node_server_url="https://gudhub.com/api/services/prod",t=exports.async_modules_path="build/latest/async_modules_node/",o=exports.automation_modules_path="build/latest/automation_modules/",u=exports.file_server_url="https://gudhub.com",p=exports.port=9e3;
143
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wss_url=exports.server_url=exports.port=exports.node_server_url=exports.file_server_url=exports.cache_chunk_requests=exports.cache_app_requests=exports.automation_modules_path=exports.async_modules_path=void 0;var e=exports.server_url="https://gudhub.com/GudHub_Test",s=exports.wss_url="wss://gudhub.com/GudHub/ws/app/",r=exports.node_server_url="https://gudhub.com/api/services/prod",t=exports.async_modules_path="build/latest/async_modules_node/",o=exports.automation_modules_path="build/latest/automation_modules/",u=exports.file_server_url="https://gudhub.com",p=exports.cache_chunk_requests=!0,_=exports.cache_app_requests=!0,a=exports.port=9e3;
144
144
  },{}],"DvAj":[function(require,module,exports) {
145
145
  "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){e=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(r){s=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),u=new G(n||[]);return i(a,"_invoke",{value:O(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function _(){}var x={};s(x,c,function(){return this});var L=Object.getPrototypeOf,E=L&&L(L(I([])));E&&E!==o&&a.call(E,c)&&(x=E);var S=_.prototype=b.prototype=Object.create(x);function k(t){["next","throw","return"].forEach(function(e){s(t,e,function(t){return this._invoke(e,t)})})}function A(e,r){function n(o,i,u,c){var l=p(e[o],e,i);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==t(s)&&a.call(s,"__await")?r.resolve(s.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):r.resolve(s).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,c)})}c(l.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new r(function(r,o){n(t,e,r,o)})}return o=o?o.then(a,a):a()}})}function O(t,e,n){var o=y;return function(a,i){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=p(t,e,n);if("normal"===l.type){if(o=n.done?g:v,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=g,n.method="throw",n.arg=l.arg)}}}function j(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,j(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=p(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,m;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,m):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return w.prototype=_,i(S,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=s(_,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,f,"GeneratorFunction")),t.prototype=Object.create(S),t},n.awrap=function(t){return{__await:t}},k(A.prototype),s(A.prototype,l,function(){return this}),n.AsyncIterator=A,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new A(h(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},k(S),s(S,f,"Generator"),s(S,c,function(){return this}),s(S,"toString",function(){return"[object Generator]"}),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=I,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),m}},n}function r(t){return a(t)||o(t)||u(t)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t){if(Array.isArray(t))return c(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=u(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(l){return void r(l)}u.done?e(c):Promise.resolve(c).then(n,o)}function f(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(t){l(a,n,o,i,u,"next",t)}function u(t){l(a,n,o,i,u,"throw",t)}i(void 0)})}}function s(t,e,r){return h.apply(this,arguments)}function h(){return(h=f(e().mark(function t(n,o,a){var u,c,l,f,s,h,p,y,v,d,g,m,b,w,_,x=arguments;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(_=function(t){return new Promise(function(e){a.on("gh_value_get",t,function r(n,o){a.destroy("gh_value_get",t,r),e(o)}).emit("gh_value_get",{},t)})},u=x.length>3&&void 0!==x[3]?x[3]:{},c=[],l={variableMethodcurrent_app:function(){return[u.current_app_id||u.app_id]},variableMethodelement_app:function(){return[u.element_app_id]},variableMethodcurrent_item:function(){return["".concat(u.current_app_id||u.app_id,".").concat(u.item_id)]},variableMethoduser_id:function(){return[o.getUser().user_id]},variableMethoduser_email:function(t){return[o.getUser().username]},variableMethodtoday:function(t){var e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);return[r.valueOf().toString()+":"+n.valueOf().toString()]},variableMethodvariable:function(t){return[u[t]]}},!n){t.next=40;break}f=i(n),t.prev=6,f.s();case 8:if((s=f.n()).done){t.next=32;break}if(!(h=s.value)){t.next=29;break}t.t0=h.input_type,t.next="variable"===t.t0?14:"field"===t.t0?19:25;break;case 14:h.valuesArray=[],p=i(null==h?void 0:h.input_value.split(","));try{for(p.s();!(y=p.n()).done;)v=y.value,d=h.input_type+"Method"+v,"function"==typeof(g=l[d])?h.valuesArray?(m=h.valuesArray).push.apply(m,r(g())):h.valuesArray=g():h.valuesArray?(b=h.valuesArray).push.apply(b,r(l.variableMethodvariable(v))):h.valuesArray=l.variableMethodvariable(v)}catch(e){p.e(e)}finally{p.f()}return c.push(h),t.abrupt("break",27);case 19:return t.next=21,_({app_id:u.current_app_id||u.app_id,item_id:u.item_id,field_id:h.input_value});case 21:return null!=(w=t.sent)&&h.valuesArray.push(w),c.push(h),t.abrupt("break",27);case 25:return c.push(h),t.abrupt("break",27);case 27:t.next=30;break;case 29:c.push(h);case 30:t.next=8;break;case 32:t.next=37;break;case 34:t.prev=34,t.t1=t.catch(6),f.e(t.t1);case 37:return t.prev=37,f.f(),t.finish(37);case 40:return t.abrupt("return",c);case 41:case"end":return t.stop()}},t,null,[[6,34,37,40]])}))).apply(this,arguments)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.filterPreparation=s;
146
146
  },{}],"jqRt":[function(require,module,exports) {
@@ -217,7 +217,7 @@ function o(e){return module.exports=o="function"==typeof Symbol&&"symbol"==typeo
217
217
  },{}],"mWlG":[function(require,module,exports) {
218
218
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Utils=void 0;var e=require("./filter/filterPreparation.js"),t=k(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"),a=k(require("./populate_items/populate_items.js")),c=require("./get_date/get_date.js"),s=require("./merge_objects/merge_objects.js"),l=require("./merge_chunks/merge_chunks.js"),f=require("./nested_list/nested_list.js"),p=k(require("./MergeFields/MergeFields.js")),h=k(require("./ItemsSelection/ItemsSelection.js")),m=require("./compare_items_lists_worker/compare_items_lists.worker.js"),v=require("./json_constructor/json_constructor.js"),y=k(require("./AppsTemplateService/AppsTemplateService.js")),d=require("./FIleHelper/FileHelper.js"),g=require("./compareObjects/compareObjects.js"),w=require("./dynamicPromiseAll/dynamicPromiseAll.js"),b=require("./filter/sortItems.js");function k(e){return e&&e.__esModule?e:{default:e}}function j(e){return(j="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 _(){_=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,u=Object.create(o.prototype),a=new q(n||[]);return i(u,"_invoke",{value:F(e,r,a)}),u}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",m="executing",v="completed",y={};function d(){}function g(){}function w(){}var b={};s(b,u,function(){return this});var k=Object.getPrototypeOf,L=k&&k(k(P([])));L&&L!==r&&n.call(L,u)&&(b=L);var I=w.prototype=d.prototype=Object.create(b);function S(e){["next","throw","return"].forEach(function(t){s(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){function r(i,o,u,a){var c=f(e[i],e,o);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==j(l)&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,u,a)},function(e){r("throw",e,u,a)}):t.resolve(l).then(function(e){s.value=e,u(s)},function(e){return r("throw",e,u,a)})}a(c.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t(function(t,i){r(e,n,t,i)})}return o=o?o.then(i,i):i()}})}function F(t,r,n){var i=p;return function(o,u){if(i===m)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw u;return{value:e,done:!0}}for(n.method=o,n.arg=u;;){var a=n.delegate;if(a){var c=E(a,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var s=f(t,r,n);if("normal"===s.type){if(i=n.done?v:h,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=v,n.method="throw",n.arg=s.arg)}}}function E(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var u=o.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function q(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function P(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(j(t)+" is not iterable")}return g.prototype=w,i(I,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:g,configurable:!0}),g.displayName=s(w,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,s(e,c,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},S(x.prototype),s(x.prototype,a,function(){return this}),t.AsyncIterator=x,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new x(l(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then(function(e){return e.done?e.value:u.next()})},S(I),s(I,c,"Generator"),s(I,u,function(){return this}),s(I,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,q.prototype={constructor:q,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return a.type="throw",a.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var c=n.call(u,"catchLoc"),s=n.call(u,"finallyLoc");if(c&&s){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function L(e,t,r,n,i,o,u){try{var a=e[o](u),c=a.value}catch(s){return void r(s)}a.done?t(c):Promise.resolve(c).then(n,i)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function u(e){L(o,n,i,u,a,"next",e)}function a(e){L(o,n,i,u,a,"throw",e)}u(void 0)})}}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(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,E(n.key),n)}}function F(e,t,r){return t&&x(e.prototype,t),r&&x(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function E(e){var t=T(e,"string");return"symbol"==j(t)?t:String(t)}function T(e,t){if("object"!=j(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var O=exports.Utils=function(){function k(e){S(this,k),this.gudhub=e,this.MergeFields=new p.default(e),this.ItemsSelection=new h.default(e),this.AppsTemplateService=new y.default(e),this.FileHelper=new d.FileHelper(e)}return F(k,[{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=I(_().mark(function e(){var t,r,n,i,o,a,c,s,l,f,p,h=arguments;return _().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:[],r=h.length>1&&void 0!==h[1]?h[1]:[],n=h.length>2?h[2]:void 0,i=h.length>3?h[3]:void 0,o=h.length>4?h[4]:void 0,a=h.length>5&&void 0!==h[5]?h[5]:"",c=h.length>6?h[6]:void 0,s=h.length>7?h[7]:void 0,e.next=10,this.prefilter(r,{element_app_id:n,app_id:i,item_id:o});case 10:return l=e.sent,f=this.filter(t,l),p=this.group(a,f),e.abrupt("return",p.filter(function(e){return!c||1===(0,u.searchValue)([e],c).length}).filter(function(e){return!s||1===(0,u.searchValue)([e],s).length}));case 14:case"end":return e.stop()}},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,c.getDate)(e)}},{key:"checkRecurringDate",value:function(e,t){return(0,c.checkRecurringDate)(e,t)}},{key:"populateItems",value:function(e,t,r){return(0,a.default)(e,t,r)}},{key:"populateWithDate",value:function(e,t){return(0,c.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,s.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,l.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,v.compiler)(e,t,this,r,n)}},{key:"fileInstallerHelper",value:function(e,t,r){return this.FileHelper.fileInstallerHelper(e,t,r)}},{key:"createAppsFromTemplate",value:function(e,t,r,n){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,n)}},{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,m.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,w.dynamicPromiseAll)(e)}},{key:"sortItems",value:function(e,t){return(0,b.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)}}}]),k}();
219
219
  },{"./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) {
220
- "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(){r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function h(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{h({},"")}catch(e){h=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),u=new j(n||[]);return a(i,"_invoke",{value:O(t,e,u)}),i}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function w(){}function b(){}function k(){}var x={};h(x,s,function(){return this});var L=Object.getPrototypeOf,U=L&&L(L(P([])));U&&U!==o&&i.call(U,s)&&(x=U);var E=k.prototype=w.prototype=Object.create(x);function S(t){["next","throw","return"].forEach(function(r){h(t,r,function(t){return this._invoke(r,t)})})}function A(r,e){function n(o,a,u,s){var c=l(r[o],r,a);if("throw"!==c.type){var f=c.arg,h=f.value;return h&&"object"==t(h)&&i.call(h,"__await")?e.resolve(h.__await).then(function(t){n("next",t,u,s)},function(t){n("throw",t,u,s)}):e.resolve(h).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,s)})}s(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function O(t,r,n){var o=v;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=T(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var c=l(t,r,n);if("normal"===c.type){if(o=n.done?d:y,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=l(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function q(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(r){if(r||""===r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return b.prototype=k,a(E,"constructor",{value:k,configurable:!0}),a(k,"constructor",{value:b,configurable:!0}),b.displayName=h(k,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,h(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},S(A.prototype),h(A.prototype,c,function(){return this}),n.AsyncIterator=A,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new A(p(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},S(E),h(E,f,"Generator"),h(E,s,function(){return this}),h(E,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(q),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),q(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;q(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},n}function e(t,r,e,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void e(c)}u.done?r(s):Promise.resolve(s).then(n,o)}function n(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,s,"next",t)}function s(t){e(a,o,i,u,s,"throw",t)}u(void 0)})}}function o(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,u(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 u(r){var e=s(r,"string");return"symbol"==t(e)?e:String(e)}function s(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 c=exports.Auth=function(){function t(r,e){o(this,t),this.req=r,this.storage=e}return a(t,[{key:"login",value:function(){var t=n(r().mark(function t(){var e,n,o,i,a=arguments;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:{},n=e.username,o=e.password,t.next=3,this.loginApi(n,o);case 3:return i=t.sent,this.storage.updateUser(i),t.abrupt("return",i);case 6:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"loginWithToken",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.loginWithTokenApi(e);case 2:return n=t.sent,this.storage.updateUser(n),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"logout",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.logoutApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"signup",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.signupApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateToken",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.updateTokenApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateUser",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.updateUserApi(e);case 2:return n=t.sent,this.storage.updateUser(n),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateAvatar",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.avatarUploadApi(e);case 2:return n=t.sent,this.storage.updateUser(n),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getUsersList",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getUsersListApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"loginApi",value:function(){var t=n(r().mark(function t(e,n){var o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{username:e,password:n}});case 3:return o=t.sent,t.abrupt("return",o);case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}},t,this,[[0,7]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"loginWithTokenApi",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login?accesstoken=").concat(e)});case 3:return n=t.sent,t.abrupt("return",n);case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}},t,this,[[0,7]])}));return function(r){return t.apply(this,arguments)}}()},{key:"updateTokenApi",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{auth_key:e}});case 3:return n=t.sent,t.abrupt("return",n);case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}},t,this,[[0,7]])}));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=n(r().mark(function t(e){var n,o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.getUserFromStorage(e)){t.next=9;break}return t.next=4,this.getUserByIdApi(e);case 4:if(o=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:(n=this.getUserFromStorage(e))||(this.saveUserToStorage(o),n=o);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getToken",value:function(){var t=n(r().mark(function t(){var e,n,o,i;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=new Date(this.storage.getUser().expirydate),n=new Date,o=this.storage.getUser().accesstoken,!(e<n)&&o){t.next=9;break}return t.next=6,this.updateToken(this.storage.getUser().auth_key);case 6:i=t.sent,this.storage.updateUser(i),o=i.accesstoken;case 9:return t.abrupt("return",o);case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}();
220
+ "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(){r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function h(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{h({},"")}catch(e){h=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),u=new P(n||[]);return a(i,"_invoke",{value:_(t,e,u)}),i}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function w(){}function b(){}function x(){}var k={};h(k,s,function(){return this});var L=Object.getPrototypeOf,E=L&&L(L(q([])));E&&E!==o&&i.call(E,s)&&(k=E);var U=x.prototype=w.prototype=Object.create(k);function S(t){["next","throw","return"].forEach(function(r){h(t,r,function(t){return this._invoke(r,t)})})}function O(r,e){function n(o,a,u,s){var c=l(r[o],r,a);if("throw"!==c.type){var f=c.arg,h=f.value;return h&&"object"==t(h)&&i.call(h,"__await")?e.resolve(h.__await).then(function(t){n("next",t,u,s)},function(t){n("throw",t,u,s)}):e.resolve(h).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,s)})}s(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function _(t,r,n){var o=v;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=A(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var c=l(t,r,n);if("normal"===c.type){if(o=n.done?d:y,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=d,n.method="throw",n.arg=c.arg)}}}function A(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=l(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function T(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function q(r){if(r||""===r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return b.prototype=x,a(U,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,f,"GeneratorFunction")),t.prototype=Object.create(U),t},n.awrap=function(t){return{__await:t}},S(O.prototype),h(O.prototype,c,function(){return this}),n.AsyncIterator=O,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new O(p(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},S(U),h(U,f,"Generator"),h(U,s,function(){return this}),h(U,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=q,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:q(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},n}function e(t,r,e,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void e(c)}u.done?r(s):Promise.resolve(s).then(n,o)}function n(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,s,"next",t)}function s(t){e(a,o,i,u,s,"throw",t)}u(void 0)})}}function o(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,u(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 u(r){var e=s(r,"string");return"symbol"==t(e)?e:String(e)}function s(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 c=exports.Auth=function(){function t(r,e){o(this,t),this.req=r,this.storage=e}return a(t,[{key:"login",value:function(){var t=n(r().mark(function t(){var e,n,o,i,a=arguments;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:{},n=e.username,o=e.password,t.next=3,this.loginApi(n,o);case 3:return i=t.sent,this.storage.updateUser(i),t.abrupt("return",i);case 6:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"logout",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.logoutApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"signup",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.signupApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateToken",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.updateTokenApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateUser",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.updateUserApi(e);case 2:return n=t.sent,this.storage.updateUser(n),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"updateAvatar",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.avatarUploadApi(e);case 2:return n=t.sent,this.storage.updateUser(n),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getUsersList",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getUsersListApi(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"loginApi",value:function(){var t=n(r().mark(function t(e,n){var o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{username:e,password:n}});case 3:return o=t.sent,t.abrupt("return",o);case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}},t,this,[[0,7]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"updateTokenApi",value:function(){var t=n(r().mark(function t(e){var n;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{auth_key:e}});case 3:return n=t.sent,t.abrupt("return",n);case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}},t,this,[[0,7]])}));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=n(r().mark(function t(e){var n,o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.getUserFromStorage(e)){t.next=9;break}return t.next=4,this.getUserByIdApi(e);case 4:if(o=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:(n=this.getUserFromStorage(e))||(this.saveUserToStorage(o),n=o);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"getToken",value:function(){var t=n(r().mark(function t(){var e,n,o,i;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=new Date(this.storage.getUser().expirydate),n=new Date,o=this.storage.getUser().accesstoken,!(e<n)&&o){t.next=9;break}return t.next=6,this.updateToken(this.storage.getUser().auth_key);case 6:i=t.sent,this.storage.updateUser(i),o=i.accesstoken;case 9:return t.abrupt("return",o);case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}();
221
221
  },{}],"UV2u":[function(require,module,exports) {
222
222
  "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=exports.IS_WEB=!["undefined"==typeof window?"undefined":e(window),"undefined"==typeof document?"undefined":e(document)].includes("undefined");
223
223
  },{}],"osSN":[function(require,module,exports) {
@@ -231,18 +231,18 @@ var t,e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),expo
231
231
  },{"axios":"O4Aa","./../consts.js":"UV2u"}],"Htuh":[function(require,module,exports) {
232
232
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GHConstructor=void 0;var t=r(require("./createAngularModuleInstance.js")),e=r(require("./createClassInstance.js"));function r(t){return t&&t.__esModule?t:{default:t}}function n(t){return(n="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 o(){o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new G(n||[]);return a(i,"_invoke",{value:P(t,r,u)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,c,function(){return this});var j=Object.getPrototypeOf,k=j&&j(j(T([])));k&&k!==r&&i.call(k,c)&&(L=k);var E=x.prototype=b.prototype=Object.create(L);function _(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function O(t,e){function r(o,a,u,c){var s=p(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then(function(t){r("next",t,u,c)},function(t){r("throw",t,u,c)}):e.resolve(f).then(function(t){l.value=t,u(l)},function(t){return r("throw",t,u,c)})}c(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,o){r(t,n,e,o)})}return o=o?o.then(i,i):i()}})}function P(e,r,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?g:v,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function S(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(E,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,l,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},_(O.prototype),f(O.prototype,s,function(){return this}),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(E),f(E,l,"Generator"),f(E,c,function(){return this}),f(E,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function u(t){i(a,n,o,u,c,"next",t)}function c(t){i(a,n,o,u,c,"throw",t)}u(void 0)})}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(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,l(n.key),n)}}function s(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t){var e=f(t,"string");return"symbol"==n(e)?e:String(e)}function f(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var h=exports.GHConstructor=function(){function r(t){u(this,r),this.gudhub=t,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}return s(r,[{key:"getInstance",value:function(){var t=a(o().mark(function t(e){return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.getCached(e)){t.next=4;break}return t.abrupt("return",this.getCached(e));case 4:if(!this.modulesQueue[e]){t.next=9;break}return t.next=7,this.modulesQueue[e];case 7:t.next=12;break;case 9:return this.modulesQueue[e]=this.createInstance(e),t.next=12,this.modulesQueue[e];case 12:return t.abrupt("return",this.getCached(e));case 13:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"pupToCache",value:function(t,e){this.cache[t]=e}},{key:"getCached",value:function(t){return this.cache[t]}},{key:"initAngularInjector",value:function(t){this.angularInjector=t}},{key:"initJsdomWindow",value:function(t){this.nodeWindow=t}},{key:"createInstance",value:function(){var r=a(o().mark(function r(n){var i,a;return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(i=this.gudhub.storage.getModuleUrl(n)){r.next=4;break}return console.log("Cannot find module: ".concat(n)),r.abrupt("return");case 4:if("gh_element"!==i.type){r.next=15;break}if("angular"!==i.technology){r.next=11;break}return r.next=8,(0,t.default)(this.gudhub,n,i.url,this.angularInjector,this.nodeWindow);case 8:a=r.sent,r.next=15;break;case 11:if("class"!==i.technology){r.next=15;break}return r.next=14,(0,e.default)(this.gudhub,n,i.js,i.css,this.nodeWindow);case 14:a=r.sent;case 15:return a&&this.pupToCache(n,a),r.abrupt("return",a);case 17:case"end":return r.stop()}},r,this)}));return function(t){return r.apply(this,arguments)}}()}]),r}();
233
233
  },{"./createAngularModuleInstance.js":"osSN","./createClassInstance.js":"DsUm"}],"q0my":[function(require,module,exports) {
234
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppProcessor=void 0;var t=require("../consts.js");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 r(t){return a(t)||i(t)||c(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){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t){if(Array.isArray(t))return f(t)}function o(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 p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=c(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 a,o=!0,p=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){p=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(p)throw a}}}}function c(t,e){if(t){if("string"==typeof t)return f(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)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(){l=function(){return r};var t,r={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},p=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),p=new N(n||[]);return a(o,"_invoke",{value:O(t,r,p)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var v="suspendedStart",d="suspendedYield",g="executing",_="completed",m={};function y(){}function w(){}function b(){}var A={};c(A,p,function(){return this});var x=Object.getPrototypeOf,k=x&&x(x(F([])));k&&k!==n&&i.call(k,p)&&(A=k);var S=b.prototype=y.prototype=Object.create(A);function L(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function j(t,r){function n(a,o,p,s){var u=h(t[a],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==e(f)&&i.call(f,"__await")?r.resolve(f.__await).then(function(t){n("next",t,p,s)},function(t){n("throw",t,p,s)}):r.resolve(f).then(function(t){c.value=t,p(c)},function(t){return n("throw",t,p,s)})}s(u.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r(function(r,i){n(t,e,r,i)})}return o=o?o.then(i,i):i()}})}function O(e,r,n){var i=v;return function(a,o){if(i===g)throw new Error("Generator is already running");if(i===_){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var p=n.delegate;if(p){var s=E(p,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===v)throw i=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var u=h(e,r,n);if("normal"===u.type){if(i=n.done?_:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=_,n.method="throw",n.arg=u.arg)}}}function E(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,E(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=h(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function F(r){if(r||""===r){var n=r[p];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,o=function e(){for(;++a<r.length;)if(i.call(r,a))return e.value=r[a],e.done=!1,e;return e.value=t,e.done=!0,e};return o.next=o}}throw new TypeError(e(r)+" is not iterable")}return w.prototype=b,a(S,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=c(b,u,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},L(j.prototype),c(j.prototype,s,function(){return this}),r.AsyncIterator=j,r.async=function(t,e,n,i,a){void 0===a&&(a=Promise);var o=new j(f(t,e,n,i),a);return r.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},L(S),c(S,u,"Generator"),c(S,p,function(){return this}),c(S,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=F,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return p.type="throw",p.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],p=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function h(t,e,r,n,i,a,o){try{var p=t[a](o),s=p.value}catch(u){return void r(u)}p.done?e(s):Promise.resolve(s).then(n,i)}function v(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function o(t){h(a,n,i,o,p,"next",t)}function p(t){h(a,n,i,o,p,"throw",t)}o(void 0)})}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(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,m(n.key),n)}}function _(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function m(t){var r=y(t,"string");return"symbol"==e(r)?r:String(r)}function y(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var w=exports.AppProcessor=function(){function e(t,r,n,i,a,o,p){d(this,e),this.storage=t,this.pipeService=r,this.req=n,this.ws=i,this.applistReceived=!1,this.activateSW=p,this.chunksManager=a,this.util=o,this.appListeners()}return _(e,[{key:"createNewAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});case 3:return(r=t.sent).from_apps_list=!0,t.abrupt("return",r);case 8:return t.prev=8,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 12:case"end":return t.stop()}},t,this,[[0,8]])}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/delete",form:{app_id:e}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListApi",value:function(){var t=v(l().mark(function t(){var e;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/api/applist/get"});case 3:return e=t.sent,t.abrupt("return",e.apps_list.map(function(t){return t.from_apps_list=!0,t}));case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(){return t.apply(this,arguments)}}()},{key:"getAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/api/app/get",params:{app_id:e}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListFromStorage",value:function(){return this.storage.getAppsList()}},{key:"getAppFromStorage",value:function(t){var e=this.storage.getApp(t);return e&&e.field_list.length?e:null}},{key:"addNewAppToStorage",value:function(t){return this.storage.getAppsList().push(t)}},{key:"saveAppInStorage",value:function(t){t.items_object={};for(var e=0;e<t.items_list.length;e++){t.items_object[t.items_list[e].item_id]={};for(var r=0;r<t.items_list[e].fields.length;r++)t.items_object[t.items_list[e].item_id][t.items_list[e].fields[r].field_id]=t.items_list[e].fields[r]}var n=this.storage.getApp(t.app_id);return n?(t.from_apps_list=n.from_apps_list,t.permission=n.permission,this.storage.updateApp(t)):(t.from_apps_list=!1,this.addNewAppToStorage(t)),this.getAppFromStorage(t.app_id)}},{key:"updateAppFieldsAndViews",value:function(t){var e=this,r=this.getAppFromStorage(t.app_id);t.items_list=r.items_list,t.file_list=r.file_list,t.from_apps_list=r.from_apps_list,t.items_object=r.items_object,this.storage.updateApp(t),this.pipeService.emit("gh_app_views_update",{app_id:t.app_id},t.views_list),t.field_list.forEach(function(r){e.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:r.field_id},r)})}},{key:"updateAppInStorage",value:function(t){this.storage.getApp(t.app_id)?(this.storage.updateApp(t),this.pipeService.emit("gh_app_update",{app_id:t.app_id},t),this.pipeService.emit("gh_items_update",{app_id:t.app_id},t.items_list)):this.addNewAppToStorage(t)}},{key:"deletingAppFromStorage",value:function(t){var e=this.storage.getAppsList();return e.forEach(function(r,n){r.app_id==t&&e.splice(n)}),e}},{key:"updateAppsListInStorage",value:function(){var t,e=u(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this.storage.getApp(r.app_id);n?(n.from_apps_list=r.from_apps_list,n.permission=r.permission):this.addNewAppToStorage(r)}}catch(i){e.e(i)}finally{e.f()}}},{key:"refreshApps",value:function(){var t=v(l().mark(function t(){var e,r,n,i,a,o,p,s=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=s.length>0&&void 0!==s[0]?s[0]:[],r=u(e),t.prev=2,r.s();case 4:if((n=r.n()).done){t.next=19;break}if(null==(i=n.value)){t.next=17;break}return t.prev=7,t.next=10,this.getAppApi(i);case 10:if(a=t.sent){for(a.items_object={},o=0;o<a.items_list.length;o++)for(a.items_object[a.items_list[o].item_id]={},p=0;p<a.items_list[o].fields.length;p++)a.items_object[a.items_list[o].item_id][a.items_list[o].fields[p].field_id]=a.items_list[o].fields[p];this.updateAppInStorage(a),this.pipeService.emit("gh_app_views_update",{app_id:a.app_id},a.views_list)}t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7),console.log(t.t0);case 17:t.next=4;break;case 19:t.next=24;break;case 21:t.prev=21,t.t1=t.catch(2),r.e(t.t1);case 24:return t.prev=24,r.f(),t.finish(24);case 27:console.log("Apps refreshed: ",JSON.stringify(e));case 28:case"end":return t.stop()}},t,this,[[2,21,24,27],[7,14]])}));return function(){return t.apply(this,arguments)}}()},{key:"refreshAppsList",value:function(){var t=v(l().mark(function t(){var e,r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getAppListFromStorage(),t.next=3,this.getAppListApi();case 3:r=t.sent,n=r.map(function(t){return p(p({},t),e.find(function(e){return e.app_id===t.app_id}))}),this.updateAppsListInStorage(n),this.pipeService.emit("gh_apps_list_refreshed",{});case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppsList",value:function(){var t=v(l().mark(function t(){var e,r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.getAppListFromStorage(),this.applistReceived){t.next=11;break}return t.next=4,this.getAppListApi();case 4:if(r=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:this.updateAppsListInStorage(r),this.applistReceived=!0,e=r,this.getApp(this.storage.getUser().app_init);case 11:return t.abrupt("return",e);case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppInfo",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAppsList();case 2:return r=t.sent,t.abrupt("return",r?r.find(function(t){return t.app_id==e}):null);case 4:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteApp",value:function(){var t=v(l().mark(function t(e){return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.deleteAppApi(e);case 2:return t.abrupt("return",this.deletingAppFromStorage(e));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getApp",value:function(){var t=v(l().mark(function t(e){var n,i,a,o=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o.length>1&&void 0!==o[1]&&o[1],e){t.next=3;break}return t.abrupt("return",null);case 3:if(!(n=this.getAppFromStorage(e))){t.next=6;break}return t.abrupt("return",n);case 6:return t.next=8,this.getAppApi(e);case 8:if(i=t.sent){t.next=11;break}return t.abrupt("return");case 11:if(!i.chunks||!i.chunks.length){t.next=16;break}return t.next=14,this.chunksManager.getChunks(e,i.chunks);case 14:a=t.sent,i.items_list=this.util.mergeChunks([].concat(r(a),[i]));case 16:return this.saveAppInStorage(i),this.ws.addSubscription(e),t.abrupt("return",i);case 19:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateApp",value:function(){var t=v(l().mark(function t(e){var r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views_list&&e.views_list.length&&e.show){t.next=6;break}return t.next=3,this.getApp(e.app_id);case 3:r=t.sent,e.views_list&&e.views_list.length||(e.views_list=r.views_list),void 0===e.show&&(e.show=r.show);case 6:return t.next=8,this.updateAppApi(e);case 8:return n=t.sent,this.updateAppFieldsAndViews(n),t.abrupt("return",n);case 11:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppInfo",value:function(){var t=v(l().mark(function t(){var e,r=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),t.abrupt("return",this.updateApp(e));case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"createNewApp",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.createNewAppApi(e);case 2:return(r=t.sent).items_object={},this.addNewAppToStorage(r),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppViews",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,this.getApp(e);case 3:return r=t.sent,t.abrupt("return",r.views_list);case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"clearAppProcessor",value:function(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}},{key:"appListeners",value:function(){var e=this;this.pipeService.onRoot("gh_app_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:i=t.sent,e.pipeService.emit("gh_app_get",n,i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_apps_list_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppsList();case 2:i=t.sent,e.pipeService.emit("gh_apps_list_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_delete_app",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deleteApp(n.app_id);case 2:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_update",{},function(){var t=v(l().mark(function t(r,n){var i,a;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n.app.items_list=[],n.app.file_list=[],t.next=4,e.updateApp(n.app);case 4:return i=t.sent,e.pipeService.emit("gh_app_views_update",{app_id:i.app_id},i.views_list),t.next=8,e.getAppsList();case 8:a=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),i.field_list.forEach(function(t){e.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:t.field_id},t)});case 11:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_view_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:(i=t.sent).views_list.forEach(function(t,r){t.view_id==n.view_id&&e.pipeService.emit("gh_app_view_get",n,i.views_list[r])});case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppInfo(n.app_id);case 2:(i=t.sent)&&e.pipeService.emit("gh_app_info_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_update",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app){t.next=5;break}return t.next=3,e.updateAppInfo(n.app);case 3:i=t.sent,e.pipeService.emit("gh_app_info_update",{app_id:n.app.app_id},i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_create",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.createNewApp(n.app);case 2:return t.next=4,e.getAppsList();case 4:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 6:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),t.IS_WEB&&this.activateSW&&navigator.serviceWorker.addEventListener("message",function(){var t=v(l().mark(function t(r){var n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("refresh app"!==r.data.type){t.next=7;break}return t.next=3,e.getApp(r.data.payload.app_id);case 3:(n=t.sent)&&e.util.compareAppsItemsLists(n.items_list,r.data.payload.items_list.filter(function(t){return!t.trash}),function(t){var n=t.diff_fields_items,i=t.diff_fields_items_Ids,a=t.diff_items,o=t.newItems,p=t.deletedItems;(a.length||o.length||p.length)&&(e.pipeService.emit("gh_items_update",{app_id:r.data.payload.app_id},r.data.payload.items_list.filter(function(t){return!t.trash})),a.forEach(function(t){return e.pipeService.emit("gh_item_update",{app_id:r.data.payload.app_id,item_id:t.item_id},t)})),i.forEach(function(t){var i=n[t];i&&i.forEach(function(n){e.pipeService.emit("gh_value_update",{app_id:r.data.payload.app_id,item_id:t,field_id:n.field_id},n.field_value)})})}),r.data.payload.items_list=e.util.mergeChunks([n,r.data.payload]),e.saveAppInStorage(r.data.payload);case 7:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}}]),e}();
234
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppProcessor=void 0;var t=require("../consts.js");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 r(t){return a(t)||i(t)||c(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){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t){if(Array.isArray(t))return f(t)}function o(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 p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=c(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 a,o=!0,p=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){p=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(p)throw a}}}}function c(t,e){if(t){if("string"==typeof t)return f(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)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(){l=function(){return r};var t,r={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},p=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),p=new N(n||[]);return a(o,"_invoke",{value:O(t,r,p)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var v="suspendedStart",d="suspendedYield",g="executing",_="completed",m={};function y(){}function w(){}function b(){}var A={};c(A,p,function(){return this});var x=Object.getPrototypeOf,k=x&&x(x(F([])));k&&k!==n&&i.call(k,p)&&(A=k);var S=b.prototype=y.prototype=Object.create(A);function L(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function j(t,r){function n(a,o,p,s){var u=h(t[a],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==e(f)&&i.call(f,"__await")?r.resolve(f.__await).then(function(t){n("next",t,p,s)},function(t){n("throw",t,p,s)}):r.resolve(f).then(function(t){c.value=t,p(c)},function(t){return n("throw",t,p,s)})}s(u.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r(function(r,i){n(t,e,r,i)})}return o=o?o.then(i,i):i()}})}function O(e,r,n){var i=v;return function(a,o){if(i===g)throw new Error("Generator is already running");if(i===_){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var p=n.delegate;if(p){var s=E(p,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===v)throw i=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var u=h(e,r,n);if("normal"===u.type){if(i=n.done?_:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=_,n.method="throw",n.arg=u.arg)}}}function E(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,E(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=h(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function F(r){if(r||""===r){var n=r[p];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,o=function e(){for(;++a<r.length;)if(i.call(r,a))return e.value=r[a],e.done=!1,e;return e.value=t,e.done=!0,e};return o.next=o}}throw new TypeError(e(r)+" is not iterable")}return w.prototype=b,a(S,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=c(b,u,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},L(j.prototype),c(j.prototype,s,function(){return this}),r.AsyncIterator=j,r.async=function(t,e,n,i,a){void 0===a&&(a=Promise);var o=new j(f(t,e,n,i),a);return r.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},L(S),c(S,u,"Generator"),c(S,p,function(){return this}),c(S,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=F,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return p.type="throw",p.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],p=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function h(t,e,r,n,i,a,o){try{var p=t[a](o),s=p.value}catch(u){return void r(u)}p.done?e(s):Promise.resolve(s).then(n,i)}function v(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function o(t){h(a,n,i,o,p,"next",t)}function p(t){h(a,n,i,o,p,"throw",t)}o(void 0)})}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(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,m(n.key),n)}}function _(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function m(t){var r=y(t,"string");return"symbol"==e(r)?r:String(r)}function y(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var w=exports.AppProcessor=function(){function e(t,r,n,i,a,o,p,s){d(this,e),this.storage=t,this.pipeService=r,this.req=n,this.ws=i,this.applistReceived=!1,this.activateSW=p,this.chunksManager=a,this.util=o,this.appListeners(),this.dataService=s}return _(e,[{key:"createNewAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});case 3:return(r=t.sent).from_apps_list=!0,t.abrupt("return",r);case 8:return t.prev=8,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 12:case"end":return t.stop()}},t,this,[[0,8]])}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/delete",form:{app_id:e}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListApi",value:function(){var t=v(l().mark(function t(){var e;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/api/applist/get"});case 3:return e=t.sent,t.abrupt("return",e.apps_list.map(function(t){return t.from_apps_list=!0,t}));case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(){return t.apply(this,arguments)}}()},{key:"getAppApi",value:function(){var t=v(l().mark(function t(e){return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.dataService.getApp(e));case 1:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListFromStorage",value:function(){return this.storage.getAppsList()}},{key:"getAppFromStorage",value:function(t){var e=this.storage.getApp(t);return e&&e.field_list.length?e:null}},{key:"addNewAppToStorage",value:function(t){return this.storage.getAppsList().push(t)}},{key:"saveAppInStorage",value:function(t){t.items_object={};for(var e=0;e<t.items_list.length;e++){t.items_object[t.items_list[e].item_id]={};for(var r=0;r<t.items_list[e].fields.length;r++)t.items_object[t.items_list[e].item_id][t.items_list[e].fields[r].field_id]=t.items_list[e].fields[r]}var n=this.storage.getApp(t.app_id);return n?(t.from_apps_list=n.from_apps_list,t.permission=n.permission,this.storage.updateApp(t)):(t.from_apps_list=!1,this.addNewAppToStorage(t)),this.getAppFromStorage(t.app_id)}},{key:"updateAppFieldsAndViews",value:function(t){var e=this,r=this.getAppFromStorage(t.app_id);t.items_list=r.items_list,t.file_list=r.file_list,t.from_apps_list=r.from_apps_list,t.items_object=r.items_object,this.storage.updateApp(t),this.pipeService.emit("gh_app_views_update",{app_id:t.app_id},t.views_list),t.field_list.forEach(function(r){e.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:r.field_id},r)})}},{key:"updateAppInStorage",value:function(t){this.storage.getApp(t.app_id)?(this.storage.updateApp(t),this.pipeService.emit("gh_app_update",{app_id:t.app_id},t),this.pipeService.emit("gh_items_update",{app_id:t.app_id},t.items_list)):this.addNewAppToStorage(t)}},{key:"deletingAppFromStorage",value:function(t){var e=this.storage.getAppsList();return e.forEach(function(r,n){r.app_id==t&&e.splice(n)}),e}},{key:"updateAppsListInStorage",value:function(){var t,e=u(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this.storage.getApp(r.app_id);n?(n.from_apps_list=r.from_apps_list,n.permission=r.permission):this.addNewAppToStorage(r)}}catch(i){e.e(i)}finally{e.f()}}},{key:"refreshApps",value:function(){var t=v(l().mark(function t(){var e,r,n,i,a,o,p,s=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=s.length>0&&void 0!==s[0]?s[0]:[],r=u(e),t.prev=2,r.s();case 4:if((n=r.n()).done){t.next=19;break}if(null==(i=n.value)){t.next=17;break}return t.prev=7,t.next=10,this.getAppApi(i);case 10:if(a=t.sent){for(a.items_object={},o=0;o<a.items_list.length;o++)for(a.items_object[a.items_list[o].item_id]={},p=0;p<a.items_list[o].fields.length;p++)a.items_object[a.items_list[o].item_id][a.items_list[o].fields[p].field_id]=a.items_list[o].fields[p];this.updateAppInStorage(a),this.pipeService.emit("gh_app_views_update",{app_id:a.app_id},a.views_list)}t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7),console.log(t.t0);case 17:t.next=4;break;case 19:t.next=24;break;case 21:t.prev=21,t.t1=t.catch(2),r.e(t.t1);case 24:return t.prev=24,r.f(),t.finish(24);case 27:console.log("Apps refreshed: ",JSON.stringify(e));case 28:case"end":return t.stop()}},t,this,[[2,21,24,27],[7,14]])}));return function(){return t.apply(this,arguments)}}()},{key:"refreshAppsList",value:function(){var t=v(l().mark(function t(){var e,r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getAppListFromStorage(),t.next=3,this.getAppListApi();case 3:r=t.sent,n=r.map(function(t){return p(p({},t),e.find(function(e){return e.app_id===t.app_id}))}),this.updateAppsListInStorage(n),this.pipeService.emit("gh_apps_list_refreshed",{});case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppsList",value:function(){var t=v(l().mark(function t(){var e,r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.getAppListFromStorage(),this.applistReceived){t.next=11;break}return t.next=4,this.getAppListApi();case 4:if(r=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:this.updateAppsListInStorage(r),this.applistReceived=!0,e=r,this.getApp(this.storage.getUser().app_init);case 11:return t.abrupt("return",e);case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppInfo",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAppsList();case 2:return r=t.sent,t.abrupt("return",r?r.find(function(t){return t.app_id==e}):null);case 4:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteApp",value:function(){var t=v(l().mark(function t(e){return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.deleteAppApi(e);case 2:return t.abrupt("return",this.deletingAppFromStorage(e));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getApp",value:function(){var t=v(l().mark(function t(e){var n,i,a,o=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o.length>1&&void 0!==o[1]&&o[1],e){t.next=3;break}return t.abrupt("return",null);case 3:if(!(n=this.getAppFromStorage(e))){t.next=6;break}return t.abrupt("return",n);case 6:return t.next=8,this.getAppApi(e);case 8:if(i=t.sent){t.next=11;break}return t.abrupt("return");case 11:if(!i.chunks||!i.chunks.length){t.next=16;break}return t.next=14,this.chunksManager.getChunks(e,i.chunks);case 14:a=t.sent,i.items_list=this.util.mergeChunks([].concat(r(a),[i]));case 16:return this.saveAppInStorage(i),this.ws.addSubscription(e),t.abrupt("return",i);case 19:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateApp",value:function(){var t=v(l().mark(function t(e){var r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views_list&&e.views_list.length&&e.show){t.next=6;break}return t.next=3,this.getApp(e.app_id);case 3:r=t.sent,e.views_list&&e.views_list.length||(e.views_list=r.views_list),void 0===e.show&&(e.show=r.show);case 6:return t.next=8,this.updateAppApi(e);case 8:return n=t.sent,this.updateAppFieldsAndViews(n),t.abrupt("return",n);case 11:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppInfo",value:function(){var t=v(l().mark(function t(){var e,r=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),t.abrupt("return",this.updateApp(e));case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"createNewApp",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.createNewAppApi(e);case 2:return(r=t.sent).items_object={},this.addNewAppToStorage(r),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppViews",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,this.getApp(e);case 3:return r=t.sent,t.abrupt("return",r.views_list);case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"clearAppProcessor",value:function(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}},{key:"appListeners",value:function(){var e=this;this.pipeService.onRoot("gh_app_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:i=t.sent,e.pipeService.emit("gh_app_get",n,i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_apps_list_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppsList();case 2:i=t.sent,e.pipeService.emit("gh_apps_list_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_delete_app",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deleteApp(n.app_id);case 2:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_update",{},function(){var t=v(l().mark(function t(r,n){var i,a;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n.app.items_list=[],n.app.file_list=[],t.next=4,e.updateApp(n.app);case 4:return i=t.sent,e.pipeService.emit("gh_app_views_update",{app_id:i.app_id},i.views_list),t.next=8,e.getAppsList();case 8:a=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),i.field_list.forEach(function(t){e.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:t.field_id},t)});case 11:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_view_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:(i=t.sent).views_list.forEach(function(t,r){t.view_id==n.view_id&&e.pipeService.emit("gh_app_view_get",n,i.views_list[r])});case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppInfo(n.app_id);case 2:(i=t.sent)&&e.pipeService.emit("gh_app_info_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_update",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app){t.next=5;break}return t.next=3,e.updateAppInfo(n.app);case 3:i=t.sent,e.pipeService.emit("gh_app_info_update",{app_id:n.app.app_id},i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_create",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.createNewApp(n.app);case 2:return t.next=4,e.getAppsList();case 4:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 6:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),t.IS_WEB&&this.activateSW&&navigator.serviceWorker.addEventListener("message",function(){var t=v(l().mark(function t(r){var n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("refresh app"!==r.data.type){t.next=7;break}return t.next=3,e.getApp(r.data.payload.app_id);case 3:(n=t.sent)&&e.util.compareAppsItemsLists(n.items_list,r.data.payload.items_list.filter(function(t){return!t.trash}),function(t){var n=t.diff_fields_items,i=t.diff_fields_items_Ids,a=t.diff_items,o=t.newItems,p=t.deletedItems;(a.length||o.length||p.length)&&(e.pipeService.emit("gh_items_update",{app_id:r.data.payload.app_id},r.data.payload.items_list.filter(function(t){return!t.trash})),a.forEach(function(t){return e.pipeService.emit("gh_item_update",{app_id:r.data.payload.app_id,item_id:t.item_id},t)})),i.forEach(function(t){var i=n[t];i&&i.forEach(function(n){e.pipeService.emit("gh_value_update",{app_id:r.data.payload.app_id,item_id:t,field_id:n.field_id},n.field_value)})})}),r.data.payload.items_list=e.util.mergeChunks([n,r.data.payload]),e.saveAppInStorage(r.data.payload);case 7:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}}]),e}();
235
235
  },{"../consts.js":"UV2u"}],"UUd3":[function(require,module,exports) {
236
236
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ItemProcessor=void 0;var t=require("../utils.js");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 r(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 n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function i(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(){o=function(){return r};var t,r={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",p=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),u=new N(n||[]);return a(o,"_invoke",{value:I(t,r,u)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=l;var d="suspendedStart",v="suspendedYield",m="executing",y="completed",_={};function g(){}function w(){}function b(){}var x={};f(x,s,function(){return this});var S=Object.getPrototypeOf,k=S&&S(S(F([])));k&&k!==n&&i.call(k,s)&&(x=k);var O=b.prototype=g.prototype=Object.create(x);function j(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function E(t,r){function n(o,a,u,s){var c=h(t[o],t,a);if("throw"!==c.type){var p=c.arg,f=p.value;return f&&"object"==e(f)&&i.call(f,"__await")?r.resolve(f.__await).then(function(t){n("next",t,u,s)},function(t){n("throw",t,u,s)}):r.resolve(f).then(function(t){p.value=t,u(p)},function(t){return n("throw",t,u,s)})}s(c.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r(function(r,i){n(t,e,r,i)})}return o=o?o.then(i,i):i()}})}function I(e,r,n){var i=d;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var s=L(u,n);if(s){if(s===_)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=h(e,r,n);if("normal"===c.type){if(i=n.done?y:v,c.arg===_)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=y,n.method="throw",n.arg=c.arg)}}}function L(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var o=h(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,_;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,_)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function F(r){if(r||""===r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(e(r)+" is not iterable")}return w.prototype=b,a(O,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=f(b,p,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,p,"GeneratorFunction")),t.prototype=Object.create(O),t},r.awrap=function(t){return{__await:t}},j(E.prototype),f(E.prototype,c,function(){return this}),r.AsyncIterator=E,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new E(l(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},j(O),f(O,p,"Generator"),f(O,s,function(){return this}),f(O,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=F,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},r}function a(t,e,r,n,i,o,a){try{var u=t[o](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function u(t){a(o,n,i,u,s,"next",t)}function s(t){a(o,n,i,u,s,"throw",t)}u(void 0)})}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(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,f(n.key),n)}}function p(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var r=l(t,"string");return"symbol"==e(r)?r:String(r)}function l(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var h=exports.ItemProcessor=function(){function e(t,r,n,i,o){s(this,e),this.storage=t,this.pipeService=r,this.req=n,this.appProcessor=i,this.util=o,this.itemListeners()}return p(e,[{key:"addItemsApi",value:function(){var t=u(o().mark(function t(e,r){var n;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/items/add",form:{items:JSON.stringify(r),app_id:e}});case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"updateItemsApi",value:function(){var t=u(o().mark(function t(e,r){var n;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/items/update",form:{items:JSON.stringify(r),app_id:e}});case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItemsApi",value:function(t){try{var e=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(t)}});return e.from_apps_list=!0,e}catch(r){return console.log(r),null}}},{key:"addItemsToStorage",value:function(){var t=u(o().mark(function t(e,r){var n,i=this;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.appProcessor.getApp(e);case 2:return(n=t.sent)&&(r.forEach(function(t){n.items_list.push(t),n.items_object[t.item_id]={};for(var r=0;r<t.fields.length;r++)n.items_object[t.item_id][t.fields[r].field_id]=t.fields[r];i.pipeService.emit("gh_item_update",{app_id:e},[t])}),this.pipeService.emit("gh_items_update",{app_id:e},n.items_list),this.storage.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:"updateItemsInStorage",value:function(){var t=u(o().mark(function t(e,r){var n,i=this;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.pipeService.emit("gh_items_update",{app_id:e},r),t.next=3,this.appProcessor.getApp(e);case 3:return(n=t.sent)&&r&&r.forEach(function(t){var r={app_id:e};i.pipeService.emit("gh_item_update",r,[t]),r.item_id=t.item_id,i.pipeService.emit("gh_item_update",r,t);var o=n.items_list.find(function(e){return e.item_id==t.item_id});o&&t.fields.forEach(function(t){var e=o.fields.find(function(e){return e.field_id==t.field_id});r.field_id=t.field_id,e?e.field_value!=t.field_value&&(e.field_value=t.field_value,n.items_object[o.item_id][e.field_id]=e,i.pipeService.emit("gh_value_update",r,t.field_value)):(o.fields.push(t),n.items_object[o.item_id][t.field_id]=t,i.pipeService.emit("gh_value_update",r,t.field_value))})}),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItemsFromStorage",value:function(){var t=u(o().mark(function t(e){var r,n,i=arguments;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:[],t.next=3,this.appProcessor.getApp(e);case 3:(n=t.sent)&&(n.items_list=n.items_list.filter(function(t){return!r.find(function(e){return t.item_id==e.item_id})||(delete n.items_object[t.item_id],!1)}),this.pipeService.emit("gh_items_update",{app_id:e},n.items_list),this.storage.updateApp(n));case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getItems",value:function(){var t=u(o().mark(function t(e){var r,n,i=arguments;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]&&i[1],t.next=3,this.appProcessor.getApp(e,r);case 3:if(n=t.sent){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",n.items_list);case 7:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"addNewItems",value:function(){var e=u(o().mark(function e(r,i){var a,u;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.map(function(e){return n(n({},e),{},{fields:(0,t.filterFields)(e.fields)})}),e.next=3,this.addItemsApi(r,a);case 3:return u=e.sent,e.next=6,this.addItemsToStorage(r,u);case 6:return this.pipeService.emit("gh_items_add",{app_id:r},u),e.abrupt("return",u);case 8:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItems",value:function(){var e=u(o().mark(function e(r,i){var a,u;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.map(function(e){return n(n({},e),{},{fields:(0,t.filterFields)(e.fields)})}),e.next=3,this.updateItemsApi(r,a);case 3:return u=e.sent,e.next=6,this.updateItemsInStorage(r,u);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteItems",value:function(){var t=u(o().mark(function t(e,r){var n=this;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.deleteItemsApi(r).then(function(){var t=u(o().mark(function t(r){return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.deleteItemsFromStorage(e,r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"itemListeners",value:function(){var t=this;this.pipeService.onRoot("gh_items_get",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.app_id){e.next=5;break}return e.next=3,t.getItems(n.app_id);case 3:(i=e.sent)?t.pipeService.emit("gh_items_get",n,i):t.pipeService.emit("gh_items_get",n,[]);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_add",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n&&n.app_id&&n.items)){e.next=5;break}return e.next=3,t.addNewItems(n.app_id,n.items);case 3:(i=e.sent)?t.pipeService.emit("gh_items_add",n,i):t.pipeService.emit("gh_items_add",n,[]);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_update",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n&&n.app_id&&n.items)){e.next=5;break}return e.next=3,t.updateItems(n.app_id,n.items);case 3:(i=e.sent)?t.pipeService.emit("gh_items_update",n,i):t.pipeService.emit("gh_items_update",n,[]);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_item_get",{},function(){var e=u(o().mark(function e(r,n){var i,a;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.app_id){e.next=6;break}return e.next=3,t.getItems(n.app_id);case 3:i=e.sent,a=i.find(function(t){return t.item_id==n.item_id}),t.pipeService.emit("gh_item_get",n,a);case 6:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filtered_items_get",{},function(){var e=u(o().mark(function e(r,n){var i,a;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.element_app_id){e.next=8;break}return e.next=3,t.getItems(n.element_app_id);case 3:return i=e.sent,e.next=6,t.util.getFilteredItems(i,n.filters_list,n.element_app_id,n.app_id,n.item_id,n.field_groupe,n.search,n.search_params);case 6:a=e.sent,t.pipeService.emit("gh_filtered_items_get",n,a);case 8:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filter_items",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.items){e.next=5;break}return e.next=3,t.util.getFilteredItems(n.items,n.filters_list,n.element_app_id,n.app_id,n.item_id,n.field_groupe,n.search,n.search_params);case 3:i=e.sent,t.pipeService.emit("gh_filter_items",n,i);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}())}}]),e}();
237
237
  },{"../utils.js":"EgeI"}],"PoPF":[function(require,module,exports) {
238
238
  "use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(){t=function(){return n};var r,n={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(r){p=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof _?t:_,o=Object.create(i.prototype),u=new N(n||[]);return a(o,"_invoke",{value:j(e,r,u)}),o}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var h="suspendedStart",v="suspendedYield",y="executing",g="completed",m={};function _(){}function b(){}function w(){}var x={};p(x,c,function(){return this});var k=Object.getPrototypeOf,O=k&&k(k(I([])));O&&O!==i&&o.call(O,c)&&(x=O);var P=w.prototype=_.prototype=Object.create(x);function F(e){["next","throw","return"].forEach(function(t){p(e,t,function(e){return this._invoke(t,e)})})}function S(t,r){function n(i,a,u,c){var s=d(t[i],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==e(p)&&o.call(p,"__await")?r.resolve(p.__await).then(function(e){n("next",e,u,c)},function(e){n("throw",e,u,c)}):r.resolve(p).then(function(e){l.value=e,u(l)},function(e){return n("throw",e,u,c)})}c(s.arg)}var i;a(this,"_invoke",{value:function(e,t){function o(){return new r(function(r,i){n(e,t,r,i)})}return i=i?i.then(o,o):o()}})}function j(e,t,n){var i=h;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:r,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var c=L(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var s=d(e,t,n);if("normal"===s.type){if(i=n.done?g:v,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=g,n.method="throw",n.arg=s.arg)}}}function L(e,t){var n=t.method,i=e.iterator[n];if(i===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,L(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=d(i,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,m;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,m):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function e(){for(;++i<t.length;)if(o.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}throw new TypeError(e(t)+" is not iterable")}return b.prototype=w,a(P,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=p(w,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,p(e,l,"GeneratorFunction")),e.prototype=Object.create(P),e},n.awrap=function(e){return{__await:e}},F(S.prototype),p(S.prototype,s,function(){return this}),n.AsyncIterator=S,n.async=function(e,t,r,i,o){void 0===o&&(o=Promise);var a=new S(f(e,t,r,i),o);return n.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},F(P),p(P,l,"Generator"),p(P,c,function(){return this}),p(P,"toString",function(){return"[object Generator]"}),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=I,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return u.type="throw",u.arg=e,t.next=n,i&&(t.method="next",t.arg=r),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),m}},n}function r(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 n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e,t,r){return(t=l(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t,r,n,i,o,a){try{var u=e[o](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function u(e){o(a,n,i,u,c,"next",e)}function c(e){o(a,n,i,u,c,"throw",e)}u(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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,l(n.key),n)}}function s(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(t){var r=p(t,"string");return"symbol"==e(r)?r:String(r)}function p(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FieldProcessor=void 0;var f=exports.FieldProcessor=function(){function e(t,r,n,i,o){u(this,e),this.storage=t,this.req=r,this.appProcessor=n,this.itemProcessor=i,this.pipeService=o,this.fieldListeners()}return s(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=a(t().mark(function e(r){var i,o,a,u=arguments;return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>1&&void 0!==u[1]?u[1]:{},e.next=3,this.appProcessor.getApp(r);case 3:return o=e.sent,a={app_id:r,app_name:o.app_name,group_id:o.group_id,icon:o.icon,field_list:o.field_list.map(function(e){return e.field_id==i.field_id?n(n({},e),i):e}),views_list:o.views_list},e.abrupt("return",this.appProcessor.updateApp(a));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);return 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),!0}},{key:"updateFieldInStorage",value:function(e,t){var r=this.storage.getApp(e);return r.field_list=r.field_list.map(function(e){return e.field_id==t.field_id?n(n({},e),t):e}),this.storage.updateApp(r),t}},{key:"updateFieldValue",value:function(e,t,r,n){var i=this.storage.getApp(e);return i.items_list.forEach(function(e){e.item_id==t&&e.fields.forEach(function(t){t.field_id==r&&(t.field_value=n,i.items_object[e.item_id][t.field_id]=t)})}),this.storage.updateApp(i),n}},{key:"getField",value:function(){var e=a(t().mark(function e(r,n){var i,o;return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(r);case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:o=0;case 6:if(!(o<i.field_list.length)){e.next=12;break}if(i.field_list[o].field_id!=n){e.next=9;break}return e.abrupt("return",i.field_list[o]);case 9:o++,e.next=6;break;case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldIdByNameSpace",value:function(){var e=a(t().mark(function e(r,n){var i,o;return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(r);case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:o=0;case 6:if(!(o<i.field_list.length)){e.next=12;break}if(i.field_list[o].name_space!=n){e.next=9;break}return e.abrupt("return",i.field_list[o].field_id);case 9:o++,e.next=6;break;case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldModels",value:function(){var e=a(t().mark(function e(r){var n;return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.appProcessor.getApp(r);case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",n.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=a(t().mark(function e(r,n){var i;return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&n){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.updatedFieldApi(r,n);case 4:return i=e.sent,e.abrupt("return",this.updateFieldInStorage(r,i));case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteField",value:function(){var e=a(t().mark(function e(r,n){return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deleteFieldApi(n);case 2:return e.abrupt("return",this.deleteFieldInStorage(r,n));case 3:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"getFieldValue",value:function(){var e=a(t().mark(function e(r,n,i){var o,a;return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=null,e.next=3,this.appProcessor.getApp(r);case 3:a=e.sent;try{o=a.items_object[n][i].field_value}catch(t){}return e.abrupt("return",o);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=a(t().mark(function e(r,n,i,o){return t().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&n&&i){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.setFieldValueApi(r,n,i,o);case 4:return e.abrupt("return",this.updateFieldValue(r,n,i,o));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 r=a(t().mark(function r(n,i){var o;return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i.app_id&&i.item_id&&i.field_id)){t.next=5;break}return t.next=3,e.getFieldValue(i.app_id,i.item_id,i.field_id);case 3:o=t.sent,e.pipeService.emit("gh_value_get",i,o);case 5:case"end":return t.stop()}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_value_set",{},function(){var r=a(t().mark(function r(n,i){return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i.item_id&&(e.setFieldValue(i.app_id,i.item_id,i.field_id,i.new_value),delete i.new_value);case 1:case"end":return t.stop()}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_get",{},function(){var r=a(t().mark(function r(n,i){var o;return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.getField(i.app_id,i.field_id);case 3:o=t.sent,e.pipeService.emit("gh_model_get",i,o),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()}},r,null,[[0,7]])}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_update",{},function(){var r=a(t().mark(function r(n,i){var o;return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.updateField(i.app_id,i.field_model);case 2:o=t.sent,e.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:i.field_id},o);case 4:case"end":return t.stop()}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_models_get",{},function(){var r=a(t().mark(function r(n,i){var o;return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getFieldModels(i.app_id);case 2:o=t.sent,e.pipeService.emit("gh_models_get",i,o);case 4:case"end":return t.stop()}},r)}));return function(e,t){return r.apply(this,arguments)}}()),this.pipeService.onRoot("gh_model_delete",{},function(){var r=a(t().mark(function r(n,i){var o;return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deleteField(i.app_id,i.field_id);case 2:o=t.sent,e.pipeService.emit("gh_model_delete",i,o);case 4:case"end":return t.stop()}},r)}));return function(e,t){return r.apply(this,arguments)}}())}}]),e}();
239
239
  },{}],"XUT2":[function(require,module,exports) {
240
240
  "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t){return o(t)||i(t)||n(t)||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 n(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 i(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function o(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 u(){u=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:L(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var v="suspendedStart",d="suspendedYield",y="executing",g="completed",m={};function w(){}function b(){}function x(){}var _={};f(_,c,function(){return this});var F=Object.getPrototypeOf,k=F&&F(F(N([])));k&&k!==n&&i.call(k,c)&&(_=k);var S=x.prototype=w.prototype=Object.create(_);function E(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function A(e,r){function n(o,a,u,c){var s=h(e[o],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):r.resolve(f).then(function(t){l.value=t,u(l)},function(t){return n("throw",t,u,c)})}c(s.arg)}var a;o(this,"_invoke",{value:function(t,e){function i(){return new r(function(r,i){n(t,e,r,i)})}return a=a?a.then(i,i):i()}})}function L(t,r,n){var i=v;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var c=O(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===v)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var s=h(t,r,n);if("normal"===s.type){if(i=n.done?g:d,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=g,n.method="throw",n.arg=s.arg)}}}function O(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=h(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function N(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return b.prototype=x,o(S,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},E(A.prototype),f(A.prototype,s,function(){return this}),r.AsyncIterator=A,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new A(p(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},E(S),f(S,l,"Generator"),f(S,c,function(){return this}),f(S,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=N,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return u.type="throw",u.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},r}function c(t,e,r,n,i,o,a){try{var u=t[o](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,i)}function s(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){c(o,n,i,a,u,"next",t)}function u(t){c(o,n,i,a,u,"throw",t)}a(void 0)})}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(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,h(n.key),n)}}function p(t,e,r){return e&&f(t.prototype,e),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(e){var r=v(e,"string");return"symbol"==t(r)?r:String(r)}function v(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileManager=void 0;var d=exports.FileManager=function(){function t(e,r,n,i){l(this,t),this.storage=e,this.pipeService=r,this.req=n,this.appProcessor=i}return p(t,[{key:"uploadFileApi",value:function(){var t=s(u().mark(function t(e,r,n){var i,o;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i={"file-0":e,app_id:r,item_id:n},t.next=4,this.req.post({url:"/file/formupload",form:i});case 4:return o=t.sent,t.abrupt("return",o);case 8:return t.prev=8,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 12:case"end":return t.stop()}},t,this,[[0,8]])}));return function(e,r,n){return t.apply(this,arguments)}}()},{key:"uploadFileFromStringApi",value:function(){var t=s(u().mark(function t(e){var r;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/file/upload",form:{file:JSON.stringify(e)}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"updateFileFromStringApi",value:function(){var t=s(u().mark(function t(e,r,n,i,o){var a,c;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,a={file_name:n,extension:i,file_id:r,format:o,source:e},t.next=4,this.req.post({url:"/file/update",form:{file:JSON.stringify(a)}});case 4:return c=t.sent,t.abrupt("return",c);case 8:return t.prev=8,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 12:case"end":return t.stop()}},t,this,[[0,8]])}));return function(e,r,n,i,o){return t.apply(this,arguments)}}()},{key:"duplicateFileApi",value:function(){var t=s(u().mark(function t(e){return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(e)}}));case 1:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"downloadFileFromString",value:function(){var t=s(u().mark(function t(e,r){var n,i;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.isFileExists(e,r);case 2:if(!t.sent){t.next=12;break}return t.next=5,this.getFile(e,r);case 5:return n=t.sent,t.next=8,this.req.get({url:n.url+"?timestamp="+n.last_update,externalResource:!0});case 8:return i=t.sent,t.abrupt("return",{file:n,data:i,type:"file"});case 12:return t.abrupt("return",!1);case 13:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"duplicateFile",value:function(){var t=s(u().mark(function t(e){var r,n=this;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.duplicateFileApi(e);case 2:return(r=t.sent).forEach(function(t){n.addFileToStorage(t.app_id,t)}),t.abrupt("return",r);case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteFileApi",value:function(){var t=s(u().mark(function t(e){var r;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/file/delete?file_id=".concat(e)});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"addFileToStorage",value:function(t,e){var r=this.storage.getApp(t);r&&(r.file_list.push(e),this.storage.updateApp(r),this.pipeService.emit("gh_file_upload",{app_id:t,item_id:e.item_id,file_id:e.file_id},e))}},{key:"addFilesToStorage",value:function(t,r){var n,i=this,o=this.storage.getApp(t);o&&((n=o.file_list).push.apply(n,e(r)),this.storage.updateApp(o),r.forEach(function(e){i.pipeService.emit("gh_file_upload",{app_id:t,item_id:e.item_id,file_id:e.file_id},e)}))}},{key:"deleteFileFromStorage",value:function(t,e){var r,n=this.storage.getApp(e);n&&(n.file_list=n.file_list.filter(function(e){return e.file_id!=t||(r=e,!1)}),this.storage.updateApp(n),this.pipeService.emit("gh_file_delete",{file_id:t},r))}},{key:"updateFileInStorage",value:function(t,e,r){var n=this.storage.getApp(e);n&&(n.file_list=n.file_list.map(function(e){return e.file_id==t?r:e}),this.storage.updateApp(n),this.pipeService.emit("gh_file_update",{file_id:t}))}},{key:"getFile",value:function(){var t=s(u().mark(function t(e,r){var n;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.appProcessor.getApp(e);case 2:return n=t.sent,t.abrupt("return",new Promise(function(t,e){var i=n.file_list.find(function(t){return t.file_id==r});t(i||"")}));case 4:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"getFiles",value:function(){var t=s(u().mark(function t(e){var r,n,i=arguments;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:[],t.next=3,this.appProcessor.getApp(e);case 3:return n=t.sent,t.abrupt("return",new Promise(function(t,e){var i=n.file_list.filter(function(t){return r.some(function(e){return e==t.file_id})});t(i||"")}));case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"uploadFile",value:function(){var t=s(u().mark(function t(e,r,n){var i;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.uploadFileApi(e,r,n);case 2:return i=t.sent,this.addFileToStorage(r,i),t.abrupt("return",i);case 5:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()},{key:"uploadFileFromString",value:function(){var t=s(u().mark(function t(e){var r;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.uploadFileFromStringApi(e);case 2:return r=t.sent,this.addFileToStorage(r.app_id,r),t.abrupt("return",r);case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateFileFromString",value:function(){var t=s(u().mark(function t(e,r,n,i,o){var a;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.updateFileFromStringApi(e,r,n,i,o);case 2:return a=t.sent,this.updateFileInStorage(r,a.app_id,a),t.abrupt("return",a);case 5:case"end":return t.stop()}},t,this)}));return function(e,r,n,i,o){return t.apply(this,arguments)}}()},{key:"deleteFile",value:function(){var t=s(u().mark(function t(e,r){return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.deleteFileApi(e);case 2:return this.deleteFileFromStorage(e,r),t.abrupt("return",!0);case 4:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"isFileExists",value:function(){var t=s(u().mark(function t(e,r){var n,i;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,!Boolean(r)){t.next=12;break}return t.next=4,this.getFile(e,r);case 4:if(i=t.sent,!Boolean(i)){t.next=9;break}return t.abrupt("return",n.test(i.url));case 9:return t.abrupt("return",!1);case 10:t.next=13;break;case 12:return t.abrupt("return",!1);case 13:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()}]),t}();
241
- },{}],"htZj":[function(require,module,exports) {
241
+ },{}],"baS4":[function(require,module,exports) {
242
242
  "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(){r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(e){l=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),u=new N(n||[]);return a(i,"_invoke",{value:P(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var L={};l(L,c,function(){return this});var E=Object.getPrototypeOf,k=E&&E(E(q([])));k&&k!==o&&i.call(k,c)&&(L=k);var j=x.prototype=w.prototype=Object.create(L);function O(t){["next","throw","return"].forEach(function(r){l(t,r,function(t){return this._invoke(r,t)})})}function _(r,e){function n(o,a,u,c){var f=p(r[o],r,a);if("throw"!==f.type){var s=f.arg,l=s.value;return l&&"object"==t(l)&&i.call(l,"__await")?e.resolve(l.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):e.resolve(l).then(function(t){s.value=t,u(s)},function(t){return n("throw",t,u,c)})}c(f.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function P(t,r,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=p(t,r,n);if("normal"===f.type){if(o=n.done?g:v,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=g,n.method="throw",n.arg=f.arg)}}}function S(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function G(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function T(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(G,this),this.reset(!0)}function q(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return b.prototype=x,a(j,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},n.awrap=function(t){return{__await:t}},O(_.prototype),l(_.prototype,f,function(){return this}),n.AsyncIterator=_,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new _(h(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},O(j),l(j,s,"Generator"),l(j,c,function(){return this}),l(j,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=q,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),f=i.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:q(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},n}function e(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(f){return void e(f)}u.done?r(c):Promise.resolve(c).then(n,o)}function n(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)})}}function o(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,u(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 u(r){var e=c(r,"string");return"symbol"==t(e)?e:String(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.ChunkAPI=void 0;var f=exports.ChunkAPI=function(){function t(r){o(this,t),this.req=r}return a(t,[{key:"getChunk",value:function(){var t=n(r().mark(function t(e,n){return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.req.get({url:"".concat(this.req.root,"/api/get-items-chunk/").concat(e,"/").concat(n),method:"GET"}));case 1:case"end":return t.stop()}},t,this)}));return function(r,e){return t.apply(this,arguments)}}()},{key:"getLastChunk",value:function(){var t=n(r().mark(function t(e){return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.req.axiosRequest({url:"".concat(this.req.root,"/api/get-last-items-chunk/").concat(e),method:"GET"}));case 1:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()}]),t}();
243
243
  },{}],"KHGc":[function(require,module,exports) {
244
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChunksManager=void 0;var t=require("./ChunkApi.js");function r(t){return(r="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 e(){e=function(){return n};var t,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function h(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{h({},"")}catch(t){h=function(t,r,e){return t[r]=e}}function l(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),u=new N(n||[]);return a(i,"_invoke",{value:O(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=l;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function w(){}function b(){}function x(){}var k={};h(k,c,function(){return this});var L=Object.getPrototypeOf,E=L&&L(L(G([])));E&&E!==o&&i.call(E,c)&&(k=E);var P=x.prototype=w.prototype=Object.create(k);function S(t){["next","throw","return"].forEach(function(r){h(t,r,function(t){return this._invoke(r,t)})})}function j(t,e){function n(o,a,u,c){var s=p(t[o],t,a);if("throw"!==s.type){var f=s.arg,h=f.value;return h&&"object"==r(h)&&i.call(h,"__await")?e.resolve(h.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):e.resolve(h).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,c)})}c(s.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function O(r,e,n){var o=v;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=_(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var s=p(r,e,n);if("normal"===s.type){if(o=n.done?d:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=d,n.method="throw",n.arg=s.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function A(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function C(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function G(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=x,a(P,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,f,"GeneratorFunction")),t.prototype=Object.create(P),t},n.awrap=function(t){return{__await:t}},S(j.prototype),h(j.prototype,s,function(){return this}),n.AsyncIterator=j,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},S(P),h(P,f,"Generator"),h(P,c,function(){return this}),h(P,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=G,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return u.type="throw",u.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),C(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;C(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:G(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},n}function n(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void e(s)}u.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 a=t.apply(r,e);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)})}}function i(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function a(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 u(t,r,e){return r&&a(t.prototype,r),e&&a(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:String(e)}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=exports.ChunksManager=function(){function r(e,n,o,a,u){i(this,r),this.storage=e,this.pipeService=n,this.req=o,this.util=a,this.dataService=u,this.chunkApi=new t.ChunkAPI(o),this.itemListeners()}return u(r,[{key:"getChunk",value:function(){var t=o(e().mark(function t(r,n){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.abrupt("return",this.dataService.getChunk(r,n));case 4:return t.prev=4,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 8:case"end":return t.stop()}},t,this,[[0,4]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"getLastChunk",value:function(){var t=o(e().mark(function t(r){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.abrupt("return",this.chunkApi.getLastChunk(r));case 4:return t.prev=4,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 8:case"end":return t.stop()}},t,this,[[0,4]])}));return function(r){return t.apply(this,arguments)}}()},{key:"getChunks",value:function(){var t=o(e().mark(function t(r,n){var o,i=this;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=[],!n){t.next=5;break}return t.next=4,Promise.all(n.map(function(t){return i.getChunk(r,t)}));case 4:o=t.sent;case 5:return t.abrupt("return",o);case 6:case"end":return t.stop()}},t)}));return function(r,e){return t.apply(this,arguments)}}()},{key:"itemListeners",value:function(){}},{key:"getApp",value:function(){var t=o(e().mark(function t(r){var n;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return",null);case 2:if(n=this.getAppFromStorage(r)){t.next=16;break}if(!this.getAppPromises[r]){t.next=6;break}return t.abrupt("return",this.getAppPromises[r]);case 6:return this.getAppPromises[r]=this.getAppApi(r),t.next=9,this.getAppPromises[r];case 9:if(!(n=t.sent)){t.next=15;break}this.saveAppInStorage(n),this.ws.addSubscription(r),t.next=16;break;case 15:return t.abrupt("return",null);case 16:return t.abrupt("return",n);case 17:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()}]),r}();
245
- },{"./ChunkApi.js":"htZj"}],"K1Gs":[function(require,module,exports) {
244
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChunksManager=void 0;var t=require("../api/ChunkApi.js");function r(t){return(r="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 e(){e=function(){return n};var t,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function h(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{h({},"")}catch(t){h=function(t,r,e){return t[r]=e}}function l(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),u=new N(n||[]);return a(i,"_invoke",{value:O(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=l;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function w(){}function b(){}function x(){}var k={};h(k,c,function(){return this});var L=Object.getPrototypeOf,E=L&&L(L(G([])));E&&E!==o&&i.call(E,c)&&(k=E);var P=x.prototype=w.prototype=Object.create(k);function S(t){["next","throw","return"].forEach(function(r){h(t,r,function(t){return this._invoke(r,t)})})}function j(t,e){function n(o,a,u,c){var s=p(t[o],t,a);if("throw"!==s.type){var f=s.arg,h=f.value;return h&&"object"==r(h)&&i.call(h,"__await")?e.resolve(h.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):e.resolve(h).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,c)})}c(s.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function O(r,e,n){var o=v;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=_(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var s=p(r,e,n);if("normal"===s.type){if(o=n.done?d:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=d,n.method="throw",n.arg=s.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function A(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function C(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function G(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=x,a(P,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,f,"GeneratorFunction")),t.prototype=Object.create(P),t},n.awrap=function(t){return{__await:t}},S(j.prototype),h(j.prototype,s,function(){return this}),n.AsyncIterator=j,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},S(P),h(P,f,"Generator"),h(P,c,function(){return this}),h(P,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=G,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return u.type="throw",u.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),C(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;C(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:G(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},n}function n(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void e(s)}u.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 a=t.apply(r,e);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)})}}function i(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function a(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 u(t,r,e){return r&&a(t.prototype,r),e&&a(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:String(e)}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=exports.ChunksManager=function(){function r(e,n,o,a,u){i(this,r),this.storage=e,this.pipeService=n,this.req=o,this.util=a,this.dataService=u,this.chunkApi=new t.ChunkAPI(o),this.itemListeners()}return u(r,[{key:"getChunk",value:function(){var t=o(e().mark(function t(r,n){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.abrupt("return",this.dataService.getChunk(r,n));case 4:return t.prev=4,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 8:case"end":return t.stop()}},t,this,[[0,4]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"getLastChunk",value:function(){var t=o(e().mark(function t(r){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.abrupt("return",this.chunkApi.getLastChunk(r));case 4:return t.prev=4,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 8:case"end":return t.stop()}},t,this,[[0,4]])}));return function(r){return t.apply(this,arguments)}}()},{key:"getChunks",value:function(){var t=o(e().mark(function t(r,n){var o,i=this;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=[],!n){t.next=5;break}return t.next=4,Promise.all(n.map(function(t){return i.getChunk(r,t)}));case 4:o=t.sent;case 5:return t.abrupt("return",o);case 6:case"end":return t.stop()}},t)}));return function(r,e){return t.apply(this,arguments)}}()},{key:"itemListeners",value:function(){}},{key:"getApp",value:function(){var t=o(e().mark(function t(r){var n;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return",null);case 2:if(n=this.getAppFromStorage(r)){t.next=16;break}if(!this.getAppPromises[r]){t.next=6;break}return t.abrupt("return",this.getAppPromises[r]);case 6:return this.getAppPromises[r]=this.getAppApi(r),t.next=9,this.getAppPromises[r];case 9:if(!(n=t.sent)){t.next=15;break}this.saveAppInStorage(n),this.ws.addSubscription(r),t.next=16;break;case 15:return t.abrupt("return",null);case 16:return t.abrupt("return",n);case 17:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()}]),r}();
245
+ },{"../api/ChunkApi.js":"baS4"}],"K1Gs":[function(require,module,exports) {
246
246
  "use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(t){var n=i(t,"string");return"symbol"==e(n)?n:String(n)}function i(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DocumentManager=void 0;var u=exports.DocumentManager=function(){function e(n,r){t(this,e),this.req=n,this.pipeService=r}return r(e,[{key:"createDocument",value:function(e){return this.emitDocumentInsert(e),this.req.post({url:"/api/new/document/insert-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}},{key:"emitDocumentInsert",value:function(e){var t="string"==typeof e.data?JSON.parse(e.data):e.data;this.pipeService.emit("gh_document_insert_one",{app_id:e.app_id,item_id:e.item_id,element_id:e.element_id},t)}},{key:"getDocument",value:function(e){return this.req.post({url:"/api/new/document/find-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}},{key:"getDocuments",value:function(e){return this.req.post({url:"/api/new/document/find",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}},{key:"deleteDocument",value:function(e){return this.req.post({url:"/api/new/document/remove-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}}]),e}();
247
247
  },{}],"X4Dt":[function(require,module,exports) {
248
248
  "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(r){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(n||[]);return a(i,"_invoke",{value:I(t,r,u)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",d="suspendedYield",v="executing",g="completed",m={};function b(){}function w(){}function x(){}var _={};l(_,c,function(){return this});var k=Object.getPrototypeOf,L=k&&k(k(T([])));L&&L!==o&&i.call(L,c)&&(_=L);var E=x.prototype=b.prototype=Object.create(_);function j(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function O(e,r){function n(o,a,u,c){var s=p(e[o],e,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==t(l)&&i.call(l,"__await")?r.resolve(l.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):r.resolve(l).then(function(t){f.value=t,u(f)},function(t){return n("throw",t,u,c)})}c(s.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r(function(r,o){n(t,e,r,o)})}return o=o?o.then(i,i):i()}})}function I(t,e,n){var o=y;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=p(t,e,n);if("normal"===s.type){if(o=n.done?g:d,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function P(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,P(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return w.prototype=x,a(E,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},j(O.prototype),l(O.prototype,s,function(){return this}),n.AsyncIterator=O,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new O(h(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},j(E),l(E,f,"Generator"),l(E,c,function(){return this}),l(E,"toString",function(){return"[object Generator]"}),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(G),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;G(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),m}},n}function r(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)})}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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,u(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(e){var r=c(e,"string");return"symbol"==t(r)?r:String(r)}function c(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Interpritate=void 0;var s=exports.Interpritate=function(){function t(e){o(this,t),this.gudhub=e}return a(t,[{key:"getInterpretationObj",value:function(){var t=n(e().mark(function t(r,n,o,i,a,u){var c,s,f,l,h;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(c=[],s=n.data_model.interpretation.find(function(t){return t.src==o})||n.data_model.interpretation.find(function(t){return"table"==t.src})||{id:"default"},f=s,!r.data_model||!r.data_model.interpretation){t.next=22;break}for(l=0;l<r.data_model.interpretation.length;l++)r.data_model.interpretation[l].src!=o&&r.data_model.interpretation[l].src!=i||c.push(r.data_model.interpretation[l]);l=0;case 6:if(!(l<c.length)){t.next=22;break}if(!(c[l].settings&&c[l].settings.condition_filter&&c[l].settings.filters_list.length>0)){t.next=18;break}return t.next=10,gudhub.getItem(u,a);case 10:if(!(h=t.sent)){t.next=16;break}if(!(gudhub.filter([h],c[l].settings.filters_list).length>0)){t.next=16;break}return f=c[l],t.abrupt("break",22);case 16:t.next=19;break;case 18:f=gudhub.mergeObjects(f,c[l]);case 19:l++,t.next=6;break;case 22:return t.abrupt("return",f);case 23:case"end":return t.stop()}},t)}));return function(e,r,n,o,i,a){return t.apply(this,arguments)}}()},{key:"getInterpretation",value:function(t,r,o,i,a,u,c){var s=this;return new Promise(function(){var f=n(e().mark(function f(l,h){var p;return e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:(p=r&&r.data_type?r.data_type:o)?gudhub.ghconstructor.getInstance(p).then(function(){var o=n(e().mark(function n(o){var f;return e().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=5;break}return e.next=3,s.getInterpretationObj(r,o.getTemplate().model,i,c,a,u);case 3:f=e.sent,o.getInterpretation(t,f.id,p,r,a,u).then(function(t){l(gudhub.mergeObjects(t,f))},function(t){h()});case 5:case"end":return e.stop()}},n)}));return function(t){return o.apply(this,arguments)}}(),function(t){}):console.error("Get Interpretation: data_type is undefined",o,r);case 2:case"end":return f.stop()}},f)}));return function(t,e){return f.apply(this,arguments)}}())}},{key:"getInterpretationById",value:function(){var t=n(e().mark(function t(r,n,o,i){var a,u,c,s,f,l,h=arguments;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=h.length>4&&void 0!==h[4]?h[4]:null,u=h.length>5&&void 0!==h[5]?h[5]:null,null!=a){t.next=8;break}return t.next=5,this.gudhub.getFieldValue(r,n,o);case 5:t.t0=t.sent,t.next=9;break;case 8:t.t0=a;case 9:if(c=t.t0,null!=u){t.next=16;break}return t.next=13,this.gudhub.getField(r,o);case 13:t.t1=t.sent,t.next=17;break;case 16:t.t1=u;case 17:if(null!=(s=t.t1)){t.next=20;break}return t.abrupt("return","");case 20:return t.next=22,this.gudhub.ghconstructor.getInstance(s.data_type);case 22:return f=t.sent,t.next=25,f.getInterpretation(c,i,s.data_type,s,n,r);case 25:if("<span>no interpretation</span>"!=(l=t.sent).html){t.next=30;break}return t.abrupt("return",c);case 30:return t.abrupt("return",l.html);case 31:case"end":return t.stop()}},t,this)}));return function(e,r,n,o){return t.apply(this,arguments)}}()}]),t}();
@@ -258,16 +258,43 @@ var t,e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),expo
258
258
  "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(){r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(e){f=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),u=new G(n||[]);return a(i,"_invoke",{value:S(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var v="suspendedStart",y="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var k={};f(k,c,function(){return this});var L=Object.getPrototypeOf,_=L&&L(L(q([])));_&&_!==o&&i.call(_,c)&&(k=_);var E=x.prototype=w.prototype=Object.create(k);function j(t){["next","throw","return"].forEach(function(r){f(t,r,function(t){return this._invoke(r,t)})})}function O(r,e){function n(o,a,u,c){var s=p(r[o],r,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==t(f)&&i.call(f,"__await")?e.resolve(f.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):e.resolve(f).then(function(t){l.value=t,u(l)},function(t){return n("throw",t,u,c)})}c(s.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function S(t,r,n){var o=v;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=p(t,r,n);if("normal"===s.type){if(o=n.done?g:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function N(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function q(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return b.prototype=x,a(E,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,l,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},j(O.prototype),f(O.prototype,s,function(){return this}),n.AsyncIterator=O,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new O(h(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},j(E),f(E,l,"Generator"),f(E,c,function(){return this}),f(E,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=q,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),N(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;N(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:q(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},n}function e(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void e(s)}u.done?r(c):Promise.resolve(c).then(n,o)}function n(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)})}}function o(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,u(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 u(r){var e=c(r,"string");return"symbol"==t(e)?e:String(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.Sharing=void 0;var s=exports.Sharing=function(){function t(r,e){o(this,t),this.req=e,this.gudhub=r}return a(t,[{key:"add",value:function(){var t=n(r().mark(function t(e,n,o){var i,a;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=n,t.t3=o,i={token:t.t0,app_id:t.t1,user_id:t.t2,sharing_permission:t.t3},t.next=10,this.req.post({url:"/sharing/add",form:i});case 10:return a=t.sent,t.abrupt("return",a);case 14:return t.prev=14,t.t4=t.catch(0),console.log(t.t4),t.abrupt("return",null);case 18:case"end":return t.stop()}},t,this,[[0,14]])}));return function(r,e,n){return t.apply(this,arguments)}}()},{key:"update",value:function(){var t=n(r().mark(function t(e,n,o){var i,a;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=n,t.t3=o,i={token:t.t0,app_id:t.t1,user_id:t.t2,sharing_permission:t.t3},t.next=10,this.req.post({url:"/sharing/update",form:i});case 10:return a=t.sent,t.abrupt("return",a);case 14:return t.prev=14,t.t4=t.catch(0),console.log(t.t4),t.abrupt("return",null);case 18:case"end":return t.stop()}},t,this,[[0,14]])}));return function(r,e,n){return t.apply(this,arguments)}}()},{key:"delete",value:function(){var t=n(r().mark(function t(e,n){var o,i;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=n,o={token:t.t0,app_id:t.t1,user_id:t.t2},t.next=9,this.req.post({url:"/sharing/delete",form:o});case 9:return i=t.sent,t.abrupt("return",i);case 13:return t.prev=13,t.t3=t.catch(0),console.log(t.t3),t.abrupt("return",null);case 17:case"end":return t.stop()}},t,this,[[0,13]])}));return function(r,e){return t.apply(this,arguments)}}()},{key:"getAppUsers",value:function(){var t=n(r().mark(function t(e){var n,o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,n={token:t.t0,app_id:t.t1},t.next=8,this.req.post({url:"/sharing/get-app-users",form:n});case 8:return o=t.sent,t.abrupt("return",o);case 12:return t.prev=12,t.t2=t.catch(0),console.log(t.t2),t.abrupt("return",null);case 16:case"end":return t.stop()}},t,this,[[0,12]])}));return function(r){return t.apply(this,arguments)}}()},{key:"addInvitation",value:function(){var t=n(r().mark(function t(e,n){var o,i;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.gudhub.auth.getToken();case 3:return t.t0=t.sent,t.t1=e,t.t2=n,o={token:t.t0,guests_emails:t.t1,apps:t.t2},t.next=9,this.req.post({url:"/api/invitation/add",form:o});case 9:return i=t.sent,t.abrupt("return",i);case 13:return t.prev=13,t.t3=t.catch(0),console.log(t.t3),t.abrupt("return",null);case 17:case"end":return t.stop()}},t,this,[[0,13]])}));return function(r,e){return t.apply(this,arguments)}}()}]),t}();
259
259
  },{}],"quyV":[function(require,module,exports) {
260
260
  "use strict";function t(){t=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(e){l=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),u=new G(n||[]);return a(i,"_invoke",{value:k(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function x(){}var L={};l(L,c,function(){return this});var E=Object.getPrototypeOf,_=E&&E(E(F([])));_&&_!==o&&i.call(_,c)&&(L=_);var j=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach(function(r){l(t,r,function(t){return this._invoke(r,t)})})}function S(t,e){function n(o,a,u,c){var f=p(t[o],t,a);if("throw"!==f.type){var s=f.arg,l=s.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):e.resolve(l).then(function(t){s.value=t,u(s)},function(t){return n("throw",t,u,c)})}c(f.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function k(t,r,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=p(t,r,n);if("normal"===f.type){if(o=n.done?m:v,f.arg===g)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=m,n.method="throw",n.arg=f.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function T(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(i.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(r(t)+" is not iterable")}return w.prototype=x,a(j,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},n.awrap=function(t){return{__await:t}},O(S.prototype),l(S.prototype,f,function(){return this}),n.AsyncIterator=S,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new S(h(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},O(j),l(j,s,"Generator"),l(j,c,function(){return this}),l(j,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=F,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),f=i.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:F(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},n}function r(t){return(r="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 e(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(f){return void e(f)}u.done?r(c):Promise.resolve(c).then(n,o)}function n(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)})}}function o(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,u(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 u(t){var e=c(t,"string");return"symbol"==r(e)?e:String(e)}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketEmitter=void 0;var f=exports.WebSocketEmitter=function(){function e(t){o(this,e),this.gudhub=t}return a(e,[{key:"emitToUser",value:function(){var e=n(t().mark(function e(n,o){var i,a;return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i={user_id:n,data:"object"===r(o)?JSON.stringify(o):o},t.next=3,this.gudhub.req.post({url:"/ws/emit-to-user",form:i});case 3:return a=t.sent,t.abrupt("return",a);case 5:case"end":return t.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"broadcastToAppSubscribers",value:function(){var r=n(t().mark(function r(e,n,o){var i,a;return t().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i={app_id:e,data:JSON.stringify({data_type:n,data:o})},t.next=3,this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:i});case 3:return a=t.sent,t.abrupt("return",a);case 5:case"end":return t.stop()}},r,this)}));return function(t,e,n){return r.apply(this,arguments)}}()}]),e}();
261
- },{}],"vb1X":[function(require,module,exports) {
262
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpDataService=exports.ChunkDataService=void 0;var t=require("../ChunkApi.js");function r(t){return(r="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 e(){e=function(){return n};var t,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(t){s=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),u=new C(n||[]);return a(i,"_invoke",{value:P(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function x(){}var O={};s(O,c,function(){return this});var j=Object.getPrototypeOf,E=j&&j(j(G([])));E&&E!==o&&i.call(E,c)&&(O=E);var L=x.prototype=b.prototype=Object.create(O);function _(t){["next","throw","return"].forEach(function(r){s(t,r,function(t){return this._invoke(r,t)})})}function k(t,e){function n(o,a,u,c){var f=p(t[o],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==r(s)&&i.call(s,"__await")?e.resolve(s.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):e.resolve(s).then(function(t){l.value=t,u(l)},function(t){return n("throw",t,u,c)})}c(f.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function P(r,e,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=p(r,e,n);if("normal"===f.type){if(o=n.done?g:v,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=g,n.method="throw",n.arg=f.arg)}}}function S(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,S(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function N(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function G(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=x,a(L,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=s(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,s(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},n.awrap=function(t){return{__await:t}},_(k.prototype),s(k.prototype,f,function(){return this}),n.AsyncIterator=k,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new k(h(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(L),s(L,l,"Generator"),s(L,c,function(){return this}),s(L,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=G,C.prototype={constructor:C,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return u.type="throw",u.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),f=i.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),N(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;N(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:G(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},n}function n(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(f){return void e(f)}u.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 a=t.apply(r,e);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)})}}function i(t,r,e){return r=f(r),a(t,c()?Reflect.construct(r,e||[],f(t).constructor):r.apply(t,e))}function a(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return u(t)}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(c=function(){return!!t})()}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&s(t,r)}function s(t,r){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t})(t,r)}function h(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,y(n.key),n)}}function p(t,r,e){return r&&h(t.prototype,r),e&&h(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t){var e=v(t,"string");return"symbol"==r(e)?e:String(e)}function v(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function d(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var g=exports.ChunkDataService=p(function t(){d(this,t)}),m=exports.HttpDataService=function(r){function n(r){var e;return d(this,n),(e=i(this,n)).chunkApi=new t.ChunkAPI(r),e}return l(n,g),p(n,[{key:"getChunk",value:function(){var t=o(e().mark(function t(r,n){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.chunkApi.getChunk(r,n));case 1:case"end":return t.stop()}},t,this)}));return function(r,e){return t.apply(this,arguments)}}()},{key:"putChunk",value:function(){}}]),n}();
263
- },{"../ChunkApi.js":"htZj"}],"kIbf":[function(require,module,exports) {
261
+ },{}],"wc2J":[function(require,module,exports) {
262
+ "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(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,o(n.key),n)}}function r(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(e){var r=n(e,"string");return"symbol"==t(r)?r:String(r)}function n(e,r){if("object"!=t(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,r||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataService=void 0;var u=exports.DataService=r(function t(){i(this,t)});
263
+ },{}],"RQNC":[function(require,module,exports) {
264
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppDataService=void 0;var t=require("./DataService.js");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 r(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function o(t,e,o){return e&&r(t.prototype,e),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(t){var r=i(t,"string");return"symbol"==e(r)?r:String(r)}function i(t,r){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,r||"default");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e,r){return e=l(e),f(t,p()?Reflect.construct(e,r||[],l(t).constructor):e.apply(t,r))}function f(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return a(t)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(p=function(){return!!t})()}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}function b(t,e){return(b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=exports.AppDataService=function(e){function r(){return u(this,r),c(this,r,arguments)}return y(r,t.DataService),o(r)}();
265
+ },{"./DataService.js":"wc2J"}],"VAmb":[function(require,module,exports) {
266
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChunkDataService=void 0;var t=require("./DataService.js");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 r(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,o(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t){var r=i(t,"string");return"symbol"==e(r)?r:String(r)}function i(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)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e,r){return e=p(e),f(t,l()?Reflect.construct(e,r||[],p(t).constructor):e.apply(t,r))}function f(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return a(t)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}function b(t,e){return(b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var s=exports.ChunkDataService=function(e){function r(){return u(this,r),c(this,r,arguments)}return y(r,t.DataService),n(r)}();
267
+ },{"./DataService.js":"wc2J"}],"PrkT":[function(require,module,exports) {
268
+ "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(){r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(e){s=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),u=new T(n||[]);return a(i,"_invoke",{value:S(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var L={};s(L,c,function(){return this});var E=Object.getPrototypeOf,j=E&&E(E(A([])));j&&j!==o&&i.call(j,c)&&(L=j);var _=x.prototype=w.prototype=Object.create(L);function O(t){["next","throw","return"].forEach(function(r){s(t,r,function(t){return this._invoke(r,t)})})}function P(r,e){function n(o,a,u,c){var f=p(r[o],r,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==t(s)&&i.call(s,"__await")?e.resolve(s.__await).then(function(t){n("next",t,u,c)},function(t){n("throw",t,u,c)}):e.resolve(s).then(function(t){l.value=t,u(l)},function(t){return n("throw",t,u,c)})}c(f.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function S(t,r,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=p(t,r,n);if("normal"===f.type){if(o=n.done?g:v,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=g,n.method="throw",n.arg=f.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function N(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function G(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function A(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return b.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=s(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,s(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},n.awrap=function(t){return{__await:t}},O(P.prototype),s(P.prototype,f,function(){return this}),n.AsyncIterator=P,n.async=function(t,r,e,o,i){void 0===i&&(i=Promise);var a=new P(h(t,r,e,o),i);return n.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},O(_),s(_,l,"Generator"),s(_,c,function(){return this}),s(_,"toString",function(){return"[object Generator]"}),n.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=A,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(G),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),f=i.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),G(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;G(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},n}function e(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(f){return void e(f)}u.done?r(c):Promise.resolve(c).then(n,o)}function n(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)})}}function o(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,u(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 u(r){var e=c(r,"string");return"symbol"==t(e)?e:String(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.AppAPI=void 0;var f=exports.AppAPI=function(){function t(r){o(this,t),this.req=r}return a(t,[{key:"getApp",value:function(){var t=n(r().mark(function t(e){return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.req.get({url:"".concat(this.req.root,"/api/app/get"),params:{app_id:e}}));case 1:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()}]),t}();
269
+ },{}],"hg0N":[function(require,module,exports) {
270
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.objectAssignWithoutOverride=exports.objectAssignWithOverride=exports.checkInstanceModifier=void 0;var e=exports.objectAssignWithoutOverride=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];for(var n=0,i=t;n<i.length;n++){var c=i[n];if(c)for(var a=0,s=Object.keys(c);a<s.length;a++){var v=s[a];if(!(v in e)){var f=Object.getOwnPropertyDescriptor(c,v);f.enumerable&&Object.defineProperty(e,v,f)}}}},r=exports.objectAssignWithOverride=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];for(var n=0,i=t;n<i.length;n++){var c=i[n];if(c)for(var a=0,s=Object.keys(c);a<s.length;a++){var v=s[a],f=Object.getOwnPropertyDescriptor(c,v);f.enumerable&&Object.defineProperty(e,v,f)}}},t=exports.checkInstanceModifier=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];for(var n=0,i=t;n<i.length;n++){var c=i[n];if(c)for(var a=0,s=Object.keys(c);a<s.length;a++){var v=s[a],f=Object.getOwnPropertyDescriptor(c,v);f.enumerable&&Object.defineProperty(e,v,f)}}};
271
+ },{}],"t7L1":[function(require,module,exports) {
272
+ "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(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,o(n.key),n)}}function r(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(e){var r=n(e,"string");return"symbol"==t(r)?r:String(r)}function n(e,r){if("object"!=t(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,r||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpService=void 0;var u=exports.HttpService=r(function t(){i(this,t)});
273
+ },{}],"gUcM":[function(require,module,exports) {
274
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppHttpService=void 0;var t=require("../../api/AppApi.js"),r=require("../AppDataService.js"),e=require("../utils.js"),n=require("./HttpService.js");function o(t){return(o="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 i(){i=function(){return r};var t,r={},e=Object.prototype,n=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",f=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(t){s=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:P(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function j(){}var x={};s(x,u,function(){return this});var O=Object.getPrototypeOf,E=O&&O(O(G([])));E&&E!==e&&n.call(E,u)&&(x=E);var L=j.prototype=w.prototype=Object.create(x);function _(t){["next","throw","return"].forEach(function(r){s(t,r,function(t){return this._invoke(r,t)})})}function S(t,r){function e(i,a,c,u){var f=h(t[i],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==o(s)&&n.call(s,"__await")?r.resolve(s.__await).then(function(t){e("next",t,c,u)},function(t){e("throw",t,c,u)}):r.resolve(s).then(function(t){l.value=t,c(l)},function(t){return e("throw",t,c,u)})}u(f.arg)}var i;a(this,"_invoke",{value:function(t,n){function o(){return new r(function(r,o){e(t,n,r,o)})}return i=i?i.then(o,o):o()}})}function P(r,e,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=A(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=h(r,e,n);if("normal"===f.type){if(o=n.done?g:v,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=g,n.method="throw",n.arg=f.arg)}}}function A(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,A(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function T(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function G(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function e(){for(;++i<r.length;)if(n.call(r,i))return e.value=r[i],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(o(r)+" is not iterable")}return b.prototype=j,a(L,"constructor",{value:j,configurable:!0}),a(j,"constructor",{value:b,configurable:!0}),b.displayName=s(j,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,s(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},_(S.prototype),s(S.prototype,f,function(){return this}),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(L),s(L,l,"Generator"),s(L,u,function(){return this}),s(L,"toString",function(){return"[object Generator]"}),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=G,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function o(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),f=n.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:G(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function a(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(f){return void e(f)}c.done?r(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function c(t){a(i,n,o,c,u,"next",t)}function u(t){a(i,n,o,c,u,"throw",t)}c(void 0)})}}function u(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function f(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 l(t,r,e){return r&&f(t.prototype,r),e&&f(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var r=p(t,"string");return"symbol"==o(r)?r:String(r)}function p(t,r){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function h(t,r,e){return r=d(r),y(t,v()?Reflect.construct(r,e||[],d(t).constructor):r.apply(t,e))}function y(t,r){if(r&&("object"===o(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return g(t)}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(v=function(){return!!t})()}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&w(t,r)}function w(t,r){return(w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t})(t,r)}var b=exports.AppHttpService=function(r,o){function a(r,o){var i;u(this,a),(i=h(this,a)).appApi=new t.AppAPI(r);var c=new n.HttpService(o);return(0,e.objectAssignWithOverride)(g(i),c),i}return m(a,r),l(a,[{key:"getApp",value:function(){var t=c(i().mark(function t(r){return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.appApi.getApp(r));case 1:case"end":return t.stop()}},t,this)}));return function(r){return t.apply(this,arguments)}}()},{key:"putApp",value:function(){var t=c(i().mark(function t(r,e){return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}},t)}));return function(r,e){return t.apply(this,arguments)}}()}],[{key:o,value:function(t){return t instanceof a||t.chunkDataService instanceof n.HttpService}}]),a}(r.AppDataService,Symbol.hasInstance);
275
+ },{"../../api/AppApi.js":"PrkT","../AppDataService.js":"RQNC","../utils.js":"hg0N","./HttpService.js":"t7L1"}],"vsBf":[function(require,module,exports) {
276
+ "use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){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,o(n.key),n)}}function r(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(t){var r=n(t,"string");return"symbol"==e(r)?r:String(r)}function n(t,r){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,r||"default");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.IndexedDBService=void 0;var u=exports.IndexedDBService=r(function e(t){i(this,e),this.store=t.store,this.dbName=t.dbName,this.dbVersion=t.dbVersion});
277
+ },{}],"YqNA":[function(require,module,exports) {
264
278
  var define;
265
- var t;Object.defineProperty(exports,"__esModule",{value:!0}),exports.IndexedDBChunkCacheService=void 0;var e=require("./httpDataService.js");function r(t){return(r="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(){"use strict";n=function(){return e};var t,e={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,i=Object.create(o.prototype),c=new D(n||[]);return a(i,"_invoke",{value:k(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var v="suspendedStart",y="suspendedYield",d="executing",b="completed",g={};function m(){}function w(){}function O(){}var x={};l(x,u,function(){return this});var E=Object.getPrototypeOf,j=E&&E(E(B([])));j&&j!==o&&i.call(j,u)&&(x=j);var S=O.prototype=m.prototype=Object.create(x);function _(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function L(t,e){function n(o,a,c,u){var s=p(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then(function(t){n("next",t,c,u)},function(t){n("throw",t,c,u)}):e.resolve(l).then(function(t){f.value=t,c(f)},function(t){return n("throw",t,c,u)})}u(s.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e(function(e,o){n(t,r,e,o)})}return o=o?o.then(i,i):i()}})}function k(e,r,n){var o=v;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?b:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=b,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=O,a(S,"constructor",{value:O,configurable:!0}),a(O,"constructor",{value:w,configurable:!0}),w.displayName=l(O,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,l(t,f,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},_(L.prototype),l(L.prototype,s,function(){return this}),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(S),l(S,f,"Generator"),l(S,u,function(){return this}),l(S,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=B,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:B(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function o(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function c(t){o(a,n,i,c,u,"next",t)}function u(t){o(a,n,i,c,u,"throw",t)}c(void 0)})}}function a(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,b(n.key),n)}}function c(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e,r){return e=h(e),f(t,l()?Reflect.construct(e,r||[],h(t).constructor):e.apply(t,r))}function f(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function y(t,e){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=g(t,"string");return"symbol"==r(e)?e:String(e)}function g(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var m=function(t){function r(){var t;u(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return d(p(t=s(this,r,[].concat(n))),"dataService",void 0),t}return v(r,e.ChunkDataService),c(r)}(),w=exports.IndexedDBChunkCacheService=function(t){function r(t){var n;return u(this,r),d(p(n=s(this,r)),"OBJECT_STORE","v2"),d(p(n),"DatabaseName","my-cache-db"),d(p(n),"DatabaseVersion",1),n.dataService=new e.HttpDataService(t),n}return v(r,m),c(r,[{key:"putChunk",value:function(){var t=i(n().mark(function t(e,r){var o,i;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.openDatabase();case 3:o=t.sent,i=o.transaction(this.OBJECT_STORE,"readwrite"),i.objectStore(this.OBJECT_STORE).put(r,e),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}},t,this,[[0,9]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"getChunk",value:function(){var t=i(n().mark(function t(e,r){var o,i,a,c,u;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.openDatabase();case 3:return o=t.sent,i=o.transaction(this.OBJECT_STORE,"readonly"),a=i.objectStore(this.OBJECT_STORE),c=a.get(r),t.next=9,new Promise(function(t,e){c.onsuccess=function(r){var n=r.target.result;n||e(),n&&t(n)},c.onerror=e});case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(0),t.next=16,this.dataService.getChunk(e,r);case 16:return u=t.sent,t.next=19,this.putChunk(r,u);case 19:return t.abrupt("return",u);case 20:case"end":return t.stop()}},t,this,[[0,12]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"openDatabase",value:function(){var t=i(n().mark(function t(){var e=this;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,r){var n=indexedDB.open(e.DatabaseName,e.DatabaseVersion);n.onupgradeneeded=function(t){t.target.result.createObjectStore(e.OBJECT_STORE)},n.onsuccess=function(e){t(e.target.result)},n.onerror=function(t){r(t.target.error)}}));case 1:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}()}]),r}();
266
- },{"./httpDataService.js":"vb1X"}],"PLI6":[function(require,module,exports) {
267
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataService=void 0;var e,r=require("../../consts.js"),t=require("./IndexedDBCacheService.js"),a=require("./httpDataService.js");r.IS_WEB?exports.DataService=e=t.IndexedDBChunkCacheService:exports.DataService=e=a.HttpDataService;
268
- },{"../../consts.js":"UV2u","./IndexedDBCacheService.js":"kIbf","./httpDataService.js":"vb1X"}],"U9gy":[function(require,module,exports) {
269
- "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"),n=require("./WebSocket/WebSocket.js"),i=require("./config.js"),o=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),a=require("./GHConstructor/ghconstructor.js"),s=require("./AppProcessor/AppProcessor.js"),c=require("./ItemProcessor/ItemProcessor.js"),l=require("./FieldProcessor/FieldProcessor.js"),h=require("./FileManager/FileManager.js"),p=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"),m=require("./Utils/sharing/Sharing.js"),k=require("./WebSocket/WebSocketEmitter.js"),w=require("./ChunksManager/DataService/export.js");function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(){S=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,u=Object.create(o.prototype),a=new A(n||[]);return i(u,"_invoke",{value:j(e,r,a)}),u}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="suspendedYield",d="executing",v="completed",g={};function y(){}function m(){}function k(){}var w={};c(w,u,function(){return this});var P=Object.getPrototypeOf,x=P&&P(P(M([])));x&&x!==r&&n.call(x,u)&&(w=x);var _=k.prototype=y.prototype=Object.create(w);function F(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function I(e,t){function r(i,o,u,a){var s=h(e[i],e,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==b(l)&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,u,a)},function(e){r("throw",e,u,a)}):t.resolve(l).then(function(e){c.value=e,u(c)},function(e){return r("throw",e,u,a)})}a(s.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t(function(t,i){r(e,n,t,i)})}return o=o?o.then(i,i):i()}})}function j(t,r,n){var i=p;return function(o,u){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw u;return{value:e,done:!0}}for(n.method=o,n.arg=u;;){var a=n.delegate;if(a){var s=L(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var c=h(t,r,n);if("normal"===c.type){if(i=n.done?v:f,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=h(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var u=o.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function W(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(b(t)+" is not iterable")}return m.prototype=k,i(_,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:m,configurable:!0}),m.displayName=c(k,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,c(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},F(I.prototype),c(I.prototype,a,function(){return this}),t.AsyncIterator=I,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new I(l(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then(function(e){return e.done?e.value:u.next()})},F(_),c(_,s,"Generator"),c(_,u,function(){return this}),c(_,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(W),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return a.type="throw",a.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var s=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(s&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),W(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;W(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function P(e,t,r,n,i,o,u){try{var a=e[o](u),s=a.value}catch(c){return void r(c)}a.done?t(s):Promise.resolve(s).then(n,i)}function x(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function u(e){P(o,n,i,u,a,"next",e)}function a(e){P(o,n,i,u,a,"throw",e)}u(void 0)})}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(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,j(n.key),n)}}function I(e,t,r){return t&&F(e.prototype,t),r&&F(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function j(e){var t=L(e,"string");return"symbol"==b(t)?t:String(t)}function L(e,t){if("object"!=b(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var q=exports.GudHub=function(){function b(v){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:i.server_url,wss_url:i.wss_url,node_server_url:i.node_server_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:i.async_modules_path,file_server_url:i.file_server_url,automation_modules_path:i.automation_modules_path,accesstoken:this.accesstoken,expirydate:this.expirydate};if(_(this,b),this.config=S,this.ghconstructor=new a.GHConstructor(this),this.interpritate=new d.Interpritate(this),this.pipeService=new t.PipeService,this.storage=new r.Storage(S.async_modules_path,S.file_server_url,S.automation_modules_path),this.util=new o.Utils(this),this.req=new e.GudHubHttpsService(S.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),v?this.storage.setUser({auth_key:v}):S.accesstoken&&S.expirydate&&this.storage.setUser({accesstoken:S.accesstoken,expirydate:S.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new n.WebSocketApi(S.wss_url,this.auth),this.chunksManager=new p.ChunksManager(this.storage,this.pipeService,this.req,this.util,new w.DataService(this.req)),this.appProcessor=new s.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,S.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 h.FileManager(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),this.websocketsemitter=new k.WebSocketEmitter(this),S.initWebsocket){this.ws.initWebSocket(g.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor))}S.activateSW&&this.activateSW(S.swLink)}return I(b,[{key:"activateSW",value:function(){var e=x(S().mark(function e(t){var r;return S().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(v.IS_WEB&&"serviceWorker"in window.navigator)){e.next=14;break}return e.prev=1,e.next=4,window.navigator.serviceWorker.register(t);case 4:(r=e.sent).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.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),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;",e.t0);case 12:e.next=15;break;case 14:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 15:case"end":return e.stop()}},e,null,[[1,9]])}));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,n){return this.pipeService.emit(e,t,r,n),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,n,i,o,u){return this.interpritate.getInterpretation(e,t,r,n,i,o,u)}},{key:"getInterpretationById",value:function(e,t,r,n,i,o){return this.interpritate.getInterpretationById(e,t,r,n,i,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,n,i,o){return this.util.populateWithItemRef(e,t,r,n,i,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,n,i){return this.util.makeNestedList(e,t,r,n,i)}},{key:"jsonConstructor",value:function(e,t,r,n){return this.util.jsonConstructor(e,t,r,n)}},{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=x(S().mark(function e(t,r){var n;return S().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getItems(t);case 2:if(!(n=e.sent)){e.next=5;break}return e.abrupt("return",n.find(function(e){return e.item_id==r}));case 5:case"end":return e.stop()}},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:"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,n){return this.fieldProcessor.setFieldValue(e,t,r,n)}},{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,n,i,o,u){return this.fileManager.uploadFileFromString(e,t,r,n,i,o,u)}},{key:"updateFileFromString",value:function(e,t,r,n,i){return this.fileManager.updateFileFromString(e,t,r,n,i)}},{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)}}]),b}();
270
- },{"./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/Sharing.js":"XaHW","./WebSocket/WebSocketEmitter.js":"quyV","./ChunksManager/DataService/export.js":"PLI6"}],"iRRN":[function(require,module,exports) {
279
+ var t;Object.defineProperty(exports,"__esModule",{value:!0}),exports.IndexedDBAppService=void 0;var e=require("../AppDataService.js"),r=require("../ChunkDataService.js"),n=require("../httpService/AppHttpService.js"),o=require("../utils.js"),i=require("./IndexedDBService.js");function a(t){return(a="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 c(){"use strict";c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",d="executing",b="completed",g={};function m(){}function w(){}function x(){}var j={};l(j,u,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(T([])));O&&O!==r&&n.call(O,u)&&(j=O);var E=x.prototype=m.prototype=Object.create(j);function L(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function _(t,e){function r(o,i,c,u){var s=h(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==a(l)&&n.call(l,"__await")?e.resolve(l.__await).then(function(t){r("next",t,c,u)},function(t){r("throw",t,c,u)}):e.resolve(l).then(function(t){f.value=t,c(f)},function(t){return r("throw",t,c,u)})}u(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=v;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?b:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=b,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(a(e)+" is not iterable")}return w.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},L(_.prototype),l(_.prototype,s,function(){return this}),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},L(E),l(E,f,"Generator"),l(E,u,function(){return this}),l(E,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)})}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(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,h(n.key),n)}}function p(t,e,r){return e&&l(t.prototype,e),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t){var e=v(t,"string");return"symbol"==a(e)?e:String(e)}function v(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function y(t,e,r){return e=g(e),d(t,b()?Reflect.construct(e,r||[],g(t).constructor):e.apply(t,r))}function d(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}function b(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(b=function(){return!!t})()}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&x(t,e)}function x(t,e){return(x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var j=exports.IndexedDBAppService=function(t,e){function r(t,e){var a;f(this,r),(a=y(this,r,[t,e])).dataService=new n.AppHttpService(t);var c=new i.IndexedDBService(e);return(0,o.objectAssignWithOverride)(m(a),c),a}return w(r,t),p(r,[{key:"getApp",value:function(){var t=s(c().mark(function t(e){var r,n,o,i,a,u=this;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return(r=this.dataService.getApp(e)).then(function(t){return u.putApp(e,t)}),t.prev=2,t.next=5,this.openDatabase();case 5:return n=t.sent,o=n.transaction(this.store,"readonly"),i=o.objectStore(this.store),a=i.get(e),t.next=11,new Promise(function(t,e){a.onsuccess=function(r){var n=r.target.result;n||e(),n&&t(n)},a.onerror=e});case 11:return t.abrupt("return",t.sent);case 14:return t.prev=14,t.t0=t.catch(2),t.abrupt("return",r);case 17:case"end":return t.stop()}},t,this,[[2,14]])}));return function(e){return t.apply(this,arguments)}}()},{key:"putApp",value:function(){var t=s(c().mark(function t(e,r){var n,o;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.openDatabase();case 3:n=t.sent,o=n.transaction(this.store,"readwrite"),o.objectStore(this.store).put(r,e),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}},t,this,[[0,9]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"openDatabase",value:function(){var t=s(c().mark(function t(){var e=this;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,r){var n=indexedDB.open(e.dbName,e.dbVersion);n.onsuccess=function(e){t(e.target.result)},n.onerror=function(t){r(t.target.error)}}));case 1:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}()}],[{key:e,value:function(t){return t instanceof i.IndexedDBService||t.chunkDataService instanceof r}}]),r}(e.AppDataService,Symbol.hasInstance);
280
+ },{"../AppDataService.js":"RQNC","../ChunkDataService.js":"VAmb","../httpService/AppHttpService.js":"gUcM","../utils.js":"hg0N","./IndexedDBService.js":"vsBf"}],"Q7LR":[function(require,module,exports) {
281
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChunkHttpService=void 0;var t=require("../../api/ChunkApi.js"),r=require("../ChunkDataService.js"),e=require("../utils.js"),n=require("./HttpService.js");function o(t){return(o="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 i(){i=function(){return r};var t,r={},e=Object.prototype,n=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(t){s=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),u=new N(n||[]);return a(i,"_invoke",{value:S(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function j(){}var O={};s(O,c,function(){return this});var x=Object.getPrototypeOf,E=x&&x(x(G([])));E&&E!==e&&n.call(E,c)&&(O=E);var L=j.prototype=b.prototype=Object.create(O);function k(t){["next","throw","return"].forEach(function(r){s(t,r,function(t){return this._invoke(r,t)})})}function _(t,r){function e(i,a,u,c){var f=p(t[i],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==o(s)&&n.call(s,"__await")?r.resolve(s.__await).then(function(t){e("next",t,u,c)},function(t){e("throw",t,u,c)}):r.resolve(s).then(function(t){l.value=t,u(l)},function(t){return e("throw",t,u,c)})}c(f.arg)}var i;a(this,"_invoke",{value:function(t,n){function o(){return new r(function(r,o){e(t,n,r,o)})}return i=i?i.then(o,o):o()}})}function S(r,e,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=p(r,e,n);if("normal"===f.type){if(o=n.done?g:v,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=g,n.method="throw",n.arg=f.arg)}}}function P(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,P(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function C(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function T(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function G(r){if(r||""===r){var e=r[c];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function e(){for(;++i<r.length;)if(n.call(r,i))return e.value=r[i],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(o(r)+" is not iterable")}return w.prototype=j,a(L,"constructor",{value:j,configurable:!0}),a(j,"constructor",{value:w,configurable:!0}),w.displayName=s(j,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,s(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},k(_.prototype),s(_.prototype,f,function(){return this}),r.AsyncIterator=_,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new _(h(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},k(L),s(L,l,"Generator"),s(L,c,function(){return this}),s(L,"toString",function(){return"[object Generator]"}),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=G,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function o(n,o){return u.type="throw",u.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),f=n.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:G(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function a(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(f){return void e(f)}u.done?r(c):Promise.resolve(c).then(n,o)}function u(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)})}}function c(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function f(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 l(t,r,e){return r&&f(t.prototype,r),e&&f(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var r=h(t,"string");return"symbol"==o(r)?r:String(r)}function h(t,r){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function p(t,r,e){return r=d(r),y(t,v()?Reflect.construct(r,e||[],d(t).constructor):r.apply(t,e))}function y(t,r){if(r&&("object"===o(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return g(t)}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(v=function(){return!!t})()}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&b(t,r)}function b(t,r){return(b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t})(t,r)}var w=exports.ChunkHttpService=function(r,o){function a(r,o){var i;c(this,a),(i=p(this,a)).chunkApi=new t.ChunkAPI(r);var u=new n.HttpService(o);return(0,e.objectAssignWithOverride)(g(i),u),i}return m(a,r),l(a,[{key:"getChunk",value:function(){var t=u(i().mark(function t(r,e){return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.chunkApi.getChunk(r,e));case 1:case"end":return t.stop()}},t,this)}));return function(r,e){return t.apply(this,arguments)}}()},{key:"putChunk",value:function(){}}],[{key:o,value:function(t){return t instanceof a||t.chunkDataService instanceof n.HttpService}}]),a}(r.ChunkDataService,Symbol.hasInstance);
282
+ },{"../../api/ChunkApi.js":"baS4","../ChunkDataService.js":"VAmb","../utils.js":"hg0N","./HttpService.js":"t7L1"}],"KFHD":[function(require,module,exports) {
283
+ var define;
284
+ var t;Object.defineProperty(exports,"__esModule",{value:!0}),exports.IndexedDBChunkService=void 0;var e=require("../ChunkDataService.js"),r=require("../httpService/ChunkHttpService.js"),n=require("../utils.js"),o=require("./IndexedDBService.js");function i(t){return(i="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 a(){"use strict";a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new N(n||[]);return o(a,"_invoke",{value:_(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var v="suspendedStart",y="suspendedYield",d="executing",b="completed",g={};function m(){}function w(){}function x(){}var j={};l(j,c,function(){return this});var O=Object.getPrototypeOf,S=O&&O(O(T([])));S&&S!==r&&n.call(S,c)&&(j=S);var k=x.prototype=m.prototype=Object.create(j);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function L(t,e){function r(o,a,u,c){var s=p(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==i(l)&&n.call(l,"__await")?e.resolve(l.__await).then(function(t){r("next",t,u,c)},function(t){r("throw",t,u,c)}):e.resolve(l).then(function(t){f.value=t,u(f)},function(t){return r("throw",t,u,c)})}c(s.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return a=a?a.then(o,o):o()}})}function _(e,r,n){var o=v;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?b:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=b,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(i(e)+" is not iterable")}return w.prototype=x,o(k,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(L.prototype),l(L.prototype,s,function(){return this}),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},E(k),l(k,f,"Generator"),l(k,c,function(){return this}),l(k,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)})}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(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,h(n.key),n)}}function l(t,e,r){return e&&f(t.prototype,e),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t){var e=p(t,"string");return"symbol"==i(e)?e:String(e)}function p(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function v(t,e,r){return e=b(e),y(t,d()?Reflect.construct(e,r||[],b(t).constructor):e.apply(t,r))}function y(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return g(t)}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&w(t,e)}function w(t,e){return(w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var x=exports.IndexedDBChunkService=function(t,e){function i(t,e){var a;s(this,i),(a=v(this,i,[t,e])).dataService=new r.ChunkHttpService(t);var u=new o.IndexedDBService(e);return(0,n.objectAssignWithOverride)(g(a),u),a}return m(i,t),l(i,[{key:"putChunk",value:function(){var t=c(a().mark(function t(e,r){var n,o;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.openDatabase();case 3:n=t.sent,o=n.transaction(this.store,"readwrite"),o.objectStore(this.store).put(r,e),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}},t,this,[[0,9]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"getChunk",value:function(){var t=c(a().mark(function t(e,r){var n,o,i,u,c;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.openDatabase();case 3:return n=t.sent,o=n.transaction(this.store,"readonly"),i=o.objectStore(this.store),u=i.get(r),t.next=9,new Promise(function(t,e){u.onsuccess=function(r){var n=r.target.result;n||e(),n&&t(n)},u.onerror=e});case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(0),t.next=16,this.dataService.getChunk(e,r);case 16:return c=t.sent,t.next=19,this.putChunk(r,c);case 19:return t.abrupt("return",c);case 20:case"end":return t.stop()}},t,this,[[0,12]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"openDatabase",value:function(){var t=c(a().mark(function t(){var e=this;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,r){var n=indexedDB.open(e.dbName,e.dbVersion);n.onsuccess=function(e){t(e.target.result)},n.onerror=function(t){r(t.target.error)}}));case 1:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}()}],[{key:e,value:function(t){return t instanceof o.IndexedDBService||t.chunkDataService instanceof i}}]),i}(e.ChunkDataService,Symbol.hasInstance);
285
+ },{"../ChunkDataService.js":"VAmb","../httpService/ChunkHttpService.js":"Q7LR","../utils.js":"hg0N","./IndexedDBService.js":"vsBf"}],"QBs9":[function(require,module,exports) {
286
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.dbVersion=exports.dbName=void 0;var e=exports.dbName="gudhub",r=exports.dbVersion=7;
287
+ },{}],"NKir":[function(require,module,exports) {
288
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.appsConf=void 0;var e=require("./consts.js"),s=exports.appsConf={dbName:e.dbName,dbVersion:e.dbVersion,store:"apps"};
289
+ },{"./consts.js":"QBs9"}],"YaEO":[function(require,module,exports) {
290
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.chunksConf=void 0;var e=require("./consts.js"),s=exports.chunksConf={dbName:e.dbName,dbVersion:e.dbVersion,store:"chunks"};
291
+ },{"./consts.js":"QBs9"}],"BtEV":[function(require,module,exports) {
292
+ "use strict";var e=require("../../consts.js"),r=require("./appDataConf.js"),t=require("./chunkDataConf.js"),n=require("./consts.js");if(e.IS_WEB){var s=indexedDB.open(n.dbName,n.dbVersion);s.onupgradeneeded=function(e){for(var n=e.target.result,s=0,o=[r.appsConf.store,t.chunksConf.store];s<o.length;s++){var a=o[s];n.objectStoreNames.contains(a)||n.createObjectStore(a)}}}
293
+ },{"../../consts.js":"UV2u","./appDataConf.js":"NKir","./chunkDataConf.js":"YaEO","./consts.js":"QBs9"}],"F1EO":[function(require,module,exports) {
294
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.chunkDataServiceConf=exports.appDataServiceConf=exports.ChunkDataService=exports.AppDataService=void 0;var e,r,t,p,i=require("../config.js"),a=require("../consts.js"),c=require("./IndexedDB/IndexedDBAppService.js"),n=require("./IndexedDB/IndexedDBChunkService.js"),s=require("./IndexedDB/appDataConf.js"),u=require("./IndexedDB/chunkDataConf.js"),o=require("./httpService/AppHttpService.js"),v=require("./httpService/ChunkHttpService.js");require("./IndexedDB/init.js"),a.IS_WEB&&i.cache_chunk_requests?(exports.ChunkDataService=r=n.IndexedDBChunkService,exports.chunkDataServiceConf=p=u.chunksConf):exports.ChunkDataService=r=v.ChunkHttpService,a.IS_WEB&&i.cache_app_requests?(exports.AppDataService=e=c.IndexedDBAppService,exports.appDataServiceConf=t=s.appsConf):exports.AppDataService=e=o.AppHttpService;
295
+ },{"../config.js":"TPH7","../consts.js":"UV2u","./IndexedDB/IndexedDBAppService.js":"YqNA","./IndexedDB/IndexedDBChunkService.js":"KFHD","./IndexedDB/appDataConf.js":"NKir","./IndexedDB/chunkDataConf.js":"YaEO","./httpService/AppHttpService.js":"gUcM","./httpService/ChunkHttpService.js":"Q7LR","./IndexedDB/init.js":"BtEV"}],"U9gy":[function(require,module,exports) {
296
+ "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"),n=require("./WebSocket/WebSocket.js"),i=require("./config.js"),o=require("./Utils/Utils.js"),u=require("./Auth/Auth.js"),a=require("./GHConstructor/ghconstructor.js"),s=require("./AppProcessor/AppProcessor.js"),c=require("./ItemProcessor/ItemProcessor.js"),l=require("./FieldProcessor/FieldProcessor.js"),h=require("./FileManager/FileManager.js"),p=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"),m=require("./Utils/sharing/Sharing.js"),k=require("./WebSocket/WebSocketEmitter.js"),w=require("./DataService/export.js");function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(){S=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,u=Object.create(o.prototype),a=new W(n||[]);return i(u,"_invoke",{value:j(e,r,a)}),u}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="suspendedYield",d="executing",v="completed",g={};function y(){}function m(){}function k(){}var w={};c(w,u,function(){return this});var P=Object.getPrototypeOf,_=P&&P(P(E([])));_&&_!==r&&n.call(_,u)&&(w=_);var F=k.prototype=y.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function I(e,t){function r(i,o,u,a){var s=h(e[i],e,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==b(l)&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,u,a)},function(e){r("throw",e,u,a)}):t.resolve(l).then(function(e){c.value=e,u(c)},function(e){return r("throw",e,u,a)})}a(s.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t(function(t,i){r(e,n,t,i)})}return o=o?o.then(i,i):i()}})}function j(t,r,n){var i=p;return function(o,u){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw u;return{value:e,done:!0}}for(n.method=o,n.arg=u;;){var a=n.delegate;if(a){var s=L(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var c=h(t,r,n);if("normal"===c.type){if(i=n.done?v:f,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=h(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var u=o.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function W(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function E(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(b(t)+" is not iterable")}return m.prototype=k,i(F,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:m,configurable:!0}),m.displayName=c(k,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,c(e,s,"GeneratorFunction")),e.prototype=Object.create(F),e},t.awrap=function(e){return{__await:e}},x(I.prototype),c(I.prototype,a,function(){return this}),t.AsyncIterator=I,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var u=new I(l(e,r,n,i),o);return t.isGeneratorFunction(r)?u:u.next().then(function(e){return e.done?e.value:u.next()})},x(F),c(F,s,"Generator"),c(F,u,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=E,W.prototype={constructor:W,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return a.type="throw",a.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var s=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(s&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:E(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function P(e,t,r,n,i,o,u){try{var a=e[o](u),s=a.value}catch(c){return void r(c)}a.done?t(s):Promise.resolve(s).then(n,i)}function _(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function u(e){P(o,n,i,u,a,"next",e)}function a(e){P(o,n,i,u,a,"throw",e)}u(void 0)})}}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(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,j(n.key),n)}}function I(e,t,r){return t&&x(e.prototype,t),r&&x(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function j(e){var t=L(e,"string");return"symbol"==b(t)?t:String(t)}function L(e,t){if("object"!=b(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var q=exports.GudHub=function(){function b(v){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{server_url:i.server_url,wss_url:i.wss_url,node_server_url:i.node_server_url,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:i.async_modules_path,file_server_url:i.file_server_url,automation_modules_path:i.automation_modules_path};if(F(this,b),this.config=S,this.ghconstructor=new a.GHConstructor(this),this.interpritate=new d.Interpritate(this),this.pipeService=new t.PipeService,this.storage=new r.Storage(S.async_modules_path,S.file_server_url,S.automation_modules_path),this.util=new o.Utils(this),this.req=new e.GudHubHttpsService(S.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),v&&this.storage.setUser({auth_key:v}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new n.WebSocketApi(S.wss_url,this.auth),this.chunksManager=new p.ChunksManager(this.storage,this.pipeService,this.req,this.util,new w.ChunkDataService(this.req,w.chunkDataServiceConf)),this.appProcessor=new s.AppProcessor(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,S.activateSW,new w.AppDataService(this.req,w.appDataServiceConf)),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 h.FileManager(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new f.DocumentManager(this.req,this.pipeService),this.websocketsemitter=new k.WebSocketEmitter(this),S.initWebsocket){this.ws.initWebSocket(g.WebsocketHandler.bind(this,this),this.appProcessor.refreshApps.bind(this.appProcessor))}S.activateSW&&this.activateSW(S.swLink)}return I(b,[{key:"activateSW",value:function(){var e=_(S().mark(function e(t){var r;return S().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(v.IS_WEB&&"serviceWorker"in window.navigator)){e.next=14;break}return e.prev=1,e.next=4,window.navigator.serviceWorker.register(t);case 4:(r=e.sent).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.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),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;",e.t0);case 12:e.next=15;break;case 14:console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");case 15:case"end":return e.stop()}},e,null,[[1,9]])}));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,n){return this.pipeService.emit(e,t,r,n),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,n,i,o,u){return this.interpritate.getInterpretation(e,t,r,n,i,o,u)}},{key:"getInterpretationById",value:function(e,t,r,n,i,o){return this.interpritate.getInterpretationById(e,t,r,n,i,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,n,i,o){return this.util.populateWithItemRef(e,t,r,n,i,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,n,i){return this.util.makeNestedList(e,t,r,n,i)}},{key:"jsonConstructor",value:function(e,t,r,n){return this.util.jsonConstructor(e,t,r,n)}},{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=_(S().mark(function e(t,r){var n;return S().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getItems(t);case 2:if(!(n=e.sent)){e.next=5;break}return e.abrupt("return",n.find(function(e){return e.item_id==r}));case 5:case"end":return e.stop()}},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:"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,n){return this.fieldProcessor.setFieldValue(e,t,r,n)}},{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,n,i,o,u){return this.fileManager.uploadFileFromString(e,t,r,n,i,o,u)}},{key:"updateFileFromString",value:function(e,t,r,n,i){return this.fileManager.updateFileFromString(e,t,r,n,i)}},{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:"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)}}]),b}();
297
+ },{"./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/Sharing.js":"XaHW","./WebSocket/WebSocketEmitter.js":"quyV","./DataService/export.js":"F1EO"}],"iRRN":[function(require,module,exports) {
271
298
  "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;
272
299
  },{"regenerator-runtime/runtime.js":"KA2S","./GUDHUB/gudhub.js":"U9gy"}]},{},["iRRN"], "GudHubLibrary")
273
300
  //# sourceMappingURL=/library.min.js.map