From 604a3621bcbdc4f9573fb0691c192cb61570c645 Mon Sep 17 00:00:00 2001 From: Oleg Date: Sun, 25 Feb 2018 18:57:05 +0200 Subject: [PATCH] eslint anble --- .eslintrc.js | 37 + bundle/index.html | 7 + package-lock.json | 2303 +++--------- package.json | 17 +- src/assets/vendor/utils/dashboard.js | 3139 ++++++++--------- src/assets/vendor/utils/global.js | 247 +- src/assets/vendor/utils/handlers.js | 185 +- src/assets/vendor/utils/json-bert-old.js | 1786 +++++----- src/assets/vendor/utils/json-bert-test.js | 48 +- src/assets/vendor/utils/json-bert.js | 2478 +++++++------ src/assets/vendor/utils/recorder.js | 514 ++- src/assets/vendor/utils/signin.js | 438 +-- src/assets/vendor/utils/signup.js | 666 ++-- src/assets/vendor/utils/spa_mq.js | 167 +- src/assets/vendor/utils/timer.js | 38 +- src/assets/vendor/utils/voximplant.js | 93 +- src/assets/vendor/utils/welcome.js | 66 +- src/componets/ChatListItem/ChatListItem.js | 113 +- src/componets/PaperWithDrop/PaperWithDrop.js | 64 +- src/componets/SvgIcons/CallsIcon/CallsIcon.js | 47 +- src/componets/SvgIcons/ChatIcon/ChatIcon.js | 47 +- .../SvgIcons/ContactsIcon/ContactsIcon.js | 55 +- .../SvgIcons/GropsIcon/GroupsIcon.js | 47 +- src/componets/SvgIcons/LogoIcon/LogoIcon.js | 45 +- .../SvgIcons/OptionsIcon/OptionsIcon.js | 45 +- src/componets/SvgIcons/index.js | 17 +- src/componets/index.js | 8 +- src/containers/ActionMenu/ActionMenu.js | 194 +- src/containers/ActivityList/ActivityList.js | 105 +- src/containers/ChatModal/ChatModal.js | 24 +- src/containers/MenuAppBar/MenuAppBar.js | 80 +- src/containers/index.js | 13 +- src/core/bert/Converter.bert.js | 117 +- src/core/bert/SignatureGenerator.bert.js | 2872 ++++++++------- src/core/configs/BrowserStorage.config.js | 2 +- src/core/configs/MqttEvents.config.js | 2 +- src/core/configs/MqttInit.config.js | 34 +- src/core/configs/ProtocolHandlers.config.js | 2 +- src/core/loggers/SentryError.logger | 2 + src/core/messages/Converter.message.js | 14 +- .../middlewares/ErrorHandler.middleware.js | 28 +- .../service-worker/register.service-worker.js | 53 +- .../unregister.service-worker.js | 14 +- .../validator.service-worker.js | 96 +- src/core/protocols/Index.protocol.js | 220 +- src/core/protocols/Topic.protocol.js | 24 +- src/core/protocols/Validator.protocol.js | 25 +- src/core/protocols/index.js | 2 +- src/core/resource/Auth.resource.js | 4 +- src/core/resource/Init.resource.js | 34 +- src/core/resource/Messages.resource.js | 86 +- src/core/resource/Registry.resource.js | 32 +- src/core/resource/Users.resource.js | 61 +- src/core/resource/index.js | 4 +- src/core/sagas/Connector.saga.js | 19 +- src/core/sagas/Messages.saga.js | 6 +- src/core/sagas/Root.saga.js | 10 +- src/core/sagas/index.js | 2 +- src/core/services/MqttClient.service.js | 55 +- src/core/services/MqttEventChannel.service.js | 74 +- src/core/services/index.js | 2 +- src/core/store/Browser.store.js | 22 +- src/core/store/Configure.dev.store.js | 9 +- src/core/store/ConfigureBrowser.store.js | 10 +- src/core/store/MqttLocaforage.store.js | 127 +- src/core/store/index.js | 16 +- src/core/utils/utf8.util.js | 12 +- src/index.js | 23 +- src/modules/Chats/Chats.js | 17 +- src/modules/Dashboard/Dashboard.js | 76 +- src/modules/Home/Home.js | 12 +- src/modules/Login/Login.js | 121 +- src/modules/SignUp/SignUp.js | 231 +- src/modules/index.js | 12 +- src/pages/App/App.js | 44 +- src/pages/NinjaApp/NinjaApp.js | 51 +- src/pages/NotFound/NotFoundPage.js | 2 +- src/pages/Unauthorized/UnauthorizedPage.js | 10 +- src/pages/index.js | 10 +- src/root.js | 34 +- src/routes.js | 37 +- src/vendors.js | 4 +- tools/ErlangDebugger.tools.js | 2 + webpackConfigs/webPackServerApp.js | 2 + webpackConfigs/webpack-compiler.js | 2 + webpackConfigs/webpack.production.config.js | 2 + 86 files changed, 8611 insertions(+), 9306 deletions(-) create mode 100644 .eslintrc.js create mode 100644 bundle/index.html diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..59506eea4 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,37 @@ +module.exports = { + "extends": "airbnb", + "parser": "babel-eslint", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "modules": true, + "experimentalObjectRestSpread": true + } + }, + "rules": { + "react/no-multi-comp": 0, + "import/default": 0, + "import/first": 0, + "import/no-duplicates": 0, + "import/named": 0, + "import/namespace": 0, + "import/no-unresolved": 0, + "import/no-named-as-default": 2, + "comma-dangle": [2, "never"], + "func-names": 0, + "no-console": 0, + "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], + + }, + "plugins": [ + "react", "import" + ], + "settings": { + "import/parser": "babel-eslint", + "import/resolve": { + "moduleDirectory": ["node_modules", "src"] + } + }, +}; \ No newline at end of file diff --git a/bundle/index.html b/bundle/index.html new file mode 100644 index 000000000..e0436732e --- /dev/null +++ b/bundle/index.html @@ -0,0 +1,7 @@ + + + + +
+ + diff --git a/package-lock.json b/package-lock.json index ed3e4547a..c13da914f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "@types/jss": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@types/jss/-/jss-9.3.0.tgz", - "integrity": "sha512-n7MUYCO/Wt4d6Yj0ZewXSSkqBcrdLFgpQ4mUBRXBWDmLfXtgT3tJ26GVPr8HiyRLLze6iQfaBJTlvjRTjgZpRg==" + "integrity": "sha1-D4SE/QPe0gaRe+J7WCF/J0oK1Z8=" }, "@types/react": { "version": "16.0.35", @@ -31,7 +31,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=", "dev": true }, "accepts": { @@ -50,23 +50,6 @@ "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", "dev": true }, - "acorn-dynamic-import": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", - "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", - "dev": true, - "requires": { - "acorn": "4.0.13" - }, - "dependencies": { - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - } - } - }, "acorn-globals": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", @@ -125,9 +108,9 @@ } }, "ajv-keywords": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.0.tgz", - "integrity": "sha1-opbhf3v658HOT34N5T0pyzIWLfA=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.1.0.tgz", + "integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=", "dev": true }, "align-text": { @@ -156,7 +139,7 @@ "ansi-escapes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", - "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "integrity": "sha1-7D6LTp+AZPwCw6ybZfHCdb2o75I=", "dev": true }, "ansi-html": { @@ -174,7 +157,7 @@ "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "integrity": "sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g=", "dev": true, "requires": { "color-convert": "1.9.0" @@ -183,7 +166,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", "dev": true, "requires": { "micromatch": "2.3.11", @@ -202,7 +185,7 @@ "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=", "dev": true }, "are-we-there-yet": { @@ -224,6 +207,16 @@ "sprintf-js": "1.0.3" } }, + "aria-query": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.1.tgz", + "integrity": "sha1-Jsu1r/ZBRLCoJb4YRuCxbPoAsR4=", + "dev": true, + "requires": { + "ast-types-flow": "0.0.7", + "commander": "2.11.0" + } + }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", @@ -236,7 +229,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", "dev": true }, "array-back": { @@ -338,32 +331,18 @@ "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", "dev": true }, - "asn1.js": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", - "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" - } - }, - "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", - "dev": true, - "requires": { - "util": "0.10.3" - } - }, "assert-plus": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", "dev": true }, + "ast-types-flow": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", + "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "dev": true + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -391,7 +370,7 @@ "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + "integrity": "sha1-ePrtjD0HSrgfIrTphdeehzj3IPg=" }, "asynckit": { "version": "0.4.0", @@ -425,6 +404,15 @@ "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", "dev": true }, + "axobject-query": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-0.1.0.tgz", + "integrity": "sha1-YvWdvFnJ+SQnWco0mWDnov48NsA=", + "dev": true, + "requires": { + "ast-types-flow": "0.0.7" + } + }, "babel-cli": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.24.1.tgz", @@ -1358,7 +1346,7 @@ "babel-preset-env": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "integrity": "sha1-LeHHgqeAoKXWBdGZyVdZbaQ8ROQ=", "dev": true, "requires": { "babel-plugin-check-es2015-constants": "6.22.0", @@ -1393,38 +1381,6 @@ "semver": "5.4.1" } }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoping": "6.26.0", - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-plugin-transform-es2015-computed-properties": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", - "babel-plugin-transform-es2015-for-of": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-literals": "6.22.0", - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", - "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", - "babel-plugin-transform-es2015-modules-umd": "6.24.1", - "babel-plugin-transform-es2015-object-super": "6.24.1", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-template-literals": "6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.26.0" - } - }, "babel-preset-flow": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", @@ -1578,7 +1534,7 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "requires": { "core-js": "2.5.1", - "regenerator-runtime": "0.11.0" + "regenerator-runtime": "0.11.1" }, "dependencies": { "core-js": { @@ -1641,7 +1597,7 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", "dev": true }, "backo2": { @@ -1667,12 +1623,6 @@ "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", "dev": true }, - "base64-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", - "dev": true - }, "base64id": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz", @@ -1707,7 +1657,7 @@ "big.js": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "integrity": "sha1-pfwpi4G54Nyi5FiCR4S2XFK6WI4=", "dev": true }, "binary-extensions": { @@ -1742,13 +1692,7 @@ "bluebird": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "integrity": "sha1-2VUfnemPH82h5oPRfukaBgLuLrk=", "dev": true }, "body-parser": { @@ -1784,7 +1728,7 @@ "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=", "dev": true }, "setprototypeof": { @@ -1833,13 +1777,7 @@ "brcast": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/brcast/-/brcast-3.0.1.tgz", - "integrity": "sha512-eI3yqf9YEqyGl9PCNTR46MGvDylGtaHjalcz6Q3fAPnP/PhpKkkve52vFdfGpwp4VUvK6LUr4TQN+2stCrEwTg==" - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true + "integrity": "sha1-YlaoNJsg3p7tRCV6myTXFJPNSN0=" }, "browser-resolve": { "version": "1.11.2", @@ -1916,76 +1854,6 @@ "weinre": "2.0.0-pre-I0Z7U9OV" } }, - "browserify-aes": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", - "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", - "dev": true, - "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - }, - "browserify-cipher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", - "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", - "dev": true, - "requires": { - "browserify-aes": "1.1.1", - "browserify-des": "1.0.0", - "evp_bytestokey": "1.0.3" - } - }, - "browserify-des": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", - "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.3" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.5" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "elliptic": "6.4.0", - "inherits": "2.0.3", - "parse-asn1": "5.1.0" - } - }, - "browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", - "dev": true, - "requires": { - "pako": "0.2.9" - } - }, "browserslist": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.0.tgz", @@ -2011,43 +1879,12 @@ "node-int64": "0.4.0" } }, - "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "dev": true, - "requires": { - "base64-js": "1.2.1", - "ieee754": "1.1.8", - "isarray": "1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -2178,7 +2015,7 @@ "chalk": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.0.1.tgz", - "integrity": "sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0g==", + "integrity": "sha1-2+xJQ20q4V9TYRTnbRRlbNvA9E0=", "dev": true, "requires": { "ansi-styles": "3.2.0", @@ -2191,6 +2028,12 @@ "resolved": "https://registry.npmjs.org/change-emitter/-/change-emitter-0.1.6.tgz", "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=" }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, "charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", @@ -2244,26 +2087,16 @@ "integrity": "sha512-vHDDF/bP9RYpTWtUhpJRhCFdvvp3iDWvEbuDbWgvjUrNGV1MXJrE0MPcwGtEled04m61iwdBLUIHZtDgzWS4ZQ==", "dev": true }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", "dev": true }, "clap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/clap/-/clap-1.2.3.tgz", - "integrity": "sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA==", + "integrity": "sha1-TzZ0WzIAhJJVf0ZBLWbVDLmbzlE=", "dev": true, "requires": { "chalk": "1.1.3" @@ -2513,30 +2346,6 @@ "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", "dev": true }, - "compressible": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.12.tgz", - "integrity": "sha1-xZpcmdt2dn6YdlAOJx72OzSTvWY=", - "dev": true, - "requires": { - "mime-db": "1.30.0" - } - }, - "compression": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.1.tgz", - "integrity": "sha1-7/JgPvwuIs+G810uuTWJ+YdTc9s=", - "dev": true, - "requires": { - "accepts": "1.3.4", - "bytes": "3.0.0", - "compressible": "2.0.12", - "debug": "2.6.9", - "on-headers": "1.0.1", - "safe-buffer": "5.1.1", - "vary": "1.1.2" - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2587,27 +2396,12 @@ "integrity": "sha1-5R0X+PDvDbkKZP20feMFFVbp8Wk=", "dev": true }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "0.1.4" - } - }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", @@ -2623,7 +2417,7 @@ "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=", "dev": true }, "content-type-parser": { @@ -2663,7 +2457,7 @@ "cosmiconfig": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-2.2.2.tgz", - "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==", + "integrity": "sha1-YXPOvVb6wELB9DkO33r2wHx8uJI=", "dev": true, "requires": { "is-directory": "0.3.1", @@ -2724,42 +2518,6 @@ } } }, - "create-ecdh": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", - "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0" - } - }, - "create-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", - "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.3", - "ripemd160": "2.0.1", - "sha.js": "2.4.9" - } - }, - "create-hmac": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", - "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "inherits": "2.0.3", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.9" - } - }, "create-react-class": { "version": "15.6.2", "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.2.tgz", @@ -2802,25 +2560,6 @@ "boom": "2.10.1" } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "1.0.0", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.0", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "diffie-hellman": "5.0.2", - "inherits": "2.0.3", - "pbkdf2": "3.0.14", - "public-encrypt": "4.0.0", - "randombytes": "2.0.5", - "randomfill": "1.0.3" - } - }, "css-color-names": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", @@ -2885,7 +2624,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -3067,7 +2806,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -3141,14 +2880,11 @@ "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", "dev": true }, - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "0.10.38" - } + "damerau-levenshtein": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz", + "integrity": "sha1-AxkcQyy27qFou3fzpV/9zLiXhRQ=", + "dev": true }, "dashdash": { "version": "1.14.1", @@ -3167,16 +2903,10 @@ } } }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -3208,7 +2938,7 @@ "deepmerge": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.0.1.tgz", - "integrity": "sha512-VIPwiMJqJ13ZQfaCsIFnp5Me9tnjURiaIFxfz7EH0Ci0dTSQpZtSLrqOicXqEd/z2r+z+Klk9GzmnRsgpgbOsQ==" + "integrity": "sha1-JcHCTxEPuRT4AAG5JSZN138/QxI=" }, "default-require-extensions": { "version": "1.0.0", @@ -3268,16 +2998,6 @@ "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", "dev": true }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" - } - }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -3293,12 +3013,6 @@ "repeating": "2.0.1" } }, - "detect-node": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.3.tgz", - "integrity": "sha1-ogM8CcyOFY03dI+951B4Mr1s4Sc=", - "dev": true - }, "dev-ip": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dev-ip/-/dev-ip-1.0.1.tgz", @@ -3308,42 +3022,16 @@ "diff": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", - "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==", + "integrity": "sha1-sdhVB9rzlkgo3lSzfQ1zumfdpWw=", "dev": true }, - "diffie-hellman": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", - "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.5" - } - }, "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" - }, - "dependencies": { - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } + "esutils": "2.0.2" } }, "dom-converter": { @@ -3376,7 +3064,7 @@ "dom-helpers": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.3.1.tgz", - "integrity": "sha512-2Sm+JaYn74OiTM2wHvxJOo3roiq/h25Yi69Fqk269cNUwIXsCvATB6CRSFC9Am/20G2b28hGv/+7NiWydIrPvg==" + "integrity": "sha1-/BpOFf/fYN3eA6SAqcD+zoId1KY=" }, "dom-serializer": { "version": "0.1.0", @@ -3401,12 +3089,6 @@ "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=" }, - "domain-browser": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", - "dev": true - }, "domelementtype": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", @@ -3441,7 +3123,7 @@ "duplexify": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.3.tgz", - "integrity": "sha512-g8ID9OroF9hKt2POf8YLayy+9594PzmM3scI00/uBXocX3TWNgoB67hjzkFe9ITAbQOne/lLdBxHXvYUM4ZgGA==", + "integrity": "sha1-i1gYgA35L9ASWyeriWSRkShYJD4=", "requires": { "end-of-stream": "1.4.1", "inherits": "2.0.3", @@ -3503,27 +3185,18 @@ "integrity": "sha1-m3uIuwXOufoBahd4M8wt3jiPIbY=", "dev": true }, - "elliptic": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", - "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "hmac-drbg": "1.0.1", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" - } - }, "emitter-steward": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/emitter-steward/-/emitter-steward-1.0.0.tgz", "integrity": "sha1-80Ea3pdYp1Zd+Eiy2gy70bRsvWQ=", "dev": true }, + "emoji-regex": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", + "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", + "dev": true + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", @@ -3547,7 +3220,7 @@ "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "integrity": "sha1-7SljTRm6ukY7bOa4CjchPqtx7EM=", "requires": { "once": "1.4.0" } @@ -3661,18 +3334,6 @@ } } }, - "enhanced-resolve": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", - "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "memory-fs": "0.4.1", - "object-assign": "4.1.0", - "tapable": "0.2.8" - } - }, "entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", @@ -3748,86 +3409,16 @@ "is-symbol": "1.0.1" } }, - "es5-ext": { - "version": "0.10.38", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.38.tgz", - "integrity": "sha512-jCMyePo7AXbUESwbl8Qi01VSH2piY9s/a3rSU/5w/MlTIx8HPL1xn2InGN8ejt/xulcJgnTO7vqNtOAxzYd2Kg==", - "dev": true, - "requires": { - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" - } - }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==" + "integrity": "sha1-njr0B0Wd7tR+mpH5uIWoTrBcVh0=" }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.38", - "es6-symbol": "3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.38", - "es6-iterator": "2.0.3", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.38", - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.38" - } - }, - "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.38", - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" - } - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true }, "escape-string-regexp": { "version": "1.0.5", @@ -3835,44 +3426,34 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.2.0", - "estraverse": "4.2.0" - } - }, "eslint": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.2.0.tgz", - "integrity": "sha1-orMYQRGxmOAunH88ymJaXgHFaz0=", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.1.tgz", + "integrity": "sha512-gPSfpSRCHre1GLxGmO68tZNxOlL2y7xBd95VcLD+Eo4S2js31YoMum3CAQIOaxY24hqYOMksMvW38xuuWKQTgw==", "dev": true, "requires": { - "ajv": "5.2.3", + "ajv": "5.5.2", "babel-code-frame": "6.26.0", - "chalk": "1.1.3", + "chalk": "2.3.1", "concat-stream": "1.6.0", - "debug": "2.6.9", - "doctrine": "2.0.0", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", "eslint-scope": "3.7.1", - "espree": "3.5.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.3", "esquery": "1.0.0", - "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.5", + "globals": "11.3.0", + "ignore": "3.3.7", "imurmurhash": "0.1.4", "inquirer": "3.3.0", - "is-resolvable": "1.0.0", + "is-resolvable": "1.1.0", "js-yaml": "3.10.0", - "json-stable-stringify": "1.0.1", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", "minimatch": "3.0.4", @@ -3880,83 +3461,139 @@ "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "4.0.0", + "pluralize": "7.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", + "semver": "5.4.1", + "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "4.0.2", + "table": "4.0.3", "text-table": "0.2.0" }, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { - "ansi-styles": "2.2.1", + "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "supports-color": "5.2.0" } }, - "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", - "dev": true + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", "dev": true }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "js-yaml": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "integrity": "sha1-LnhEFka9RoLpY/IrbpKCPDCcYtw=", "dev": true, "requires": { "argparse": "1.0.9", "esprima": "4.0.0" } }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } } } }, + "eslint-config-airbnb": { + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-16.1.0.tgz", + "integrity": "sha512-zLyOhVWhzB/jwbz7IPSbkUuj7X2ox4PHXTcZkEmDqTvd0baJmJyuxlFPDlZOE/Y5bC+HQRaEkT3FoHo9wIdRiw==", + "dev": true, + "requires": { + "eslint-config-airbnb-base": "12.1.0" + } + }, + "eslint-config-airbnb-base": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-12.1.0.tgz", + "integrity": "sha1-OGRB5UoSzNlXsKklZKS6/r10eUQ=", + "dev": true, + "requires": { + "eslint-restricted-globals": "0.1.1" + } + }, "eslint-import-resolver-node": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", - "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", "dev": true, "requires": { "debug": "2.6.9", - "resolve": "1.4.0" + "resolve": "1.5.0" }, "dependencies": { "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", "dev": true, "requires": { "path-parse": "1.0.5" @@ -3967,7 +3604,7 @@ "eslint-module-utils": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", - "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "integrity": "sha1-q67IJBd2E7ipWymWOeG2+s9HNEk=", "dev": true, "requires": { "debug": "2.6.9", @@ -4005,19 +3642,19 @@ } }, "eslint-plugin-import": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz", - "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz", + "integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=", "dev": true, "requires": { "builtin-modules": "1.1.1", "contains-path": "0.1.0", "debug": "2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "0.3.1", + "eslint-import-resolver-node": "0.3.2", "eslint-module-utils": "2.1.1", "has": "1.0.1", - "lodash.cond": "4.5.2", + "lodash": "4.17.4", "minimatch": "3.0.4", "read-pkg-up": "2.0.0" }, @@ -4032,12 +3669,6 @@ "isarray": "1.0.0" } }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -4094,18 +3725,58 @@ } } }, + "eslint-plugin-jsx-a11y": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.3.tgz", + "integrity": "sha1-VFg9GuRCSDFi4EDhPMMYZUZRAOU=", + "dev": true, + "requires": { + "aria-query": "0.7.1", + "array-includes": "3.0.3", + "ast-types-flow": "0.0.7", + "axobject-query": "0.1.0", + "damerau-levenshtein": "1.0.4", + "emoji-regex": "6.5.1", + "jsx-ast-utils": "2.0.1" + } + }, "eslint-plugin-react": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.3.0.tgz", - "integrity": "sha512-7L6QEOxm7XhcDoe+U9Qt7GJjU6KeQOX9jCLGE8EPGF6FQbwZ9LgcBzsjXIZv9oYvNQlvQZmLjJs76xEeWsI4QA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz", + "integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==", "dev": true, "requires": { - "doctrine": "2.0.0", + "doctrine": "2.1.0", "has": "1.0.1", "jsx-ast-utils": "2.0.1", - "prop-types": "15.5.10" + "prop-types": "15.6.0" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "prop-types": { + "version": "15.6.0", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.0.tgz", + "integrity": "sha1-zq8IMCL8RrSjX2nhPvda7Q1jmFY=", + "dev": true, + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + } + } } }, + "eslint-restricted-globals": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz", + "integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=", + "dev": true + }, "eslint-scope": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", @@ -4114,16 +3785,14 @@ "requires": { "esrecurse": "4.2.0", "estraverse": "4.2.0" - }, - "dependencies": { - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - } } }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, "eslint-watch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/eslint-watch/-/eslint-watch-3.1.2.tgz", @@ -4171,15 +3840,29 @@ } }, "espree": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", - "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.3.tgz", + "integrity": "sha512-Zy3tAJDORxQZLl2baguiRU1syPERAIg0L+JB2MWorORgTu/CplzvxS9WWA7Xh4+Q+eOQihNs/1o1Xep8cvCxWQ==", "dev": true, "requires": { - "acorn": "5.1.2", + "acorn": "5.4.1", "acorn-jsx": "3.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==", + "dev": true + } } }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, "esquery": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", @@ -4187,14 +3870,6 @@ "dev": true, "requires": { "estraverse": "4.2.0" - }, - "dependencies": { - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - } } }, "esrecurse": { @@ -4205,14 +3880,6 @@ "requires": { "estraverse": "4.2.0", "object-assign": "4.1.0" - }, - "dependencies": { - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - } } }, "estraverse": { @@ -4221,22 +3888,18 @@ "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.38" - } - }, "event-stream": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", @@ -4258,68 +3921,15 @@ "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=", "dev": true }, - "events": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "dev": true - }, - "eventsource": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz", - "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=", - "dev": true, - "requires": { - "original": "1.0.0" - } - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "1.3.4", - "safe-buffer": "5.1.1" - } - }, "exec-sh": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", - "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", + "integrity": "sha1-FjuYpuiea2W0fCoo0hW8H2OYnDg=", "dev": true, "requires": { "merge": "1.2.0" } }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "4.1.1", - "shebang-command": "1.2.0", - "which": "1.3.0" - } - } - } - }, "exenv": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz", @@ -4386,13 +3996,13 @@ "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, "external-editor": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.5.tgz", - "integrity": "sha512-Msjo64WT5W+NhOpQXh0nOHm+n0RfU1QUwDnKYvJ8dEJ8zlwLrqXNTv5mSUTJpepf41PDJGyhueTw2vNZW+Fr/w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", "dev": true, "requires": { + "chardet": "0.4.2", "iconv-lite": "0.4.19", - "jschardet": "1.5.1", "tmp": "0.0.33" } }, @@ -4446,6 +4056,12 @@ "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", "dev": true }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -4458,15 +4074,6 @@ "integrity": "sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg=", "dev": true }, - "faye-websocket": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", - "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", - "dev": true, - "requires": { - "websocket-driver": "0.7.0" - } - }, "fb-watchman": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", @@ -4521,7 +4128,7 @@ "file-loader": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-0.11.2.tgz", - "integrity": "sha512-N+uhF3mswIFeziHQjGScJ/yHXYt3DiLBeC+9vWW+WjUBiClMSOlV1YrXQi+7KM2aA3Rn4Bybgv+uXFQbfkzpvg==", + "integrity": "sha1-T/HfKK84cZpgmAk7iMgscdF5SjQ=", "dev": true, "requires": { "loader-utils": "1.1.0" @@ -4733,7 +4340,7 @@ "fsevents": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", - "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "integrity": "sha1-EfgjGPX+e7LNIpZaEI6TBiCCFtg=", "dev": true, "optional": true, "requires": { @@ -5649,7 +5256,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", "dev": true }, "function.prototype.name": { @@ -5663,6 +5270,12 @@ "is-callable": "1.1.3" } }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -5715,12 +5328,6 @@ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", "dev": true }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -5741,7 +5348,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -5823,7 +5430,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", "dev": true }, "globby": { @@ -5872,12 +5479,6 @@ "duplexer": "0.1.1" } }, - "handle-thing": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", - "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", - "dev": true - }, "handlebars": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.10.tgz", @@ -6057,25 +5658,6 @@ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, - "hash-base": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", - "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" - } - }, "hawk": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", @@ -6105,17 +5687,6 @@ "xtend": "4.0.1" } }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "1.1.3", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" - } - }, "hoek": { "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", @@ -6140,21 +5711,9 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=", "dev": true }, - "hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "obuf": "1.1.1", - "readable-stream": "2.3.3", - "wbuf": "1.7.2" - } - }, "html-comment-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz", @@ -6243,12 +5802,6 @@ "readable-stream": "2.3.3" } }, - "http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", - "dev": true - }, "http-errors": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.5.1.tgz", @@ -6260,12 +5813,6 @@ "statuses": "1.3.1" } }, - "http-parser-js": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.9.tgz", - "integrity": "sha1-6hoE+2St/wJC6ZdPKX3Uw8rSceE=", - "dev": true - }, "http-proxy": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.15.2.tgz", @@ -6326,12 +5873,6 @@ "sshpk": "1.13.1" } }, - "https-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", - "dev": true - }, "i": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", @@ -6341,7 +5882,7 @@ "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + "integrity": "sha1-90aPYBNfXl2tM5nAqBvpoWA6CCs=" }, "icss-replace-symbols": { "version": "1.1.0", @@ -6367,16 +5908,10 @@ "harmony-reflect": "1.5.1" } }, - "ieee754": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", - "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", - "dev": true - }, "ignore": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", - "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, "immediate": { @@ -6440,14 +5975,14 @@ "inquirer": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "integrity": "sha1-ndLyrXZdyrH/BEO0kUQqILoifck=", "dev": true, "requires": { "ansi-escapes": "3.0.0", "chalk": "2.0.1", "cli-cursor": "2.1.0", "cli-width": "2.2.0", - "external-editor": "2.0.5", + "external-editor": "2.1.0", "figures": "2.0.0", "lodash": "4.17.4", "mute-stream": "0.0.7", @@ -6474,7 +6009,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", @@ -6492,12 +6027,6 @@ } } }, - "interpret": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", - "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", - "dev": true - }, "invariant": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", @@ -6521,7 +6050,7 @@ "is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=", "requires": { "is-relative": "1.0.0", "is-windows": "1.0.1" @@ -6683,7 +6212,7 @@ "is-number-like": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/is-number-like/-/is-number-like-1.0.8.tgz", - "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", + "integrity": "sha1-LhKWILUIkQQuROm7uzBZPnXPu+M=", "dev": true, "requires": { "lodash.isfinite": "3.3.2" @@ -6701,13 +6230,13 @@ "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", "dev": true, "requires": { - "is-path-inside": "1.0.0" + "is-path-inside": "1.0.1" } }, "is-path-inside": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "1.0.2" @@ -6722,7 +6251,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "requires": { "isobject": "3.0.1" }, @@ -6769,19 +6298,16 @@ "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "integrity": "sha1-obtpNc6MXboei5dUubLcwCDiJg0=", "requires": { "is-unc-path": "1.0.0" } }, "is-resolvable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", - "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", - "dev": true, - "requires": { - "tryit": "1.0.3" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true }, "is-stream": { "version": "1.1.0", @@ -6818,7 +6344,7 @@ "is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=", "requires": { "unc-path-regex": "0.1.2" } @@ -6909,13 +6435,13 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", "dev": true }, "js-yaml": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "integrity": "sha1-LnhEFka9RoLpY/IrbpKCPDCcYtw=", "dev": true, "requires": { "argparse": "1.0.9", @@ -7255,7 +6781,7 @@ "jest-haste-map": { "version": "20.0.5", "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-20.0.5.tgz", - "integrity": "sha512-0IKAQjUvuZjMCNi/0VNQQF74/H9KB67hsHJqGiwTWQC6XO5Azs7kLWm+6Q/dwuhvDUvABDOBMFK2/FwZ3sZ07Q==", + "integrity": "sha1-q61077GgBZdKe2UX4RAQcJyrkRI=", "dev": true, "requires": { "fb-watchman": "2.0.0", @@ -7690,12 +7216,6 @@ "dev": true, "optional": true }, - "jschardet": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", - "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==", - "dev": true - }, "jsdom": { "version": "9.12.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-9.12.0.tgz", @@ -7768,7 +7288,7 @@ "boom": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "integrity": "sha1-XdnabuOl8wIHdDYpDLcX0/SlTgI=", "dev": true, "requires": { "hoek": "4.2.0" @@ -7831,7 +7351,7 @@ "hawk": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "integrity": "sha1-r02RTrBl+bXOTZ0RwcshJu7MMDg=", "dev": true, "requires": { "boom": "4.3.1", @@ -7860,13 +7380,13 @@ "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=", "dev": true }, "request": { "version": "2.83.0", "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "integrity": "sha1-ygtl2gLtYpNYh4COb1EDgQNOM1Y=", "dev": true, "requires": { "aws-sign2": "0.7.0", @@ -7952,6 +7472,12 @@ "jsonify": "0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -8035,7 +7561,7 @@ "jss-compose": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/jss-compose/-/jss-compose-5.0.0.tgz", - "integrity": "sha512-YofRYuiA0+VbeOw0VjgkyO380sA4+TWDrW52nSluD9n+1FWOlDzNbgpZ/Sb3Y46+DcAbOS21W5jo6SAqUEiuwA==", + "integrity": "sha1-zgGy5FIdZcN+pCz0kRbl96tZZIQ=", "requires": { "warning": "3.0.0" } @@ -8043,12 +7569,12 @@ "jss-default-unit": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/jss-default-unit/-/jss-default-unit-8.0.2.tgz", - "integrity": "sha512-WxNHrF/18CdoAGw2H0FqOEvJdREXVXLazn7PQYU7V6/BWkCV0GkmWsppNiExdw8dP4TU1ma1dT9zBNJ95feLmg==" + "integrity": "sha1-zB6Im65MC5QZMnsxSrHI4oJokOY=" }, "jss-expand": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/jss-expand/-/jss-expand-5.1.0.tgz", - "integrity": "sha512-WTxmNipgj0V8kr8gc8Gc6Et7uQZH60H7FFNG9zZHjR6TPJoj7TDK+/EBxwRHtCRQD4B8RTwoa7MyEKD4ReKfXw==" + "integrity": "sha1-sa107BhjHzT2WiEk/PzrZABhDj0=" }, "jss-extend": { "version": "6.1.0", @@ -8061,12 +7587,12 @@ "jss-global": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/jss-global/-/jss-global-3.0.0.tgz", - "integrity": "sha512-wxYn7vL+TImyQYGAfdplg7yaxnPQ9RaXY/cIA8hawaVnmmWxDHzBK32u1y+RAvWboa3lW83ya3nVZ/C+jyjZ5Q==" + "integrity": "sha1-4Z5ckasrljU8In4wqiy9k4zar6I=" }, "jss-nested": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/jss-nested/-/jss-nested-6.0.1.tgz", - "integrity": "sha512-rn964TralHOZxoyEgeq3hXY8hyuCElnvQoVrQwKHVmu55VRDd6IqExAx9be5HgK0yN/+hQdgAXQl/GUrBbbSTA==", + "integrity": "sha1-75kredbo9j2TnEOXudmbXLvoJMo=", "requires": { "warning": "3.0.0" } @@ -8091,12 +7617,12 @@ "jss-props-sort": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/jss-props-sort/-/jss-props-sort-6.0.0.tgz", - "integrity": "sha512-E89UDcrphmI0LzmvYk25Hp4aE5ZBsXqMWlkFXS0EtPkunJkRr+WXdCNYbXbksIPnKlBenGB9OxzQY+mVc70S+g==" + "integrity": "sha1-kQUQGjtQcfq2Hi2F6nTMIumxYyM=" }, "jss-template": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/jss-template/-/jss-template-1.0.1.tgz", - "integrity": "sha512-m5BqEWha17fmIVXm1z8xbJhY6GFJxNB9H68GVnCWPyGYfxiAgY9WTQyvDAVj+pYRgrXSOfN5V1T4+SzN1sJTeg==", + "integrity": "sha1-Ca7Z2GzFR7B/U+81XX4Xd/faQwo=", "requires": { "warning": "3.0.0" } @@ -8104,7 +7630,7 @@ "jss-vendor-prefixer": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/jss-vendor-prefixer/-/jss-vendor-prefixer-7.0.0.tgz", - "integrity": "sha512-Agd+FKmvsI0HLcYXkvy8GYOw3AAASBUpsmIRvVQheps+JWaN892uFOInTr0DRydwaD91vSSUCU4NssschvF7MA==", + "integrity": "sha1-AWZyllABXvGdnwJDfHNmcjFgXHE=", "requires": { "css-vendor": "0.3.8" } @@ -8186,7 +7712,7 @@ "limiter": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.2.tgz", - "integrity": "sha512-JIKZ0xb6fZZYa3deZ0BgXCgX6HgV8Nx3mFGeFHmFWW8Fb2c08e0CyE+G3nalpD0xGvGssjGb1UdFr+PprxZEbw==", + "integrity": "sha1-Ip2AVYkcixGvng7lIA6OCbs9y+s=", "dev": true }, "load-json-file": { @@ -8202,12 +7728,6 @@ "strip-bom": "2.0.0" } }, - "loader-runner": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", - "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=", - "dev": true - }, "loader-utils": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", @@ -8326,12 +7846,6 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.cond": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", - "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", - "dev": true - }, "lodash.curry": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.curry/-/lodash.curry-4.1.1.tgz", @@ -8482,7 +7996,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -8601,43 +8115,12 @@ "is-buffer": "1.1.5" } }, - "md5.js": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", - "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", - "dev": true, - "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" - }, - "dependencies": { - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - } - } - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "1.1.0" - } - }, "memory-fs": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", @@ -8705,16 +8188,6 @@ "regex-cache": "0.4.4" } }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" - } - }, "mime": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.4.tgz", @@ -8737,9 +8210,9 @@ } }, "mimic-fn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", - "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "min-document": { @@ -8750,22 +8223,10 @@ "dom-walk": "0.1.1" } }, - "minimalistic-assert": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", - "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -8839,7 +8300,7 @@ "mqtt-localforage-store": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/mqtt-localforage-store/-/mqtt-localforage-store-1.0.5.tgz", - "integrity": "sha512-FG/tidF0CABS434D2oRNhjTy/asifCYnVVLXa5eW3miggoWu9slvJ4+bqkFP7W34SqPHR64LnRirSh99ntzy8A==", + "integrity": "sha1-v9fF7lHzOWRWYsuU/3Nf1eXTzQ4=", "requires": { "readable-stream": "2.3.3" } @@ -8847,7 +8308,7 @@ "mqtt-packet": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-5.4.0.tgz", - "integrity": "sha512-ziN7uVysLdn7fYbOhEaKOhcZC3yIRTTakY4TFd2w+UvZIx9dPr8NCqbBYoC4WYDlzWHTn5EqR5x20pC+K24Ymg==", + "integrity": "sha1-OHEEwGqmj7ufgVnQxyLdXD5F3yI=", "requires": { "bl": "1.2.1", "inherits": "2.0.3", @@ -8903,7 +8364,7 @@ "no-case": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "integrity": "sha1-YLgTOWvjmz8SiKTB7V0efSi0ZKw=", "dev": true, "requires": { "lower-case": "1.1.4" @@ -8912,7 +8373,7 @@ "node-fetch": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "integrity": "sha1-mA9vcthSEaU0fGsrwYxbhMPrR+8=", "requires": { "encoding": "0.1.12", "is-stream": "1.1.0" @@ -8953,51 +8414,6 @@ "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", "dev": true }, - "node-libs-browser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.0.0.tgz", - "integrity": "sha1-o6WeyXAkmFtG6Vg3lkb5bEthZkY=", - "dev": true, - "requires": { - "assert": "1.4.1", - "browserify-zlib": "0.1.4", - "buffer": "4.9.1", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "domain-browser": "1.1.7", - "events": "1.1.1", - "https-browserify": "0.0.1", - "os-browserify": "0.2.1", - "path-browserify": "0.0.0", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "readable-stream": "2.3.3", - "stream-browserify": "2.0.1", - "stream-http": "2.7.2", - "string_decoder": "0.10.31", - "timers-browserify": "2.0.4", - "tty-browserify": "0.0.0", - "url": "0.11.0", - "util": "0.10.3", - "vm-browserify": "0.0.4" - }, - "dependencies": { - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, "node-notifier": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.1.2.tgz", @@ -9094,7 +8510,7 @@ "boom": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "integrity": "sha1-XdnabuOl8wIHdDYpDLcX0/SlTgI=", "dev": true, "requires": { "hoek": "4.2.0" @@ -9126,7 +8542,7 @@ "hawk": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "integrity": "sha1-r02RTrBl+bXOTZ0RwcshJu7MMDg=", "dev": true, "requires": { "boom": "4.3.1", @@ -9155,13 +8571,13 @@ "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=", "dev": true }, "request": { "version": "2.83.0", "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "integrity": "sha1-ygtl2gLtYpNYh4COb1EDgQNOM1Y=", "dev": true, "requires": { "aws-sign2": "0.7.0", @@ -9250,7 +8666,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", "dev": true, "requires": { "hosted-git-info": "2.5.0", @@ -9277,7 +8693,7 @@ "normalize-scroll-left": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/normalize-scroll-left/-/normalize-scroll-left-0.1.2.tgz", - "integrity": "sha512-F9YMRls0zCF6BFIE2YnXDRpHPpfd91nOIaNdDgrx5YMoPLo8Wqj+6jNXHQsYBavJeXP4ww8HCt0xQAKc5qk2Fg==" + "integrity": "sha1-a3lpG6eetfsQf6Xt+9wGtVyu4qo=" }, "normalize-url": { "version": "1.9.1", @@ -9382,19 +8798,10 @@ } } }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "2.0.1" - } - }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", "dev": true, "requires": { "are-we-there-yet": "1.1.4", @@ -9510,12 +8917,6 @@ "has": "1.0.1" } }, - "obuf": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.1.tgz", - "integrity": "sha1-EEEktsYCxnlogaBCVB0220OlJk4=", - "dev": true - }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -9525,12 +8926,6 @@ "ee-first": "1.1.1" } }, - "on-headers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", - "dev": true - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -9545,7 +8940,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "opener": { @@ -9643,33 +9038,6 @@ "readable-stream": "2.3.3" } }, - "original": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", - "integrity": "sha1-kUf5P6FpbQS+YeAb1QuurKZWvTs=", - "dev": true, - "requires": { - "url-parse": "1.0.5" - }, - "dependencies": { - "url-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", - "integrity": "sha1-CFSGBCKv3P7+tsllxmLUgAFpkns=", - "dev": true, - "requires": { - "querystringify": "0.0.4", - "requires-port": "1.0.0" - } - } - } - }, - "os-browserify": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", - "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", - "dev": true - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -9712,12 +9080,6 @@ "object-assign": "4.1.0" } }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, "p-limit": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", @@ -9736,13 +9098,7 @@ "p-map": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", - "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", - "dev": true - }, - "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "integrity": "sha1-5OlPMR6rvIYzoeeZCBZfyiYkG2s=", "dev": true }, "param-case": { @@ -9754,19 +9110,6 @@ "no-case": "2.3.2" } }, - "parse-asn1": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", - "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", - "dev": true, - "requires": { - "asn1.js": "4.9.2", - "browserify-aes": "1.1.1", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.14" - } - }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -9849,12 +9192,6 @@ } } }, - "path-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", - "dev": true - }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -9877,24 +9214,12 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", "dev": true }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true - }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -9915,19 +9240,6 @@ "through": "2.3.8" } }, - "pbkdf2": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", - "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", - "dev": true, - "requires": { - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.9" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -9970,9 +9282,9 @@ "dev": true }, "pluralize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz", - "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "popper.js": { @@ -9980,17 +9292,6 @@ "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.12.9.tgz", "integrity": "sha1-DfvC3/lsRRuzMu3Pz6r1ZtMx1bM=" }, - "portfinder": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz", - "integrity": "sha1-uzLs2HwnEErm7kS1o8y/Drsa7ek=", - "dev": true, - "requires": { - "async": "1.5.2", - "debug": "2.6.9", - "mkdirp": "0.5.1" - } - }, "portscanner": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/portscanner/-/portscanner-2.1.1.tgz", @@ -10078,7 +9379,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10151,7 +9452,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10223,7 +9524,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10294,7 +9595,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10365,7 +9666,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10436,7 +9737,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10507,7 +9808,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10579,7 +9880,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10651,7 +9952,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10769,7 +10070,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10842,7 +10143,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10913,7 +10214,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -10998,7 +10299,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11077,7 +10378,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11149,7 +10450,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11223,7 +10524,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11297,7 +10598,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11407,7 +10708,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11481,7 +10782,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11553,7 +10854,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11625,7 +10926,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11696,7 +10997,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11769,7 +11070,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11854,7 +11155,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -11927,7 +11228,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -12006,7 +11307,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "1.1.3", @@ -12100,7 +11401,7 @@ "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=", "requires": { "asap": "2.0.6" } @@ -12165,23 +11466,10 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, - "public-encrypt": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", - "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "parse-asn1": "5.1.0", - "randombytes": "2.0.5" - } - }, "pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "integrity": "sha1-Ejma3W5M91Jtlzy8i1zi4pCLOQk=", "requires": { "end-of-stream": "1.4.1", "once": "1.4.0" @@ -12190,7 +11478,7 @@ "pumpify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", - "integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", + "integrity": "sha1-gLfF334kFT0D8OesigWl0Gi9B/s=", "requires": { "duplexify": "3.5.3", "inherits": "2.0.3", @@ -12236,22 +11524,10 @@ "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", "dev": true }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "querystringify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", - "integrity": "sha1-DPf4T5Rj/wrlHExLFC2VvjdyTZw=", - "dev": true - }, "raf": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.0.tgz", - "integrity": "sha512-pDP/NMRAXoTfrhCfyfSEwJAKLaxBU9eApMeBPB1TkDouZmvPerIClV8lTAd+uF8ZiTaVl69e1FCxQrAd/VTjGw==", + "integrity": "sha1-ooh2iBtLwsqRF9QTgWPduA94FXU=", "requires": { "performance-now": "2.1.0" } @@ -12267,7 +11543,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", "dev": true, "requires": { "is-number": "3.0.0", @@ -12305,25 +11581,6 @@ } } }, - "randombytes": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", - "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "randomfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", - "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", - "dev": true, - "requires": { - "randombytes": "2.0.5", - "safe-buffer": "5.1.1" - } - }, "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -12449,7 +11706,7 @@ "react-event-listener": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/react-event-listener/-/react-event-listener-0.5.3.tgz", - "integrity": "sha512-fTGYvhe7eTsqq0m664Km0rxKQcqLIGZWZINmy1LU0fu312tay8Mt3Twq2P5Xj1dfDVvvzT1Ql3/FDkiMPJ1MOg==", + "integrity": "sha1-qLSSWWrWAYZTFPzCwYy4e2zjh24=", "requires": { "babel-runtime": "6.26.0", "fbjs": "0.8.16", @@ -12600,7 +11857,7 @@ "react-router": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/react-router/-/react-router-3.2.0.tgz", - "integrity": "sha512-sXlLOg0TRCqnjCVskqBHGjzNjcJKUqXEKnDSuxMYJSPJNq9hROE9VsiIW2kfIq7Ev+20Iz0nxayekXyv0XNmsg==", + "integrity": "sha1-YrYnnVibcLNOJlET5MCpJhoC7TY=", "requires": { "create-react-class": "15.6.2", "history": "3.3.0", @@ -12632,7 +11889,7 @@ "react-router-navigation-prompt": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/react-router-navigation-prompt/-/react-router-navigation-prompt-1.5.5.tgz", - "integrity": "sha512-hRVNE1+yVNHERCE+25Q/HJpyQaf1HKcaz5MjikOvZkXvMlM2W5QpcslDSEOhao0rWw9np2QvOuFwr8Vhbg7qKQ==" + "integrity": "sha1-kilX4JoZ8b7F1LwqaMQH9Qu8bDo=" }, "react-sanfona": { "version": "0.4.0", @@ -12702,7 +11959,7 @@ "react-transition-group": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.2.1.tgz", - "integrity": "sha512-q54UBM22bs/CekG8r3+vi9TugSqh0t7qcEVycaRc9M0p0aCEu+h6rp/RFiW7fHfgd1IKpd9oILFTl5QK+FpiPA==", + "integrity": "sha1-6ftne3nmRV/TkbA4I6/oSEnfShA=", "requires": { "chain-function": "1.0.0", "classnames": "2.2.5", @@ -12799,7 +12056,7 @@ "recompose": { "version": "0.26.0", "resolved": "https://registry.npmjs.org/recompose/-/recompose-0.26.0.tgz", - "integrity": "sha512-KwOu6ztO0mN5vy3+zDcc45lgnaUoaQse/a5yLVqtzTK13czSWnFGmXbQVmnoMgDkI5POd1EwIKSbjU1V7xdZog==", + "integrity": "sha1-m6v/A5y3K6W9FzZtVdcjL737LTA=", "requires": { "change-emitter": "0.1.6", "fbjs": "0.8.16", @@ -12810,7 +12067,7 @@ "redbox-react": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/redbox-react/-/redbox-react-1.5.0.tgz", - "integrity": "sha512-mdxArOI3sF8K5Nay5NG+lv/VW516TbXjjd4h1wcV1Iy4IMDQPnCayjoQXBAycAFSME4nyXRUXCjHxsw2rYpVRw==", + "integrity": "sha1-BNqxFVfSZlG/NWKmfCKs5WxdOWc=", "dev": true, "requires": { "error-stack-parser": "1.3.6", @@ -12868,7 +12125,7 @@ "redux": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", - "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "integrity": "sha1-BrcxIyFZAdJdBlvjQusCa8HIU3s=", "requires": { "lodash": "4.17.4", "lodash-es": "4.17.4", @@ -12895,7 +12152,7 @@ "redux-devtools-dock-monitor": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/redux-devtools-dock-monitor/-/redux-devtools-dock-monitor-1.1.3.tgz", - "integrity": "sha512-yAXzoI0lpjv19CxVuw8RECeFWUVdyzayqnkX8ePZyeXV2ZgIk4T+rKx82Wk+REP1y3rl8o1/oFDq4B7EobOqMg==", + "integrity": "sha1-EgXoI8glNlcKrIVRocS3CXLLpqo=", "dev": true, "requires": { "babel-runtime": "6.26.0", @@ -12963,7 +12220,7 @@ "redux-form-material-ui": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/redux-form-material-ui/-/redux-form-material-ui-4.3.3.tgz", - "integrity": "sha512-3VS2NgwqTsObdNrg8QoGRadr0PGyYW352GpKbfTrz51wWHUYX/zo7S5O/FunrCqjmUCnS/mERCU4i6Wx1RWmFw==" + "integrity": "sha1-WMWhYjEa1v7UtHCc1KKxTOJpseM=" }, "redux-immutable-state-invariant": { "version": "2.0.0", @@ -12992,18 +12249,18 @@ "regenerate": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", - "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", + "integrity": "sha1-DDNtOYBVPXVcObWGrjsgqknIK38=", "dev": true }, "regenerator-runtime": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", - "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==" + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" }, "regenerator-transform": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "integrity": "sha1-HkmWg3Ix2ot/PPQRTXG1aRoGgN0=", "dev": true, "requires": { "babel-runtime": "6.26.0", @@ -13014,7 +12271,7 @@ "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", "dev": true, "requires": { "is-equal-shallow": "0.1.3" @@ -13327,16 +12584,6 @@ "glob": "7.1.2" } }, - "ripemd160": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", - "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", - "dev": true, - "requires": { - "hash-base": "2.0.2", - "inherits": "2.0.3" - } - }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", @@ -13370,7 +12617,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" }, "sane": { "version": "1.6.0", @@ -13460,7 +12707,7 @@ "sass-loader": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-6.0.6.tgz", - "integrity": "sha512-c3/Zc+iW+qqDip6kXPYLEgsAu2lf4xz0EZDplB7EmSUMda12U1sGJPetH55B/j9eu0bTtKzKlNPWWyYC7wFNyQ==", + "integrity": "sha1-6dXmwfFV+qMqSybXqbcQfCJeQPk=", "dev": true, "requires": { "async": "2.5.0", @@ -13490,7 +12737,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", "dev": true }, "schema-utils": { @@ -13531,12 +12778,6 @@ } } }, - "select-hose": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", - "dev": true - }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", @@ -13692,16 +12933,6 @@ "integrity": "sha1-gaVSFB7BBLiOic44MQOtXGZWTQg=", "dev": true }, - "sha.js": { - "version": "2.4.9", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", - "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - }, "shallow-clone": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", @@ -13734,7 +12965,7 @@ "shallowequal": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.0.2.tgz", - "integrity": "sha512-zlVXeVUKvo+HEv1e2KQF/csyeMKx2oHvatQ9l6XjCUj3agvC8XGf6R9HvIPDSmp8FNPvx7b5kaEJTRi7CqxtEw==" + "integrity": "sha1-FWHb3vuMAUCBADGQhXZNo/z4P48=" }, "shebang-command": { "version": "1.2.0", @@ -13766,7 +12997,7 @@ "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "integrity": "sha1-1rkYHBpI05cyTISHHvvPxz/AZUs=", "dev": true }, "sigmund": { @@ -13790,7 +13021,7 @@ "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "integrity": "sha1-BE8aSdiEL/MHqta1Be0Xi9lQE00=", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0" @@ -13943,24 +13174,6 @@ } } }, - "sockjs": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.18.tgz", - "integrity": "sha1-2bKJMWyn33dZXvKZ4HXw+TfrQgc=", - "dev": true, - "requires": { - "faye-websocket": "0.10.0", - "uuid": "2.0.3" - }, - "dependencies": { - "uuid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", - "dev": true - } - } - }, "sort-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", @@ -13976,16 +13189,10 @@ "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", "dev": true }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", "dev": true, "requires": { "source-map": "0.5.7" @@ -14037,35 +13244,6 @@ "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", "dev": true }, - "spdy": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-3.4.7.tgz", - "integrity": "sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw=", - "dev": true, - "requires": { - "debug": "2.6.9", - "handle-thing": "1.2.5", - "http-deceiver": "1.2.7", - "safe-buffer": "5.1.1", - "select-hose": "2.0.0", - "spdy-transport": "2.0.20" - } - }, - "spdy-transport": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-2.0.20.tgz", - "integrity": "sha1-c15yBUxIayNU/onnAiVgBKOazk0=", - "dev": true, - "requires": { - "debug": "2.6.9", - "detect-node": "2.0.3", - "hpack.js": "2.1.6", - "obuf": "1.1.1", - "readable-stream": "2.3.3", - "safe-buffer": "5.1.1", - "wbuf": "1.7.2" - } - }, "split": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", @@ -14078,7 +13256,7 @@ "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=", "requires": { "through2": "2.0.3" } @@ -14140,16 +13318,6 @@ "readable-stream": "2.3.3" } }, - "stream-browserify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.3" - } - }, "stream-combiner": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", @@ -14159,19 +13327,6 @@ "duplexer": "0.1.1" } }, - "stream-http": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", - "dev": true, - "requires": { - "builtin-status-codes": "3.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.3", - "to-arraybuffer": "1.0.1", - "xtend": "4.0.1" - } - }, "stream-shift": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", @@ -14226,7 +13381,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "requires": { "safe-buffer": "5.1.1" } @@ -14255,12 +13410,6 @@ "is-utf8": "0.2.1" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", @@ -14279,7 +13428,7 @@ "style-loader": { "version": "0.18.2", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.18.2.tgz", - "integrity": "sha512-WPpJPZGUxWYHWIUMNNOYqql7zh85zGmr84FdTVWq52WTIkqlW9xSxD3QYWi/T31cqn9UNSsietVEgGn2aaSCzw==", + "integrity": "sha1-zDFFmvvNbYC3Ig7lSykan9Zv9es=", "dev": true, "requires": { "loader-utils": "1.1.0", @@ -14340,36 +13489,53 @@ "dev": true }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", + "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", "dev": true, "requires": { - "ajv": "5.2.3", - "ajv-keywords": "2.1.0", - "chalk": "2.1.0", + "ajv": "6.1.1", + "ajv-keywords": "3.1.0", + "chalk": "2.3.1", "lodash": "4.17.4", "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", + "ajv": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.1.1.tgz", + "integrity": "sha1-l41Zf7wrfQ5aXD3esUmmgvKr+g4=", + "dev": true, + "requires": { + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ansi-regex": { + "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha1-Uj/iZ4rsewToBBkJKS/osXBZt5Y=", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.4.0" + "supports-color": "5.2.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -14379,7 +13545,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", @@ -14394,15 +13560,18 @@ "requires": { "ansi-regex": "3.0.0" } + }, + "supports-color": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } } } }, - "tapable": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", - "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", - "dev": true - }, "tar": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", @@ -14505,7 +13674,7 @@ "theming": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/theming/-/theming-1.3.0.tgz", - "integrity": "sha512-ya5Ef7XDGbTPBv5ENTwrwkPUexrlPeiAg/EI9kdlUAZhNlRbCdhMKRgjNX1IcmsmiPcqDQZE6BpSaH+cr31FKw==", + "integrity": "sha1-KG1broC+iQ0K3GReXKBJhyNyW9w=", "requires": { "brcast": "3.0.1", "is-function": "1.0.1", @@ -14516,7 +13685,7 @@ "throat": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/throat/-/throat-3.2.0.tgz", - "integrity": "sha512-/EY8VpvlqJ+sFtLPeOgc8Pl7kQVOWv0woD87KTXVHPIAE842FGT+rokxIhe8xIUP1cfgrkt0as0vDLjDiMtr8w==", + "integrity": "sha1-UMsGcO28QCN7njR9fh+I5GIK+DY=", "dev": true }, "through": { @@ -14543,15 +13712,6 @@ "xtend": "4.0.1" } }, - "timers-browserify": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", - "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", - "dev": true, - "requires": { - "setimmediate": "1.0.5" - } - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -14582,12 +13742,6 @@ "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", "dev": true }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, "to-camel-case": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-camel-case/-/to-camel-case-1.0.0.tgz", @@ -14648,18 +13802,6 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, - "tryit": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", - "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", - "dev": true - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, "tunnel-agent": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", @@ -14733,65 +13875,6 @@ "dev": true, "optional": true }, - "uglifyjs-webpack-plugin": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz", - "integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=", - "dev": true, - "requires": { - "source-map": "0.5.7", - "uglify-js": "2.8.29", - "webpack-sources": "1.0.1" - }, - "dependencies": { - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" - } - }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, - "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true - }, - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" - } - } - } - }, "ultron": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", @@ -14884,7 +13967,7 @@ "url-loader": { "version": "0.5.9", "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-0.5.9.tgz", - "integrity": "sha512-B7QYFyvv+fOBqBVeefsxv6koWWtjmHaMFT6KZWti4KRw8YUD/hOU+3AECvXuzyVawIBx3z7zQRejXCDSO5kk1Q==", + "integrity": "sha1-zI/qgse5Bud3cBklCGnlaemVwpU=", "dev": true, "requires": { "loader-utils": "1.1.0", @@ -14899,24 +13982,6 @@ } } }, - "url-parse": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.2.0.tgz", - "integrity": "sha512-DT1XbYAfmQP65M/mE6OALxmXzZ/z1+e5zk2TcSKe/KiYbNGZxgtttzC0mR/sjopbpOXcbniq7eIKmocJnUWlEw==", - "dev": true, - "requires": { - "querystringify": "1.0.0", - "requires-port": "1.0.0" - }, - "dependencies": { - "querystringify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz", - "integrity": "sha1-YoYkIRLFtxL6ZU5SZlK/ahP/Bcs=", - "dev": true - } - } - }, "user-home": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", @@ -14986,7 +14051,7 @@ "uuid": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" + "integrity": "sha1-PdPT55Crwk17DToDT/q6vijrvAQ=" }, "v8flags": { "version": "2.1.1", @@ -15038,15 +14103,6 @@ } } }, - "vm-browserify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", - "dev": true, - "requires": { - "indexof": "0.0.1" - } - }, "walker": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", @@ -15070,216 +14126,12 @@ "integrity": "sha1-d3mLLaD5kQ1ZXxrOWwwiWFIfIdw=", "dev": true }, - "watchpack": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.4.0.tgz", - "integrity": "sha1-ShRyvLuVK9Cpu0A2gB+VTfs5+qw=", - "dev": true, - "requires": { - "async": "2.5.0", - "chokidar": "1.7.0", - "graceful-fs": "4.1.11" - }, - "dependencies": { - "async": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", - "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==", - "dev": true, - "requires": { - "lodash": "4.17.4" - } - } - } - }, - "wbuf": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.2.tgz", - "integrity": "sha1-1pe5nx9ZUS3ydRvkJ2nBWAtYAf4=", - "dev": true, - "requires": { - "minimalistic-assert": "1.0.0" - } - }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", "dev": true }, - "webpack": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.10.0.tgz", - "integrity": "sha512-fxxKXoicjdXNUMY7LIdY89tkJJJ0m1Oo8PQutZ5rLgWbV5QVKI15Cn7+/IHnRTd3vfKfiwBx6SBqlorAuNA8LA==", - "dev": true, - "requires": { - "acorn": "5.1.2", - "acorn-dynamic-import": "2.0.2", - "ajv": "5.2.3", - "ajv-keywords": "2.1.0", - "async": "2.6.0", - "enhanced-resolve": "3.4.1", - "escope": "3.6.0", - "interpret": "1.0.4", - "json-loader": "0.5.4", - "json5": "0.5.1", - "loader-runner": "2.3.0", - "loader-utils": "1.1.0", - "memory-fs": "0.4.1", - "mkdirp": "0.5.1", - "node-libs-browser": "2.0.0", - "source-map": "0.5.7", - "supports-color": "4.4.0", - "tapable": "0.2.8", - "uglifyjs-webpack-plugin": "0.4.6", - "watchpack": "1.4.0", - "webpack-sources": "1.0.1", - "yargs": "8.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", - "dev": true, - "requires": { - "lodash": "4.17.4" - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" - } - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" - } - }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "2.3.0" - } - }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.4.0", - "path-type": "2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", - "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", - "dev": true, - "requires": { - "camelcase": "4.1.0", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "read-pkg-up": "2.0.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "7.0.0" - } - }, - "yargs-parser": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", - "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", - "dev": true, - "requires": { - "camelcase": "4.1.0" - } - } - } - }, "webpack-bundle-analyzer": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.8.2.tgz", @@ -15400,7 +14252,7 @@ "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY=", "dev": true }, "path-to-regexp": { @@ -15412,13 +14264,13 @@ "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=", "dev": true }, "send": { "version": "0.16.1", "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", - "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", + "integrity": "sha1-pw4coh0TgsEdDZ9iMd6ygQgNerM=", "dev": true, "requires": { "debug": "2.6.9", @@ -15439,7 +14291,7 @@ "serve-static": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", - "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", + "integrity": "sha1-TFfVNASnYdjy58HooYpH2/J4pxk=", "dev": true, "requires": { "encodeurl": "1.0.1", @@ -15451,7 +14303,7 @@ "setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "integrity": "sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY=", "dev": true }, "supports-color": { @@ -15585,211 +14437,10 @@ } } }, - "webpack-dev-server": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.4.5.tgz", - "integrity": "sha1-MThM6BE2vhCAtLTN4OubkOVO5s8=", - "dev": true, - "requires": { - "ansi-html": "0.0.7", - "chokidar": "1.7.0", - "compression": "1.7.1", - "connect-history-api-fallback": "1.3.0", - "express": "4.16.2", - "html-entities": "1.2.1", - "http-proxy-middleware": "0.17.4", - "opn": "4.0.2", - "portfinder": "1.0.13", - "serve-index": "1.8.0", - "sockjs": "0.3.18", - "sockjs-client": "1.1.2", - "spdy": "3.4.7", - "strip-ansi": "3.0.1", - "supports-color": "3.2.3", - "webpack-dev-middleware": "1.11.0", - "yargs": "6.4.0" - }, - "dependencies": { - "express": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", - "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", - "dev": true, - "requires": { - "accepts": "1.3.4", - "array-flatten": "1.1.1", - "body-parser": "1.18.2", - "content-disposition": "0.5.2", - "content-type": "1.0.4", - "cookie": "0.3.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "1.1.1", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "etag": "1.8.1", - "finalhandler": "1.1.0", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.2", - "qs": "6.5.1", - "range-parser": "1.2.0", - "safe-buffer": "5.1.1", - "send": "0.16.1", - "serve-static": "1.13.1", - "setprototypeof": "1.1.0", - "statuses": "1.3.1", - "type-is": "1.6.15", - "utils-merge": "1.0.1", - "vary": "1.1.2" - } - }, - "faye-websocket": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", - "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", - "dev": true, - "requires": { - "websocket-driver": "0.7.0" - } - }, - "finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" - } - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "dev": true, - "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": "1.3.1" - }, - "dependencies": { - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", - "dev": true - } - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", - "dev": true - }, - "send": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", - "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "1.1.1", - "destroy": "1.0.4", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "etag": "1.8.1", - "fresh": "0.5.2", - "http-errors": "1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.3.1" - } - }, - "serve-static": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", - "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", - "dev": true, - "requires": { - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "parseurl": "1.3.2", - "send": "0.16.1" - } - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "sockjs-client": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.2.tgz", - "integrity": "sha1-8CEqhVDkyUaMjM6u79LjSTwDOtU=", - "dev": true, - "requires": { - "debug": "2.6.9", - "eventsource": "0.1.6", - "faye-websocket": "0.11.1", - "inherits": "2.0.3", - "json3": "3.3.2", - "url-parse": "1.2.0" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "1.0.0" - } - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - } - } - }, "webpack-hot-middleware": { "version": "2.18.2", "resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.18.2.tgz", - "integrity": "sha512-dB7uOnUWsojZIAC6Nwi5v3tuaQNd2i7p4vF5LsJRyoTOgr2fRYQdMKQxRZIZZaz0cTPBX8rvcWU1A6/n7JTITg==", + "integrity": "sha1-hN7mQ/A3w9WcneFCVIQwNxqo07I=", "dev": true, "requires": { "ansi-html": "0.0.7", @@ -15820,7 +14471,7 @@ "source-list-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", + "integrity": "sha1-qqR0A/eyRakvvJfqCPJQ1gh+0IU=", "dev": true }, "source-map": { @@ -15831,26 +14482,10 @@ } } }, - "websocket-driver": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", - "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", - "dev": true, - "requires": { - "http-parser-js": "0.4.9", - "websocket-extensions": "0.1.3" - } - }, - "websocket-extensions": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", - "dev": true - }, "websocket-stream": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/websocket-stream/-/websocket-stream-5.1.1.tgz", - "integrity": "sha512-ypQ50zVCnikSvJcRFWaZh7xeCufSje5+mbJRq3mdvdNx+06TD98C+bQsSKc7FkI6y1PVuNbzkenGywxlFiQeUQ==", + "integrity": "sha1-aNI5Fs31NonP9z4hP6IXjbzqYWk=", "requires": { "duplexify": "3.5.3", "inherits": "2.0.3", @@ -15937,7 +14572,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", "dev": true, "requires": { "isexe": "2.0.0" @@ -15952,7 +14587,7 @@ "wide-align": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "integrity": "sha1-Vx4PGwYEY268DfwhsDObvjE0FxA=", "dev": true, "requires": { "string-width": "1.0.2" diff --git a/package.json b/package.json index 2b811dbad..3e42b4004 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "build": "npm run clean && webpack --config webpackConfigs/webpack.production.config.js", "clean": "rimraf src/build/*", "client": "NODE_ENV=development babel-node webpackConfigs/webPackServerApp.js", - "dev": "npm run client && concurrently --kill-others" + "dev": "npm run client && concurrently --kill-others", + "lint-fix": "./node_modules/.bin/eslint --fix src", + "lint": "./node_modules/.bin/eslint src" }, "author": "", "license": "MIT", @@ -40,13 +42,14 @@ "redux-act": "^1.5.1", "redux-form": "^7.2.1", "redux-form-material-ui": "^4.3.3", - "redux-saga": "^0.16.0" + "redux-saga": "^0.16.0", + "regenerator-runtime": "^0.11.1" }, "devDependencies": { "autoprefixer": "7.1.2", "babel-cli": "6.24.1", "babel-core": "^6.25.0", - "babel-eslint": "7.2.3", + "babel-eslint": "^7.2.3", "babel-jest": "20.0.3", "babel-loader": "^7.1.1", "babel-plugin-transform-class-properties": "^6.24.1", @@ -65,9 +68,11 @@ "coveralls": "2.13.1", "css-loader": "0.28.4", "enzyme": "2.9.1", - "eslint": "4.2.0", - "eslint-plugin-import": "2.7.0", - "eslint-plugin-react": "7.3.0", + "eslint": "^4.18.1", + "eslint-config-airbnb": "^16.1.0", + "eslint-plugin-import": "^2.9.0", + "eslint-plugin-jsx-a11y": "^6.0.3", + "eslint-plugin-react": "^7.7.0", "eslint-watch": "3.1.2", "extract-text-webpack-plugin": "3.0.0-rc.2", "file-loader": "0.11.2", diff --git a/src/assets/vendor/utils/dashboard.js b/src/assets/vendor/utils/dashboard.js index b3422e605..a38b12e4e 100644 --- a/src/assets/vendor/utils/dashboard.js +++ b/src/assets/vendor/utils/dashboard.js @@ -1,123 +1,124 @@ -var recorder, - audio_context, - DashboardWidget, - ChatListWidget, - ProfileViewWidget, - ContactsWidget, - ContactRequestsWidget, - AddContactWidget, - ChatAreaWidget; +let recorder, + audio_context, + DashboardWidget, + ChatListWidget, + ProfileViewWidget, + ContactsWidget, + ContactRequestsWidget, + AddContactWidget, + ChatAreaWidget; (function () { - var el, t; - DashboardWidget = { - settings: { - panels_options: { - logo_wrap: [], - chats_list: [], - contacts_list_view: [], - new_contact_view: [], - profile_view: [], - photos_list: [], - videos_list: [], - links_list: [], - files_list: [] - }, - vw: 0, - active_chat: 1, - chat_types: [], - message_statuses: [], - contacts: [], - chats: [], - geoIpService: "//freegeoip.net/json/", - minNumberDigits: 10, - minCodeDigits: 6, - }, - elements: { - countryData: [], - addressDropdown: '#country', - codeInput: '#code', - telRealInput: '#number', - telInput: '#full-number', - verify: '#verify', - first_name: "#first_name", - last_name: "#last_name", - sendCodeBtn: '#sendCode', - sendVerifyBtn: '#verifyCode', - doneBtn: '#doneBtn', - - chat: '#chat', - chats: '#chats', - photos: '#photos', - videos: '#videos', - links: '#links', - files: '#files', - - logo_wrap: '#logo_wrap', - chats_list: '#chats_list', - photos_list: '#photos_list', - videos_list: '#vidoes_list', - links_list: '#links_list', - files_list: '#files_list', - }, - titleTemplate: 'Dashboard | ', - init: function () { - t = this; - el = this.elements; - - this.initSettings(); - this.initDashboard(); - this.initChat(); - - this.initCountry(); - this.initCodePhone(); - - this.bindUIActions(); - - this.initElementMasks(); - //this.initRecording(); - //this.initRecordLog(); - }, - initSettings: function () { - t.calculateVWCoefficient(); - - t.settings.panels_options['logo_wrap']['width'] = t.settings.vw * $('#logo_wrap').width(); - t.settings.panels_options['logo_wrap']['min'] = t.settings.vw * 100; - t.settings.panels_options['logo_wrap']['max'] = t.settings.vw * 3400; - - t.settings.panels_options['chats_list']['width'] = t.settings.vw * $('#chats_list').width(); - t.settings.panels_options['chats_list']['min'] = t.settings.vw * 100; - t.settings.panels_options['chats_list']['max'] = t.settings.vw * 3400; - - t.settings.panels_options['contacts_list_view']['width'] = t.settings.vw * $('#contacts_list_view').width(); - t.settings.panels_options['contacts_list_view']['min'] = t.settings.vw * 100; - t.settings.panels_options['contacts_list_view']['max'] = t.settings.vw * 3400; - - t.settings.panels_options['new_contact_view']['width'] = t.settings.vw * $('#new_contact_view').width(); - t.settings.panels_options['new_contact_view']['min'] = t.settings.vw * 100; - t.settings.panels_options['new_contact_view']['max'] = t.settings.vw * 3400; - - t.settings.panels_options['profile_view']['width'] = t.settings.vw * $('#profile_view').width(); - t.settings.panels_options['profile_view']['min'] = t.settings.vw * 100; - t.settings.panels_options['profile_view']['max'] = t.settings.vw * 3400; - - t.settings.panels_options['photos_list']['width'] = t.settings.vw * $('#photos_list').width(); - t.settings.panels_options['photos_list']['min'] = 70; - t.settings.panels_options['photos_list']['max'] = 90; - - t.settings.panels_options['videos_list']['width'] = t.settings.vw * $('#videos_list').width(); - t.settings.panels_options['videos_list']['min'] = 70; - t.settings.panels_options['videos_list']['max'] = 90; - - t.settings.panels_options['links_list']['width'] = t.settings.vw * $('#links_list').width(); - t.settings.panels_options['links_list']['min'] = 70; - t.settings.panels_options['links_list']['max'] = 90; - - t.settings.panels_options['files_list']['width'] = t.settings.vw * $('#files_list').width(); - t.settings.panels_options['files_list']['min'] = 70; - t.settings.panels_options['files_list']['max'] = 90; - - /* + let el, + t; + DashboardWidget = { + settings: { + panels_options: { + logo_wrap: [], + chats_list: [], + contacts_list_view: [], + new_contact_view: [], + profile_view: [], + photos_list: [], + videos_list: [], + links_list: [], + files_list: [] + }, + vw: 0, + active_chat: 1, + chat_types: [], + message_statuses: [], + contacts: [], + chats: [], + geoIpService: '//freegeoip.net/json/', + minNumberDigits: 10, + minCodeDigits: 6 + }, + elements: { + countryData: [], + addressDropdown: '#country', + codeInput: '#code', + telRealInput: '#number', + telInput: '#full-number', + verify: '#verify', + first_name: '#first_name', + last_name: '#last_name', + sendCodeBtn: '#sendCode', + sendVerifyBtn: '#verifyCode', + doneBtn: '#doneBtn', + + chat: '#chat', + chats: '#chats', + photos: '#photos', + videos: '#videos', + links: '#links', + files: '#files', + + logo_wrap: '#logo_wrap', + chats_list: '#chats_list', + photos_list: '#photos_list', + videos_list: '#vidoes_list', + links_list: '#links_list', + files_list: '#files_list' + }, + titleTemplate: 'Dashboard | ', + init() { + t = this; + el = this.elements; + + this.initSettings(); + this.initDashboard(); + this.initChat(); + + this.initCountry(); + this.initCodePhone(); + + this.bindUIActions(); + + this.initElementMasks(); + // this.initRecording(); + // this.initRecordLog(); + }, + initSettings() { + t.calculateVWCoefficient(); + + t.settings.panels_options.logo_wrap.width = t.settings.vw * $('#logo_wrap').width(); + t.settings.panels_options.logo_wrap.min = t.settings.vw * 100; + t.settings.panels_options.logo_wrap.max = t.settings.vw * 3400; + + t.settings.panels_options.chats_list.width = t.settings.vw * $('#chats_list').width(); + t.settings.panels_options.chats_list.min = t.settings.vw * 100; + t.settings.panels_options.chats_list.max = t.settings.vw * 3400; + + t.settings.panels_options.contacts_list_view.width = t.settings.vw * $('#contacts_list_view').width(); + t.settings.panels_options.contacts_list_view.min = t.settings.vw * 100; + t.settings.panels_options.contacts_list_view.max = t.settings.vw * 3400; + + t.settings.panels_options.new_contact_view.width = t.settings.vw * $('#new_contact_view').width(); + t.settings.panels_options.new_contact_view.min = t.settings.vw * 100; + t.settings.panels_options.new_contact_view.max = t.settings.vw * 3400; + + t.settings.panels_options.profile_view.width = t.settings.vw * $('#profile_view').width(); + t.settings.panels_options.profile_view.min = t.settings.vw * 100; + t.settings.panels_options.profile_view.max = t.settings.vw * 3400; + + t.settings.panels_options.photos_list.width = t.settings.vw * $('#photos_list').width(); + t.settings.panels_options.photos_list.min = 70; + t.settings.panels_options.photos_list.max = 90; + + t.settings.panels_options.videos_list.width = t.settings.vw * $('#videos_list').width(); + t.settings.panels_options.videos_list.min = 70; + t.settings.panels_options.videos_list.max = 90; + + t.settings.panels_options.links_list.width = t.settings.vw * $('#links_list').width(); + t.settings.panels_options.links_list.min = 70; + t.settings.panels_options.links_list.max = 90; + + t.settings.panels_options.files_list.width = t.settings.vw * $('#files_list').width(); + t.settings.panels_options.files_list.min = 70; + t.settings.panels_options.files_list.max = 90; + + /* $(document).keypress(function (e) { var keycode = (e.keyCode ? e.keyCode : e.which); if (keycode == '13') { @@ -125,330 +126,318 @@ var recorder, } }); */ - }, - initDashboard: function () { - //@TODO: need check user session - if (!GlobalWidget.getRosterId()) { - location.replace('/web/welcome.htm'); - } - - //4a. reconnect because was redirect to dashboard (temporary) - mqttOptions.password = token(); - mqttOptions.cleanSession = false; - mqttOptions.onFailure = function (m) { - console.log("%cClient{%s, %s} - connection to backend failed: %s", "color:red", client(), token(), m.errorMessage); - ProfileViewWidget.logout(); - }; - mqttOptions.onSuccess = function () { - console.log("%cClient{%s, %s} - connected to backend", "color:green", client(), token()); - - var msg = enc(encProfile({"phone": GlobalWidget.getPhoneNumber(), "status": "get"})); - ws.send(msg); - }; - delete mqttOptions.mqttVersion; - delete mqttOptions.mqttVersionExplicit; - - mqtt_open(mqttOptions); - }, - calculateVWCoefficient: function () { - t.settings.vw = (100 / $(document).width()); - }, - bindUIActions: function () { - - $('.drag_handle_left').on('mousedown', function (e) { - e.preventDefault(); - - var right_side_bar_id = ''; - right_side_bar_id = $('#chats_list').is(':hidden') ? right_side_bar_id : 'chats_list'; - right_side_bar_id = $('#contacts_list_view').is(':hidden') ? right_side_bar_id : 'contacts_list_view'; - right_side_bar_id = $('#new_contact_view').is(':hidden') ? right_side_bar_id : 'new_contact_view'; - right_side_bar_id = $('#profile_view').is(':hidden') ? right_side_bar_id : 'profile_view'; - - $(document).mousemove(function (e) { - var right_sid_bar_selector = '#' + right_side_bar_id; - var width_start = $(right_sid_bar_selector).width(); - var width = e.pageX - $(right_sid_bar_selector).offset().left; - - t.settings.panels_options[right_side_bar_id]['width'] = width * t.settings.vw; - t.settings.panels_options['logo_wrap']['width'] = width * t.settings.vw; - - var right_side_bar_width = (width * t.settings.vw) + 'vw'; - var chat_width = t.settings.vw * ($('#chat').width() + (width_start - width)) + 'vw'; - var tool_bar_width = t.settings.vw * ($('#tool_bar').width() + (width_start - width)) + 'vw'; - var padding_chat_wrapper = '0vw ' + ((15 - ((t.settings.vw * width) / 2)) < 0 ? 0 : (15 - ((t.settings.vw * width) / 2))) + 'vw'; - - if ((e.pageX * t.settings.vw) > t.settings.panels_options[right_side_bar_id]['min'] && (e.pageX * t.settings.vw) < t.settings.panels_options[right_side_bar_id]['max']) { - $('#logo_wrap').css("width", right_side_bar_width); - $(right_sid_bar_selector).css("width", right_side_bar_width); - $('#chat').css("width", chat_width); - $('#tool_bar').css("width", tool_bar_width); - - $('.chat_wrapper').css("padding", padding_chat_wrapper); - } - }) - }).mouseup(function () { - //console.log('mouseup'); - //$(document).unbind('mousemove'); - }).mouseout(function () { - //console.log('mouseout'); - - //$(document).unbind('mousemove'); - }); - - $(document).on('mouseup', function () { - //console.log('mouseup'); - - $(document).unbind('mousemove'); - }); - - $('.drag_handle').mousedown(function (e) { - e.preventDefault(); - - var right_side_bar_id = ''; - right_side_bar_id = $('#photos_list').is(':hidden') ? right_side_bar_id : 'photos_list'; - right_side_bar_id = $('#videos_list').is(':hidden') ? right_side_bar_id : 'videos_list'; - right_side_bar_id = $('#links_list').is(':hidden') ? right_side_bar_id : 'links_list'; - right_side_bar_id = $('#files_list').is(':hidden') ? right_side_bar_id : 'files_list'; - - var right_sid_bar_selector = '#' + right_side_bar_id; - var vw = (100 / $(document).width()); - $(document).mousemove(function (e) { - e.preventDefault(); - var width_start = $(right_sid_bar_selector).width(); - var width = ($(right_sid_bar_selector).offset().left + $(right_sid_bar_selector).width()) - e.pageX; - - t.settings.panels_options[right_side_bar_id]['width'] = width * t.settings.vw; - - var right_side_bar_width = (width * vw) + 'vw'; - var chat_width = t.settings.vw * ($('#chat').width() + (width_start - width)) + 'vw'; - - if ((e.pageX * t.settings.vw) > t.settings.panels_options[right_side_bar_id]['min'] && (e.pageX * t.settings.vw) < t.settings.panels_options[right_side_bar_id]['max']) { - - $(right_sid_bar_selector).css("width", right_side_bar_width); - $('#chat').css("width", chat_width); - } - }) - }).mouseup(function () { - //$(this).unbind('mousemove'); - }).mouseout(function () { - //$(this).unbind('mousemove'); - }); - - $('#videos').click(function () { - var videos_is_hidden = $('#videos_list').is(':hidden'); - $('#chat').css("width", ''); - $('#tool_bar').css("width", ''); - $('.chat_wrapper').css("padding", ''); - if (videos_is_hidden) { - - $('#logo_wrap').hide(); - - $('#chats_list').hide(); - $('#contacts_list_view').hide(); - $('#new_contact_view').hide(); - $('#profile_view').hide(); - $('.drag_handle_left').hide(); - $('#files_list').hide(); - $('#photos_list').hide(); - $('#links_list').hide(); - - $('#recents').hide('slow'); - $('#favorite').hide('slow'); - $('#family').hide('slow'); - $('#new_chat').hide('slow'); - - $("#videos_list").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var vw = (100 / $(document).width()); - - var chat_width = ((t.settings.vw * $('#chat').width()) - t.settings.panels_options['videos_list']['width']) + 'vw'; - $('#chat').css("width", chat_width); - - var panel_width = t.settings.panels_options['videos_list']['width']; - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - $('.chat_wrapper').css("padding", padding_chat_wrapper); - - } else { - $('#videos_list').hide(); - } - }); - - $('#files').click(function () { - var files_is_hidden = $('#files_list').is(':hidden'); - $('#chat').css("width", ''); - $('#tool_bar').css("width", ''); - $('.chat_wrapper').css("padding", ''); - if (files_is_hidden) { - - $('#logo_wrap').hide(); - - $('#chats_list').hide(); - $('#contacts_list_view').hide(); - $('#new_contact_view').hide(); - $('#profile_view').hide(); - $('.drag_handle_left').hide(); - $('#videos_list').hide(); - $('#links_list').hide(); - $('#photos_list').hide(); - - $('#recents').hide('slow'); - $('#favorite').hide('slow'); - $('#family').hide('slow'); - $('#new_chat').hide('slow'); - - $("#files_list").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var vw = (100 / $(document).width()); - - var chat_width = ((t.settings.vw * $('#chat').width()) - t.settings.panels_options['files_list']['width']) + 'vw'; - $('#chat').css("width", chat_width); - - var panel_width = t.settings.panels_options['files_list']['width']; - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - $('.chat_wrapper').css("padding", padding_chat_wrapper); - - } else { - $('#files_list').hide(); - } - }); - - $('#links').click(function () { - $('#chat').css("width", ''); - $('#tool_bar').css("width", ''); - $('.chat_wrapper').css("padding", ''); - var links_is_hidden = $('#links_list').is(':hidden'); - if (links_is_hidden) { - - $('#logo_wrap').hide(); - - $('#chats_list').hide(); - $('#contacts_list_view').hide(); - $('#new_contact_view').hide(); - $('#profile_view').hide(); - $('.drag_handle_left').hide(); - $('#files_list').hide(); - $('#videos_list').hide(); - $('#photos_list').hide(); - - $('#recents').hide('slow'); - $('#favorite').hide('slow'); - $('#family').hide('slow'); - $('#new_chat').hide('slow'); - - $("#links_list").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var vw = (100 / $(document).width()); - - var chat_width = ((t.settings.vw * $('#chat').width()) - t.settings.panels_options['links_list']['width']) + 'vw'; - $('#chat').css("width", chat_width); - - var panel_width = t.settings.panels_options['links_list']['width']; - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - $('.chat_wrapper').css("padding", padding_chat_wrapper); - - } else { - $('#links_list').hide(); - } - }); - - $('#photos').click(function () { - var photos_is_hidden = $('#photos_list').is(':hidden'); - $('#chat').css("width", ''); - $('#tool_bar').css("width", ''); - $('.chat_wrapper').css("padding", ''); - if (photos_is_hidden) { - - $('#logo_wrap').hide(); - - $('#chats_list').hide(); - $('#contacts_list_view').hide(); - $('#new_contact_view').hide(); - $('#profile_view').hide(); - $('.drag_handle_left').hide(); - $('#videos_list').hide(); - $('#files_list').hide(); - $('#links_list').hide(); - - $('#recents').hide('slow'); - $('#favorite').hide('slow'); - $('#family').hide('slow'); - $('#new_chat').hide('slow'); - - $("#photos_list").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var vw = (100 / $(document).width()); - - var chat_width = ((t.settings.vw * $('#chat').width()) - t.settings.panels_options['photos_list']['width']) + 'vw'; - $('#chat').css("width", chat_width); - - var panel_width = t.settings.panels_options['photos_list']['width']; - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - $('.chat_wrapper').css("padding", padding_chat_wrapper); - - } else { - $('#photos_list').hide(); - - - } - }); + }, + initDashboard() { + // @TODO: need check user session + if (!GlobalWidget.getRosterId()) { + location.replace('/web/welcome.htm'); + } + + // 4a. reconnect because was redirect to dashboard (temporary) + mqttOptions.password = token(); + mqttOptions.cleanSession = false; + mqttOptions.onFailure = function (m) { + console.log('%cClient{%s, %s} - connection to backend failed: %s', 'color:red', client(), token(), m.errorMessage); + ProfileViewWidget.logout(); + }; + mqttOptions.onSuccess = function () { + console.log('%cClient{%s, %s} - connected to backend', 'color:green', client(), token()); + + const msg = enc(encProfile({ phone: GlobalWidget.getPhoneNumber(), status: 'get' })); + ws.send(msg); + }; + delete mqttOptions.mqttVersion; + delete mqttOptions.mqttVersionExplicit; + + mqtt_open(mqttOptions); + }, + calculateVWCoefficient() { + t.settings.vw = (100 / $(document).width()); + }, + bindUIActions() { + $('.drag_handle_left').on('mousedown', (e) => { + e.preventDefault(); + + let right_side_bar_id = ''; + right_side_bar_id = $('#chats_list').is(':hidden') ? right_side_bar_id : 'chats_list'; + right_side_bar_id = $('#contacts_list_view').is(':hidden') ? right_side_bar_id : 'contacts_list_view'; + right_side_bar_id = $('#new_contact_view').is(':hidden') ? right_side_bar_id : 'new_contact_view'; + right_side_bar_id = $('#profile_view').is(':hidden') ? right_side_bar_id : 'profile_view'; + + $(document).mousemove((e) => { + const right_sid_bar_selector = `#${right_side_bar_id}`; + const width_start = $(right_sid_bar_selector).width(); + const width = e.pageX - $(right_sid_bar_selector).offset().left; + + t.settings.panels_options[right_side_bar_id].width = width * t.settings.vw; + t.settings.panels_options.logo_wrap.width = width * t.settings.vw; + + const right_side_bar_width = `${width * t.settings.vw}vw`; + const chat_width = `${t.settings.vw * ($('#chat').width() + (width_start - width))}vw`; + const tool_bar_width = `${t.settings.vw * ($('#tool_bar').width() + (width_start - width))}vw`; + const padding_chat_wrapper = `0vw ${(15 - ((t.settings.vw * width) / 2)) < 0 ? 0 : (15 - ((t.settings.vw * width) / 2))}vw`; + + if ((e.pageX * t.settings.vw) > t.settings.panels_options[right_side_bar_id].min && (e.pageX * t.settings.vw) < t.settings.panels_options[right_side_bar_id].max) { + $('#logo_wrap').css('width', right_side_bar_width); + $(right_sid_bar_selector).css('width', right_side_bar_width); + $('#chat').css('width', chat_width); + $('#tool_bar').css('width', tool_bar_width); + + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } + }); + }).mouseup(() => { + // console.log('mouseup'); + // $(document).unbind('mousemove'); + }).mouseout(() => { + // console.log('mouseout'); + + // $(document).unbind('mousemove'); + }); + + $(document).on('mouseup', () => { + // console.log('mouseup'); + + $(document).unbind('mousemove'); + }); + + $('.drag_handle').mousedown((e) => { + e.preventDefault(); + + let right_side_bar_id = ''; + right_side_bar_id = $('#photos_list').is(':hidden') ? right_side_bar_id : 'photos_list'; + right_side_bar_id = $('#videos_list').is(':hidden') ? right_side_bar_id : 'videos_list'; + right_side_bar_id = $('#links_list').is(':hidden') ? right_side_bar_id : 'links_list'; + right_side_bar_id = $('#files_list').is(':hidden') ? right_side_bar_id : 'files_list'; + + const right_sid_bar_selector = `#${right_side_bar_id}`; + const vw = (100 / $(document).width()); + $(document).mousemove((e) => { + e.preventDefault(); + const width_start = $(right_sid_bar_selector).width(); + const width = ($(right_sid_bar_selector).offset().left + $(right_sid_bar_selector).width()) - e.pageX; + + t.settings.panels_options[right_side_bar_id].width = width * t.settings.vw; + + const right_side_bar_width = `${width * vw}vw`; + const chat_width = `${t.settings.vw * ($('#chat').width() + (width_start - width))}vw`; + + if ((e.pageX * t.settings.vw) > t.settings.panels_options[right_side_bar_id].min && (e.pageX * t.settings.vw) < t.settings.panels_options[right_side_bar_id].max) { + $(right_sid_bar_selector).css('width', right_side_bar_width); + $('#chat').css('width', chat_width); + } + }); + }).mouseup(() => { + // $(this).unbind('mousemove'); + }).mouseout(() => { + // $(this).unbind('mousemove'); + }); + + $('#videos').click(() => { + const videos_is_hidden = $('#videos_list').is(':hidden'); + $('#chat').css('width', ''); + $('#tool_bar').css('width', ''); + $('.chat_wrapper').css('padding', ''); + if (videos_is_hidden) { + $('#logo_wrap').hide(); + + $('#chats_list').hide(); + $('#contacts_list_view').hide(); + $('#new_contact_view').hide(); + $('#profile_view').hide(); + $('.drag_handle_left').hide(); + $('#files_list').hide(); + $('#photos_list').hide(); + $('#links_list').hide(); + + $('#recents').hide('slow'); + $('#favorite').hide('slow'); + $('#family').hide('slow'); + $('#new_chat').hide('slow'); + + $('#videos_list').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const vw = (100 / $(document).width()); + + const chat_width = `${(t.settings.vw * $('#chat').width()) - t.settings.panels_options.videos_list.width}vw`; + $('#chat').css('width', chat_width); + + const panel_width = t.settings.panels_options.videos_list.width; + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } else { + $('#videos_list').hide(); + } + }); + + $('#files').click(() => { + const files_is_hidden = $('#files_list').is(':hidden'); + $('#chat').css('width', ''); + $('#tool_bar').css('width', ''); + $('.chat_wrapper').css('padding', ''); + if (files_is_hidden) { + $('#logo_wrap').hide(); + + $('#chats_list').hide(); + $('#contacts_list_view').hide(); + $('#new_contact_view').hide(); + $('#profile_view').hide(); + $('.drag_handle_left').hide(); + $('#videos_list').hide(); + $('#links_list').hide(); + $('#photos_list').hide(); + + $('#recents').hide('slow'); + $('#favorite').hide('slow'); + $('#family').hide('slow'); + $('#new_chat').hide('slow'); + + $('#files_list').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const vw = (100 / $(document).width()); + + const chat_width = `${(t.settings.vw * $('#chat').width()) - t.settings.panels_options.files_list.width}vw`; + $('#chat').css('width', chat_width); + + const panel_width = t.settings.panels_options.files_list.width; + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } else { + $('#files_list').hide(); + } + }); + + $('#links').click(() => { + $('#chat').css('width', ''); + $('#tool_bar').css('width', ''); + $('.chat_wrapper').css('padding', ''); + const links_is_hidden = $('#links_list').is(':hidden'); + if (links_is_hidden) { + $('#logo_wrap').hide(); + + $('#chats_list').hide(); + $('#contacts_list_view').hide(); + $('#new_contact_view').hide(); + $('#profile_view').hide(); + $('.drag_handle_left').hide(); + $('#files_list').hide(); + $('#videos_list').hide(); + $('#photos_list').hide(); + + $('#recents').hide('slow'); + $('#favorite').hide('slow'); + $('#family').hide('slow'); + $('#new_chat').hide('slow'); + + $('#links_list').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const vw = (100 / $(document).width()); + + const chat_width = `${(t.settings.vw * $('#chat').width()) - t.settings.panels_options.links_list.width}vw`; + $('#chat').css('width', chat_width); + + const panel_width = t.settings.panels_options.links_list.width; + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } else { + $('#links_list').hide(); + } + }); + + $('#photos').click(() => { + const photos_is_hidden = $('#photos_list').is(':hidden'); + $('#chat').css('width', ''); + $('#tool_bar').css('width', ''); + $('.chat_wrapper').css('padding', ''); + if (photos_is_hidden) { + $('#logo_wrap').hide(); + + $('#chats_list').hide(); + $('#contacts_list_view').hide(); + $('#new_contact_view').hide(); + $('#profile_view').hide(); + $('.drag_handle_left').hide(); + $('#videos_list').hide(); + $('#files_list').hide(); + $('#links_list').hide(); + + $('#recents').hide('slow'); + $('#favorite').hide('slow'); + $('#family').hide('slow'); + $('#new_chat').hide('slow'); + + $('#photos_list').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const vw = (100 / $(document).width()); + + const chat_width = `${(t.settings.vw * $('#chat').width()) - t.settings.panels_options.photos_list.width}vw`; + $('#chat').css('width', chat_width); + + const panel_width = t.settings.panels_options.photos_list.width; + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } else { + $('#photos_list').hide(); + } + }); - $('.chat_contact').click(function () { - var show_chat = $(this).data('id'); - t.settings.chats[t.settings.active_chat].status = 'hidden'; - t.settings.chats[show_chat].status = 'active'; - t.settings.active_chat = show_chat; + $('.chat_contact').click(function () { + const show_chat = $(this).data('id'); + t.settings.chats[t.settings.active_chat].status = 'hidden'; + t.settings.chats[show_chat].status = 'active'; + t.settings.active_chat = show_chat; - //$('#chat_view').html(t.renderChat(show_chat)); + // $('#chat_view').html(t.renderChat(show_chat)); - //$('.chat_wrapper .view_active').removeClass('view_active').addClass('hidden'); - //$('.chat_wrapper #' + $(this).attr('id') + '_view').removeClass('hidden').addClass('view_active'); - //t.checkChats(); - }); + // $('.chat_wrapper .view_active').removeClass('view_active').addClass('hidden'); + // $('.chat_wrapper #' + $(this).attr('id') + '_view').removeClass('hidden').addClass('view_active'); + // t.checkChats(); + }); - /* + /* $('#send_message').click(function () { t.sendTextInInput(); }); */ - $('#favorite').click(function () { - console.log("You clicked a favorite!"); - }); + $('#favorite').click(() => { + console.log('You clicked a favorite!'); + }); - $('#family').click(function () { - console.log("You clicked a family!"); - }); + $('#family').click(() => { + console.log('You clicked a family!'); + }); - $('#work').click(function () { - console.log("You clicked a work!"); - }); + $('#work').click(() => { + console.log('You clicked a work!'); + }); - $('#new_chat').click(function () { - console.log("You clicked a new_chat!"); - $('#contacts').click(); - }); + $('#new_chat').click(() => { + console.log('You clicked a new_chat!'); + $('#contacts').click(); + }); - $('#group').click(function () { - console.log("You clicked a group!"); - }); + $('#group').click(() => { + console.log('You clicked a group!'); + }); - $('#calls').click(function () { - console.log("You clicked a calls!"); - }); + $('#calls').click(() => { + console.log('You clicked a calls!'); + }); - $('#settings').click(function () { - console.log("You clicked a settings!"); - }); + $('#settings').click(() => { + console.log('You clicked a settings!'); + }); - /* + /* $('#storage').click(function () { console.log("You clicked a storage!"); @@ -492,16 +481,16 @@ var recorder, }); */ - $('#right_bar_arrow_up').click(function () { - console.log("You clicked a right_bar_arrow2!"); - }); + $('#right_bar_arrow_up').click(() => { + console.log('You clicked a right_bar_arrow2!'); + }); - $('#right_bar_arrow_down').click(function () { - console.log("You clicked a right_bar_arrow2!"); - }); + $('#right_bar_arrow_down').click(() => { + console.log('You clicked a right_bar_arrow2!'); + }); - $('.right_sidebar').scroll(function (e) { - /*var elem = $(e.currentTarget); + $('.right_sidebar').scroll((e) => { + /* var elem = $(e.currentTarget); console.log( elem.outerHeight() + "------1" ); console.log( elem[0].scrollHeight + "------2" ); console.log( elem.scrollTop() + "------3" ); @@ -518,1257 +507,1243 @@ var recorder, $('#overlay_top').hide(); $('#right_bar_arrow_down').show(); $('#overlay_bottom').show(); - }*/ - }); - - $(el.telInput).on("countrychange", function (e, countryData) { - $(el.addressDropdown).val(countryData.iso2); - $(el.codeInput).val('+' + countryData.dialCode); - $(el.telRealInput).focus(); - }); - $(el.addressDropdown).on('change', function () { - $(el.telInput).intlTelInput("setCountry", $(this).val()); - }); - $(el.telRealInput).on('keyup', function () { - if ($(this).val().length > t.settings.minNumberDigits) { - $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.sendCodeBtn).addClass('disabled').prop('disabled', true); - } - }); - $(el.verify).on('keyup', function () { - if ($(this).val().length > t.settings.minCodeDigits) { - $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true); - } - }); - $(el.first_name + "," + el.last_name).on('keyup', function () { - if ($(el.first_name).val().length && $(el.last_name).val().length) { - $(el.doneBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.doneBtn).addClass('disabled').prop('disabled', true); - } - }); - }, - initChat: function () { - - t.settings.chat_types[0] = 'chat'; - t.settings.chat_types[1] = 'group_chat'; - t.settings.message_statuses[0] = 'sent'; - t.settings.message_statuses[1] = 'not sent'; - t.settings.message_statuses[2] = 'viewed'; - t.settings.message_statuses[3] = 'not viewed'; - - t.settings.contacts[0] = { - name: 'David Mickelson', - image: 'sender_image' - }; - t.settings.contacts[1] = { - name: 'David Mickelson', - image: 'sender_image' - }; - - var messages_0 = []; - var contacts_0 = []; - var messages_1 = []; - var contacts_1 = []; - var messages_2 = []; - var contacts_2 = []; - - - contacts_0[0] = { - id: 0 - }; - /*contacts_0[1] = { + } */ + }); + + $(el.telInput).on('countrychange', (e, countryData) => { + $(el.addressDropdown).val(countryData.iso2); + $(el.codeInput).val(`+${countryData.dialCode}`); + $(el.telRealInput).focus(); + }); + $(el.addressDropdown).on('change', function () { + $(el.telInput).intlTelInput('setCountry', $(this).val()); + }); + $(el.telRealInput).on('keyup', function () { + if ($(this).val().length > t.settings.minNumberDigits) { + $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.sendCodeBtn).addClass('disabled').prop('disabled', true); + } + }); + $(el.verify).on('keyup', function () { + if ($(this).val().length > t.settings.minCodeDigits) { + $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true); + } + }); + $(`${el.first_name},${el.last_name}`).on('keyup', () => { + if ($(el.first_name).val().length && $(el.last_name).val().length) { + $(el.doneBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.doneBtn).addClass('disabled').prop('disabled', true); + } + }); + }, + initChat() { + t.settings.chat_types[0] = 'chat'; + t.settings.chat_types[1] = 'group_chat'; + t.settings.message_statuses[0] = 'sent'; + t.settings.message_statuses[1] = 'not sent'; + t.settings.message_statuses[2] = 'viewed'; + t.settings.message_statuses[3] = 'not viewed'; + + t.settings.contacts[0] = { + name: 'David Mickelson', + image: 'sender_image' + }; + t.settings.contacts[1] = { + name: 'David Mickelson', + image: 'sender_image' + }; + + const messages_0 = []; + const contacts_0 = []; + const messages_1 = []; + const contacts_1 = []; + const messages_2 = []; + const contacts_2 = []; + + + contacts_0[0] = { + id: 0 + }; + /* contacts_0[1] = { id: 1 - };*/ + }; */ - messages_1[0] = { - type: 'send', - text: "There are many variations of passages of Lorem Ipsum available, " + - "but the majority have suffered alteration in some form, by injected humour. " + + messages_1[0] = { + type: 'send', + text: 'There are many variations of passages of Lorem Ipsum available, ' + + 'but the majority have suffered alteration in some form, by injected humour. ' + "or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, " + "you need to be sure there isn't anything embarrassing hidden in the middle of text", - time: '10:00pm', - status: 0 - }; - - messages_1[1] = { - type: 'received', - image: 'sender_image_0', - from: 'David Mickelson', - from_id: 0, - text: "There are many variations of passages of Lorem Ipsum available, " + - "but the majority have suffered alteration in some form, by injected humour. " + + time: '10:00pm', + status: 0 + }; + + messages_1[1] = { + type: 'received', + image: 'sender_image_0', + from: 'David Mickelson', + from_id: 0, + text: 'There are many variations of passages of Lorem Ipsum available, ' + + 'but the majority have suffered alteration in some form, by injected humour. ' + "or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, " + "you need to be sure there isn't anything embarrassing hidden in the middle of text", - time: '10:01pm', - status: 3 - }; - - contacts_1[0] = { - id: 1 - }; - - messages_2[0] = { - type: 'send', - text: "There are many variations of passages of Lorem Ipsum available, " + - "but the majority have suffered alteration in some form, by injected humour. ", - time: '10:10pm', - status: 0 - }; - messages_2[1] = { - type: 'received', - image: 'sender_image_1', - from: 'Mary', - from_id: 1, - text: "There are many variations of passages of Lorem Ipsum available, " + - "but the majority have suffered alteration in some form, by injected humour. ", - time: '10:11pm', - status: 3 - }; - - contacts_2[0] = { - id: 2 - }; - - t.settings.chats[0] = + time: '10:01pm', + status: 3 + }; + + contacts_1[0] = { + id: 1 + }; + + messages_2[0] = { + type: 'send', + text: 'There are many variations of passages of Lorem Ipsum available, ' + + 'but the majority have suffered alteration in some form, by injected humour. ', + time: '10:10pm', + status: 0 + }; + messages_2[1] = { + type: 'received', + image: 'sender_image_1', + from: 'Mary', + from_id: 1, + text: 'There are many variations of passages of Lorem Ipsum available, ' + + 'but the majority have suffered alteration in some form, by injected humour. ', + time: '10:11pm', + status: 3 + }; + + contacts_2[0] = { + id: 2 + }; + + t.settings.chats[0] = { - type: 1, - status: 'hidden', - contacts: contacts_0, - messages: [] + type: 1, + status: 'hidden', + contacts: contacts_0, + messages: [] }; - t.settings.chats[1] = + t.settings.chats[1] = { - type: 0, - status: 'active', - contacts: contacts_1, - messages: messages_1 + type: 0, + status: 'active', + contacts: contacts_1, + messages: messages_1 }; - t.settings.chats[2] = + t.settings.chats[2] = { - type: 0, - status: 'hidden', - contacts: contacts_2, - messages: messages_2 + type: 0, + status: 'hidden', + contacts: contacts_2, + messages: messages_2 }; - $.each(t.settings.chats, function (index, value) { - if (value.status == 'active') { - var chat_html = t.renderChat(index); - //$('#chat_view').html(chat_html); - } - - }); - }, - checkChats: function () { - $.each(t.settings.chats, function (index, value) { - if (value.status == 'active') { - //var chat_html = t.renderChat(index); - //$('#chat_view').html(chat_html); - $.each(value.messages, function (i, msg) { - if (msg.type == 'received') { - msg.status = 2; - } - }); - //notifications_number - $('#chats_list #chat_' + index + ' .notifications_number').text('').hide(); - } else if (value.status == 'hidden') { - var not_viewed_msgs = 0; - $.each(value.messages, function (i, msg) { - if (msg.type == 'received' && msg.status == 3) { - not_viewed_msgs++; - } - - }); - if (not_viewed_msgs > 0) { - $('#chats_list #chat_' + index + ' .notifications_number').text(not_viewed_msgs).show(); - } - } - - }); - }, - renderChat: function (id) { - var chat_html = ''; - $.each(t.settings.chats[id].messages, function (index, value) { - if (value.type == 'send') { - var msg = { - text: value.text, - time: value.time - }; - //chat_html += ChatAreaWidget.renderSentMessage(msg); - } else if (value.type == 'received') { - var msg = { - text: value.text, - image: value.image, - from: value.from, - time: value.time - }; - //chat_html += ChatAreaWidget.renderReceivedMessage(msg); - } - - }); - return chat_html; - }, - getTime: function () { - var date = new Date(); - var hours = date.getHours(); - var minutes = date.getMinutes(); - var ampm = hours >= 12 ? 'pm' : 'am'; - hours = hours % 12; - hours = hours ? hours : 12; // the hour '0' should be '12' - minutes = minutes < 10 ? '0' + minutes : minutes; - var strTime = hours + ':' + minutes + ' ' + ampm; - return strTime; - }, - refresh: function (res) { - var el = ProfileViewWidget.elements; - if (Array.isArray(res)) { - var rosterId = GlobalWidget.getRosterId() || 0; - var userName = res.rosters[rosterId].names; - // DashboardWidget.settings.profile should be array? - DashboardWidget.settings.profile = res; - $(el.firstName).val(userName); - $(el.lastName).val(res.rosters[rosterId].surnames); - document.title = DashboardWidget.settings.titleTemplate + userName + $.each(t.settings.chats, (index, value) => { + if (value.status == 'active') { + const chat_html = t.renderChat(index); + // $('#chat_view').html(chat_html); + } + }); + }, + checkChats() { + $.each(t.settings.chats, (index, value) => { + if (value.status == 'active') { + // var chat_html = t.renderChat(index); + // $('#chat_view').html(chat_html); + $.each(value.messages, (i, msg) => { + if (msg.type == 'received') { + msg.status = 2; } - }, - incomingMessage: function (msg) { - $.each(t.settings.chats, function (index, value) { - var right_chat = false; - $.each(value.contacts, function (i, contact) { - console.log(contact); - if (contact.id == msg.from_id) { - console.log(index); - right_chat = true; - } - }); - if (right_chat) { - - if (value.status == 'active') { - msg.status = 2; - $('#chat_view').append(t.renderReceivedMessage(msg)); - } else if (value.status == 'hidden') { - msg.status = 3; - } - value.messages.push(msg); - - - } - }); - t.checkChats(); - }, - initCodePhone: function () { - $(el.telInput).intlTelInput({ - allowDropdown: false, - initialCountry: "auto", - geoIpLookup: function () { - $.get(t.settings.geoIpService, function () { - }, "jsonp").always(function (resp) { - var countryCode = (resp && resp.country_code) ? resp.country_code : ""; - $(el.telInput).intlTelInput("setCountry", countryCode.toLowerCase()); - }); - }, - utilsScript: "../../build/js/utils.js" - }); - }, - initCountry: function () { - el.countryData = $.fn.intlTelInput.getCountryData(); - $.each(el.countryData, function (i, country) { - $(el.addressDropdown).append($("").attr("value", country.iso2).text(country.name)); - }); - - $(el.addressDropdown).val($(el.telInput).intlTelInput("getSelectedCountryData").iso2); - }, - initElementMasks: function () { - $(el.codeInput).mask('+0000', {placeholder: "+----"}); - $(el.telRealInput).mask('00 0000 0000', {placeholder: "-- ---- ----"}); - $(el.verify).mask('000 000', {placeholder: "--- ---"}); - }, - initRecording: function () { - - document.getElementById('recording').onmousedown = function (e) { - recorder && recorder.record(); - t.__log('Recording...'); - }; - document.getElementById('recording').onmouseup = function (e) { - recorder && recorder.stop(); - t.__log('Stopped recording.'); - // create WAV download link using audio data blob - t.createDownloadLink(); - recorder.clear(); - }; - }, - __log: function (e, data) { - console.log("\n" + e + " " + (data || '')); - }, - startUserMedia: function (stream) { - var input = audio_context.createMediaStreamSource(stream); - t.__log('Media stream created.'); - - // Uncomment if you want the audio to feedback directly - //input.connect(audio_context.destination); - //__log('Input connected to audio context destination.'); - - recorder = new Recorder(input); - t.__log('Recorder initialised.'); - }, - createDownloadLink: function () { - recorder && recorder.exportWAV(function (blob) { - var url = URL.createObjectURL(blob); - var div_bubble = document.createElement('div'); - var div_text = document.createElement('div'); - var div_time = document.createElement('div'); - var time = t.getTime(); - div_bubble.setAttribute("class", "text_send"); - div_text.setAttribute("class", "text_bubble_send"); - div_time.setAttribute("class", "time_chat"); - div_time.innerHTML = time; - var au = document.createElement('audio'); - var hf = document.createElement('a'); - au.controls = true; - au.src = url; - hf.href = url; - hf.download = new Date().toISOString() + '.wav'; - hf.innerHTML = hf.download; - div_text.appendChild(div_bubble); - div_bubble.appendChild(au); - div_bubble.appendChild(div_time); - //li.appendChild(hf); - document.getElementById('chat_view').appendChild(div_text); - }); - }, - initRecordLog: function () { - window.onload = function init() { - try { - // webkit shim - window.AudioContext = window.AudioContext || window.webkitAudioContext; - navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia; - window.URL = window.URL || window.webkitURL; - - audio_context = new AudioContext; - t.__log('Audio context set up.'); - t.__log('navigator.getUserMedia ' + (navigator.getUserMedia ? 'available.' : 'not present!')); - } catch (e) { - alert('No web audio support in this browser!'); - } + }); + // notifications_number + $(`#chats_list #chat_${index} .notifications_number`).text('').hide(); + } else if (value.status == 'hidden') { + let not_viewed_msgs = 0; + $.each(value.messages, (i, msg) => { + if (msg.type == 'received' && msg.status == 3) { + not_viewed_msgs++; + } + }); + if (not_viewed_msgs > 0) { + $(`#chats_list #chat_${index} .notifications_number`).text(not_viewed_msgs).show(); + } + } + }); + }, + renderChat(id) { + const chat_html = ''; + $.each(t.settings.chats[id].messages, (index, value) => { + if (value.type == 'send') { + var msg = { + text: value.text, + time: value.time + }; + // chat_html += ChatAreaWidget.renderSentMessage(msg); + } else if (value.type == 'received') { + var msg = { + text: value.text, + image: value.image, + from: value.from, + time: value.time + }; + // chat_html += ChatAreaWidget.renderReceivedMessage(msg); + } + }); + return chat_html; + }, + getTime() { + const date = new Date(); + let hours = date.getHours(); + let minutes = date.getMinutes(); + const ampm = hours >= 12 ? 'pm' : 'am'; + hours %= 12; + hours = hours || 12; // the hour '0' should be '12' + minutes = minutes < 10 ? `0${minutes}` : minutes; + const strTime = `${hours}:${minutes} ${ampm}`; + return strTime; + }, + refresh(res) { + const el = ProfileViewWidget.elements; + if (Array.isArray(res)) { + const rosterId = GlobalWidget.getRosterId() || 0; + const userName = res.rosters[rosterId].names; + // DashboardWidget.settings.profile should be array? + DashboardWidget.settings.profile = res; + $(el.firstName).val(userName); + $(el.lastName).val(res.rosters[rosterId].surnames); + document.title = DashboardWidget.settings.titleTemplate + userName; + } + }, + incomingMessage(msg) { + $.each(t.settings.chats, (index, value) => { + let right_chat = false; + $.each(value.contacts, (i, contact) => { + console.log(contact); + if (contact.id == msg.from_id) { + console.log(index); + right_chat = true; + } + }); + if (right_chat) { + if (value.status == 'active') { + msg.status = 2; + $('#chat_view').append(t.renderReceivedMessage(msg)); + } else if (value.status == 'hidden') { + msg.status = 3; + } + value.messages.push(msg); + } + }); + t.checkChats(); + }, + initCodePhone() { + $(el.telInput).intlTelInput({ + allowDropdown: false, + initialCountry: 'auto', + geoIpLookup() { + $.get(t.settings.geoIpService, () => { + }, 'jsonp').always((resp) => { + const countryCode = (resp && resp.country_code) ? resp.country_code : ''; + $(el.telInput).intlTelInput('setCountry', countryCode.toLowerCase()); + }); + }, + utilsScript: '../../build/js/utils.js' + }); + }, + initCountry() { + el.countryData = $.fn.intlTelInput.getCountryData(); + $.each(el.countryData, (i, country) => { + $(el.addressDropdown).append($('').attr('value', country.iso2).text(country.name)); + }); + + $(el.addressDropdown).val($(el.telInput).intlTelInput('getSelectedCountryData').iso2); + }, + initElementMasks() { + $(el.codeInput).mask('+0000', { placeholder: '+----' }); + $(el.telRealInput).mask('00 0000 0000', { placeholder: '-- ---- ----' }); + $(el.verify).mask('000 000', { placeholder: '--- ---' }); + }, + initRecording() { + document.getElementById('recording').onmousedown = function (e) { + recorder && recorder.record(); + t.__log('Recording...'); + }; + document.getElementById('recording').onmouseup = function (e) { + recorder && recorder.stop(); + t.__log('Stopped recording.'); + // create WAV download link using audio data blob + t.createDownloadLink(); + recorder.clear(); + }; + }, + __log(e, data) { + console.log(`\n${e} ${data || ''}`); + }, + startUserMedia(stream) { + const input = audio_context.createMediaStreamSource(stream); + t.__log('Media stream created.'); + + // Uncomment if you want the audio to feedback directly + // input.connect(audio_context.destination); + // __log('Input connected to audio context destination.'); + + recorder = new Recorder(input); + t.__log('Recorder initialised.'); + }, + createDownloadLink() { + recorder && recorder.exportWAV((blob) => { + const url = URL.createObjectURL(blob); + const div_bubble = document.createElement('div'); + const div_text = document.createElement('div'); + const div_time = document.createElement('div'); + const time = t.getTime(); + div_bubble.setAttribute('class', 'text_send'); + div_text.setAttribute('class', 'text_bubble_send'); + div_time.setAttribute('class', 'time_chat'); + div_time.innerHTML = time; + const au = document.createElement('audio'); + const hf = document.createElement('a'); + au.controls = true; + au.src = url; + hf.href = url; + hf.download = `${new Date().toISOString()}.wav`; + hf.innerHTML = hf.download; + div_text.appendChild(div_bubble); + div_bubble.appendChild(au); + div_bubble.appendChild(div_time); + // li.appendChild(hf); + document.getElementById('chat_view').appendChild(div_text); + }); + }, + initRecordLog() { + window.onload = function init() { + try { + // webkit shim + window.AudioContext = window.AudioContext || window.webkitAudioContext; + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia; + window.URL = window.URL || window.webkitURL; + + audio_context = new AudioContext(); + t.__log('Audio context set up.'); + t.__log(`navigator.getUserMedia ${navigator.getUserMedia ? 'available.' : 'not present!'}`); + } catch (e) { + alert('No web audio support in this browser!'); + } -// navigator.getUserMedia({audio: true}, t.startUserMedia, function (e) { -// t.__log('No live audio input: ' + e); -// }); - }; - }, + // navigator.getUserMedia({audio: true}, t.startUserMedia, function (e) { + // t.__log('No live audio input: ' + e); + // }); + }; } - DashboardWidget.init(); + }; + DashboardWidget.init(); - /** + /** * ChatArea Widget * @type {{elements: {chatView: string, chatPanel: string}, activePhoneId: null, init: init, subscribe: subscribe, bindUIActions: bindUIActions, showChat: showChat, hideChat: hideChat, setTopic: setTopic, getHistory: getHistory}} */ - ChatAreaWidget = { - elements: { - chatView: '#chat_view', - chatPanel: '#chatPanel', - textInput: '#text_input', - sendMessageBtn: '#send_message', - }, - settings: { - activeChat: { - name: null, - online: 0, - offline: 0, - from: { - names: null, - surnames: null, - phone: null, - phone_id: null, - }, - to: { - names: null, - surnames: null, - phone: null, - phone_id: null, - }, - chatType: null, + ChatAreaWidget = { + elements: { + chatView: '#chat_view', + chatPanel: '#chatPanel', + textInput: '#text_input', + sendMessageBtn: '#send_message' + }, + settings: { + activeChat: { + name: null, + online: 0, + offline: 0, + from: { + names: null, + surnames: null, + phone: null, + phone_id: null + }, + to: { + names: null, + surnames: null, + phone: null, + phone_id: null + }, + chatType: null + }, + historySize: -100 + }, + init() { + this.subscribe(); + this.bindUIActions(); + }, + subscribe() { + GlobalWidget.subscribe('history.get', ChatAreaWidget, this.historyRefresh); + GlobalWidget.subscribe('message.sent', ChatAreaWidget, this.messageSent); + }, + bindUIActions() { + const el = this.elements; + + $(el.textInput).keypress((e) => { + const keycode = (e.keyCode ? e.keyCode : e.which); + if (keycode == '13') { + ChatAreaWidget.sendMessage(); + } + }); + + $(el.sendMessageBtn).on('click', this.sendMessage); + + $(document).ready(() => { + /* Example of sending to middle backend */ + // ws.send(enc(tuple(atom('direct'), tuple(atom('page'), atom('dashboard'))))); + }); + }, + showChat() { + const el = this.elements; + + this.setTopic(); + this.getHistory(); + $(`${el.chatView}, ${el.chatPanel}`).removeClass('hidden'); + }, + hideChat() { + const el = this.elements; + }, + setTopic() { + let topicName = 'undefined', + topicId; + + switch (this.settings.activeChat.chatType) { + case 'p2p': + var from_p = this.settings.activeChat.from.phone_id, + from_f = this.settings.activeChat.from.names, + from_l = this.settings.activeChat.from.surnames, + to_p = this.settings.activeChat.to.phone_id, + to_f = this.settings.activeChat.to.names, + to_l = this.settings.activeChat.to.surnames; + + topicName = `${from_f} ${from_l}, ${to_f} ${to_l}`; + topicId = `${from_p}-${to_p}`; + + this.settings.activeChat.name = topicName; + + ChatListWidget.addToChatList({ topicId, topicName, time: GlobalWidget.convertUnixTime(Date.now()) }); + break; + } + + $('#tool_bar .topic .topic_name').html(topicName); + $('#tool_bar .topic').removeClass('hidden'); + }, + getHistory() { + const s = this.settings; + + switch (this.settings.activeChat.chatType) { + case 'p2p': + var msg = enc(encHistory({ + roster_id: s.activeChat.from.phone_id, + feed: { + tup: 'p2p', + from: s.activeChat.from.phone_id, + to: s.activeChat.to.phone_id }, - historySize: -100 - }, - init: function () { - this.subscribe(); - this.bindUIActions() - }, - subscribe: function () { - GlobalWidget.subscribe('history.get', ChatAreaWidget, this.historyRefresh); - GlobalWidget.subscribe('message.sent', ChatAreaWidget, this.messageSent); - }, - bindUIActions: function () { - var el = this.elements; - - $(el.textInput).keypress(function (e) { - var keycode = (e.keyCode ? e.keyCode : e.which); - if (keycode == '13') { - ChatAreaWidget.sendMessage(); - } - }); - - $(el.sendMessageBtn).on('click', this.sendMessage); - - $(document).ready(function () { - /* Example of sending to middle backend */ - //ws.send(enc(tuple(atom('direct'), tuple(atom('page'), atom('dashboard'))))); - }); - }, - showChat: function () { - var el = this.elements; - - this.setTopic(); - this.getHistory() - $(el.chatView + ', ' + el.chatPanel).removeClass('hidden'); - - }, - hideChat: function () { - var el = this.elements; - }, - setTopic: function () { - var topicName = 'undefined', - topicId; - - switch (this.settings.activeChat.chatType) { - case "p2p": - var from_p = this.settings.activeChat.from.phone_id, - from_f = this.settings.activeChat.from.names, - from_l = this.settings.activeChat.from.surnames, - to_p = this.settings.activeChat.to.phone_id, - to_f = this.settings.activeChat.to.names, - to_l = this.settings.activeChat.to.surnames; - - topicName = from_f + ' ' + from_l + ', ' + to_f + ' ' + to_l; - topicId = from_p + '-' + to_p; - - this.settings.activeChat.name = topicName; - - ChatListWidget.addToChatList({"topicId": topicId, "topicName": topicName, "time": GlobalWidget.convertUnixTime(Date.now())}); - break; - } - - $("#tool_bar .topic .topic_name").html(topicName); - $("#tool_bar .topic").removeClass('hidden'); - }, - getHistory: function () { - var s = this.settings; - - switch (this.settings.activeChat.chatType) { - case "p2p": - var msg = enc(encHistory({ - roster_id: s.activeChat.from.phone_id, - feed: { - tup: "p2p", - from: s.activeChat.from.phone_id, - to: s.activeChat.to.phone_id - }, - size: s.historySize, - entity_id: 0, - status: "get" - })); - ws.send(msg); - break; - } - }, - historyRefresh: function (res) { - var el = ChatAreaWidget.elements, - s = ChatAreaWidget.settings; - var msg_html = ''; - $(el.chatView).html(msg_html); - - if (Array.isArray(res.data)) { - res.data.forEach(function (message, i) { - if ( message.files[0]) { - var msg = { - id: message.id, - from: message.from, - to: message.to, - text: message.files[0].payload, - time: message.created, - mime: message.files[0].mime, - status: message.status - }; - - if (msg.from == s.activeChat.from.phone_id) { - msg_html += ChatAreaWidget.renderSentMessage(msg); - } else { - msg_html += ChatAreaWidget.renderReceivedMessage(msg); - } - } - }); - } - - $(el.chatView).append(msg_html); - $(el.chatView).scrollTop($(el.chatView)[0].scrollHeight); - }, - sendMessage: function () { - var el = this.elements, - s = this.settings; - - //text message - var text = $(el.textInput).val(); - - if (text) { - var msg = enc(encMessage({ - container: "chain", - feed_id: { - tup: "p2p", - from: s.activeChat.from.phone_id, - to: s.activeChat.to.phone_id - }, - from: s.activeChat.from.phone_id, - to: s.activeChat.to.phone_id, - files: [{ - tup: "Desc", - mime: "text", - payload: text, - size: text.length - }], - status: "client" - })); - ws.send(msg); - } - }, - messageSent: function (message) { - var el = ChatAreaWidget.elements, - s = ChatAreaWidget.settings, - msg_html = '', - msg = { - id: message.id, - from: message.from, - to: message.to, - text: message.files[0].payload, - time: message.created, - mime: message.files[0].mime, - status: message.status - }; + size: s.historySize, + entity_id: 0, + status: 'get' + })); + ws.send(msg); + break; + } + }, + historyRefresh(res) { + let el = ChatAreaWidget.elements, + s = ChatAreaWidget.settings; + let msg_html = ''; + $(el.chatView).html(msg_html); + + if (Array.isArray(res.data)) { + res.data.forEach((message, i) => { + if (message.files[0]) { + const msg = { + id: message.id, + from: message.from, + to: message.to, + text: message.files[0].payload, + time: message.created, + mime: message.files[0].mime, + status: message.status + }; - //@TODO: store in some local storage for cache - if (message.from == s.activeChat.from.phone_id) { - msg_html = ChatAreaWidget.renderSentMessage(msg); - $(el.textInput).val(''); + if (msg.from == s.activeChat.from.phone_id) { + msg_html += ChatAreaWidget.renderSentMessage(msg); } else { - var from = ContactsWidget.getNameByPhoneID(msg.from), - m = from + ": " + msg.text; - GlobalWidget.sucsessMsg(m); - msg_html = ChatAreaWidget.renderReceivedMessage(msg); + msg_html += ChatAreaWidget.renderReceivedMessage(msg); } - - $(el.chatView).append(msg_html).scrollTop($(el.chatView)[0].scrollHeight); - }, - renderSentMessage: function (msg) { - return '
' + - '
' + msg.text + - '
' + GlobalWidget.convertUnixTime(msg.time) + '
' + + } + }); + } + + $(el.chatView).append(msg_html); + $(el.chatView).scrollTop($(el.chatView)[0].scrollHeight); + }, + sendMessage() { + let el = this.elements, + s = this.settings; + + // text message + const text = $(el.textInput).val(); + + if (text) { + const msg = enc(encMessage({ + container: 'chain', + feed_id: { + tup: 'p2p', + from: s.activeChat.from.phone_id, + to: s.activeChat.to.phone_id + }, + from: s.activeChat.from.phone_id, + to: s.activeChat.to.phone_id, + files: [{ + tup: 'Desc', + mime: 'text', + payload: text, + size: text.length + }], + status: 'client' + })); + ws.send(msg); + } + }, + messageSent(message) { + let el = ChatAreaWidget.elements, + s = ChatAreaWidget.settings, + msg_html = '', + msg = { + id: message.id, + from: message.from, + to: message.to, + text: message.files[0].payload, + time: message.created, + mime: message.files[0].mime, + status: message.status + }; + + // @TODO: store in some local storage for cache + if (message.from == s.activeChat.from.phone_id) { + msg_html = ChatAreaWidget.renderSentMessage(msg); + $(el.textInput).val(''); + } else { + let from = ContactsWidget.getNameByPhoneID(msg.from), + m = `${from}: ${msg.text}`; + GlobalWidget.sucsessMsg(m); + msg_html = ChatAreaWidget.renderReceivedMessage(msg); + } + + $(el.chatView).append(msg_html).scrollTop($(el.chatView)[0].scrollHeight); + }, + renderSentMessage(msg) { + return `
` + + `
${msg.text + }
${GlobalWidget.convertUnixTime(msg.time)}
` + '
'; - }, - renderReceivedMessage: function (msg) { - return '
' + - '
' + ContactsWidget.getNameByPhoneID(msg.from) + '
' - + msg.text + - '
' + - '
' + GlobalWidget.convertUnixTime(msg.time) + '
' + + }, + renderReceivedMessage(msg) { + return `
` + + `
${ContactsWidget.getNameByPhoneID(msg.from)}
${ + msg.text + }
` + + `
${GlobalWidget.convertUnixTime(msg.time)}
` + '
'; - }, - }; - ChatAreaWidget.init(); + } + }; + ChatAreaWidget.init(); - /** + /** * ChatList Widget * @type {{init: init}} */ - ChatListWidget = { - elements: { - chats: "#chats", - contacts: "#recents", - listScrollWrapper: "#chats_list_scroll_wrapper", - listScroll: "#chats_list_scroll", - }, - init: function () { - this.subscribe(); - this.bindUIActions() - }, - subscribe: function () { - - }, - bindUIActions: function () { - var el = ChatListWidget.elements; - - $(el.chats).on("click", function () { - //@TODO: need to refactoring this sheet - var hidden = $('#recents').is(':hidden'); - - if (hidden) { - $('#chats').addClass('active selected'); - $('#recents').slideDown("slow"); - $('#favorite').slideDown("slow"); - $('#family').slideDown("slow"); - $('#work').slideDown("slow"); - $('#new_chat').slideDown("slow"); - - //$('#recents').show('slow'); - //$('#favorite').show('slow'); - //$('#family').show('slow'); - ///$('#work').show('slow'); - //$('#new_chat').show('slow'); - } else { - $('#chats').removeClass('active selected'); - $('#recents').slideUp('slow'); - $('#favorite').slideUp('slow'); - $('#family').slideUp('slow'); - $('#work').slideUp('slow'); - $('#new_chat').slideUp('slow'); - } - }); - - $(el.contacts).on("click", function () { - //@TODO: need to refactoring this sheet - var chats_is_hidden = $('#chats_list').is(':hidden'); - $('#tool_bar').css("width", ''); - $('#chat').css("width", ''); - $('.chat_wrapper').css("padding", ''); - if (chats_is_hidden) { - $("#logo_wrap").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['chats_list']['width']) + 'vw'; - $('#tool_bar').css("width", tool_bar_width); - - $('#contacts_list_view, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); + ChatListWidget = { + elements: { + chats: '#chats', + contacts: '#recents', + listScrollWrapper: '#chats_list_scroll_wrapper', + listScroll: '#chats_list_scroll' + }, + init() { + this.subscribe(); + this.bindUIActions(); + }, + subscribe() { + + }, + bindUIActions() { + const el = ChatListWidget.elements; + + $(el.chats).on('click', () => { + // @TODO: need to refactoring this sheet + const hidden = $('#recents').is(':hidden'); + + if (hidden) { + $('#chats').addClass('active selected'); + $('#recents').slideDown('slow'); + $('#favorite').slideDown('slow'); + $('#family').slideDown('slow'); + $('#work').slideDown('slow'); + $('#new_chat').slideDown('slow'); + + // $('#recents').show('slow'); + // $('#favorite').show('slow'); + // $('#family').show('slow'); + // /$('#work').show('slow'); + // $('#new_chat').show('slow'); + } else { + $('#chats').removeClass('active selected'); + $('#recents').slideUp('slow'); + $('#favorite').slideUp('slow'); + $('#family').slideUp('slow'); + $('#work').slideUp('slow'); + $('#new_chat').slideUp('slow'); + } + }); - $("#chats_list, .drag_handle_left").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); + $(el.contacts).on('click', () => { + // @TODO: need to refactoring this sheet + const chats_is_hidden = $('#chats_list').is(':hidden'); + $('#tool_bar').css('width', ''); + $('#chat').css('width', ''); + $('.chat_wrapper').css('padding', ''); + if (chats_is_hidden) { + $('#logo_wrap').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); - var vw = (100 / $(document).width()); - var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['chats_list']['width']) + 'vw'; - $('#chat').css("width", chat_width); + const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.chats_list.width}vw`; + $('#tool_bar').css('width', tool_bar_width); - var panel_width = t.settings.panels_options['chats_list']['width']; - $('#logo_wrap').css("width", panel_width + 'vw'); + $('#contacts_list_view, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - $('.chat_wrapper').css("padding", padding_chat_wrapper); + $('#chats_list, .drag_handle_left').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); - ChatListWidget.refreshList(); - } else { - $('#logo_wrap, #chats_list, .drag_handle_left').hide(); - } - }); - }, - getChatList: function () { - var current = localStorage.getItem("chatList") || []; + const vw = (100 / $(document).width()); + const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.chats_list.width}vw`; + $('#chat').css('width', chat_width); - return (current.length) ? JSON.parse(current) : []; - }, - addToChatList: function (chat) { - var current = ChatListWidget.getChatList(), - exists = false - - //@TODO: refactor this exp - if (Array.isArray(current)) { - current.forEach(function (value) { - if (value.topicId == chat.topicId) { - exists = true; - } - }); - - if (!exists) { - current.push(chat); - localStorage.setItem("chatList", JSON.stringify(current)); - } - } + const panel_width = t.settings.panels_options.chats_list.width; + $('#logo_wrap').css('width', `${panel_width}vw`); - }, - refreshList: function () { - var el = ChatListWidget.elements, - s = ChatListWidget.settings, - chatList = ChatListWidget.getChatList(); - - $(el.listScroll).html(''); - - if (Array.isArray(chatList)) { - $.each(chatList, function (ind, chat) { - $(el.listScroll).append(ChatListWidget.itemView(chat)); - - //@TODO: !!! remove handlers events in loop!!! - $(el.listScroll + ' ' + ' .chat_' + chat.topicId).on("click", function () { - $('.contact_chat_' + chat.topicId).click(); - }); - }); - } - }, - itemView : function(chat) { - var item = ''; + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + $('.chat_wrapper').css('padding', padding_chat_wrapper); - item += '
\n' + + ChatListWidget.refreshList(); + } else { + $('#logo_wrap, #chats_list, .drag_handle_left').hide(); + } + }); + }, + getChatList() { + const current = localStorage.getItem('chatList') || []; + + return (current.length) ? JSON.parse(current) : []; + }, + addToChatList(chat) { + let current = ChatListWidget.getChatList(), + exists = false; + + // @TODO: refactor this exp + if (Array.isArray(current)) { + current.forEach((value) => { + if (value.topicId == chat.topicId) { + exists = true; + } + }); + + if (!exists) { + current.push(chat); + localStorage.setItem('chatList', JSON.stringify(current)); + } + } + }, + refreshList() { + let el = ChatListWidget.elements, + s = ChatListWidget.settings, + chatList = ChatListWidget.getChatList(); + + $(el.listScroll).html(''); + + if (Array.isArray(chatList)) { + $.each(chatList, (ind, chat) => { + $(el.listScroll).append(ChatListWidget.itemView(chat)); + + // @TODO: !!! remove handlers events in loop!!! + $(`${el.listScroll} ` + ` .chat_${chat.topicId}`).on('click', () => { + $(`.contact_chat_${chat.topicId}`).click(); + }); + }); + } + }, + itemView(chat) { + let item = ''; + + item += `
\n` + '
\n' + '
\n' + '
\n' + '
\n' + '
\n' + - '
' + chat.topicName + '
\n' + + `
${chat.topicName}
\n` + ' \n' + '
\n' + '
\n' + '
\n' + '
\n' + ' \n' + - '
' + chat.time + '
\n' + + `
${chat.time}
\n` + '
\n' + '
\n' + ' \n' + '
'; - return item; - } - }; - ChatListWidget.init(); + return item; + } + }; + ChatListWidget.init(); - /** + /** * Profile Widget * @type {{settings: {profileView: string, logoutBtn: string}, init: init, update: update}} */ - ProfileViewWidget = { - elements: { - profileImg: '#profile_img', - firstName: "#first_name", - lastName: "#last_name", - userName: "#user_name", - phoneNumber: "#phone_number", - profileView: "#profile_view", - editBtn: "#editBtn", - logoutBtn: "#logoutBtn" - }, - settings: { - profile: {} - }, - init: function () { - this.subscribe(); - this.bindUIActions(); - }, - subscribe: function () { - GlobalWidget.subscribe('profile.get', GlobalWidget, this.refresh); - GlobalWidget.subscribe('io.error.nick_taken', GlobalWidget, this.errorNickTaken); - GlobalWidget.subscribe('roster.patch', this, this.profileUpdated); - GlobalWidget.subscribe('io.ok.logout', this, this.logout); - }, - bindUIActions: function () { - var t = ProfileViewWidget, - el = t.elements; - - $(el.profileImg).on("click", function () { - //@TODO: need to refactoring this sheet - var hidden = $('#profile_view').is(':hidden'); - $('#tool_bar').css("width", ''); - $('#chat').css("width", ''); - $('.chat_wrapper').css("padding", ''); - - if (hidden) { - $("#logo_wrap").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['profile_view']['width']) + 'vw'; - $('#tool_bar').css("width", tool_bar_width); - - $('#chats_list, #contacts_list_view, #new_contact_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); - - - $("#profile_view, .drag_handle_left").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var vw = (100 / $(document).width()); - - var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['profile_view']['width']) + 'vw'; - $('#chat').css("width", chat_width); - - var panel_width = DashboardWidget.settings.panels_options['profile_view']['width']; - $('#logo_wrap').css("width", panel_width + 'vw'); - - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - console.log(padding_chat_wrapper); - $('.chat_wrapper').css("padding", padding_chat_wrapper); - - } else { - $('#logo_wrap, #profile_view, .drag_handle_left').hide(); - } - }); - $(el.logoutBtn).on('click', function () { - var msg = enc(encAuth({"type": "logout"})); - ws.send(msg); - }); - $(el.editBtn).on('click', function () { - var f = $(el.firstName).val(), - l = $(el.lastName).val(), - un = $(el.userName).val(); - - if (t.profileUpdateValidation(f, l, un)) { - var mes = { - "id": GlobalWidget.getRosterId(), - "names": f, - "surnames": l, - "status": "patch" - }; - - if (typeof un != "undefined" && un != t.settings.profile.rosters[GlobalWidget.getRosterIndex()].nick) { - mes.nick = un; - } - - var msg = enc(encRoster(mes)); - ws.send(msg); - } - }); - }, - profileGet: function () { - var msg = enc(encProfile({"phone": GlobalWidget.getPhoneNumber(), "status": "get"})); - ws.send(msg); - }, - profileUpdated: function () { - var msg = GlobalWidget.messages(1100); - GlobalWidget.sucsessMsg(msg); - }, - profileUpdateValidation: function (firstName, lastName, userName) { - try { - if (!firstName.length) { - throw new Error(GlobalWidget.messages(1101)); - } - if (userName.length > 0 && userName.length < 2) { - throw new Error(GlobalWidget.messages(1103)); - } - - var pattern = /^([a-zA-Z0-9_-]{2,})$/; - if (userName && !pattern.test(userName)) { - throw new Error(GlobalWidget.messages(1104)); - } - } catch (err) { - GlobalWidget.warningMsg(err.message) - return; - } - return true; - }, - errorNickTaken: function () { - GlobalWidget.warningMsg(GlobalWidget.messages(1102)); - }, - refresh: function (res) { - var el = ProfileViewWidget.elements, - s = ProfileViewWidget.settings, - rosInd = GlobalWidget.getRosterIndex(); - - s.profile = res; - - $(el.firstName).val(res.rosters[rosInd].names); - $(el.lastName).val(res.rosters[rosInd].surnames); - $(el.userName).val(res.rosters[rosInd].nick); - $(el.phoneNumber).val(res.phone); - }, - logout: function () { - //@TODO: need to clean needed data - var chatList = localStorage.getItem('chatList'); - - localStorage.clear(); - localStorage.setItem('chatList', chatList); + ProfileViewWidget = { + elements: { + profileImg: '#profile_img', + firstName: '#first_name', + lastName: '#last_name', + userName: '#user_name', + phoneNumber: '#phone_number', + profileView: '#profile_view', + editBtn: '#editBtn', + logoutBtn: '#logoutBtn' + }, + settings: { + profile: {} + }, + init() { + this.subscribe(); + this.bindUIActions(); + }, + subscribe() { + GlobalWidget.subscribe('profile.get', GlobalWidget, this.refresh); + GlobalWidget.subscribe('io.error.nick_taken', GlobalWidget, this.errorNickTaken); + GlobalWidget.subscribe('roster.patch', this, this.profileUpdated); + GlobalWidget.subscribe('io.ok.logout', this, this.logout); + }, + bindUIActions() { + let t = ProfileViewWidget, + el = t.elements; + + $(el.profileImg).on('click', () => { + // @TODO: need to refactoring this sheet + const hidden = $('#profile_view').is(':hidden'); + $('#tool_bar').css('width', ''); + $('#chat').css('width', ''); + $('.chat_wrapper').css('padding', ''); + + if (hidden) { + $('#logo_wrap').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.profile_view.width}vw`; + $('#tool_bar').css('width', tool_bar_width); + + $('#chats_list, #contacts_list_view, #new_contact_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); + + + $('#profile_view, .drag_handle_left').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const vw = (100 / $(document).width()); + + const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.profile_view.width}vw`; + $('#chat').css('width', chat_width); + + const panel_width = DashboardWidget.settings.panels_options.profile_view.width; + $('#logo_wrap').css('width', `${panel_width}vw`); + + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + console.log(padding_chat_wrapper); + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } else { + $('#logo_wrap, #profile_view, .drag_handle_left').hide(); + } + }); + $(el.logoutBtn).on('click', () => { + const msg = enc(encAuth({ type: 'logout' })); + ws.send(msg); + }); + $(el.editBtn).on('click', () => { + let f = $(el.firstName).val(), + l = $(el.lastName).val(), + un = $(el.userName).val(); + + if (t.profileUpdateValidation(f, l, un)) { + const mes = { + id: GlobalWidget.getRosterId(), + names: f, + surnames: l, + status: 'patch' + }; + + if (typeof un !== 'undefined' && un != t.settings.profile.rosters[GlobalWidget.getRosterIndex()].nick) { + mes.nick = un; + } + + const msg = enc(encRoster(mes)); + ws.send(msg); + } + }); + }, + profileGet() { + const msg = enc(encProfile({ phone: GlobalWidget.getPhoneNumber(), status: 'get' })); + ws.send(msg); + }, + profileUpdated() { + const msg = GlobalWidget.messages(1100); + GlobalWidget.sucsessMsg(msg); + }, + profileUpdateValidation(firstName, lastName, userName) { + try { + if (!firstName.length) { + throw new Error(GlobalWidget.messages(1101)); + } + if (userName.length > 0 && userName.length < 2) { + throw new Error(GlobalWidget.messages(1103)); + } - location.replace("/web/welcome.htm"); + const pattern = /^([a-zA-Z0-9_-]{2,})$/; + if (userName && !pattern.test(userName)) { + throw new Error(GlobalWidget.messages(1104)); } - }; - ProfileViewWidget.init(); + } catch (err) { + GlobalWidget.warningMsg(err.message); + return; + } + return true; + }, + errorNickTaken() { + GlobalWidget.warningMsg(GlobalWidget.messages(1102)); + }, + refresh(res) { + let el = ProfileViewWidget.elements, + s = ProfileViewWidget.settings, + rosInd = GlobalWidget.getRosterIndex(); + + s.profile = res; + + $(el.firstName).val(res.rosters[rosInd].names); + $(el.lastName).val(res.rosters[rosInd].surnames); + $(el.userName).val(res.rosters[rosInd].nick); + $(el.phoneNumber).val(res.phone); + }, + logout() { + // @TODO: need to clean needed data + const chatList = localStorage.getItem('chatList'); + + localStorage.clear(); + localStorage.setItem('chatList', chatList); + + location.replace('/web/welcome.htm'); + } + }; + ProfileViewWidget.init(); - /** + /** * Contacts * @type {{elements: {chats: string, contacts: string, newContact: string, contactsList: string, contactRequest: string}, init: init, subscribe: subscribe, bindUIActions: bindUIActions}} */ - ContactsWidget = { - elements: { - contacts: '#contacts', - newContact: '#new_contact', - contactsList: '#contacts_list', - contactRequest: '#contact_request', - contactsListScroll: '#contacts_list_scroll', - chatContactItem: '.chat_contact', - }, - settings: { - contacts: [] - }, - init: function () { - this.subscribe(); - this.bindUIActions() - }, - subscribe: function () { - GlobalWidget.subscribe('profile.get', GlobalWidget, this.refreshList); - GlobalWidget.subscribe('contact.internal', GlobalWidget, this.contactInternal); - }, - bindUIActions: function () { - var el = ContactsWidget.elements; - - $(el.contacts).on("click", function () { - if ($(el.newContact).is(':hidden')) { - $(el.contacts).addClass('active selected'); - $(el.contactRequest + ',' + el.newContact).removeClass('hidden').slideDown('slow'); - } else { - $(el.newContact).removeClass('active selected'); - $(el.contactRequest, el.newContact).addClass('hidden').slideUp('slow'); - } - - //@TODO: need to refactoring the code below - var hidden = $('#contacts_list_view').is(':hidden'); - $('#tool_bar').css("width", ''); - $('#chat').css("width", ''); - $('.chat_wrapper').css("padding", ''); - - if (hidden) { - $("#logo_wrap").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); + ContactsWidget = { + elements: { + contacts: '#contacts', + newContact: '#new_contact', + contactsList: '#contacts_list', + contactRequest: '#contact_request', + contactsListScroll: '#contacts_list_scroll', + chatContactItem: '.chat_contact' + }, + settings: { + contacts: [] + }, + init() { + this.subscribe(); + this.bindUIActions(); + }, + subscribe() { + GlobalWidget.subscribe('profile.get', GlobalWidget, this.refreshList); + GlobalWidget.subscribe('contact.internal', GlobalWidget, this.contactInternal); + }, + bindUIActions() { + const el = ContactsWidget.elements; + + $(el.contacts).on('click', () => { + if ($(el.newContact).is(':hidden')) { + $(el.contacts).addClass('active selected'); + $(`${el.contactRequest},${el.newContact}`).removeClass('hidden').slideDown('slow'); + } else { + $(el.newContact).removeClass('active selected'); + $(el.contactRequest, el.newContact).addClass('hidden').slideUp('slow'); + } - var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['contacts_list_view']['width']) + 'vw'; - $('#tool_bar').css("width", tool_bar_width); + // @TODO: need to refactoring the code below + const hidden = $('#contacts_list_view').is(':hidden'); + $('#tool_bar').css('width', ''); + $('#chat').css('width', ''); + $('.chat_wrapper').css('padding', ''); - $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); + if (hidden) { + $('#logo_wrap').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); - $("#contacts_list_view").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); + const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.contacts_list_view.width}vw`; + $('#tool_bar').css('width', tool_bar_width); - $(".drag_handle_left").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); + $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); - var vw = (100 / $(document).width()); + $('#contacts_list_view').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); - var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['contacts_list_view']['width']) + 'vw'; - $('#chat').css("width", chat_width); + $('.drag_handle_left').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); - var panel_width = DashboardWidget.settings.panels_options['contacts_list_view']['width']; - $('#logo_wrap').css("width", panel_width + 'vw'); + const vw = (100 / $(document).width()); - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - $('.chat_wrapper').css("padding", padding_chat_wrapper); + const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.contacts_list_view.width}vw`; + $('#chat').css('width', chat_width); - } else { - $('#logo_wrap, #chats_list, #contacts_list_view, .drag_handle_left').hide(); - } - }); - }, - contactInternal: function (res) { - var el = ContactsWidget.elements; - if (typeof res.presence != "undefined") { - $(el.contactsListScroll + ' .contact_' + res.phone_id + ' div.presence').html(res.presence); - } - }, - refreshList: function (res) { - var el = ContactsWidget.elements, - s = ContactsWidget.settings, - rosInd = GlobalWidget.getRosterIndex(), - userlist = res.rosters[rosInd].userlist; - - $(el.contactsListScroll).html(''); - - $.each(userlist, function (ind, contact) { - if (contact.status == "friend") { - s.contacts[contact.phone_id] = contact; - - $(el.contactsListScroll).append(ContactsWidget.itemView(contact)); - - //@TODO: !!! remove handlers events in loop!!! - $(el.contactsListScroll + ' ' + ' .contact_' + contact.phone_id).on("click", function () { - //@TODO: move to separate function - //p2p chat - ChatAreaWidget.settings.activeChat = { - from: { - names: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].names, - surnames: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].surnames, - phone: GlobalWidget.getPhoneNumber(), - phone_id: GlobalWidget.getPhoneNumberId() - }, - to: { - names: $(this).data('names'), - surnames: $(this).data('surnames'), - phone: $(this).data('phone'), - phone_id: $(this).data('phone-id'), - reader: $(this).data('reader') - }, - chatType: "p2p" - }; - - ChatAreaWidget.showChat(); - }); - } - }) - }, - itemView: function (contact) { - var item = '', - presence = (typeof contact.presence != "undefined") ? contact.presence : '', - names = (typeof contact.names != "undefined") ? contact.names : '', - surnames = (typeof contact.surnames != "undefined") ? contact.surnames : ''; + const panel_width = DashboardWidget.settings.panels_options.contacts_list_view.width; + $('#logo_wrap').css('width', `${panel_width}vw`); - var op = '
' + presence + '
'; + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } else { + $('#logo_wrap, #chats_list, #contacts_list_view, .drag_handle_left').hide(); + } + }); + }, + contactInternal(res) { + const el = ContactsWidget.elements; + if (typeof res.presence !== 'undefined') { + $(`${el.contactsListScroll} .contact_${res.phone_id} div.presence`).html(res.presence); + } + }, + refreshList(res) { + let el = ContactsWidget.elements, + s = ContactsWidget.settings, + rosInd = GlobalWidget.getRosterIndex(), + userlist = res.rosters[rosInd].userlist; + + $(el.contactsListScroll).html(''); + + $.each(userlist, (ind, contact) => { + if (contact.status == 'friend') { + s.contacts[contact.phone_id] = contact; + + $(el.contactsListScroll).append(ContactsWidget.itemView(contact)); + + // @TODO: !!! remove handlers events in loop!!! + $(`${el.contactsListScroll} ` + ` .contact_${contact.phone_id}`).on('click', function () { + // @TODO: move to separate function + // p2p chat + ChatAreaWidget.settings.activeChat = { + from: { + names: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].names, + surnames: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].surnames, + phone: GlobalWidget.getPhoneNumber(), + phone_id: GlobalWidget.getPhoneNumberId() + }, + to: { + names: $(this).data('names'), + surnames: $(this).data('surnames'), + phone: $(this).data('phone'), + phone_id: $(this).data('phone-id'), + reader: $(this).data('reader') + }, + chatType: 'p2p' + }; - item = '
\n' + + ChatAreaWidget.showChat(); + }); + } + }); + }, + itemView(contact) { + let item = '', + presence = (typeof contact.presence !== 'undefined') ? contact.presence : '', + names = (typeof contact.names !== 'undefined') ? contact.names : '', + surnames = (typeof contact.surnames !== 'undefined') ? contact.surnames : ''; + + const op = `
${presence}
`; + + item = `
\n` + '
\n' + '
\n' + '
\n' + '
\n' + '
\n' + - '
' + names + ' ' + surnames + '
\n' + - '
+' + GlobalWidget.cleanPhone(contact.phone_id) + '
\n' + + `
${names} ${surnames}
\n` + + `
+${GlobalWidget.cleanPhone(contact.phone_id)}
\n` + '
\n' + - '
' + op + '
\n' + + `
${op}
\n` + '
\n' + ' \n' + - '
' + '
'; - return item; - }, - getNameByPhoneID: function (phoneId) { - var s = ContactsWidget.settings; + return item; + }, + getNameByPhoneID(phoneId) { + const s = ContactsWidget.settings; - if (typeof s.contacts[phoneId] != "undefined") { - return s.contacts[phoneId].names + ' ' + s.contacts[phoneId].surnames; - } + if (typeof s.contacts[phoneId] !== 'undefined') { + return `${s.contacts[phoneId].names} ${s.contacts[phoneId].surnames}`; + } - return phoneId; - } - }; - ContactsWidget.init(); + return phoneId; + } + }; + ContactsWidget.init(); - /** + /** * Contact Request Widget * @type {{elements: {}, init: init, subscribe: subscribe, bindUIActions: bindUIActions, refreshList: refreshList, itemView: itemView}} */ - ContactRequestsWidget = { - elements: { - contactRequest: "#contact_request", - contactRequestsScroll: "#contact_requests_scroll", - outcomeFriendRequests: "#outcome_friend_requests", - incomeFriendRequests: "#income_friend_requests", - revokeBtn: "button.revoke", - confirmBtn: "button.confirm", - }, - init: function () { - this.subscribe(); - this.bindUIActions(); - }, - subscribe: function () { - GlobalWidget.subscribe('profile.get', ContactRequestsWidget, this.refreshList); - GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.requestNotification); - GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.addWatingApprovalContact); - GlobalWidget.subscribe('contact.request', ContactRequestsWidget, this.addWatingApprovalContact); - - //@TODO: add supporting a few handler functions - GlobalWidget.subscribe('contact.friend', ContactRequestsWidget, ProfileViewWidget.profileGet); - }, - bindUIActions: function () { - var el = ContactRequestsWidget.elements; - - $(el.contactRequest).on('click', function () { - //@TODO: need to refactor the code bellow - $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contacts_list_view').hide(); - $("#contact_requests_view, .drag_handle_left").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - }); - - $(el.contactRequestsScroll + ' ' + el.confirmBtn).on("click", function () { - var phone_id = $(this).parent().data('phone-id'); - - //3a. send Friend/Confirm - var msg = enc(encFriend({ - "phone_id": GlobalWidget.getPhoneNumberId(), - "friend_id": phone_id, - "status": "confirm" - })); - - ws.send(msg); - }); - - $(el.contactRequestsScroll + ' ' + el.revokeBtn).on("click", function () { - var phone_id = $(this).parent().data('phone-id') - - //3b. send Friend/Revoke - var msg = enc(encFriend({ - "phone_id": GlobalWidget.getPhoneNumberId(), - "friend_id": phone_id, - "status": "revoke" - })); - - ws.send(msg); - }); - }, - requestNotification: function (res) { - GlobalWidget.sucsessMsg("Friend request from " + res.names + ' ' + res.surnames); - }, - refreshList: function (res) { - var el = ContactRequestsWidget.elements, - rosInd = GlobalWidget.getRosterIndex(), - userlist = res.rosters[rosInd].userlist, - request = '', - authorization = ''; - - $.each(userlist, function (ind, contact) { - if (contact.status == "request") { - request += ContactRequestsWidget.itemView(contact); - } else if (contact.status == "authorization") { - authorization += ContactRequestsWidget.itemView(contact) - } - }) - - if (request) { - $(el.outcomeFriendRequests).html(''); - $(el.outcomeFriendRequests).append(request); - } else { - $(el.outcomeFriendRequests).html("

" + GlobalWidget.t("No Requests") + "

"); - } - - if (authorization) { - $(el.incomeFriendRequests).html(''); - $(el.incomeFriendRequests).append(authorization); - } else { - $(el.incomeFriendRequests).html("

" + GlobalWidget.t("No Requests") + "

"); - } - - //@TODO: need to unbind handlers - ContactRequestsWidget.bindUIActions(); - }, - addWatingApprovalContact: function (res) { - var el = ContactRequestsWidget.elements - $(el.contactRequest).click(); - - //@TODO: need to optimize in order not to send Profile/get request - ProfileViewWidget.profileGet(); - }, - itemView: function (contact) { - var item = '', - names = (typeof contact.names != "undefined") ? contact.names : GlobalWidget.cleanPhone(contact.phone_id), - surnames = (typeof contact.surnames != "undefined") ? contact.surnames : ''; - - var op = (contact.status == "request") ? "waiting" : ' '; - - item = '
\n' + + ContactRequestsWidget = { + elements: { + contactRequest: '#contact_request', + contactRequestsScroll: '#contact_requests_scroll', + outcomeFriendRequests: '#outcome_friend_requests', + incomeFriendRequests: '#income_friend_requests', + revokeBtn: 'button.revoke', + confirmBtn: 'button.confirm' + }, + init() { + this.subscribe(); + this.bindUIActions(); + }, + subscribe() { + GlobalWidget.subscribe('profile.get', ContactRequestsWidget, this.refreshList); + GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.requestNotification); + GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.addWatingApprovalContact); + GlobalWidget.subscribe('contact.request', ContactRequestsWidget, this.addWatingApprovalContact); + + // @TODO: add supporting a few handler functions + GlobalWidget.subscribe('contact.friend', ContactRequestsWidget, ProfileViewWidget.profileGet); + }, + bindUIActions() { + const el = ContactRequestsWidget.elements; + + $(el.contactRequest).on('click', () => { + // @TODO: need to refactor the code bellow + $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contacts_list_view').hide(); + $('#contact_requests_view, .drag_handle_left').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + }); + + $(`${el.contactRequestsScroll} ${el.confirmBtn}`).on('click', function () { + const phone_id = $(this).parent().data('phone-id'); + + // 3a. send Friend/Confirm + const msg = enc(encFriend({ + phone_id: GlobalWidget.getPhoneNumberId(), + friend_id: phone_id, + status: 'confirm' + })); + + ws.send(msg); + }); + + $(`${el.contactRequestsScroll} ${el.revokeBtn}`).on('click', function () { + const phone_id = $(this).parent().data('phone-id'); + + // 3b. send Friend/Revoke + const msg = enc(encFriend({ + phone_id: GlobalWidget.getPhoneNumberId(), + friend_id: phone_id, + status: 'revoke' + })); + + ws.send(msg); + }); + }, + requestNotification(res) { + GlobalWidget.sucsessMsg(`Friend request from ${res.names} ${res.surnames}`); + }, + refreshList(res) { + let el = ContactRequestsWidget.elements, + rosInd = GlobalWidget.getRosterIndex(), + userlist = res.rosters[rosInd].userlist, + request = '', + authorization = ''; + + $.each(userlist, (ind, contact) => { + if (contact.status == 'request') { + request += ContactRequestsWidget.itemView(contact); + } else if (contact.status == 'authorization') { + authorization += ContactRequestsWidget.itemView(contact); + } + }); + + if (request) { + $(el.outcomeFriendRequests).html(''); + $(el.outcomeFriendRequests).append(request); + } else { + $(el.outcomeFriendRequests).html(`

${GlobalWidget.t('No Requests')}

`); + } + + if (authorization) { + $(el.incomeFriendRequests).html(''); + $(el.incomeFriendRequests).append(authorization); + } else { + $(el.incomeFriendRequests).html(`

${GlobalWidget.t('No Requests')}

`); + } + + // @TODO: need to unbind handlers + ContactRequestsWidget.bindUIActions(); + }, + addWatingApprovalContact(res) { + const el = ContactRequestsWidget.elements; + $(el.contactRequest).click(); + + // @TODO: need to optimize in order not to send Profile/get request + ProfileViewWidget.profileGet(); + }, + itemView(contact) { + let item = '', + names = (typeof contact.names !== 'undefined') ? contact.names : GlobalWidget.cleanPhone(contact.phone_id), + surnames = (typeof contact.surnames !== 'undefined') ? contact.surnames : ''; + + const op = (contact.status == 'request') ? 'waiting' : ' '; + + item = `${'
\n' + '
\n' + '
\n' + '
\n' + '
\n' + '
\n' + - '
' + names + ' ' + surnames + '
\n' + - '
+' + GlobalWidget.cleanPhone(contact.phone_id) + '
\n' + + '
'}${names} ${surnames}
\n` + + `
+${GlobalWidget.cleanPhone(contact.phone_id)}
\n` + '
\n' + - '
' + op + '
\n' + + `
${op}
\n` + '
\n' + ' \n' + '
'; - return item; - } - }; - ContactRequestsWidget.init(); + return item; + } + }; + ContactRequestsWidget.init(); - /** + /** * Add Contact Widget * @type {{elements: {}, init: init, bindUIActions: bindUIActions}} */ - AddContactWidget = { - elements: { - newContact: "#new_contact", - newContactView: "#new_contact_view", - code: "#new_contact_view #code", - number: "#new_contact_view #number", - addContactBtn: "#new_contact_view #addContactBtn" - }, - init: function () { - this.subscribe(); - this.bindUIActions(); - }, - subscribe: function () { - GlobalWidget.subscribe('io.ok.roster.contact', this, this.friendRequest); - }, - bindUIActions: function () { - var el = this.elements; - - $(el.newContact).on("click", function () { - //@TODO: need to refactor the code below - var hidden = $('#new_contact_view').is(':hidden'); - - $('#tool_bar').css("width", ''); - $('#chat').css("width", ''); - $('.chat_wrapper').css("padding", ''); - if (hidden) { - $("#logo_wrap").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['new_contact_view']['width']) + 'vw'; - $('#tool_bar').css("width", tool_bar_width); - - $('#chats_list, #contacts_list_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); - - $("#new_contact_view, .drag_handle_left").fadeIn(750, function () { - $(this).addClass("lookAtMe"); - }); - - var vw = (100 / $(document).width()); - - var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['new_contact_view']['width']) + 'vw'; - $('#chat').css("width", chat_width); - - var panel_width = t.settings.panels_options['new_contact_view']['width']; - $('#logo_wrap').css("width", panel_width + 'vw'); - - var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw'; - console.log(padding_chat_wrapper); - $('.chat_wrapper').css("padding", padding_chat_wrapper); - - } else { - $('#logo_wrap, #new_contact_view, .drag_handle_left').hide(); - } - }); - - $(el.addContactBtn).on('click', function () { - var code = $(el.code).val().replace("+", ""), - phone = $(el.number).val().split(" ").join(""); - - //1. search contact for getting friend_id - var msg = enc(encSearch({ - id: GlobalWidget.getRosterId(), - field: "phone", - type: "==", - value: [code + phone], - status: "contact" - })); - - ws.send(msg); - }); - }, - friendRequest: function (res) { - var el = this.elements; - - if ('userlist' in res.data && typeof res.data.userlist[0] != "undefined") { - var phone_id = res.data.userlist[0].phone_id; - - //2. send Friend/Request - var msg = enc(encFriend({ - "phone_id": GlobalWidget.getPhoneNumber() + '_' + GlobalWidget.getRosterId(), - "friend_id": phone_id, - "status": "request" - })); - - ws.send(msg); - - $(ContactRequestsWidget.elements.contactRequest).click(); - } else { - GlobalWidget.errorMsg("Phone was not found.") - } + AddContactWidget = { + elements: { + newContact: '#new_contact', + newContactView: '#new_contact_view', + code: '#new_contact_view #code', + number: '#new_contact_view #number', + addContactBtn: '#new_contact_view #addContactBtn' + }, + init() { + this.subscribe(); + this.bindUIActions(); + }, + subscribe() { + GlobalWidget.subscribe('io.ok.roster.contact', this, this.friendRequest); + }, + bindUIActions() { + const el = this.elements; + + $(el.newContact).on('click', () => { + // @TODO: need to refactor the code below + const hidden = $('#new_contact_view').is(':hidden'); + + $('#tool_bar').css('width', ''); + $('#chat').css('width', ''); + $('.chat_wrapper').css('padding', ''); + if (hidden) { + $('#logo_wrap').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.new_contact_view.width}vw`; + $('#tool_bar').css('width', tool_bar_width); + + $('#chats_list, #contacts_list_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide(); + + $('#new_contact_view, .drag_handle_left').fadeIn(750, function () { + $(this).addClass('lookAtMe'); + }); + + const vw = (100 / $(document).width()); + + const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.new_contact_view.width}vw`; + $('#chat').css('width', chat_width); + + const panel_width = t.settings.panels_options.new_contact_view.width; + $('#logo_wrap').css('width', `${panel_width}vw`); + + const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`; + console.log(padding_chat_wrapper); + $('.chat_wrapper').css('padding', padding_chat_wrapper); + } else { + $('#logo_wrap, #new_contact_view, .drag_handle_left').hide(); } + }); + + $(el.addContactBtn).on('click', () => { + let code = $(el.code).val().replace('+', ''), + phone = $(el.number).val().split(' ').join(''); + + // 1. search contact for getting friend_id + const msg = enc(encSearch({ + id: GlobalWidget.getRosterId(), + field: 'phone', + type: '==', + value: [code + phone], + status: 'contact' + })); + + ws.send(msg); + }); + }, + friendRequest(res) { + const el = this.elements; + + if ('userlist' in res.data && typeof res.data.userlist[0] !== 'undefined') { + const phone_id = res.data.userlist[0].phone_id; + + // 2. send Friend/Request + const msg = enc(encFriend({ + phone_id: `${GlobalWidget.getPhoneNumber()}_${GlobalWidget.getRosterId()}`, + friend_id: phone_id, + status: 'request' + })); + + ws.send(msg); + + $(ContactRequestsWidget.elements.contactRequest).click(); + } else { + GlobalWidget.errorMsg('Phone was not found.'); + } + } - }; - AddContactWidget.init(); -})(); + }; + AddContactWidget.init(); +}()); diff --git a/src/assets/vendor/utils/global.js b/src/assets/vendor/utils/global.js index c8826afbe..0ca733288 100644 --- a/src/assets/vendor/utils/global.js +++ b/src/assets/vendor/utils/global.js @@ -1,132 +1,133 @@ -var GlobalWidget; +let GlobalWidget; (function () { - var el, t; - GlobalWidget = { - events: {}, - settings: {}, - init: function () { - t = this; - el = this.elements; + let el, + t; + GlobalWidget = { + events: {}, + settings: {}, + init() { + t = this; + el = this.elements; - //success - //GlobalWidget.subscribe('io.ok.added', this, this.sucsessMsg); + // success + // GlobalWidget.subscribe('io.ok.added', this, this.sucsessMsg); - //errors - GlobalWidget.subscribe('io.ok.error', this, this.errorMsg); - GlobalWidget.subscribe('io.ok2.error', this, this.errorMsg); - GlobalWidget.subscribe('io.error.invalid_sms_code', this, this.errorMsg); - GlobalWidget.subscribe('io.error.session_not_found', this, this.errorMsg); - GlobalWidget.subscribe('io.error.not_authorized', this, this.errorMsg); - GlobalWidget.subscribe('io.error.roster_not_found', this, this.errorMsg); - }, - subscribe: function (eventName, object, callback) { - this.events[eventName] = this.events[eventName] || []; - this.events[eventName].push({object: object, callback: callback}); - }, - unsubscribe: function (eventName, object, callback) { - if (this.events[eventName]) { - for (var i = 0; i < this.events[eventName].length; i++) { - if (this.events[eventName][i].object === object) { - this.events[eventName].splice(i, 1); - break; - } - } - } - }, - publish: function (eventName, data) { - if (this.events[eventName]) { - //@TODO: add support a few eventName by commas - this.events[eventName].forEach(function (instance) { - instance.callback(data); - }); - } - }, - getRosterId: function () { - return localStorage.getItem('rosterId'); - }, - setRosterId: function (res) { - if (typeof res.rosters[0].id != "undefined") { - localStorage.setItem('rosterId', res.rosters[0].id); - localStorage.setItem('roster', res.rosters[0]); - localStorage.setItem('rosterIndex', "0"); + // errors + GlobalWidget.subscribe('io.ok.error', this, this.errorMsg); + GlobalWidget.subscribe('io.ok2.error', this, this.errorMsg); + GlobalWidget.subscribe('io.error.invalid_sms_code', this, this.errorMsg); + GlobalWidget.subscribe('io.error.session_not_found', this, this.errorMsg); + GlobalWidget.subscribe('io.error.not_authorized', this, this.errorMsg); + GlobalWidget.subscribe('io.error.roster_not_found', this, this.errorMsg); + }, + subscribe(eventName, object, callback) { + this.events[eventName] = this.events[eventName] || []; + this.events[eventName].push({ object, callback }); + }, + unsubscribe(eventName, object, callback) { + if (this.events[eventName]) { + for (let i = 0; i < this.events[eventName].length; i++) { + if (this.events[eventName][i].object === object) { + this.events[eventName].splice(i, 1); + break; + } + } + } + }, + publish(eventName, data) { + if (this.events[eventName]) { + // @TODO: add support a few eventName by commas + this.events[eventName].forEach((instance) => { + instance.callback(data); + }); + } + }, + getRosterId() { + return localStorage.getItem('rosterId'); + }, + setRosterId(res) { + if (typeof res.rosters[0].id !== 'undefined') { + localStorage.setItem('rosterId', res.rosters[0].id); + localStorage.setItem('roster', res.rosters[0]); + localStorage.setItem('rosterIndex', '0'); - if (location.pathname != '/web/dashboard.htm' && res.rosters[0].status == 'patch') { - location.replace("/web/dashboard.htm"); - } - } - }, - getRosterIndex: function () { - return localStorage.getItem('rosterIndex'); - }, - setRosterIndex: function (ind) { - return localStorage.setItem('rosterIndex'); - }, - getPhoneNumber: function () { - return t.getPhoneCode().replace("+", "") + t.getPhone(); - }, - getPhoneNumberId: function () { - return t.getPhoneCode().replace("+", "") + t.getPhone() + '_' + t.getRosterId(); - }, - setPhoneCode: function (phoneCode) { - return localStorage.setItem('phoneCode', phoneCode); - }, - getPhoneCode: function () { - return localStorage.getItem('phoneCode'); - }, - getPhone: function () { - return localStorage.getItem('phone'); - }, - setPhone: function (phone) { - return localStorage.setItem('phone', phone); - }, - cleanPhone: function (phone) { - return phone.substr(0, phone.indexOf('_')); - }, - initNotify: function () { - Notify.Settings = {}; - }, - errorMsg: function (res) { - //@TODO: need to refactioring to msg - var msg = (typeof res.code != "undefined" && (typeof res.code.code != "undefined")) ? res.code.code : res; - Notify.Error(GlobalWidget.t(msg)); - }, - sucsessMsg: function (msg) { - Notify.Success(GlobalWidget.t(msg)); - }, - warningMsg: function (msg) { - Notify.Warning(GlobalWidget.t(msg)); - }, - convertUnixTime(unixtime) { - var u = new Date(unixtime); + if (location.pathname != '/web/dashboard.htm' && res.rosters[0].status == 'patch') { + location.replace('/web/dashboard.htm'); + } + } + }, + getRosterIndex() { + return localStorage.getItem('rosterIndex'); + }, + setRosterIndex(ind) { + return localStorage.setItem('rosterIndex'); + }, + getPhoneNumber() { + return t.getPhoneCode().replace('+', '') + t.getPhone(); + }, + getPhoneNumberId() { + return `${t.getPhoneCode().replace('+', '') + t.getPhone()}_${t.getRosterId()}`; + }, + setPhoneCode(phoneCode) { + return localStorage.setItem('phoneCode', phoneCode); + }, + getPhoneCode() { + return localStorage.getItem('phoneCode'); + }, + getPhone() { + return localStorage.getItem('phone'); + }, + setPhone(phone) { + return localStorage.setItem('phone', phone); + }, + cleanPhone(phone) { + return phone.substr(0, phone.indexOf('_')); + }, + initNotify() { + Notify.Settings = {}; + }, + errorMsg(res) { + // @TODO: need to refactioring to msg + const msg = (typeof res.code !== 'undefined' && (typeof res.code.code !== 'undefined')) ? res.code.code : res; + Notify.Error(GlobalWidget.t(msg)); + }, + sucsessMsg(msg) { + Notify.Success(GlobalWidget.t(msg)); + }, + warningMsg(msg) { + Notify.Warning(GlobalWidget.t(msg)); + }, + convertUnixTime(unixtime) { + const u = new Date(unixtime); - return u.getFullYear() + - '-' + ('0' + u.getMonth()).slice(-2) + - '-' + ('0' + u.getDate()).slice(-2) + - ' ' + ('0' + u.getHours()).slice(-2) + - ':' + ('0' + u.getMinutes()).slice(-2) + - ':' + ('0' + u.getSeconds()).slice(-2); - }, - t: function (msg, lang) { - var lang = lang | "en"; - //@TODO: add translation logic - return msg; - }, - messages: function (code, placeholders) { - var placeholders = placeholders || []; //@TODO: use in in the future + return `${u.getFullYear() + }-${(`0${u.getMonth()}`).slice(-2) + }-${(`0${u.getDate()}`).slice(-2) + } ${(`0${u.getHours()}`).slice(-2) + }:${(`0${u.getMinutes()}`).slice(-2) + }:${(`0${u.getSeconds()}`).slice(-2)}`; + }, + t(msg, lang) { + var lang = lang | 'en'; + // @TODO: add translation logic + return msg; + }, + messages(code, placeholders) { + var placeholders = placeholders || []; // @TODO: use in in the future - //@TODO: move to settings file e.g. JSON - var codes = { - 1100: "Profile was updated.", - 1101: "First name is needed so other people know with whom they are talking.", - 1102: "Sorry, this username is already taken.", - 1103: "Username should contain at least 2 symbols.", - 1104: "Sorry, this username is invalid." - }; + // @TODO: move to settings file e.g. JSON + const codes = { + 1100: 'Profile was updated.', + 1101: 'First name is needed so other people know with whom they are talking.', + 1102: 'Sorry, this username is already taken.', + 1103: 'Username should contain at least 2 symbols.', + 1104: 'Sorry, this username is invalid.' + }; - return (typeof codes[code] != "undefined") ? this.t(codes[code]) : this.t("Undefined error"); - }, - }; + return (typeof codes[code] !== 'undefined') ? this.t(codes[code]) : this.t('Undefined error'); + } + }; - GlobalWidget.init(); -}()); \ No newline at end of file + GlobalWidget.init(); +}()); diff --git a/src/assets/vendor/utils/handlers.js b/src/assets/vendor/utils/handlers.js index 1b8d4b620..e82a11976 100644 --- a/src/assets/vendor/utils/handlers.js +++ b/src/assets/vendor/utils/handlers.js @@ -6,59 +6,59 @@ * IO: Exceptions and Effects Protocol * @see https://github.com/NYNJA-MC/protocol/blob/master/v1/IO.md */ -var $io = {}; $io.on = function onio(r, cb) { - if (is(r, lenio(), 'io')) { - try { - var res = decio(r); - var e = 'io.' + res.code.tup; - - if (typeof res.code.code != 'undefined') { - e += '.' + res.code.code; - } else if (typeof res.data.tup != "undefined") { - //console.log(res.data); - if (res.data.tup == "Roster" && typeof res.data.status != "undefined") { - e += '.' + res.data.tup.toLowerCase() + '.' + res.data.status; - } - } - - console.log("Subscribe event: " + e); - //console.log(r); - //console.log(res); - - GlobalWidget.publish(e, res); - return { status: "ok" }; - } catch (e) { - console.log(e); - return { status: '' }; +const $io = {}; $io.on = function onio(r, cb) { + if (is(r, lenio(), 'io')) { + try { + const res = decio(r); + let e = `io.${res.code.tup}`; + + if (typeof res.code.code !== 'undefined') { + e += `.${res.code.code}`; + } else if (typeof res.data.tup !== 'undefined') { + // console.log(res.data); + if (res.data.tup == 'Roster' && typeof res.data.status !== 'undefined') { + e += `.${res.data.tup.toLowerCase()}.${res.data.status}`; } - } else return { status: '' }; + } + + console.log(`Subscribe event: ${e}`); + // console.log(r); + // console.log(res); + + GlobalWidget.publish(e, res); + return { status: 'ok' }; + } catch (e) { + console.log(e); + return { status: '' }; + } + } else return { status: '' }; }; /** * SERVER protocol for getting response from middleware * @type {{}} */ -var $server = {}; $server.on = function onserver(r, cb) { - if (is(r, 2, 'server')) { - console.log(r['v'][1]); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; -} +const $server = {}; $server.on = function onserver(r, cb) { + if (is(r, 2, 'server')) { + console.log(r.v[1]); + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; +}; /** * ROSTER: Managing Contact and Chat Lists * @see https://github.com/NYNJA-MC/protocol/blob/master/v1/ROSTER.md */ -var $roster = {}; $roster.on = function onroster(r, cb) { - if (is(r, lenRoster(), 'Roster')) { - var res = decRoster(r), - e = 'roster.' + res.status; +const $roster = {}; $roster.on = function onroster(r, cb) { + if (is(r, lenRoster(), 'Roster')) { + let res = decRoster(r), + e = `roster.${res.status}`; - console.log("Subscribe event: " + e); - GlobalWidget.publish(e, res); + console.log(`Subscribe event: ${e}`); + GlobalWidget.publish(e, res); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; }; /** @@ -78,104 +78,103 @@ var $roster = {}; $roster.on = function onroster(r, cb) { [],1507034024571,online,init} */ -var $profile = {}; $profile.on = function onprofile(r, cb) { - if (is(r, lenProfile(), 'Profile')) { - var res = decProfile(r), - e = 'profile.' + res.status; +const $profile = {}; $profile.on = function onprofile(r, cb) { + if (is(r, lenProfile(), 'Profile')) { + let res = decProfile(r), + e = `profile.${res.status}`; - console.log("Subscribe event: " + e); - //console.log(r); - //console.log(res); + console.log(`Subscribe event: ${e}`); + // console.log(r); + // console.log(res); - GlobalWidget.publish(e, res); + GlobalWidget.publish(e, res); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; }; /** * PERSON: External Settings * @see https://github.com/NYNJA-MC/protocol/blob/master/v1/PERSON.md */ -var $person = {}; $person.on = function onperson(r, cb) { - if (is(r, lenPerson(), 'Person')) { - - var res = decPerson(r), - e = 'person.' + res.status; +const $person = {}; $person.on = function onperson(r, cb) { + if (is(r, lenPerson(), 'Person')) { + let res = decPerson(r), + e = `person.${res.status}`; - console.log("Subscribe event: " + e); - //console.log(r); - //console.log(res); + console.log(`Subscribe event: ${e}`); + // console.log(r); + // console.log(res); - GlobalWidget.publish(e, res); + GlobalWidget.publish(e, res); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; }; /** * @see https://github.com/NYNJA-MC/protocol/blob/master/v1/ROSTER.md */ -var $contact = {}; $contact.on = function oncontact(r, cb) { - if (is(r, lenContact(), 'Contact')) { - var res = decContact(r), - e = 'contact.' + res.status; +const $contact = {}; $contact.on = function oncontact(r, cb) { + if (is(r, lenContact(), 'Contact')) { + let res = decContact(r), + e = `contact.${res.status}`; - console.log("Subscribe event: " + e); + console.log(`Subscribe event: ${e}`); - GlobalWidget.publish(e, res); + GlobalWidget.publish(e, res); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; }; /** * Friend * @type {{}} */ -var $friend = {}; $friend.on = function onfriend(r, cb) { - if (is(r, lenFriend(), 'Friend')) { - var res = decFriend(r), - e = 'friend.' + res.status; +const $friend = {}; $friend.on = function onfriend(r, cb) { + if (is(r, lenFriend(), 'Friend')) { + let res = decFriend(r), + e = `friend.${res.status}`; - console.log("Subscribe event: " + e); + console.log(`Subscribe event: ${e}`); - GlobalWidget.publish(e, res); + GlobalWidget.publish(e, res); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; }; /** * MESSAGE: Retrieve History * @see https://github.com/NYNJA-MC/protocol/blob/master/v1/MESSAGE.md */ -var $history = {}; $history.on = function onhistory(r, cb) { - if (is(r, lenHistory(), 'History')) { - var res = decHistory(r), - e = 'history.' + res.status; +const $history = {}; $history.on = function onhistory(r, cb) { + if (is(r, lenHistory(), 'History')) { + let res = decHistory(r), + e = `history.${res.status}`; - console.log("Subscribe event: " + e); + console.log(`Subscribe event: ${e}`); - GlobalWidget.publish(e, res); + GlobalWidget.publish(e, res); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; }; /** * MESSAGE: Sending and Receiving Messages * @see https://github.com/NYNJA-MC/protocol/blob/master/v1/MESSAGE.md */ -var $message = {}; $message.on = function onmessage(r, cb) { - if (is(r, lenMessage(), 'Message')) { - var res = decMessage(r), - e = 'message.' + res.status; +const $message = {}; $message.on = function onmessage(r, cb) { + if (is(r, lenMessage(), 'Message')) { + let res = decMessage(r), + e = `message.${res.status}`; - console.log("Subscribe event: " + e); + console.log(`Subscribe event: ${e}`); - GlobalWidget.publish(e, res); + GlobalWidget.publish(e, res); - if (typeof cb == 'function') cb(r); return { status: "ok" }; - } else return { status: '' }; -}; \ No newline at end of file + if (typeof cb === 'function') cb(r); return { status: 'ok' }; + } return { status: '' }; +}; diff --git a/src/assets/vendor/utils/json-bert-old.js b/src/assets/vendor/utils/json-bert-old.js index 2a63b44c1..eb0f12569 100644 --- a/src/assets/vendor/utils/json-bert-old.js +++ b/src/assets/vendor/utils/json-bert-old.js @@ -1,1019 +1,1169 @@ -function clean(r) { for(var k in r) if(!r[k]) delete r[k]; return r; } -function check_len(x) { try { return (eval('len'+utf8_dec(x.v[0].v))() == x.v.length) ? true : false } -catch (e) { return false; } } - -function scalar(data) { - var res = undefined; - switch (typeof data) { - case 'string': res = bin(data); break; case 'number': res = number(data); break; - default: console.log('Strange data: ' + data); } - return res; }; -function nil() { return {t: 106, v: undefined}; }; +function clean(r) { for (const k in r) if (!r[k]) delete r[k]; return r; } +function check_len(x) { + try { return (eval(`len${utf8_dec(x.v[0].v)}`)() == x.v.length); } catch (e) { return false; } +} + +function scalar(data) { + let res; + switch (typeof data) { + case 'string': res = bin(data); break; case 'number': res = number(data); break; + default: console.log(`Strange data: ${data}`); + } + return res; +} +function nil() { return { t: 106, v: undefined }; } function decode(x) { - if (typeof x == "undefined"){ //@TODO: need to add this condition to generator of models - return x; - } else if (x.t == 108) { - var r = []; x.v.forEach(function(y) { r.push(decode(y)) }); return r; - } else if (x.t == 109) { - return utf8_dec(x.v); - } else if (x.t == 104 && check_len(x)) { - return eval('dec'+x.v[0].v)(x); - } else if (x.t == 104) { - var r=[]; x.v.forEach(function(a){r.push(decode(a))}); - return Object.assign({tup:'$'}, r); - } else return x.v; + if (typeof x === 'undefined') { // @TODO: need to add this condition to generator of models + return x; + } else if (x.t == 108) { + var r = []; x.v.forEach((y) => { r.push(decode(y)); }); return r; + } else if (x.t == 109) { + return utf8_dec(x.v); + } else if (x.t == 104 && check_len(x)) { + return eval(`dec${x.v[0].v}`)(x); + } else if (x.t == 104) { + var r = []; x.v.forEach((a) => { r.push(decode(a)); }); + return Object.assign({ tup: '$' }, r); + } return x.v; } function encode(x) { - if (Array.isArray(x)) { - var r = []; x.forEach(function(y) { r.push(encode(y)) }); return {t:108,v:r}; - } else if (typeof x == 'object') { - switch (x.tup) { - case '$': delete x['tup']; var r=[]; - Object.keys(x).map(function(p){return x[p];}).forEach(function(a){r.push(encode(a))}); - return {t:104, v:r}; - default: return eval('enc'+x.tup)(x); } - } else return scalar(x); + if (Array.isArray(x)) { + var r = []; x.forEach((y) => { r.push(encode(y)); }); return { t: 108, v: r }; + } else if (typeof x === 'object') { + switch (x.tup) { + case '$': delete x.tup; var r = []; + Object.keys(x).map(p => x[p]).forEach((a) => { r.push(encode(a)); }); + return { t: 104, v: r }; + default: return eval(`enc${x.tup}`)(x); + } + } else return scalar(x); } function encwriter(d) { - var tup = atom('writer'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - var cache = 'cache' in d && d.cache ? encode(d.cache) : nil(); - var args = 'args' in d && d.args ? encode(d.args) : nil(); - var first = 'first' in d && d.first ? encode(d.first) : nil(); - return tuple(tup,id,count,cache,args,first); } + const tup = atom('writer'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + const cache = 'cache' in d && d.cache ? encode(d.cache) : nil(); + const args = 'args' in d && d.args ? encode(d.args) : nil(); + const first = 'first' in d && d.first ? encode(d.first) : nil(); + return tuple(tup, id, count, cache, args, first); +} function lenwriter() { return 6; } function decwriter(d) { - var r={}; r.tup = 'writer'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.count = d && d.v[2] ? d.v[2].v : undefined; - r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; - r.first = d && d.v[5] ? decode(d.v[5].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'writer'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.count = d && d.v[2] ? d.v[2].v : undefined; + r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; + r.first = d && d.v[5] ? decode(d.v[5].v) : undefined; + return clean(r); +} function encreader(d) { - var tup = atom('reader'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var pos = 'pos' in d && d.pos ? number(d.pos) : nil(); - var cache = 'cache' in d && d.cache ? number(d.cache) : nil(); - var args = 'args' in d && d.args ? encode(d.args) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); - return tuple(tup,id,pos,cache,args,feed,dir); } + const tup = atom('reader'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const pos = 'pos' in d && d.pos ? number(d.pos) : nil(); + const cache = 'cache' in d && d.cache ? number(d.cache) : nil(); + const args = 'args' in d && d.args ? encode(d.args) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); + return tuple(tup, id, pos, cache, args, feed, dir); +} function lenreader() { return 7; } function decreader(d) { - var r={}; r.tup = 'reader'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.pos = d && d.v[2] ? d.v[2].v : undefined; - r.cache = d && d.v[3] ? d.v[3].v : undefined; - r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; - r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.dir = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'reader'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.pos = d && d.v[2] ? d.v[2].v : undefined; + r.cache = d && d.v[3] ? d.v[3].v : undefined; + r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; + r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.dir = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function enccur(d) { - var tup = atom('cur'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var bot = 'bot' in d && d.bot ? number(d.bot) : nil(); - var dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); - var reader = 'reader' in d && d.reader ? encode(d.reader) : nil(); - var writer = 'writer' in d && d.writer ? encode(d.writer) : nil(); - var args = []; if ('args' in d && d.args) - { d.args.forEach(function(x){ - args.push(encode(x))}); - args={t:108,v:args}; } else { args = nil() }; - return tuple(tup,id,top,bot,dir,reader,writer,args); } + const tup = atom('cur'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const bot = 'bot' in d && d.bot ? number(d.bot) : nil(); + const dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); + const reader = 'reader' in d && d.reader ? encode(d.reader) : nil(); + const writer = 'writer' in d && d.writer ? encode(d.writer) : nil(); + let args = []; if ('args' in d && d.args) { + d.args.forEach((x) => { + args.push(encode(x)); + }); + args = { t: 108, v: args }; + } else { args = nil(); } + return tuple(tup, id, top, bot, dir, reader, writer, args); +} function lencur() { return 8; } function deccur(d) { - var r={}; r.tup = 'cur'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.bot = d && d.v[3] ? d.v[3].v : undefined; - r.dir = d && d.v[4] ? decode(d.v[4]) : undefined; - r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined; - r.args = []; - (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.args.push(decode(x))}) : - r.args = undefined; - return clean(r); } + const r = {}; r.tup = 'cur'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.bot = d && d.v[3] ? d.v[3].v : undefined; + r.dir = d && d.v[4] ? decode(d.v[4]) : undefined; + r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined; + r.args = []; + (d && d.v[7] && d.v[7].v) ? + d.v[7].v.forEach((x) => { r.args.push(decode(x)); }) : + r.args = undefined; + return clean(r); +} function enciter(d) { - var tup = atom('iter'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - return tuple(tup,id,container,feed,next,prev); } + const tup = atom('iter'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + return tuple(tup, id, container, feed, next, prev); +} function leniter() { return 6; } function deciter(d) { - var r={}; r.tup = 'iter'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.next = d && d.v[4] ? d.v[4].v : undefined; - r.prev = d && d.v[5] ? d.v[5].v : undefined; - return clean(r); } + const r = {}; r.tup = 'iter'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.next = d && d.v[4] ? d.v[4].v : undefined; + r.prev = d && d.v[5] ? d.v[5].v : undefined; + return clean(r); +} function enccontainer(d) { - var tup = atom('container'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('container'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lencontainer() { return 5; } function deccontainer(d) { - var r={}; r.tup = 'container'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'container'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function enciterator(d) { - var tup = atom('iterator'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - return tuple(tup,id,container,feed_id,prev,next,feeds); } + const tup = atom('iterator'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + return tuple(tup, id, container, feed_id, prev, next, feeds); +} function leniterator() { return 7; } function deciterator(d) { - var r={}; r.tup = 'iterator'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - return clean(r); } + const r = {}; r.tup = 'iterator'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + return clean(r); +} function enclog(d) { - var tup = atom('log'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('log'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lenlog() { return 5; } function declog(d) { - var r={}; r.tup = 'log'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'log'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function encoperation(d) { - var tup = atom('operation'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - return tuple(tup,id,container,feed_id,prev,next,feeds); } + const tup = atom('operation'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + return tuple(tup, id, container, feed_id, prev, next, feeds); +} function lenoperation() { return 7; } function decoperation(d) { - var r={}; r.tup = 'operation'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - return clean(r); } + const r = {}; r.tup = 'operation'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + return clean(r); +} function encerror(d) { - var tup = atom('error'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - return tuple(tup,code); } + const tup = atom('error'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + return tuple(tup, code); +} function lenerror() { return 2; } function decerror(d) { - var r={}; r.tup = 'error'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - return clean(r); } + const r = {}; r.tup = 'error'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + return clean(r); +} function encok(d) { - var tup = atom('ok'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - return tuple(tup,code); } + const tup = atom('ok'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + return tuple(tup, code); +} function lenok() { return 2; } function decok(d) { - var r={}; r.tup = 'ok'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - return clean(r); } + const r = {}; r.tup = 'ok'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + return clean(r); +} function encerror2(d) { - var tup = atom('error2'); - var code = 'code' in d && d.code ? atom(d.code) : nil(); - var src = 'src' in d && d.src ? encode(d.src) : nil(); - return tuple(tup,code,src); } + const tup = atom('error2'); + const code = 'code' in d && d.code ? atom(d.code) : nil(); + const src = 'src' in d && d.src ? encode(d.src) : nil(); + return tuple(tup, code, src); +} function lenerror2() { return 3; } function decerror2(d) { - var r={}; r.tup = 'error2'; - r.code = d && d.v[1] ? d.v[1].v : undefined; - r.src = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'error2'; + r.code = d && d.v[1] ? d.v[1].v : undefined; + r.src = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encok2(d) { - var tup = atom('ok2'); - var code = 'code' in d && d.code ? atom(d.code) : nil(); - var src = 'src' in d && d.src ? encode(d.src) : nil(); - return tuple(tup,code,src); } + const tup = atom('ok2'); + const code = 'code' in d && d.code ? atom(d.code) : nil(); + const src = 'src' in d && d.src ? encode(d.src) : nil(); + return tuple(tup, code, src); +} function lenok2() { return 3; } function decok2(d) { - var r={}; r.tup = 'ok2'; - r.code = d && d.v[1] ? d.v[1].v : undefined; - r.src = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'ok2'; + r.code = d && d.v[1] ? d.v[1].v : undefined; + r.src = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encio(d) { - var tup = atom('io'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - return tuple(tup,code,data); } + const tup = atom('io'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + return tuple(tup, code, data); +} function lenio() { return 3; } function decio(d) { - var r={}; r.tup = 'io'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - r.data = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'io'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + r.data = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encchain(d) { - var tup = atom('chain'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('chain'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lenchain() { return 5; } function decchain(d) { - var r={}; r.tup = 'chain'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'chain'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function encpush(d) { - var tup = atom('push'); - var model = 'model' in d && d.model ? bin(d.model) : nil(); - var type = 'type' in d && d.type ? bin(d.type) : nil(); - var title = 'title' in d && d.title ? bin(d.title) : nil(); - var alert = 'alert' in d && d.alert ? bin(d.alert) : nil(); - var badge = 'badge' in d && d.badge ? number(d.badge) : nil(); - var sound = 'sound' in d && d.sound ? bin(d.sound) : nil(); - return tuple(tup,model,type,title,alert,badge,sound); } + const tup = atom('push'); + const model = 'model' in d && d.model ? bin(d.model) : nil(); + const type = 'type' in d && d.type ? bin(d.type) : nil(); + const title = 'title' in d && d.title ? bin(d.title) : nil(); + const alert = 'alert' in d && d.alert ? bin(d.alert) : nil(); + const badge = 'badge' in d && d.badge ? number(d.badge) : nil(); + const sound = 'sound' in d && d.sound ? bin(d.sound) : nil(); + return tuple(tup, model, type, title, alert, badge, sound); +} function lenpush() { return 7; } function decpush(d) { - var r={}; r.tup = 'push'; - r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.badge = d && d.v[5] ? d.v[5].v : undefined; - r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'push'; + r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.badge = d && d.v[5] ? d.v[5].v : undefined; + r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + return clean(r); +} function encSearch(d) { - var tup = atom('Search'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var ref = 'ref' in d && d.ref ? bin(d.ref) : nil(); - var field = 'field' in d && d.field ? bin(d.field) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var value = 'value' in d && d.value ? encode(d.value) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,ref,field,type,value,status); } + const tup = atom('Search'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const ref = 'ref' in d && d.ref ? bin(d.ref) : nil(); + const field = 'field' in d && d.field ? bin(d.field) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const value = 'value' in d && d.value ? encode(d.value) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, ref, field, type, value, status); +} function lenSearch() { return 7; } function decSearch(d) { - var r={}; r.tup = 'Search'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.type = d && d.v[4] ? decode(d.v[4]) : undefined; - r.value = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.status = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Search'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.type = d && d.v[4] ? decode(d.v[4]) : undefined; + r.value = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.status = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function encp2p(d) { - var tup = atom('p2p'); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - return tuple(tup,from,to); } + const tup = atom('p2p'); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + return tuple(tup, from, to); +} function lenp2p() { return 3; } function decp2p(d) { - var r={}; r.tup = 'p2p'; - r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'p2p'; + r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + return clean(r); +} function encmuc(d) { - var tup = atom('muc'); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - return tuple(tup,name); } + const tup = atom('muc'); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + return tuple(tup, name); +} function lenmuc() { return 2; } function decmuc(d) { - var r={}; r.tup = 'muc'; - r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'muc'; + r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + return clean(r); +} function encCDR(d) { - var tup = atom('CDR'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - var start = 'start' in d && d.start ? number(d.start) : nil(); - var stop = 'stop' in d && d.stop ? number(d.stop) : nil(); - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); - var bill = 'bill' in d && d.bill ? number(d.bill) : nil(); - var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); - return tuple(tup,id,container,feed,next,prev,from,to,start,stop,type, - desc,bill,tariff); } + const tup = atom('CDR'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + const start = 'start' in d && d.start ? number(d.start) : nil(); + const stop = 'stop' in d && d.stop ? number(d.stop) : nil(); + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); + const bill = 'bill' in d && d.bill ? number(d.bill) : nil(); + const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); + return tuple( + tup, id, container, feed, next, prev, from, to, start, stop, type, + desc, bill, tariff + ); +} function lenCDR() { return 14; } function decCDR(d) { - var r={}; r.tup = 'CDR'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.next = d && d.v[4] ? d.v[4].v : undefined; - r.prev = d && d.v[5] ? d.v[5].v : undefined; - r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.start = d && d.v[8] ? d.v[8].v : undefined; - r.stop = d && d.v[9] ? d.v[9].v : undefined; - r.type = d && d.v[10] ? decode(d.v[10]) : undefined; - r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.bill = d && d.v[12] ? d.v[12].v : undefined; - r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'CDR'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.next = d && d.v[4] ? d.v[4].v : undefined; + r.prev = d && d.v[5] ? d.v[5].v : undefined; + r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.start = d && d.v[8] ? d.v[8].v : undefined; + r.stop = d && d.v[9] ? d.v[9].v : undefined; + r.type = d && d.v[10] ? decode(d.v[10]) : undefined; + r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.bill = d && d.v[12] ? d.v[12].v : undefined; + r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; + return clean(r); +} function encMember(d) { - var tup = atom('Member'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? encode(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var alias = 'alias' in d && d.alias ? bin(d.alias) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); - var reader = 'reader' in d && d.reader ? number(d.reader) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,feeds,phone_id,avatar,names,surnames, - alias,email,vox_id,reader,update,presence,status); } + const tup = atom('Member'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? encode(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const alias = 'alias' in d && d.alias ? bin(d.alias) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); + const reader = 'reader' in d && d.reader ? number(d.reader) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, feeds, phone_id, avatar, names, surnames, + alias, email, vox_id, reader, update, presence, status + ); +} function lenMember() { return 18; } function decMember(d) { - var r={}; r.tup = 'Member'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; - r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; - r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined; - r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; - r.reader = d && d.v[14] ? d.v[14].v : undefined; - r.update = d && d.v[15] ? d.v[15].v : undefined; - r.presence = d && d.v[16] ? decode(d.v[16]) : undefined; - r.status = d && d.v[17] ? decode(d.v[17]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Member'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; + r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; + r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined; + r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; + r.reader = d && d.v[14] ? d.v[14].v : undefined; + r.update = d && d.v[15] ? d.v[15].v : undefined; + r.presence = d && d.v[16] ? decode(d.v[16]) : undefined; + r.status = d && d.v[17] ? decode(d.v[17]) : undefined; + return clean(r); +} function encCursor(d) { - var tup = atom('Cursor'); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var position = 'position' in d && d.position ? number(d.position) : nil(); - return tuple(tup,feed,roster_id,position); } + const tup = atom('Cursor'); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const position = 'position' in d && d.position ? number(d.position) : nil(); + return tuple(tup, feed, roster_id, position); +} function lenCursor() { return 4; } function decCursor(d) { - var r={}; r.tup = 'Cursor'; - r.feed = d && d.v[1] ? decode(d.v[1]) : undefined; - r.roster_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.position = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'Cursor'; + r.feed = d && d.v[1] ? decode(d.v[1]) : undefined; + r.roster_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.position = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encPerson(d) { - var tup = atom('Person'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var phonelist = []; if ('phonelist' in d && d.phonelist) - { d.phonelist.forEach(function(x){ - phonelist.push(encode(x))}); - phonelist={t:108,v:phonelist}; } else { phonelist = nil() }; - var alias = []; if ('alias' in d && d.alias) - { d.alias.forEach(function(x){ - alias.push(encode(x))}); - alias={t:108,v:alias}; } else { alias = nil() }; - var localize = []; if ('localize' in d && d.localize) - { d.localize.forEach(function(x){ - localize.push(encode(x))}); - localize={t:108,v:localize}; } else { localize = nil() }; - var NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) - { d.NotificationSettings.forEach(function(x){ - NotificationSettings.push(encode(x))}); - NotificationSettings={t:108,v:NotificationSettings}; } else { NotificationSettings = nil() }; - var SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) - { d.SoundSettings.forEach(function(x){ - SoundSettings.push(encode(x))}); - SoundSettings={t:108,v:SoundSettings}; } else { SoundSettings = nil() }; - var ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil(); - var BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) - { d.BlockUsers.forEach(function(x){ - BlockUsers.push(encode(x))}); - BlockUsers={t:108,v:BlockUsers}; } else { BlockUsers = nil() }; - var balance = 'balance' in d && d.balance ? number(d.balance) : nil(); - var isParticipants = []; if ('isParticipants' in d && d.isParticipants) - { d.isParticipants.forEach(function(x){ - isParticipants.push(encode(x))}); - isParticipants={t:108,v:isParticipants}; } else { isParticipants = nil() }; - var status = 'status' in d && d.status ? encode(d.status) : nil(); - return tuple(tup,id,phonelist,alias,localize,NotificationSettings,SoundSettings,ThemeID,BlockUsers,balance,isParticipants,status); } + const tup = atom('Person'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + let phonelist = []; if ('phonelist' in d && d.phonelist) { + d.phonelist.forEach((x) => { + phonelist.push(encode(x)); + }); + phonelist = { t: 108, v: phonelist }; + } else { phonelist = nil(); } + let alias = []; if ('alias' in d && d.alias) { + d.alias.forEach((x) => { + alias.push(encode(x)); + }); + alias = { t: 108, v: alias }; + } else { alias = nil(); } + let localize = []; if ('localize' in d && d.localize) { + d.localize.forEach((x) => { + localize.push(encode(x)); + }); + localize = { t: 108, v: localize }; + } else { localize = nil(); } + let NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) { + d.NotificationSettings.forEach((x) => { + NotificationSettings.push(encode(x)); + }); + NotificationSettings = { t: 108, v: NotificationSettings }; + } else { NotificationSettings = nil(); } + let SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) { + d.SoundSettings.forEach((x) => { + SoundSettings.push(encode(x)); + }); + SoundSettings = { t: 108, v: SoundSettings }; + } else { SoundSettings = nil(); } + const ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil(); + let BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) { + d.BlockUsers.forEach((x) => { + BlockUsers.push(encode(x)); + }); + BlockUsers = { t: 108, v: BlockUsers }; + } else { BlockUsers = nil(); } + const balance = 'balance' in d && d.balance ? number(d.balance) : nil(); + let isParticipants = []; if ('isParticipants' in d && d.isParticipants) { + d.isParticipants.forEach((x) => { + isParticipants.push(encode(x)); + }); + isParticipants = { t: 108, v: isParticipants }; + } else { isParticipants = nil(); } + const status = 'status' in d && d.status ? encode(d.status) : nil(); + return tuple(tup, id, phonelist, alias, localize, NotificationSettings, SoundSettings, ThemeID, BlockUsers, balance, isParticipants, status); +} function lenPerson() { return 12; } function decPerson(d) { - var r={}; r.tup = 'Person'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.phonelist = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.phonelist.push(decode(x))}) : - r.phonelist = undefined; - r.alias = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.alias.push(decode(x))}) : - r.alias = undefined; - r.localize = []; - (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.localize.push(decode(x))}) : - r.localize = undefined; - r.NotificationSettings = []; - (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.NotificationSettings.push(decode(x))}) : - r.NotificationSettings = undefined; - r.SoundSettings = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.SoundSettings.push(decode(x))}) : - r.SoundSettings = undefined; - r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.BlockUsers = []; - (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.BlockUsers.push(decode(x))}) : - r.BlockUsers = undefined; - r.balance = d && d.v[9] ? d.v[9].v : undefined; - r.isParticipants = []; - (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.isParticipants.push(decode(x))}) : - r.isParticipants = undefined; - r.status = d && d.v[11] ? decode(d.v[11]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Person'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.phonelist = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.phonelist.push(decode(x)); }) : + r.phonelist = undefined; + r.alias = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.alias.push(decode(x)); }) : + r.alias = undefined; + r.localize = []; + (d && d.v[4] && d.v[4].v) ? + d.v[4].v.forEach((x) => { r.localize.push(decode(x)); }) : + r.localize = undefined; + r.NotificationSettings = []; + (d && d.v[5] && d.v[5].v) ? + d.v[5].v.forEach((x) => { r.NotificationSettings.push(decode(x)); }) : + r.NotificationSettings = undefined; + r.SoundSettings = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.SoundSettings.push(decode(x)); }) : + r.SoundSettings = undefined; + r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.BlockUsers = []; + (d && d.v[8] && d.v[8].v) ? + d.v[8].v.forEach((x) => { r.BlockUsers.push(decode(x)); }) : + r.BlockUsers = undefined; + r.balance = d && d.v[9] ? d.v[9].v : undefined; + r.isParticipants = []; + (d && d.v[10] && d.v[10].v) ? + d.v[10].v.forEach((x) => { r.isParticipants.push(decode(x)); }) : + r.isParticipants = undefined; + r.status = d && d.v[11] ? decode(d.v[11]) : undefined; + return clean(r); +} function encDesc(d) { - var tup = atom('Desc'); - var mime = 'mime' in d && d.mime ? bin(d.mime) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var size = 'size' in d && d.size ? number(d.size) : nil(); - var filename = 'filename' in d && d.filename ? bin(d.filename) : nil(); - var info = 'info' in d && d.info ? bin(d.info) : nil(); - return tuple(tup,mime,payload,size,filename,info); } + const tup = atom('Desc'); + const mime = 'mime' in d && d.mime ? bin(d.mime) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const size = 'size' in d && d.size ? number(d.size) : nil(); + const filename = 'filename' in d && d.filename ? bin(d.filename) : nil(); + const info = 'info' in d && d.info ? bin(d.info) : nil(); + return tuple(tup, mime, payload, size, filename, info); +} function lenDesc() { return 6; } function decDesc(d) { - var r={}; r.tup = 'Desc'; - r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.size = d && d.v[3] ? d.v[3].v : undefined; - r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Desc'; + r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.size = d && d.v[3] ? d.v[3].v : undefined; + r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + return clean(r); +} function encMessage(d) { - var tup = atom('Message'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - //var container = 'container' in d && d.container ? encode(d.container) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - var created = 'created' in d && d.created ? encode(d.created) : nil(); - var files = []; if ('files' in d && d.files) - { d.files.forEach(function(x){ - files.push(encode(x))}); - files={t:108,v:files}; } else { files = nil() }; - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,msg_id,from,to,created,files, - type,edit_msg,status); } + const tup = atom('Message'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + // var container = 'container' in d && d.container ? encode(d.container) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + const created = 'created' in d && d.created ? encode(d.created) : nil(); + let files = []; if ('files' in d && d.files) { + d.files.forEach((x) => { + files.push(encode(x)); + }); + files = { t: 108, v: files }; + } else { files = nil(); } + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, msg_id, from, to, created, files, + type, edit_msg, status + ); +} function lenMessage() { return 14; } function decMessage(d) { - var r={}; r.tup = 'Message'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; - r.created = d && d.v[9] ? decode(d.v[9]) : undefined; - r.files = []; - (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.files.push(decode(x))}) : - r.files = undefined; - r.type = d && d.v[11] ? decode(d.v[11]) : undefined; - r.edit_msg = d && d.v[12] ? d.v[12].v : undefined; - r.status = d && d.v[13] ? decode(d.v[13]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Message'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; + r.created = d && d.v[9] ? decode(d.v[9]) : undefined; + r.files = []; + (d && d.v[10] && d.v[10].v) ? + d.v[10].v.forEach((x) => { r.files.push(decode(x)); }) : + r.files = undefined; + r.type = d && d.v[11] ? decode(d.v[11]) : undefined; + r.edit_msg = d && d.v[12] ? d.v[12].v : undefined; + r.status = d && d.v[13] ? decode(d.v[13]) : undefined; + return clean(r); +} function encRoom(d) { - var tup = atom('Room'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var description = 'description' in d && d.description ? bin(d.description) : nil(); - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var members = []; if ('members' in d && d.members) - { d.members.forEach(function(x){ - members.push(encode(x))}); - members={t:108,v:members}; } else { members = nil() }; - var admins = []; if ('admins' in d && d.admins) - { d.admins.forEach(function(x){ - admins.push(encode(x))}); - admins={t:108,v:admins}; } else { admins = nil() }; - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var tos = 'tos' in d && d.tos ? bin(d.tos) : nil(); - var unread = 'unread' in d && d.unread ? number(d.unread) : nil(); - var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var created = 'created' in d && d.created ? number(d.created) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,name,description,settings,members,admins,data,type,tos,unread, - last_msg,update,created,status); } + const tup = atom('Room'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const description = 'description' in d && d.description ? bin(d.description) : nil(); + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + let members = []; if ('members' in d && d.members) { + d.members.forEach((x) => { + members.push(encode(x)); + }); + members = { t: 108, v: members }; + } else { members = nil(); } + let admins = []; if ('admins' in d && d.admins) { + d.admins.forEach((x) => { + admins.push(encode(x)); + }); + admins = { t: 108, v: admins }; + } else { admins = nil(); } + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const tos = 'tos' in d && d.tos ? bin(d.tos) : nil(); + const unread = 'unread' in d && d.unread ? number(d.unread) : nil(); + const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const created = 'created' in d && d.created ? number(d.created) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, name, description, settings, members, admins, data, type, tos, unread, + last_msg, update, created, status + ); +} function lenRoom() { return 15; } function decRoom(d) { - var r={}; r.tup = 'Room'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.settings = []; - (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) : - r.settings = undefined; - r.members = []; - (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.members.push(decode(x))}) : - r.members = undefined; - r.admins = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.admins.push(decode(x))}) : - r.admins = undefined; - r.data = []; - (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.data.push(decode(x))}) : - r.data = undefined; - r.type = d && d.v[8] ? decode(d.v[8]) : undefined; - r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; - r.unread = d && d.v[10] ? d.v[10].v : undefined; - r.last_msg = d && d.v[11] ? decode(d.v[11]) : undefined; - r.update = d && d.v[12] ? d.v[12].v : undefined; - r.created = d && d.v[13] ? d.v[13].v : undefined; - r.status = d && d.v[14] ? decode(d.v[14]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Room'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.settings = []; + (d && d.v[4] && d.v[4].v) ? + d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) : + r.settings = undefined; + r.members = []; + (d && d.v[5] && d.v[5].v) ? + d.v[5].v.forEach((x) => { r.members.push(decode(x)); }) : + r.members = undefined; + r.admins = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.admins.push(decode(x)); }) : + r.admins = undefined; + r.data = []; + (d && d.v[7] && d.v[7].v) ? + d.v[7].v.forEach((x) => { r.data.push(decode(x)); }) : + r.data = undefined; + r.type = d && d.v[8] ? decode(d.v[8]) : undefined; + r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; + r.unread = d && d.v[10] ? d.v[10].v : undefined; + r.last_msg = d && d.v[11] ? decode(d.v[11]) : undefined; + r.update = d && d.v[12] ? d.v[12].v : undefined; + r.created = d && d.v[13] ? d.v[13].v : undefined; + r.status = d && d.v[14] ? decode(d.v[14]) : undefined; + return clean(r); +} function encTag(d) { - var tup = atom('Tag'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var color = 'color' in d && d.color ? bin(d.color) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,name,color,status); } + const tup = atom('Tag'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const color = 'color' in d && d.color ? bin(d.color) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, name, color, status); +} function lenTag() { return 5; } function decTag(d) { - var r={}; r.tup = 'Tag'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.status = d && d.v[4] ? decode(d.v[4]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Tag'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.status = d && d.v[4] ? decode(d.v[4]) : undefined; + return clean(r); +} function encStar(d) { - var tup = atom('Star'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var message = 'message' in d && d.message ? encode(d.message) : nil(); - var tags = []; if ('tags' in d && d.tags) - { d.tags.forEach(function(x){ - tags.push(encode(x))}); - tags={t:108,v:tags}; } else { tags = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,message,tags,status); } + const tup = atom('Star'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const message = 'message' in d && d.message ? encode(d.message) : nil(); + let tags = []; if ('tags' in d && d.tags) { + d.tags.forEach((x) => { + tags.push(encode(x)); + }); + tags = { t: 108, v: tags }; + } else { tags = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, message, tags, status); +} function lenStar() { return 5; } function decStar(d) { - var r={}; r.tup = 'Star'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.message = d && d.v[2] ? decode(d.v[2]) : undefined; - r.tags = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.tags.push(decode(x))}) : - r.tags = undefined; - r.status = d && d.v[4] ? decode(d.v[4]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Star'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.message = d && d.v[2] ? decode(d.v[2]) : undefined; + r.tags = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.tags.push(decode(x)); }) : + r.tags = undefined; + r.status = d && d.v[4] ? decode(d.v[4]) : undefined; + return clean(r); +} function encHistory(d) { - var tup = atom('History'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var contact_id = 'contact_id' in d && d.contact_id ? bin(d.contact_id) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var size = 'size' in d && d.size ? number(d.size) : nil(); - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,contact_id,feed,size,data,status); } + const tup = atom('History'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const contact_id = 'contact_id' in d && d.contact_id ? bin(d.contact_id) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const size = 'size' in d && d.size ? number(d.size) : nil(); + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, contact_id, feed, size, data, status); +} function lenHistory() { return 7; } function decHistory(d) { - var r={}; r.tup = 'History'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.contact_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.feed = d && d.v[3] ? decode(d.v[3]) : undefined; - r.size = d && d.v[4] ? d.v[4].v : undefined; - r.data = []; - (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.data.push(decode(x))}) : - r.data = undefined; - r.status = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'History'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.contact_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.feed = d && d.v[3] ? decode(d.v[3]) : undefined; + r.size = d && d.v[4] ? d.v[4].v : undefined; + r.data = []; + (d && d.v[5] && d.v[5].v) ? + d.v[5].v.forEach((x) => { r.data.push(decode(x)); }) : + r.data = undefined; + r.status = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function encTyping(d) { - var tup = atom('Typing'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var comments = 'comments' in d && d.comments ? encode(d.comments) : nil(); - return tuple(tup,phone_id,comments); } + const tup = atom('Typing'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const comments = 'comments' in d && d.comments ? encode(d.comments) : nil(); + return tuple(tup, phone_id, comments); +} function lenTyping() { return 3; } function decTyping(d) { - var r={}; r.tup = 'Typing'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Typing'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined; + return clean(r); +} function encContact(d) { - var tup = atom('Contact'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); - var reader = 'reader' in d && d.reader ? number(d.reader) : nil(); - var unread = 'unread' in d && d.unread ? number(d.unread) : nil(); - var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone_id,avatar,names,surnames,nick,email,vox_id,reader,unread,last_msg, - update,presence,status); } + const tup = atom('Contact'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); + const reader = 'reader' in d && d.reader ? number(d.reader) : nil(); + const unread = 'unread' in d && d.unread ? number(d.unread) : nil(); + const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, phone_id, avatar, names, surnames, nick, email, vox_id, reader, unread, last_msg, + update, presence, status + ); +} function lenContact() { return 14; } function decContact(d) { - var r={}; r.tup = 'Contact'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.reader = d && d.v[8] ? d.v[8].v : undefined; - r.unread = d && d.v[9] ? d.v[9].v : undefined; - r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined; - r.update = d && d.v[11] ? d.v[11].v : undefined; - r.presence = d && d.v[12] ? d.v[12].v : undefined; - r.status = d && d.v[13] ? decode(d.v[13]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Contact'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.reader = d && d.v[8] ? d.v[8].v : undefined; + r.unread = d && d.v[9] ? d.v[9].v : undefined; + r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined; + r.update = d && d.v[11] ? d.v[11].v : undefined; + r.presence = d && d.v[12] ? d.v[12].v : undefined; + r.status = d && d.v[13] ? decode(d.v[13]) : undefined; + return clean(r); +} function encAuth(d) { - var tup = atom('Auth'); - var client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil(); - var dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil(); - var user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil(); - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var token = 'token' in d && d.token ? bin(d.token) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil(); - var attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil(); - var services = []; if ('services' in d && d.services) - { d.services.forEach(function(x){ - services.push(encode(x))}); - services={t:108,v:services}; } else { services = nil() }; - var push = 'push' in d && d.push ? bin(d.push) : nil(); - var os = 'os' in d && d.os ? encode(d.os) : nil(); - var created = 'created' in d && d.created ? encode(d.created) : nil(); - var last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil(); - return tuple(tup,client_id,dev_key,user_id,phone,token,type,sms_code,attempts,services,push, - os,created,last_online); } + const tup = atom('Auth'); + const client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil(); + const dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil(); + const user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil(); + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + const token = 'token' in d && d.token ? bin(d.token) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil(); + const attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil(); + let services = []; if ('services' in d && d.services) { + d.services.forEach((x) => { + services.push(encode(x)); + }); + services = { t: 108, v: services }; + } else { services = nil(); } + const push = 'push' in d && d.push ? bin(d.push) : nil(); + const os = 'os' in d && d.os ? encode(d.os) : nil(); + const created = 'created' in d && d.created ? encode(d.created) : nil(); + const last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil(); + return tuple( + tup, client_id, dev_key, user_id, phone, token, type, sms_code, attempts, services, push, + os, created, last_online + ); +} function lenAuth() { return 14; } function decAuth(d) { - var r={}; r.tup = 'Auth'; - r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.type = d && d.v[6] ? d.v[6].v : undefined; - r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.attempts = d && d.v[8] ? d.v[8].v : undefined; - r.services = []; - (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.services.push(decode(x))}) : - r.services = undefined; - r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.os = d && d.v[11] ? decode(d.v[11]) : undefined; - r.created = d && d.v[12] ? decode(d.v[12]) : undefined; - r.last_online = d && d.v[13] ? d.v[13].v : undefined; - return clean(r); } + const r = {}; r.tup = 'Auth'; + r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.type = d && d.v[6] ? d.v[6].v : undefined; + r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.attempts = d && d.v[8] ? d.v[8].v : undefined; + r.services = []; + (d && d.v[9] && d.v[9].v) ? + d.v[9].v.forEach((x) => { r.services.push(decode(x)); }) : + r.services = undefined; + r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.os = d && d.v[11] ? decode(d.v[11]) : undefined; + r.created = d && d.v[12] ? decode(d.v[12]) : undefined; + r.last_online = d && d.v[13] ? d.v[13].v : undefined; + return clean(r); +} function encService(d) { - var tup = atom('Service'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - var login = 'login' in d && d.login ? bin(d.login) : nil(); - var password = 'password' in d && d.password ? bin(d.password) : nil(); - var expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,type,data,login,password,expiration,status); } + const tup = atom('Service'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + const login = 'login' in d && d.login ? bin(d.login) : nil(); + const password = 'password' in d && d.password ? bin(d.password) : nil(); + const expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, type, data, login, password, expiration, status); +} function lenService() { return 8; } function decService(d) { - var r={}; r.tup = 'Service'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.type = d && d.v[2] ? decode(d.v[2]) : undefined; - r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.expiration = d && d.v[6] ? d.v[6].v : undefined; - r.status = d && d.v[7] ? decode(d.v[7]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Service'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.type = d && d.v[2] ? decode(d.v[2]) : undefined; + r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.expiration = d && d.v[6] ? d.v[6].v : undefined; + r.status = d && d.v[7] ? decode(d.v[7]) : undefined; + return clean(r); +} function encRoster(d) { - var tup = atom('Roster'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); - var userlist = []; if ('userlist' in d && d.userlist) - { d.userlist.forEach(function(x){ - userlist.push(encode(x))}); - userlist={t:108,v:userlist}; } else { userlist = nil() }; - var roomlist = []; if ('roomlist' in d && d.roomlist) - { d.roomlist.forEach(function(x){ - roomlist.push(encode(x))}); - roomlist={t:108,v:roomlist}; } else { roomlist = nil() }; - var favorite = []; if ('favorite' in d && d.favorite) - { d.favorite.forEach(function(x){ - favorite.push(encode(x))}); - favorite={t:108,v:favorite}; } else { favorite = nil() }; - var tags = []; if ('tags' in d && d.tags) - { d.tags.forEach(function(x){ - tags.push(encode(x))}); - tags={t:108,v:tags}; } else { tags = nil() }; - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,names,surnames,email,nick,userlist,roomlist,favorite,tags,phone, - avatar,update,status); } + const tup = atom('Roster'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); + let userlist = []; if ('userlist' in d && d.userlist) { + d.userlist.forEach((x) => { + userlist.push(encode(x)); + }); + userlist = { t: 108, v: userlist }; + } else { userlist = nil(); } + let roomlist = []; if ('roomlist' in d && d.roomlist) { + d.roomlist.forEach((x) => { + roomlist.push(encode(x)); + }); + roomlist = { t: 108, v: roomlist }; + } else { roomlist = nil(); } + let favorite = []; if ('favorite' in d && d.favorite) { + d.favorite.forEach((x) => { + favorite.push(encode(x)); + }); + favorite = { t: 108, v: favorite }; + } else { favorite = nil(); } + let tags = []; if ('tags' in d && d.tags) { + d.tags.forEach((x) => { + tags.push(encode(x)); + }); + tags = { t: 108, v: tags }; + } else { tags = nil(); } + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, names, surnames, email, nick, userlist, roomlist, favorite, tags, phone, + avatar, update, status + ); +} function lenRoster() { return 14; } function decRoster(d) { - var r={}; r.tup = 'Roster'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.userlist = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.userlist.push(decode(x))}) : - r.userlist = undefined; - r.roomlist = []; - (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.roomlist.push(decode(x))}) : - r.roomlist = undefined; - r.favorite = []; - (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.favorite.push(decode(x))}) : - r.favorite = undefined; - r.tags = []; - (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.tags.push(decode(x))}) : - r.tags = undefined; - r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.update = d && d.v[12] ? d.v[12].v : undefined; - r.status = d && d.v[13] ? decode(d.v[13]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Roster'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.userlist = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.userlist.push(decode(x)); }) : + r.userlist = undefined; + r.roomlist = []; + (d && d.v[7] && d.v[7].v) ? + d.v[7].v.forEach((x) => { r.roomlist.push(decode(x)); }) : + r.roomlist = undefined; + r.favorite = []; + (d && d.v[8] && d.v[8].v) ? + d.v[8].v.forEach((x) => { r.favorite.push(decode(x)); }) : + r.favorite = undefined; + r.tags = []; + (d && d.v[9] && d.v[9].v) ? + d.v[9].v.forEach((x) => { r.tags.push(decode(x)); }) : + r.tags = undefined; + r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.update = d && d.v[12] ? d.v[12].v : undefined; + r.status = d && d.v[13] ? decode(d.v[13]) : undefined; + return clean(r); +} function encFeature(d) { - var tup = atom('Feature'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var key = 'key' in d && d.key ? bin(d.key) : nil(); - var value = 'value' in d && d.value ? bin(d.value) : nil(); - var group = 'group' in d && d.group ? bin(d.group) : nil(); - return tuple(tup,id,key,value,group); } + const tup = atom('Feature'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const key = 'key' in d && d.key ? bin(d.key) : nil(); + const value = 'value' in d && d.value ? bin(d.value) : nil(); + const group = 'group' in d && d.group ? bin(d.group) : nil(); + return tuple(tup, id, key, value, group); +} function lenFeature() { return 5; } function decFeature(d) { - var r={}; r.tup = 'Feature'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Feature'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + return clean(r); +} function encProfile(d) { - var tup = atom('Profile'); - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var services = []; if ('services' in d && d.services) - { d.services.forEach(function(x){ - services.push(encode(x))}); - services={t:108,v:services}; } else { services = nil() }; - var rosters = []; if ('rosters' in d && d.rosters) - { d.rosters.forEach(function(x){ - rosters.push(encode(x))}); - rosters={t:108,v:rosters}; } else { rosters = nil() }; - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var update = 'update' in d && d.update ? number(d.update) : nil(); - var balance = 'balance' in d && d.balance ? number(d.balance) : nil(); - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone,services,rosters,settings,update,balance,presence,status); } + const tup = atom('Profile'); + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + let services = []; if ('services' in d && d.services) { + d.services.forEach((x) => { + services.push(encode(x)); + }); + services = { t: 108, v: services }; + } else { services = nil(); } + let rosters = []; if ('rosters' in d && d.rosters) { + d.rosters.forEach((x) => { + rosters.push(encode(x)); + }); + rosters = { t: 108, v: rosters }; + } else { rosters = nil(); } + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + const update = 'update' in d && d.update ? number(d.update) : nil(); + const balance = 'balance' in d && d.balance ? number(d.balance) : nil(); + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, phone, services, rosters, settings, update, balance, presence, status); +} function lenProfile() { return 9; } function decProfile(d) { - var r={}; r.tup = 'Profile'; - r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.services = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.services.push(decode(x))}) : - r.services = undefined; - r.rosters = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.rosters.push(decode(x))}) : - r.rosters = undefined; - r.settings = []; - (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) : - r.settings = undefined; - r.update = d && d.v[5] ? d.v[5].v : undefined; - r.balance = d && d.v[6] ? d.v[6].v : undefined; - r.presence = d && d.v[7] ? d.v[7].v : undefined; - r.status = d && d.v[8] ? d.v[8].v : undefined; - return clean(r); } + const r = {}; r.tup = 'Profile'; + r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.services = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.services.push(decode(x)); }) : + r.services = undefined; + r.rosters = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.rosters.push(decode(x)); }) : + r.rosters = undefined; + r.settings = []; + (d && d.v[4] && d.v[4].v) ? + d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) : + r.settings = undefined; + r.update = d && d.v[5] ? d.v[5].v : undefined; + r.balance = d && d.v[6] ? d.v[6].v : undefined; + r.presence = d && d.v[7] ? d.v[7].v : undefined; + r.status = d && d.v[8] ? d.v[8].v : undefined; + return clean(r); +} function encLoc(d) { - var tup = atom('Loc'); - var x = 'x' in d && d.x ? bin(d.x) : nil(); - var y = 'y' in d && d.y ? bin(d.y) : nil(); - var z = 'z' in d && d.z ? bin(d.z) : nil(); - return tuple(tup,x,y,z); } + const tup = atom('Loc'); + const x = 'x' in d && d.x ? bin(d.x) : nil(); + const y = 'y' in d && d.y ? bin(d.y) : nil(); + const z = 'z' in d && d.z ? bin(d.z) : nil(); + return tuple(tup, x, y, z); +} function lenLoc() { return 4; } function decLoc(d) { - var r={}; r.tup = 'Loc'; - r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Loc'; + r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + return clean(r); +} function encFriend(d) { - var tup = atom('Friend'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone_id,friend_id,status); } + const tup = atom('Friend'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, phone_id, friend_id, status); +} function lenFriend() { return 4; } function decFriend(d) { - var r={}; r.tup = 'Friend'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.status = d && d.v[3] ? decode(d.v[3]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Friend'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.status = d && d.v[3] ? decode(d.v[3]) : undefined; + return clean(r); +} function encIndex(d) { - var tup = atom('Index'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var roster = []; if ('roster' in d && d.roster) - { d.roster.forEach(function(x){ - roster.push(encode(x))}); - roster={t:108,v:roster}; } else { roster = nil() }; - return tuple(tup,id,roster); } + const tup = atom('Index'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + let roster = []; if ('roster' in d && d.roster) { + d.roster.forEach((x) => { + roster.push(encode(x)); + }); + roster = { t: 108, v: roster }; + } else { roster = nil(); } + return tuple(tup, id, roster); +} function lenIndex() { return 3; } function decIndex(d) { - var r={}; r.tup = 'Index'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.roster = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.roster.push(decode(x))}) : - r.roster = undefined; - return clean(r); } + const r = {}; r.tup = 'Index'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.roster = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.roster.push(decode(x)); }) : + r.roster = undefined; + return clean(r); +} function encTest(d) { - var tup = atom('Test'); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,type,count); } + const tup = atom('Test'); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, type, count); +} function lenTest() { return 3; } function decTest(d) { - var r={}; r.tup = 'Test'; - r.type = d && d.v[1] ? decode(d.v[1]) : undefined; - r.count = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'Test'; + r.type = d && d.v[1] ? decode(d.v[1]) : undefined; + r.count = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} diff --git a/src/assets/vendor/utils/json-bert-test.js b/src/assets/vendor/utils/json-bert-test.js index cd30810dc..64389f6e4 100644 --- a/src/assets/vendor/utils/json-bert-test.js +++ b/src/assets/vendor/utils/json-bert-test.js @@ -1,28 +1,28 @@ function check() { - var res = true; - //@TODO: MORE TEST DATA - testData = [ - 1, - [1, 2, 3], - "string", - {tup: 'io', code: 'login', data: {tup: '$', 0: 'Auth', 1: 12}}, - {tup: 'io', code: 'login', data: {tup: 'Auth'}}, - {tup: 'io', code: 'login', data: {tup: '$', 0: 'пизда', 1: 12}}, - {tup: 'Roster', userlist: [{tup: 'Contact'}], status: 'get'}, - {tup: 'p2p', from: 'хуй', to: 'пизда'}, - {tup: 'Profile', accounts: [1], status: 'maxim'} - ]; - testData.forEach(function (o) { - var o = JSON.stringify(o); - var d = JSON.stringify(decode(dec(enc(encode(o)).buffer))).replace(/\\/g, ''); + let res = true; + // @TODO: MORE TEST DATA + testData = [ + 1, + [1, 2, 3], + 'string', + { tup: 'io', code: 'login', data: { tup: '$', 0: 'Auth', 1: 12 } }, + { tup: 'io', code: 'login', data: { tup: 'Auth' } }, + { tup: 'io', code: 'login', data: { tup: '$', 0: 'пизда', 1: 12 } }, + { tup: 'Roster', userlist: [{ tup: 'Contact' }], status: 'get' }, + { tup: 'p2p', from: 'хуй', to: 'пизда' }, + { tup: 'Profile', accounts: [1], status: 'maxim' } + ]; + testData.forEach((o) => { + var o = JSON.stringify(o); + const d = JSON.stringify(decode(dec(enc(encode(o)).buffer))).replace(/\\/g, ''); - if (JSON.stringify(o) != JSON.stringify(decode(dec(enc(encode(o)).buffer)))) { - console.log("Original: " + o + " <=> Decode: " + d + " %c [Error]", "color: red"); - res = false; - } else { - console.log("Data: " + o + " %c [OK]", "color: green"); - } - }); + if (JSON.stringify(o) != JSON.stringify(decode(dec(enc(encode(o)).buffer)))) { + console.log(`Original: ${o} <=> Decode: ${d} %c [Error]`, 'color: red'); + res = false; + } else { + console.log(`Data: ${o} %c [OK]`, 'color: green'); + } + }); - return res; + return res; } diff --git a/src/assets/vendor/utils/json-bert.js b/src/assets/vendor/utils/json-bert.js index 14edf5e13..158a1325f 100644 --- a/src/assets/vendor/utils/json-bert.js +++ b/src/assets/vendor/utils/json-bert.js @@ -1,1521 +1,1749 @@ -function clean(r) { for(var k in r) if(!r[k]) delete r[k]; return r; } -function check_len(x) { try { return (eval('len'+utf8_dec(x.v[0].v))() == x.v.length) ? true : false } - catch (e) { return false; } } - -function scalar(data) { - var res = undefined; - switch (typeof data) { - case 'string': res = bin(data); break; case 'number': res = number(data); break; - default: console.log('Strange data: ' + data); } - return res; }; -function nil() { return {t: 106, v: undefined}; }; +function clean(r) { for (const k in r) if (!r[k]) delete r[k]; return r; } +function check_len(x) { + try { return (eval(`len${utf8_dec(x.v[0].v)}`)() == x.v.length); } catch (e) { return false; } +} + +function scalar(data) { + let res; + switch (typeof data) { + case 'string': res = bin(data); break; case 'number': res = number(data); break; + default: console.log(`Strange data: ${data}`); + } + return res; +} +function nil() { return { t: 106, v: undefined }; } function decode(x) { - if (x == undefined) { - return []; - } else if (x.t == 108) { - var r = []; x.v.forEach(function(y) { r.push(decode(y)) }); return r; - } else if (x.t == 109) { - return utf8_dec(x.v); - } else if (x.t == 104 && check_len(x)) { - return eval('dec'+x.v[0].v)(x); - } else if (x.t == 104) { - var r=[]; x.v.forEach(function(a){r.push(decode(a))}); - return Object.assign({tup:'$'}, r); - } else return x.v; + if (x == undefined) { + return []; + } else if (x.t == 108) { + var r = []; x.v.forEach((y) => { r.push(decode(y)); }); return r; + } else if (x.t == 109) { + return utf8_dec(x.v); + } else if (x.t == 104 && check_len(x)) { + return eval(`dec${x.v[0].v}`)(x); + } else if (x.t == 104) { + var r = []; x.v.forEach((a) => { r.push(decode(a)); }); + return Object.assign({ tup: '$' }, r); + } return x.v; } function encode(x) { - if (Array.isArray(x)) { - var r = []; x.forEach(function(y) { r.push(encode(y)) }); return {t:108,v:r}; - } else if (typeof x == 'object') { - switch (x.tup) { - case '$': delete x['tup']; var r=[]; - Object.keys(x).map(function(p){return x[p];}).forEach(function(a){r.push(encode(a))}); - return {t:104, v:r}; - default: return eval('enc'+x.tup)(x); } - } else return scalar(x); + if (Array.isArray(x)) { + var r = []; x.forEach((y) => { r.push(encode(y)); }); return { t: 108, v: r }; + } else if (typeof x === 'object') { + switch (x.tup) { + case '$': delete x.tup; var r = []; + Object.keys(x).map(p => x[p]).forEach((a) => { r.push(encode(a)); }); + return { t: 104, v: r }; + default: return eval(`enc${x.tup}`)(x); + } + } else return scalar(x); } function encwriter(d) { - var tup = atom('writer'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - var cache = 'cache' in d && d.cache ? encode(d.cache) : nil(); - var args = 'args' in d && d.args ? encode(d.args) : nil(); - var first = 'first' in d && d.first ? encode(d.first) : nil(); - return tuple(tup,id,count,cache,args,first); } + const tup = atom('writer'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + const cache = 'cache' in d && d.cache ? encode(d.cache) : nil(); + const args = 'args' in d && d.args ? encode(d.args) : nil(); + const first = 'first' in d && d.first ? encode(d.first) : nil(); + return tuple(tup, id, count, cache, args, first); +} function lenwriter() { return 6; } function decwriter(d) { - var r={}; r.tup = 'writer'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.count = d && d.v[2] ? d.v[2].v : undefined; - r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; - r.first = d && d.v[5] ? decode(d.v[5].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'writer'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.count = d && d.v[2] ? d.v[2].v : undefined; + r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; + r.first = d && d.v[5] ? decode(d.v[5].v) : undefined; + return clean(r); +} function encreader(d) { - var tup = atom('reader'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var pos = 'pos' in d && d.pos ? number(d.pos) : nil(); - var cache = 'cache' in d && d.cache ? number(d.cache) : nil(); - var args = 'args' in d && d.args ? encode(d.args) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); - return tuple(tup,id,pos,cache,args,feed,dir); } + const tup = atom('reader'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const pos = 'pos' in d && d.pos ? number(d.pos) : nil(); + const cache = 'cache' in d && d.cache ? number(d.cache) : nil(); + const args = 'args' in d && d.args ? encode(d.args) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); + return tuple(tup, id, pos, cache, args, feed, dir); +} function lenreader() { return 7; } function decreader(d) { - var r={}; r.tup = 'reader'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.pos = d && d.v[2] ? d.v[2].v : undefined; - r.cache = d && d.v[3] ? d.v[3].v : undefined; - r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; - r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.dir = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'reader'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.pos = d && d.v[2] ? d.v[2].v : undefined; + r.cache = d && d.v[3] ? d.v[3].v : undefined; + r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; + r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.dir = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function enccur(d) { - var tup = atom('cur'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var bot = 'bot' in d && d.bot ? number(d.bot) : nil(); - var dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); - var reader = 'reader' in d && d.reader ? encode(d.reader) : nil(); - var writer = 'writer' in d && d.writer ? encode(d.writer) : nil(); - var args = []; if ('args' in d && d.args) - { d.args.forEach(function(x){ - args.push(encode(x))}); - args={t:108,v:args}; } else { args = nil() }; - return tuple(tup,id,top,bot,dir,reader,writer,args); } + const tup = atom('cur'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const bot = 'bot' in d && d.bot ? number(d.bot) : nil(); + const dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); + const reader = 'reader' in d && d.reader ? encode(d.reader) : nil(); + const writer = 'writer' in d && d.writer ? encode(d.writer) : nil(); + let args = []; if ('args' in d && d.args) { + d.args.forEach((x) => { + args.push(encode(x)); + }); + args = { t: 108, v: args }; + } else { args = nil(); } + return tuple(tup, id, top, bot, dir, reader, writer, args); +} function lencur() { return 8; } function deccur(d) { - var r={}; r.tup = 'cur'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.bot = d && d.v[3] ? d.v[3].v : undefined; - r.dir = d && d.v[4] ? decode(d.v[4]) : undefined; - r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined; - r.args = []; + const r = {}; r.tup = 'cur'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.bot = d && d.v[3] ? d.v[3].v : undefined; + r.dir = d && d.v[4] ? decode(d.v[4]) : undefined; + r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined; + r.args = []; (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.args.push(decode(x))}) : + d.v[7].v.forEach((x) => { r.args.push(decode(x)); }) : r.args = undefined; - return clean(r); } + return clean(r); +} function enciter(d) { - var tup = atom('iter'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - return tuple(tup,id,container,feed,next,prev); } + const tup = atom('iter'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + return tuple(tup, id, container, feed, next, prev); +} function leniter() { return 6; } function deciter(d) { - var r={}; r.tup = 'iter'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.next = d && d.v[4] ? d.v[4].v : undefined; - r.prev = d && d.v[5] ? d.v[5].v : undefined; - return clean(r); } + const r = {}; r.tup = 'iter'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.next = d && d.v[4] ? d.v[4].v : undefined; + r.prev = d && d.v[5] ? d.v[5].v : undefined; + return clean(r); +} function enccontainer(d) { - var tup = atom('container'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('container'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lencontainer() { return 5; } function deccontainer(d) { - var r={}; r.tup = 'container'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'container'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function enciterator(d) { - var tup = atom('iterator'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - return tuple(tup,id,container,feed_id,prev,next,feeds); } + const tup = atom('iterator'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + return tuple(tup, id, container, feed_id, prev, next, feeds); +} function leniterator() { return 7; } function deciterator(d) { - var r={}; r.tup = 'iterator'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; + const r = {}; r.tup = 'iterator'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : r.feeds = undefined; - return clean(r); } + return clean(r); +} function enclog(d) { - var tup = atom('log'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('log'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lenlog() { return 5; } function declog(d) { - var r={}; r.tup = 'log'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'log'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function encoperation(d) { - var tup = atom('operation'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - return tuple(tup,id,container,feed_id,prev,next,feeds); } + const tup = atom('operation'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + return tuple(tup, id, container, feed_id, prev, next, feeds); +} function lenoperation() { return 7; } function decoperation(d) { - var r={}; r.tup = 'operation'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; + const r = {}; r.tup = 'operation'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : r.feeds = undefined; - return clean(r); } + return clean(r); +} function encchain(d) { - var tup = atom('chain'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('chain'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lenchain() { return 5; } function decchain(d) { - var r={}; r.tup = 'chain'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'chain'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function encpush(d) { - var tup = atom('push'); - var model = 'model' in d && d.model ? bin(d.model) : nil(); - var type = 'type' in d && d.type ? bin(d.type) : nil(); - var title = 'title' in d && d.title ? bin(d.title) : nil(); - var alert = 'alert' in d && d.alert ? bin(d.alert) : nil(); - var badge = 'badge' in d && d.badge ? number(d.badge) : nil(); - var sound = 'sound' in d && d.sound ? bin(d.sound) : nil(); - return tuple(tup,model,type,title,alert,badge,sound); } + const tup = atom('push'); + const model = 'model' in d && d.model ? bin(d.model) : nil(); + const type = 'type' in d && d.type ? bin(d.type) : nil(); + const title = 'title' in d && d.title ? bin(d.title) : nil(); + const alert = 'alert' in d && d.alert ? bin(d.alert) : nil(); + const badge = 'badge' in d && d.badge ? number(d.badge) : nil(); + const sound = 'sound' in d && d.sound ? bin(d.sound) : nil(); + return tuple(tup, model, type, title, alert, badge, sound); +} function lenpush() { return 7; } function decpush(d) { - var r={}; r.tup = 'push'; - r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.badge = d && d.v[5] ? d.v[5].v : undefined; - r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'push'; + r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.badge = d && d.v[5] ? d.v[5].v : undefined; + r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + return clean(r); +} function encSearch(d) { - var tup = atom('Search'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var ref = 'ref' in d && d.ref ? bin(d.ref) : nil(); - var field = 'field' in d && d.field ? bin(d.field) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var value = 'value' in d && d.value ? encode(d.value) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,ref,field,type,value,status); } + const tup = atom('Search'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const ref = 'ref' in d && d.ref ? bin(d.ref) : nil(); + const field = 'field' in d && d.field ? bin(d.field) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const value = 'value' in d && d.value ? encode(d.value) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, ref, field, type, value, status); +} function lenSearch() { return 7; } function decSearch(d) { - var r={}; r.tup = 'Search'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.type = d && d.v[4] ? decode(d.v[4]) : undefined; - r.value = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.status = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Search'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.type = d && d.v[4] ? decode(d.v[4]) : undefined; + r.value = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.status = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function encp2p(d) { - var tup = atom('p2p'); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - return tuple(tup,from,to); } + const tup = atom('p2p'); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + return tuple(tup, from, to); +} function lenp2p() { return 3; } function decp2p(d) { - var r={}; r.tup = 'p2p'; - r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'p2p'; + r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + return clean(r); +} function encmuc(d) { - var tup = atom('muc'); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - return tuple(tup,name); } + const tup = atom('muc'); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + return tuple(tup, name); +} function lenmuc() { return 2; } function decmuc(d) { - var r={}; r.tup = 'muc'; - r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'muc'; + r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + return clean(r); +} function encCDR(d) { - var tup = atom('CDR'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - var start = 'start' in d && d.start ? number(d.start) : nil(); - var stop = 'stop' in d && d.stop ? number(d.stop) : nil(); - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); - var bill = 'bill' in d && d.bill ? number(d.bill) : nil(); - var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); - return tuple(tup,id,container,feed,next,prev,from,to,start,stop,type, - desc,bill,tariff); } + const tup = atom('CDR'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + const start = 'start' in d && d.start ? number(d.start) : nil(); + const stop = 'stop' in d && d.stop ? number(d.stop) : nil(); + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); + const bill = 'bill' in d && d.bill ? number(d.bill) : nil(); + const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); + return tuple( + tup, id, container, feed, next, prev, from, to, start, stop, type, + desc, bill, tariff + ); +} function lenCDR() { return 14; } function decCDR(d) { - var r={}; r.tup = 'CDR'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.next = d && d.v[4] ? d.v[4].v : undefined; - r.prev = d && d.v[5] ? d.v[5].v : undefined; - r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.start = d && d.v[8] ? d.v[8].v : undefined; - r.stop = d && d.v[9] ? d.v[9].v : undefined; - r.type = d && d.v[10] ? decode(d.v[10]) : undefined; - r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.bill = d && d.v[12] ? d.v[12].v : undefined; - r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'CDR'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.next = d && d.v[4] ? d.v[4].v : undefined; + r.prev = d && d.v[5] ? d.v[5].v : undefined; + r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.start = d && d.v[8] ? d.v[8].v : undefined; + r.stop = d && d.v[9] ? d.v[9].v : undefined; + r.type = d && d.v[10] ? decode(d.v[10]) : undefined; + r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.bill = d && d.v[12] ? d.v[12].v : undefined; + r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; + return clean(r); +} function encFeature(d) { - var tup = atom('Feature'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var key = 'key' in d && d.key ? bin(d.key) : nil(); - var value = 'value' in d && d.value ? bin(d.value) : nil(); - var group = 'group' in d && d.group ? bin(d.group) : nil(); - return tuple(tup,id,key,value,group); } + const tup = atom('Feature'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const key = 'key' in d && d.key ? bin(d.key) : nil(); + const value = 'value' in d && d.value ? bin(d.value) : nil(); + const group = 'group' in d && d.group ? bin(d.group) : nil(); + return tuple(tup, id, key, value, group); +} function lenFeature() { return 5; } function decFeature(d) { - var r={}; r.tup = 'Feature'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Feature'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + return clean(r); +} function encMember(d) { - var tup = atom('Member'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? encode(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var alias = 'alias' in d && d.alias ? bin(d.alias) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); - var reader = 'reader' in d && d.reader ? number(d.reader) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,feeds,phone_id,avatar,names,surnames, - alias,email,vox_id,reader,update,settings,presence,status); } + const tup = atom('Member'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? encode(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const alias = 'alias' in d && d.alias ? bin(d.alias) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); + const reader = 'reader' in d && d.reader ? number(d.reader) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, feeds, phone_id, avatar, names, surnames, + alias, email, vox_id, reader, update, settings, presence, status + ); +} function lenMember() { return 19; } function decMember(d) { - var r={}; r.tup = 'Member'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; + const r = {}; r.tup = 'Member'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : r.feeds = undefined; - r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; - r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; - r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined; - r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; - r.reader = d && d.v[14] ? d.v[14].v : undefined; - r.update = d && d.v[15] ? d.v[15].v : undefined; - r.settings = []; + r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; + r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; + r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined; + r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; + r.reader = d && d.v[14] ? d.v[14].v : undefined; + r.update = d && d.v[15] ? d.v[15].v : undefined; + r.settings = []; (d && d.v[16] && d.v[16].v) ? - d.v[16].v.forEach(function(x){r.settings.push(decode(x))}) : + d.v[16].v.forEach((x) => { r.settings.push(decode(x)); }) : r.settings = undefined; - r.presence = d && d.v[17] ? decode(d.v[17]) : undefined; - r.status = d && d.v[18] ? decode(d.v[18]) : undefined; - return clean(r); } + r.presence = d && d.v[17] ? decode(d.v[17]) : undefined; + r.status = d && d.v[18] ? decode(d.v[18]) : undefined; + return clean(r); +} function encPerson(d) { - var tup = atom('Person'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var phonelist = []; if ('phonelist' in d && d.phonelist) - { d.phonelist.forEach(function(x){ - phonelist.push(encode(x))}); - phonelist={t:108,v:phonelist}; } else { phonelist = nil() }; - var alias = []; if ('alias' in d && d.alias) - { d.alias.forEach(function(x){ - alias.push(encode(x))}); - alias={t:108,v:alias}; } else { alias = nil() }; - var localize = []; if ('localize' in d && d.localize) - { d.localize.forEach(function(x){ - localize.push(encode(x))}); - localize={t:108,v:localize}; } else { localize = nil() }; - var NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) - { d.NotificationSettings.forEach(function(x){ - NotificationSettings.push(encode(x))}); - NotificationSettings={t:108,v:NotificationSettings}; } else { NotificationSettings = nil() }; - var SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) - { d.SoundSettings.forEach(function(x){ - SoundSettings.push(encode(x))}); - SoundSettings={t:108,v:SoundSettings}; } else { SoundSettings = nil() }; - var ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil(); - var BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) - { d.BlockUsers.forEach(function(x){ - BlockUsers.push(encode(x))}); - BlockUsers={t:108,v:BlockUsers}; } else { BlockUsers = nil() }; - var balance = 'balance' in d && d.balance ? number(d.balance) : nil(); - var isParticipants = []; if ('isParticipants' in d && d.isParticipants) - { d.isParticipants.forEach(function(x){ - isParticipants.push(encode(x))}); - isParticipants={t:108,v:isParticipants}; } else { isParticipants = nil() }; - var status = 'status' in d && d.status ? encode(d.status) : nil(); - return tuple(tup,id,phonelist,alias,localize,NotificationSettings,SoundSettings,ThemeID,BlockUsers,balance,isParticipants,status); } + const tup = atom('Person'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + let phonelist = []; if ('phonelist' in d && d.phonelist) { + d.phonelist.forEach((x) => { + phonelist.push(encode(x)); + }); + phonelist = { t: 108, v: phonelist }; + } else { phonelist = nil(); } + let alias = []; if ('alias' in d && d.alias) { + d.alias.forEach((x) => { + alias.push(encode(x)); + }); + alias = { t: 108, v: alias }; + } else { alias = nil(); } + let localize = []; if ('localize' in d && d.localize) { + d.localize.forEach((x) => { + localize.push(encode(x)); + }); + localize = { t: 108, v: localize }; + } else { localize = nil(); } + let NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) { + d.NotificationSettings.forEach((x) => { + NotificationSettings.push(encode(x)); + }); + NotificationSettings = { t: 108, v: NotificationSettings }; + } else { NotificationSettings = nil(); } + let SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) { + d.SoundSettings.forEach((x) => { + SoundSettings.push(encode(x)); + }); + SoundSettings = { t: 108, v: SoundSettings }; + } else { SoundSettings = nil(); } + const ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil(); + let BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) { + d.BlockUsers.forEach((x) => { + BlockUsers.push(encode(x)); + }); + BlockUsers = { t: 108, v: BlockUsers }; + } else { BlockUsers = nil(); } + const balance = 'balance' in d && d.balance ? number(d.balance) : nil(); + let isParticipants = []; if ('isParticipants' in d && d.isParticipants) { + d.isParticipants.forEach((x) => { + isParticipants.push(encode(x)); + }); + isParticipants = { t: 108, v: isParticipants }; + } else { isParticipants = nil(); } + const status = 'status' in d && d.status ? encode(d.status) : nil(); + return tuple(tup, id, phonelist, alias, localize, NotificationSettings, SoundSettings, ThemeID, BlockUsers, balance, isParticipants, status); +} function lenPerson() { return 12; } function decPerson(d) { - var r={}; r.tup = 'Person'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.phonelist = []; + const r = {}; r.tup = 'Person'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.phonelist = []; (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.phonelist.push(decode(x))}) : + d.v[2].v.forEach((x) => { r.phonelist.push(decode(x)); }) : r.phonelist = undefined; - r.alias = []; + r.alias = []; (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.alias.push(decode(x))}) : + d.v[3].v.forEach((x) => { r.alias.push(decode(x)); }) : r.alias = undefined; - r.localize = []; + r.localize = []; (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.localize.push(decode(x))}) : + d.v[4].v.forEach((x) => { r.localize.push(decode(x)); }) : r.localize = undefined; - r.NotificationSettings = []; + r.NotificationSettings = []; (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.NotificationSettings.push(decode(x))}) : + d.v[5].v.forEach((x) => { r.NotificationSettings.push(decode(x)); }) : r.NotificationSettings = undefined; - r.SoundSettings = []; + r.SoundSettings = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.SoundSettings.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.SoundSettings.push(decode(x)); }) : r.SoundSettings = undefined; - r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.BlockUsers = []; + r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.BlockUsers = []; (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.BlockUsers.push(decode(x))}) : + d.v[8].v.forEach((x) => { r.BlockUsers.push(decode(x)); }) : r.BlockUsers = undefined; - r.balance = d && d.v[9] ? d.v[9].v : undefined; - r.isParticipants = []; + r.balance = d && d.v[9] ? d.v[9].v : undefined; + r.isParticipants = []; (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.isParticipants.push(decode(x))}) : + d.v[10].v.forEach((x) => { r.isParticipants.push(decode(x)); }) : r.isParticipants = undefined; - r.status = d && d.v[11] ? decode(d.v[11]) : undefined; - return clean(r); } + r.status = d && d.v[11] ? decode(d.v[11]) : undefined; + return clean(r); +} function encDesc(d) { - var tup = atom('Desc'); - var mime = 'mime' in d && d.mime ? bin(d.mime) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var size = 'size' in d && d.size ? number(d.size) : nil(); - var filename = 'filename' in d && d.filename ? bin(d.filename) : nil(); - var info = 'info' in d && d.info ? bin(d.info) : nil(); - return tuple(tup,mime,payload,size,filename,info); } + const tup = atom('Desc'); + const mime = 'mime' in d && d.mime ? bin(d.mime) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const size = 'size' in d && d.size ? number(d.size) : nil(); + const filename = 'filename' in d && d.filename ? bin(d.filename) : nil(); + const info = 'info' in d && d.info ? bin(d.info) : nil(); + return tuple(tup, mime, payload, size, filename, info); +} function lenDesc() { return 6; } function decDesc(d) { - var r={}; r.tup = 'Desc'; - r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.size = d && d.v[3] ? d.v[3].v : undefined; - r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Desc'; + r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.size = d && d.v[3] ? d.v[3].v : undefined; + r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + return clean(r); +} function encMessage(d) { - var tup = atom('Message'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? encode(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - var created = 'created' in d && d.created ? encode(d.created) : nil(); - var files = []; if ('files' in d && d.files) - { d.files.forEach(function(x){ - files.push(encode(x))}); - files={t:108,v:files}; } else { files = nil() }; - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,msg_id,from,to,created,files, - type,edit_msg,status); } + const tup = atom('Message'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? encode(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + const created = 'created' in d && d.created ? encode(d.created) : nil(); + let files = []; if ('files' in d && d.files) { + d.files.forEach((x) => { + files.push(encode(x)); + }); + files = { t: 108, v: files }; + } else { files = nil(); } + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, msg_id, from, to, created, files, + type, edit_msg, status + ); +} function lenMessage() { return 14; } function decMessage(d) { - var r={}; r.tup = 'Message'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; - r.created = d && d.v[9] ? decode(d.v[9]) : undefined; - r.files = []; + const r = {}; r.tup = 'Message'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; + r.created = d && d.v[9] ? decode(d.v[9]) : undefined; + r.files = []; (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.files.push(decode(x))}) : + d.v[10].v.forEach((x) => { r.files.push(decode(x)); }) : r.files = undefined; - r.type = d && d.v[11] ? decode(d.v[11]) : undefined; - r.edit_msg = d && d.v[12] ? d.v[12].v : undefined; - r.status = d && d.v[13] ? decode(d.v[13]) : undefined; - return clean(r); } + r.type = d && d.v[11] ? decode(d.v[11]) : undefined; + r.edit_msg = d && d.v[12] ? d.v[12].v : undefined; + r.status = d && d.v[13] ? decode(d.v[13]) : undefined; + return clean(r); +} function encRoom(d) { - var tup = atom('Room'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var description = 'description' in d && d.description ? bin(d.description) : nil(); - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var members = []; if ('members' in d && d.members) - { d.members.forEach(function(x){ - members.push(encode(x))}); - members={t:108,v:members}; } else { members = nil() }; - var admins = []; if ('admins' in d && d.admins) - { d.admins.forEach(function(x){ - admins.push(encode(x))}); - admins={t:108,v:admins}; } else { admins = nil() }; - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var tos = 'tos' in d && d.tos ? bin(d.tos) : nil(); - var tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil(); - var unread = 'unread' in d && d.unread ? number(d.unread) : nil(); - var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var created = 'created' in d && d.created ? number(d.created) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,name,description,settings,members,admins,data,type,tos,tos_update, - unread,last_msg,update,created,status); } + const tup = atom('Room'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const description = 'description' in d && d.description ? bin(d.description) : nil(); + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + let members = []; if ('members' in d && d.members) { + d.members.forEach((x) => { + members.push(encode(x)); + }); + members = { t: 108, v: members }; + } else { members = nil(); } + let admins = []; if ('admins' in d && d.admins) { + d.admins.forEach((x) => { + admins.push(encode(x)); + }); + admins = { t: 108, v: admins }; + } else { admins = nil(); } + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const tos = 'tos' in d && d.tos ? bin(d.tos) : nil(); + const tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil(); + const unread = 'unread' in d && d.unread ? number(d.unread) : nil(); + const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const created = 'created' in d && d.created ? number(d.created) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, name, description, settings, members, admins, data, type, tos, tos_update, + unread, last_msg, update, created, status + ); +} function lenRoom() { return 16; } function decRoom(d) { - var r={}; r.tup = 'Room'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.settings = []; + const r = {}; r.tup = 'Room'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.settings = []; (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) : + d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) : r.settings = undefined; - r.members = []; + r.members = []; (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.members.push(decode(x))}) : + d.v[5].v.forEach((x) => { r.members.push(decode(x)); }) : r.members = undefined; - r.admins = []; + r.admins = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.admins.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.admins.push(decode(x)); }) : r.admins = undefined; - r.data = []; + r.data = []; (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.data.push(decode(x))}) : + d.v[7].v.forEach((x) => { r.data.push(decode(x)); }) : r.data = undefined; - r.type = d && d.v[8] ? decode(d.v[8]) : undefined; - r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; - r.tos_update = d && d.v[10] ? d.v[10].v : undefined; - r.unread = d && d.v[11] ? d.v[11].v : undefined; - r.last_msg = d && d.v[12] ? decode(d.v[12]) : undefined; - r.update = d && d.v[13] ? d.v[13].v : undefined; - r.created = d && d.v[14] ? d.v[14].v : undefined; - r.status = d && d.v[15] ? decode(d.v[15]) : undefined; - return clean(r); } + r.type = d && d.v[8] ? decode(d.v[8]) : undefined; + r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; + r.tos_update = d && d.v[10] ? d.v[10].v : undefined; + r.unread = d && d.v[11] ? d.v[11].v : undefined; + r.last_msg = d && d.v[12] ? decode(d.v[12]) : undefined; + r.update = d && d.v[13] ? d.v[13].v : undefined; + r.created = d && d.v[14] ? d.v[14].v : undefined; + r.status = d && d.v[15] ? decode(d.v[15]) : undefined; + return clean(r); +} function encTag(d) { - var tup = atom('Tag'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var color = 'color' in d && d.color ? bin(d.color) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,name,color,status); } + const tup = atom('Tag'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const color = 'color' in d && d.color ? bin(d.color) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, name, color, status); +} function lenTag() { return 5; } function decTag(d) { - var r={}; r.tup = 'Tag'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.status = d && d.v[4] ? decode(d.v[4]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Tag'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.status = d && d.v[4] ? decode(d.v[4]) : undefined; + return clean(r); +} function encStar(d) { - var tup = atom('Star'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var message = 'message' in d && d.message ? encode(d.message) : nil(); - var tags = []; if ('tags' in d && d.tags) - { d.tags.forEach(function(x){ - tags.push(encode(x))}); - tags={t:108,v:tags}; } else { tags = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,message,tags,status); } + const tup = atom('Star'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const message = 'message' in d && d.message ? encode(d.message) : nil(); + let tags = []; if ('tags' in d && d.tags) { + d.tags.forEach((x) => { + tags.push(encode(x)); + }); + tags = { t: 108, v: tags }; + } else { tags = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, message, tags, status); +} function lenStar() { return 5; } function decStar(d) { - var r={}; r.tup = 'Star'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.message = d && d.v[2] ? decode(d.v[2]) : undefined; - r.tags = []; + const r = {}; r.tup = 'Star'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.message = d && d.v[2] ? decode(d.v[2]) : undefined; + r.tags = []; (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.tags.push(decode(x))}) : + d.v[3].v.forEach((x) => { r.tags.push(decode(x)); }) : r.tags = undefined; - r.status = d && d.v[4] ? decode(d.v[4]) : undefined; - return clean(r); } + r.status = d && d.v[4] ? decode(d.v[4]) : undefined; + return clean(r); +} function encHistory(d) { - var tup = atom('History'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var size = 'size' in d && d.size ? number(d.size) : nil(); - var entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil(); - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,feed,size,entity_id,data,status); } + const tup = atom('History'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const size = 'size' in d && d.size ? number(d.size) : nil(); + const entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil(); + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, feed, size, entity_id, data, status); +} function lenHistory() { return 7; } function decHistory(d) { - var r={}; r.tup = 'History'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.feed = d && d.v[2] ? decode(d.v[2]) : undefined; - r.size = d && d.v[3] ? d.v[3].v : undefined; - r.entity_id = d && d.v[4] ? d.v[4].v : undefined; - r.data = []; + const r = {}; r.tup = 'History'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.feed = d && d.v[2] ? decode(d.v[2]) : undefined; + r.size = d && d.v[3] ? d.v[3].v : undefined; + r.entity_id = d && d.v[4] ? d.v[4].v : undefined; + r.data = []; (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.data.push(decode(x))}) : + d.v[5].v.forEach((x) => { r.data.push(decode(x)); }) : r.data = undefined; - r.status = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + r.status = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function encTyping(d) { - var tup = atom('Typing'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var comments = 'comments' in d && d.comments ? encode(d.comments) : nil(); - return tuple(tup,phone_id,comments); } + const tup = atom('Typing'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const comments = 'comments' in d && d.comments ? encode(d.comments) : nil(); + return tuple(tup, phone_id, comments); +} function lenTyping() { return 3; } function decTyping(d) { - var r={}; r.tup = 'Typing'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Typing'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined; + return clean(r); +} function encContact(d) { - var tup = atom('Contact'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); - var reader = 'reader' in d && d.reader ? number(d.reader) : nil(); - var unread = 'unread' in d && d.unread ? number(d.unread) : nil(); - var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone_id,avatar,names,surnames,nick,email,vox_id,reader,unread,last_msg, - update,settings,presence,status); } + const tup = atom('Contact'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); + const reader = 'reader' in d && d.reader ? number(d.reader) : nil(); + const unread = 'unread' in d && d.unread ? number(d.unread) : nil(); + const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, phone_id, avatar, names, surnames, nick, email, vox_id, reader, unread, last_msg, + update, settings, presence, status + ); +} function lenContact() { return 15; } function decContact(d) { - var r={}; r.tup = 'Contact'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.reader = d && d.v[8] ? d.v[8].v : undefined; - r.unread = d && d.v[9] ? d.v[9].v : undefined; - r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined; - r.update = d && d.v[11] ? d.v[11].v : undefined; - r.settings = []; + const r = {}; r.tup = 'Contact'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.reader = d && d.v[8] ? d.v[8].v : undefined; + r.unread = d && d.v[9] ? d.v[9].v : undefined; + r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined; + r.update = d && d.v[11] ? d.v[11].v : undefined; + r.settings = []; (d && d.v[12] && d.v[12].v) ? - d.v[12].v.forEach(function(x){r.settings.push(decode(x))}) : + d.v[12].v.forEach((x) => { r.settings.push(decode(x)); }) : r.settings = undefined; - r.presence = d && d.v[13] ? d.v[13].v : undefined; - r.status = d && d.v[14] ? decode(d.v[14]) : undefined; - return clean(r); } + r.presence = d && d.v[13] ? d.v[13].v : undefined; + r.status = d && d.v[14] ? decode(d.v[14]) : undefined; + return clean(r); +} function encAuth(d) { - var tup = atom('Auth'); - var client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil(); - var dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil(); - var user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil(); - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var token = 'token' in d && d.token ? bin(d.token) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil(); - var attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil(); - var services = []; if ('services' in d && d.services) - { d.services.forEach(function(x){ - services.push(encode(x))}); - services={t:108,v:services}; } else { services = nil() }; - var push = 'push' in d && d.push ? bin(d.push) : nil(); - var os = 'os' in d && d.os ? encode(d.os) : nil(); - var created = 'created' in d && d.created ? encode(d.created) : nil(); - var last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil(); - return tuple(tup,client_id,dev_key,user_id,phone,token,type,sms_code,attempts,services,push, - os,created,last_online); } + const tup = atom('Auth'); + const client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil(); + const dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil(); + const user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil(); + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + const token = 'token' in d && d.token ? bin(d.token) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil(); + const attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil(); + let services = []; if ('services' in d && d.services) { + d.services.forEach((x) => { + services.push(encode(x)); + }); + services = { t: 108, v: services }; + } else { services = nil(); } + const push = 'push' in d && d.push ? bin(d.push) : nil(); + const os = 'os' in d && d.os ? encode(d.os) : nil(); + const created = 'created' in d && d.created ? encode(d.created) : nil(); + const last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil(); + return tuple( + tup, client_id, dev_key, user_id, phone, token, type, sms_code, attempts, services, push, + os, created, last_online + ); +} function lenAuth() { return 14; } function decAuth(d) { - var r={}; r.tup = 'Auth'; - r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.type = d && d.v[6] ? d.v[6].v : undefined; - r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.attempts = d && d.v[8] ? d.v[8].v : undefined; - r.services = []; + const r = {}; r.tup = 'Auth'; + r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.type = d && d.v[6] ? d.v[6].v : undefined; + r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.attempts = d && d.v[8] ? d.v[8].v : undefined; + r.services = []; (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.services.push(decode(x))}) : + d.v[9].v.forEach((x) => { r.services.push(decode(x)); }) : r.services = undefined; - r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.os = d && d.v[11] ? decode(d.v[11]) : undefined; - r.created = d && d.v[12] ? decode(d.v[12]) : undefined; - r.last_online = d && d.v[13] ? d.v[13].v : undefined; - return clean(r); } + r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.os = d && d.v[11] ? decode(d.v[11]) : undefined; + r.created = d && d.v[12] ? decode(d.v[12]) : undefined; + r.last_online = d && d.v[13] ? d.v[13].v : undefined; + return clean(r); +} function encService(d) { - var tup = atom('Service'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - var login = 'login' in d && d.login ? bin(d.login) : nil(); - var password = 'password' in d && d.password ? bin(d.password) : nil(); - var expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,type,data,login,password,expiration,status); } + const tup = atom('Service'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + const login = 'login' in d && d.login ? bin(d.login) : nil(); + const password = 'password' in d && d.password ? bin(d.password) : nil(); + const expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, type, data, login, password, expiration, status); +} function lenService() { return 8; } function decService(d) { - var r={}; r.tup = 'Service'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.type = d && d.v[2] ? decode(d.v[2]) : undefined; - r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.expiration = d && d.v[6] ? d.v[6].v : undefined; - r.status = d && d.v[7] ? decode(d.v[7]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Service'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.type = d && d.v[2] ? decode(d.v[2]) : undefined; + r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.expiration = d && d.v[6] ? d.v[6].v : undefined; + r.status = d && d.v[7] ? decode(d.v[7]) : undefined; + return clean(r); +} function encRoster(d) { - var tup = atom('Roster'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); - var userlist = []; if ('userlist' in d && d.userlist) - { d.userlist.forEach(function(x){ - userlist.push(encode(x))}); - userlist={t:108,v:userlist}; } else { userlist = nil() }; - var roomlist = []; if ('roomlist' in d && d.roomlist) - { d.roomlist.forEach(function(x){ - roomlist.push(encode(x))}); - roomlist={t:108,v:roomlist}; } else { roomlist = nil() }; - var favorite = []; if ('favorite' in d && d.favorite) - { d.favorite.forEach(function(x){ - favorite.push(encode(x))}); - favorite={t:108,v:favorite}; } else { favorite = nil() }; - var tags = []; if ('tags' in d && d.tags) - { d.tags.forEach(function(x){ - tags.push(encode(x))}); - tags={t:108,v:tags}; } else { tags = nil() }; - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,names,surnames,email,nick,userlist,roomlist,favorite,tags,phone, - avatar,update,status); } + const tup = atom('Roster'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); + let userlist = []; if ('userlist' in d && d.userlist) { + d.userlist.forEach((x) => { + userlist.push(encode(x)); + }); + userlist = { t: 108, v: userlist }; + } else { userlist = nil(); } + let roomlist = []; if ('roomlist' in d && d.roomlist) { + d.roomlist.forEach((x) => { + roomlist.push(encode(x)); + }); + roomlist = { t: 108, v: roomlist }; + } else { roomlist = nil(); } + let favorite = []; if ('favorite' in d && d.favorite) { + d.favorite.forEach((x) => { + favorite.push(encode(x)); + }); + favorite = { t: 108, v: favorite }; + } else { favorite = nil(); } + let tags = []; if ('tags' in d && d.tags) { + d.tags.forEach((x) => { + tags.push(encode(x)); + }); + tags = { t: 108, v: tags }; + } else { tags = nil(); } + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, names, surnames, email, nick, userlist, roomlist, favorite, tags, phone, + avatar, update, status + ); +} function lenRoster() { return 14; } function decRoster(d) { - var r={}; r.tup = 'Roster'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.userlist = []; + const r = {}; r.tup = 'Roster'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.userlist = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.userlist.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.userlist.push(decode(x)); }) : r.userlist = undefined; - r.roomlist = []; + r.roomlist = []; (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.roomlist.push(decode(x))}) : + d.v[7].v.forEach((x) => { r.roomlist.push(decode(x)); }) : r.roomlist = undefined; - r.favorite = []; + r.favorite = []; (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.favorite.push(decode(x))}) : + d.v[8].v.forEach((x) => { r.favorite.push(decode(x)); }) : r.favorite = undefined; - r.tags = []; + r.tags = []; (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.tags.push(decode(x))}) : + d.v[9].v.forEach((x) => { r.tags.push(decode(x)); }) : r.tags = undefined; - r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.update = d && d.v[12] ? d.v[12].v : undefined; - r.status = d && d.v[13] ? decode(d.v[13]) : undefined; - return clean(r); } + r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.update = d && d.v[12] ? d.v[12].v : undefined; + r.status = d && d.v[13] ? decode(d.v[13]) : undefined; + return clean(r); +} function encProfile(d) { - var tup = atom('Profile'); - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var services = []; if ('services' in d && d.services) - { d.services.forEach(function(x){ - services.push(encode(x))}); - services={t:108,v:services}; } else { services = nil() }; - var rosters = []; if ('rosters' in d && d.rosters) - { d.rosters.forEach(function(x){ - rosters.push(encode(x))}); - rosters={t:108,v:rosters}; } else { rosters = nil() }; - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var update = 'update' in d && d.update ? number(d.update) : nil(); - var balance = 'balance' in d && d.balance ? number(d.balance) : nil(); - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone,services,rosters,settings,update,balance,presence,status); } + const tup = atom('Profile'); + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + let services = []; if ('services' in d && d.services) { + d.services.forEach((x) => { + services.push(encode(x)); + }); + services = { t: 108, v: services }; + } else { services = nil(); } + let rosters = []; if ('rosters' in d && d.rosters) { + d.rosters.forEach((x) => { + rosters.push(encode(x)); + }); + rosters = { t: 108, v: rosters }; + } else { rosters = nil(); } + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + const update = 'update' in d && d.update ? number(d.update) : nil(); + const balance = 'balance' in d && d.balance ? number(d.balance) : nil(); + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, phone, services, rosters, settings, update, balance, presence, status); +} function lenProfile() { return 9; } function decProfile(d) { - var r={}; r.tup = 'Profile'; - r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.services = []; + const r = {}; r.tup = 'Profile'; + r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.services = []; (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.services.push(decode(x))}) : + d.v[2].v.forEach((x) => { r.services.push(decode(x)); }) : r.services = undefined; - r.rosters = []; + r.rosters = []; (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.rosters.push(decode(x))}) : + d.v[3].v.forEach((x) => { r.rosters.push(decode(x)); }) : r.rosters = undefined; - r.settings = []; + r.settings = []; (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) : + d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) : r.settings = undefined; - r.update = d && d.v[5] ? d.v[5].v : undefined; - r.balance = d && d.v[6] ? d.v[6].v : undefined; - r.presence = d && d.v[7] ? d.v[7].v : undefined; - r.status = d && d.v[8] ? d.v[8].v : undefined; - return clean(r); } + r.update = d && d.v[5] ? d.v[5].v : undefined; + r.balance = d && d.v[6] ? d.v[6].v : undefined; + r.presence = d && d.v[7] ? d.v[7].v : undefined; + r.status = d && d.v[8] ? d.v[8].v : undefined; + return clean(r); +} function encLoc(d) { - var tup = atom('Loc'); - var x = 'x' in d && d.x ? bin(d.x) : nil(); - var y = 'y' in d && d.y ? bin(d.y) : nil(); - var z = 'z' in d && d.z ? bin(d.z) : nil(); - return tuple(tup,x,y,z); } + const tup = atom('Loc'); + const x = 'x' in d && d.x ? bin(d.x) : nil(); + const y = 'y' in d && d.y ? bin(d.y) : nil(); + const z = 'z' in d && d.z ? bin(d.z) : nil(); + return tuple(tup, x, y, z); +} function lenLoc() { return 4; } function decLoc(d) { - var r={}; r.tup = 'Loc'; - r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Loc'; + r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + return clean(r); +} function encFriend(d) { - var tup = atom('Friend'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone_id,friend_id,status); } + const tup = atom('Friend'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, phone_id, friend_id, status); +} function lenFriend() { return 4; } function decFriend(d) { - var r={}; r.tup = 'Friend'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.status = d && d.v[3] ? decode(d.v[3]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Friend'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.status = d && d.v[3] ? decode(d.v[3]) : undefined; + return clean(r); +} function encCallMember(d) { - var tup = atom('CallMember'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? encode(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var contact = 'contact' in d && d.contact ? encode(d.contact) : nil(); - var start = 'start' in d && d.start ? number(d.start) : nil(); - var stop = 'stop' in d && d.stop ? number(d.stop) : nil(); - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); - var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); - var bill = 'bill' in d && d.bill ? number(d.bill) : nil(); - var duration = 'duration' in d && d.duration ? number(d.duration) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,contact,start,stop,type,desc, - tariff,bill,duration,status); } + const tup = atom('CallMember'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? encode(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const contact = 'contact' in d && d.contact ? encode(d.contact) : nil(); + const start = 'start' in d && d.start ? number(d.start) : nil(); + const stop = 'stop' in d && d.stop ? number(d.stop) : nil(); + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); + const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); + const bill = 'bill' in d && d.bill ? number(d.bill) : nil(); + const duration = 'duration' in d && d.duration ? number(d.duration) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, contact, start, stop, type, desc, + tariff, bill, duration, status + ); +} function lenCallMember() { return 15; } function decCallMember(d) { - var r={}; r.tup = 'CallMember'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.contact = d && d.v[6] ? decode(d.v[6]) : undefined; - r.start = d && d.v[7] ? d.v[7].v : undefined; - r.stop = d && d.v[8] ? d.v[8].v : undefined; - r.type = d && d.v[9] ? decode(d.v[9]) : undefined; - r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.bill = d && d.v[12] ? d.v[12].v : undefined; - r.duration = d && d.v[13] ? d.v[13].v : undefined; - r.status = d && d.v[14] ? decode(d.v[14]) : undefined; - return clean(r); } + const r = {}; r.tup = 'CallMember'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.contact = d && d.v[6] ? decode(d.v[6]) : undefined; + r.start = d && d.v[7] ? d.v[7].v : undefined; + r.stop = d && d.v[8] ? d.v[8].v : undefined; + r.type = d && d.v[9] ? decode(d.v[9]) : undefined; + r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.bill = d && d.v[12] ? d.v[12].v : undefined; + r.duration = d && d.v[13] ? d.v[13].v : undefined; + r.status = d && d.v[14] ? decode(d.v[14]) : undefined; + return clean(r); +} function encCall(d) { - var tup = atom('Call'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var members = []; if ('members' in d && d.members) - { d.members.forEach(function(x){ - members.push(encode(x))}); - members={t:108,v:members}; } else { members = nil() }; - var start = 'start' in d && d.start ? number(d.start) : nil(); - var stop = 'stop' in d && d.stop ? number(d.stop) : nil(); - var vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,from,members,start,stop,vox_url,status); } + const tup = atom('Call'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + let members = []; if ('members' in d && d.members) { + d.members.forEach((x) => { + members.push(encode(x)); + }); + members = { t: 108, v: members }; + } else { members = nil(); } + const start = 'start' in d && d.start ? number(d.start) : nil(); + const stop = 'stop' in d && d.stop ? number(d.stop) : nil(); + const vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, from, members, start, stop, vox_url, status); +} function lenCall() { return 8; } function decCall(d) { - var r={}; r.tup = 'Call'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.members = []; + const r = {}; r.tup = 'Call'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.members = []; (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.members.push(decode(x))}) : + d.v[3].v.forEach((x) => { r.members.push(decode(x)); }) : r.members = undefined; - r.start = d && d.v[4] ? d.v[4].v : undefined; - r.stop = d && d.v[5] ? d.v[5].v : undefined; - r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.status = d && d.v[7] ? decode(d.v[7]) : undefined; - return clean(r); } + r.start = d && d.v[4] ? d.v[4].v : undefined; + r.stop = d && d.v[5] ? d.v[5].v : undefined; + r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.status = d && d.v[7] ? decode(d.v[7]) : undefined; + return clean(r); +} function encIndex(d) { - var tup = atom('Index'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var roster = []; if ('roster' in d && d.roster) - { d.roster.forEach(function(x){ - roster.push(encode(x))}); - roster={t:108,v:roster}; } else { roster = nil() }; - return tuple(tup,id,roster); } + const tup = atom('Index'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + let roster = []; if ('roster' in d && d.roster) { + d.roster.forEach((x) => { + roster.push(encode(x)); + }); + roster = { t: 108, v: roster }; + } else { roster = nil(); } + return tuple(tup, id, roster); +} function lenIndex() { return 3; } function decIndex(d) { - var r={}; r.tup = 'Index'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.roster = []; + const r = {}; r.tup = 'Index'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.roster = []; (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.roster.push(decode(x))}) : + d.v[2].v.forEach((x) => { r.roster.push(decode(x)); }) : r.roster = undefined; - return clean(r); } + return clean(r); +} function encerror(d) { - var tup = atom('error'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - return tuple(tup,code); } + const tup = atom('error'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + return tuple(tup, code); +} function lenerror() { return 2; } function decerror(d) { - var r={}; r.tup = 'error'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - return clean(r); } + const r = {}; r.tup = 'error'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + return clean(r); +} function encok(d) { - var tup = atom('ok'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - return tuple(tup,code); } + const tup = atom('ok'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + return tuple(tup, code); +} function lenok() { return 2; } function decok(d) { - var r={}; r.tup = 'ok'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - return clean(r); } + const r = {}; r.tup = 'ok'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + return clean(r); +} function encerror2(d) { - var tup = atom('error2'); - var code = 'code' in d && d.code ? atom(d.code) : nil(); - var src = 'src' in d && d.src ? encode(d.src) : nil(); - return tuple(tup,code,src); } + const tup = atom('error2'); + const code = 'code' in d && d.code ? atom(d.code) : nil(); + const src = 'src' in d && d.src ? encode(d.src) : nil(); + return tuple(tup, code, src); +} function lenerror2() { return 3; } function decerror2(d) { - var r={}; r.tup = 'error2'; - r.code = d && d.v[1] ? d.v[1].v : undefined; - r.src = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'error2'; + r.code = d && d.v[1] ? d.v[1].v : undefined; + r.src = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encok2(d) { - var tup = atom('ok2'); - var code = 'code' in d && d.code ? atom(d.code) : nil(); - var src = 'src' in d && d.src ? encode(d.src) : nil(); - return tuple(tup,code,src); } + const tup = atom('ok2'); + const code = 'code' in d && d.code ? atom(d.code) : nil(); + const src = 'src' in d && d.src ? encode(d.src) : nil(); + return tuple(tup, code, src); +} function lenok2() { return 3; } function decok2(d) { - var r={}; r.tup = 'ok2'; - r.code = d && d.v[1] ? d.v[1].v : undefined; - r.src = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'ok2'; + r.code = d && d.v[1] ? d.v[1].v : undefined; + r.src = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encio(d) { - var tup = atom('io'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - return tuple(tup,code,data); } + const tup = atom('io'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + return tuple(tup, code, data); +} function lenio() { return 3; } function decio(d) { - var r={}; r.tup = 'io'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - r.data = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'io'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + r.data = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encmax_tour(d) { - var tup = atom('max_tour'); - var count = 'count' in d && d.count ? number(d.count) : nil(); - var joined = 'joined' in d && d.joined ? number(d.joined) : nil(); - return tuple(tup,count,joined); } + const tup = atom('max_tour'); + const count = 'count' in d && d.count ? number(d.count) : nil(); + const joined = 'joined' in d && d.joined ? number(d.joined) : nil(); + return tuple(tup, count, joined); +} function lenmax_tour() { return 3; } function decmax_tour(d) { - var r={}; r.tup = 'max_tour'; - r.count = d && d.v[1] ? d.v[1].v : undefined; - r.joined = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'max_tour'; + r.count = d && d.v[1] ? d.v[1].v : undefined; + r.joined = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function encjoin_application(d) { - var tup = atom('join_application'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - return tuple(tup,id,name,data); } + const tup = atom('join_application'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + return tuple(tup, id, name, data); +} function lenjoin_application() { return 4; } function decjoin_application(d) { - var r={}; r.tup = 'join_application'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'join_application'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; + return clean(r); +} function enctour_list(d) { - var tup = atom('tour_list'); - var users = []; if ('users' in d && d.users) - { d.users.forEach(function(x){ - users.push(encode(x))}); - users={t:108,v:users}; } else { users = nil() }; - return tuple(tup,users); } + const tup = atom('tour_list'); + let users = []; if ('users' in d && d.users) { + d.users.forEach((x) => { + users.push(encode(x)); + }); + users = { t: 108, v: users }; + } else { users = nil(); } + return tuple(tup, users); +} function lentour_list() { return 2; } function dectour_list(d) { - var r={}; r.tup = 'tour_list'; - r.users = []; + const r = {}; r.tup = 'tour_list'; + r.users = []; (d && d.v[1] && d.v[1].v) ? - d.v[1].v.forEach(function(x){r.users.push(decode(x))}) : + d.v[1].v.forEach((x) => { r.users.push(decode(x)); }) : r.users = undefined; - return clean(r); } + return clean(r); +} function enctask(d) { - var tup = atom('task'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('task'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lentask() { return 4; } function dectask(d) { - var r={}; r.tup = 'task'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'task'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encuserTask(d) { - var tup = atom('userTask'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('userTask'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lenuserTask() { return 4; } function decuserTask(d) { - var r={}; r.tup = 'userTask'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'userTask'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encserviceTask(d) { - var tup = atom('serviceTask'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('serviceTask'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lenserviceTask() { return 4; } function decserviceTask(d) { - var r={}; r.tup = 'serviceTask'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'serviceTask'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encreceiveTask(d) { - var tup = atom('receiveTask'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('receiveTask'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lenreceiveTask() { return 4; } function decreceiveTask(d) { - var r={}; r.tup = 'receiveTask'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'receiveTask'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encmessageEvent(d) { - var tup = atom('messageEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); - return tuple(tup,name,payload,timeout); } + const tup = atom('messageEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); + return tuple(tup, name, payload, timeout); +} function lenmessageEvent() { return 4; } function decmessageEvent(d) { - var r={}; r.tup = 'messageEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'messageEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; + return clean(r); +} function encboundaryEvent(d) { - var tup = atom('boundaryEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); - var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); - var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); - var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); } + const tup = atom('boundaryEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); + const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); + const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); + const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module); +} function lenboundaryEvent() { return 8; } function decboundaryEvent(d) { - var r={}; r.tup = 'boundaryEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.module = d && d.v[7] ? d.v[7].v : undefined; - return clean(r); } + const r = {}; r.tup = 'boundaryEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.module = d && d.v[7] ? d.v[7].v : undefined; + return clean(r); +} function enctimeoutEvent(d) { - var tup = atom('timeoutEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); - var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); - var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); - var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); } + const tup = atom('timeoutEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); + const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); + const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); + const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module); +} function lentimeoutEvent() { return 8; } function dectimeoutEvent(d) { - var r={}; r.tup = 'timeoutEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.module = d && d.v[7] ? d.v[7].v : undefined; - return clean(r); } + const r = {}; r.tup = 'timeoutEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.module = d && d.v[7] ? d.v[7].v : undefined; + return clean(r); +} function encbeginEvent(d) { - var tup = atom('beginEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,module); } + const tup = atom('beginEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, module); +} function lenbeginEvent() { return 3; } function decbeginEvent(d) { - var r={}; r.tup = 'beginEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.module = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'beginEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.module = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function encendEvent(d) { - var tup = atom('endEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,module); } + const tup = atom('endEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, module); +} function lenendEvent() { return 3; } function decendEvent(d) { - var r={}; r.tup = 'endEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.module = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'endEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.module = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function encsequenceFlow(d) { - var tup = atom('sequenceFlow'); - var source = 'source' in d && d.source ? atom(d.source) : nil(); - var target = 'target' in d && d.target ? atom(d.target) : nil(); - return tuple(tup,source,target); } + const tup = atom('sequenceFlow'); + const source = 'source' in d && d.source ? atom(d.source) : nil(); + const target = 'target' in d && d.target ? atom(d.target) : nil(); + return tuple(tup, source, target); +} function lensequenceFlow() { return 3; } function decsequenceFlow(d) { - var r={}; r.tup = 'sequenceFlow'; - r.source = d && d.v[1] ? d.v[1].v : undefined; - r.target = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'sequenceFlow'; + r.source = d && d.v[1] ? d.v[1].v : undefined; + r.target = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function enchist(d) { - var tup = atom('hist'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var task = 'task' in d && d.task ? atom(d.task) : nil(); - var time = 'time' in d && d.time ? encode(d.time) : nil(); - return tuple(tup,id,container,feed_id,prev,next,feeds,name,task,time); } + const tup = atom('hist'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const task = 'task' in d && d.task ? atom(d.task) : nil(); + const time = 'time' in d && d.time ? encode(d.time) : nil(); + return tuple(tup, id, container, feed_id, prev, next, feeds, name, task, time); +} function lenhist() { return 10; } function dechist(d) { - var r={}; r.tup = 'hist'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; + const r = {}; r.tup = 'hist'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : r.feeds = undefined; - r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.task = d && d.v[8] ? d.v[8].v : undefined; - r.time = d && d.v[9] ? decode(d.v[9].v) : undefined; - return clean(r); } + r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.task = d && d.v[8] ? d.v[8].v : undefined; + r.time = d && d.v[9] ? decode(d.v[9].v) : undefined; + return clean(r); +} function encprocess(d) { - var tup = atom('process'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var roles = []; if ('roles' in d && d.roles) - { d.roles.forEach(function(x){ - roles.push(encode(x))}); - roles={t:108,v:roles}; } else { roles = nil() }; - var tasks = []; if ('tasks' in d && d.tasks) - { d.tasks.forEach(function(x){ - tasks.push(encode(x))}); - tasks={t:108,v:tasks}; } else { tasks = nil() }; - var events = []; if ('events' in d && d.events) - { d.events.forEach(function(x){ - events.push(encode(x))}); - events={t:108,v:events}; } else { events = nil() }; - var hist = 'hist' in d && d.hist ? encode(d.hist) : nil(); - var flows = []; if ('flows' in d && d.flows) - { d.flows.forEach(function(x){ - flows.push(encode(x))}); - flows={t:108,v:flows}; } else { flows = nil() }; - var rules = 'rules' in d && d.rules ? encode(d.rules) : nil(); - var docs = []; if ('docs' in d && d.docs) - { d.docs.forEach(function(x){ - docs.push(encode(x))}); - docs={t:108,v:docs}; } else { docs = nil() }; - var options = 'options' in d && d.options ? encode(d.options) : nil(); - var task = 'task' in d && d.task ? atom(d.task) : nil(); - var timer = 'timer' in d && d.timer ? bin(d.timer) : nil(); - var notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil(); - var result = 'result' in d && d.result ? bin(d.result) : nil(); - var started = 'started' in d && d.started ? bin(d.started) : nil(); - var beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil(); - var endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil(); - return tuple(tup,id,container,feed_id,prev,next,feeds,name,roles,tasks,events, - hist,flows,rules,docs,options,task,timer,notifications,result,started,beginEvent,endEvent); } + const tup = atom('process'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + const name = 'name' in d && d.name ? bin(d.name) : nil(); + let roles = []; if ('roles' in d && d.roles) { + d.roles.forEach((x) => { + roles.push(encode(x)); + }); + roles = { t: 108, v: roles }; + } else { roles = nil(); } + let tasks = []; if ('tasks' in d && d.tasks) { + d.tasks.forEach((x) => { + tasks.push(encode(x)); + }); + tasks = { t: 108, v: tasks }; + } else { tasks = nil(); } + let events = []; if ('events' in d && d.events) { + d.events.forEach((x) => { + events.push(encode(x)); + }); + events = { t: 108, v: events }; + } else { events = nil(); } + const hist = 'hist' in d && d.hist ? encode(d.hist) : nil(); + let flows = []; if ('flows' in d && d.flows) { + d.flows.forEach((x) => { + flows.push(encode(x)); + }); + flows = { t: 108, v: flows }; + } else { flows = nil(); } + const rules = 'rules' in d && d.rules ? encode(d.rules) : nil(); + let docs = []; if ('docs' in d && d.docs) { + d.docs.forEach((x) => { + docs.push(encode(x)); + }); + docs = { t: 108, v: docs }; + } else { docs = nil(); } + const options = 'options' in d && d.options ? encode(d.options) : nil(); + const task = 'task' in d && d.task ? atom(d.task) : nil(); + const timer = 'timer' in d && d.timer ? bin(d.timer) : nil(); + const notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil(); + const result = 'result' in d && d.result ? bin(d.result) : nil(); + const started = 'started' in d && d.started ? bin(d.started) : nil(); + const beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil(); + const endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, feeds, name, roles, tasks, events, + hist, flows, rules, docs, options, task, timer, notifications, result, started, beginEvent, endEvent + ); +} function lenprocess() { return 23; } function decprocess(d) { - var r={}; r.tup = 'process'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; + const r = {}; r.tup = 'process'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : r.feeds = undefined; - r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.roles = []; + r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.roles = []; (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.roles.push(decode(x))}) : + d.v[8].v.forEach((x) => { r.roles.push(decode(x)); }) : r.roles = undefined; - r.tasks = []; + r.tasks = []; (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.tasks.push(decode(x))}) : + d.v[9].v.forEach((x) => { r.tasks.push(decode(x)); }) : r.tasks = undefined; - r.events = []; + r.events = []; (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.events.push(decode(x))}) : + d.v[10].v.forEach((x) => { r.events.push(decode(x)); }) : r.events = undefined; - r.hist = d && d.v[11] ? decode(d.v[11]) : undefined; - r.flows = []; + r.hist = d && d.v[11] ? decode(d.v[11]) : undefined; + r.flows = []; (d && d.v[12] && d.v[12].v) ? - d.v[12].v.forEach(function(x){r.flows.push(decode(x))}) : + d.v[12].v.forEach((x) => { r.flows.push(decode(x)); }) : r.flows = undefined; - r.rules = d && d.v[13] ? decode(d.v[13]) : undefined; - r.docs = []; + r.rules = d && d.v[13] ? decode(d.v[13]) : undefined; + r.docs = []; (d && d.v[14] && d.v[14].v) ? - d.v[14].v.forEach(function(x){r.docs.push(decode(x))}) : + d.v[14].v.forEach((x) => { r.docs.push(decode(x)); }) : r.docs = undefined; - r.options = d && d.v[15] ? decode(d.v[15].v) : undefined; - r.task = d && d.v[16] ? d.v[16].v : undefined; - r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined; - r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined; - r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined; - r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined; - r.beginEvent = d && d.v[21] ? d.v[21].v : undefined; - r.endEvent = d && d.v[22] ? d.v[22].v : undefined; - return clean(r); } + r.options = d && d.v[15] ? decode(d.v[15].v) : undefined; + r.task = d && d.v[16] ? d.v[16].v : undefined; + r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined; + r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined; + r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined; + r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined; + r.beginEvent = d && d.v[21] ? d.v[21].v : undefined; + r.endEvent = d && d.v[22] ? d.v[22].v : undefined; + return clean(r); +} function enccomplete(d) { - var tup = atom('complete'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - return tuple(tup,id); } + const tup = atom('complete'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + return tuple(tup, id); +} function lencomplete() { return 2; } function deccomplete(d) { - var r={}; r.tup = 'complete'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - return clean(r); } + const r = {}; r.tup = 'complete'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + return clean(r); +} function encproc(d) { - var tup = atom('proc'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - return tuple(tup,id); } + const tup = atom('proc'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + return tuple(tup, id); +} function lenproc() { return 2; } function decproc(d) { - var r={}; r.tup = 'proc'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - return clean(r); } + const r = {}; r.tup = 'proc'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + return clean(r); +} function enchisto(d) { - var tup = atom('histo'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - return tuple(tup,id); } + const tup = atom('histo'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + return tuple(tup, id); +} function lenhisto() { return 2; } function dechisto(d) { - var r={}; r.tup = 'histo'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - return clean(r); } + const r = {}; r.tup = 'histo'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + return clean(r); +} function enccreate(d) { - var tup = atom('create'); - var proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); - var docs = []; if ('docs' in d && d.docs) - { d.docs.forEach(function(x){ - docs.push(encode(x))}); - docs={t:108,v:docs}; } else { docs = nil() }; - return tuple(tup,proc,docs); } + const tup = atom('create'); + const proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); + let docs = []; if ('docs' in d && d.docs) { + d.docs.forEach((x) => { + docs.push(encode(x)); + }); + docs = { t: 108, v: docs }; + } else { docs = nil(); } + return tuple(tup, proc, docs); +} function lencreate() { return 3; } function deccreate(d) { - var r={}; r.tup = 'create'; - r.proc = d && d.v[1] ? decode(d.v[1]) : undefined; - r.docs = []; + const r = {}; r.tup = 'create'; + r.proc = d && d.v[1] ? decode(d.v[1]) : undefined; + r.docs = []; (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) : + d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) : r.docs = undefined; - return clean(r); } + return clean(r); +} function encamend(d) { - var tup = atom('amend'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var docs = []; if ('docs' in d && d.docs) - { d.docs.forEach(function(x){ - docs.push(encode(x))}); - docs={t:108,v:docs}; } else { docs = nil() }; - return tuple(tup,id,docs); } + const tup = atom('amend'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + let docs = []; if ('docs' in d && d.docs) { + d.docs.forEach((x) => { + docs.push(encode(x)); + }); + docs = { t: 108, v: docs }; + } else { docs = nil(); } + return tuple(tup, id, docs); +} function lenamend() { return 3; } function decamend(d) { - var r={}; r.tup = 'amend'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.docs = []; + const r = {}; r.tup = 'amend'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.docs = []; (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) : + d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) : r.docs = undefined; - return clean(r); } + return clean(r); +} function encJob(d) { - var tup = atom('Job'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); - var docs = []; if ('docs' in d && d.docs) - { d.docs.forEach(function(x){ - docs.push(encode(x))}); - docs={t:108,v:docs}; } else { docs = nil() }; - var time = 'time' in d && d.time ? number(d.time) : nil(); - var events = []; if ('events' in d && d.events) - { d.events.forEach(function(x){ - events.push(encode(x))}); - events={t:108,v:events}; } else { events = nil() }; - var status = 'status' in d && d.status ? encode(d.status) : nil(); - return tuple(tup,id,proc,docs,time,events,status); } + const tup = atom('Job'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); + let docs = []; if ('docs' in d && d.docs) { + d.docs.forEach((x) => { + docs.push(encode(x)); + }); + docs = { t: 108, v: docs }; + } else { docs = nil(); } + const time = 'time' in d && d.time ? number(d.time) : nil(); + let events = []; if ('events' in d && d.events) { + d.events.forEach((x) => { + events.push(encode(x)); + }); + events = { t: 108, v: events }; + } else { events = nil(); } + const status = 'status' in d && d.status ? encode(d.status) : nil(); + return tuple(tup, id, proc, docs, time, events, status); +} function lenJob() { return 7; } function decJob(d) { - var r={}; r.tup = 'Job'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.proc = d && d.v[2] ? decode(d.v[2]) : undefined; - r.docs = []; + const r = {}; r.tup = 'Job'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.proc = d && d.v[2] ? decode(d.v[2]) : undefined; + r.docs = []; (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.docs.push(decode(x))}) : + d.v[3].v.forEach((x) => { r.docs.push(decode(x)); }) : r.docs = undefined; - r.time = d && d.v[4] ? d.v[4].v : undefined; - r.events = []; + r.time = d && d.v[4] ? d.v[4].v : undefined; + r.events = []; (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.events.push(decode(x))}) : + d.v[5].v.forEach((x) => { r.events.push(decode(x)); }) : r.events = undefined; - r.status = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + r.status = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function encTest(d) { - var tup = atom('Test'); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,type,count); } + const tup = atom('Test'); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, type, count); +} function lenTest() { return 3; } function decTest(d) { - var r={}; r.tup = 'Test'; - r.type = d && d.v[1] ? decode(d.v[1]) : undefined; - r.count = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'Test'; + r.type = d && d.v[1] ? decode(d.v[1]) : undefined; + r.count = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} diff --git a/src/assets/vendor/utils/recorder.js b/src/assets/vendor/utils/recorder.js index 0fcb6b3ca..89caafa71 100644 --- a/src/assets/vendor/utils/recorder.js +++ b/src/assets/vendor/utils/recorder.js @@ -1,273 +1,273 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Recorder = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o { + let define, + module, + exports; return (function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { const a = typeof require === 'function' && require; if (!u && a) return a(o, !0); if (i) return i(o, !0); const f = new Error(`Cannot find module '${o}'`); throw f.code = 'MODULE_NOT_FOUND', f; } const l = n[o] = { exports: {} }; t[o][0].call(l.exports, (e) => { const n = t[o][1][e]; return s(n || e); }, l, l.exports, e, t, n, r); } return n[o].exports; } var i = typeof require === 'function' && require; for (let o = 0; o < r.length; o++)s(r[o]); return s; }({ + 1: [function (require, module, exports) { + module.exports = require('./recorder').Recorder; + }, { './recorder': 2 }], + 2: [function (require, module, exports) { + const _createClass = (function () { + function defineProperties(target, props) { + for (let i = 0; i < props.length; i++) { + const descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); + } + } return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; + }; + }()); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Recorder = undefined; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.Recorder = undefined; -var _inlineWorker = require('inline-worker'); + const _inlineWorker = require('inline-worker'); -var _inlineWorker2 = _interopRequireDefault(_inlineWorker); + const _inlineWorker2 = _interopRequireDefault(_inlineWorker); -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } -var Recorder = exports.Recorder = (function () { - function Recorder(source, cfg) { - var _this = this; + const Recorder = exports.Recorder = (function () { + function Recorder(source, cfg) { + const _this = this; - _classCallCheck(this, Recorder); + _classCallCheck(this, Recorder); - this.config = { + this.config = { bufferLen: 4096, numChannels: 2, mimeType: 'audio/wav' - }; - this.recording = false; - this.callbacks = { + }; + this.recording = false; + this.callbacks = { getBuffer: [], exportWAV: [] - }; + }; - Object.assign(this.config, cfg); - this.context = source.context; - this.node = (this.context.createScriptProcessor || this.context.createJavaScriptNode).call(this.context, this.config.bufferLen, this.config.numChannels, this.config.numChannels); + Object.assign(this.config, cfg); + this.context = source.context; + this.node = (this.context.createScriptProcessor || this.context.createJavaScriptNode).call(this.context, this.config.bufferLen, this.config.numChannels, this.config.numChannels); - this.node.onaudioprocess = function (e) { + this.node.onaudioprocess = function (e) { if (!_this.recording) return; - var buffer = []; - for (var channel = 0; channel < _this.config.numChannels; channel++) { - buffer.push(e.inputBuffer.getChannelData(channel)); + const buffer = []; + for (let channel = 0; channel < _this.config.numChannels; channel++) { + buffer.push(e.inputBuffer.getChannelData(channel)); } _this.worker.postMessage({ - command: 'record', - buffer: buffer + command: 'record', + buffer }); - }; + }; - source.connect(this.node); - this.node.connect(this.context.destination); //this should not be necessary + source.connect(this.node); + this.node.connect(this.context.destination); // this should not be necessary - var self = {}; - this.worker = new _inlineWorker2.default(function () { - var recLength = 0, - recBuffers = [], - sampleRate = undefined, - numChannels = undefined; + const self = {}; + this.worker = new _inlineWorker2.default((() => { + let recLength = 0, + recBuffers = [], + sampleRate, + numChannels; self.onmessage = function (e) { - switch (e.data.command) { - case 'init': - init(e.data.config); - break; - case 'record': - record(e.data.buffer); - break; - case 'exportWAV': - exportWAV(e.data.type); - break; - case 'getBuffer': - getBuffer(); - break; - case 'clear': - clear(); - break; - } + switch (e.data.command) { + case 'init': + init(e.data.config); + break; + case 'record': + record(e.data.buffer); + break; + case 'exportWAV': + exportWAV(e.data.type); + break; + case 'getBuffer': + getBuffer(); + break; + case 'clear': + clear(); + break; + } }; function init(config) { - sampleRate = config.sampleRate; - numChannels = config.numChannels; - initBuffers(); + sampleRate = config.sampleRate; + numChannels = config.numChannels; + initBuffers(); } function record(inputBuffer) { - for (var channel = 0; channel < numChannels; channel++) { - recBuffers[channel].push(inputBuffer[channel]); - } - recLength += inputBuffer[0].length; + for (let channel = 0; channel < numChannels; channel++) { + recBuffers[channel].push(inputBuffer[channel]); + } + recLength += inputBuffer[0].length; } function exportWAV(type) { - var buffers = []; - for (var channel = 0; channel < numChannels; channel++) { - buffers.push(mergeBuffers(recBuffers[channel], recLength)); - } - var interleaved = undefined; - if (numChannels === 2) { - interleaved = interleave(buffers[0], buffers[1]); - } else { - interleaved = buffers[0]; - } - var dataview = encodeWAV(interleaved); - var audioBlob = new Blob([dataview], { type: type }); - - self.postMessage({ command: 'exportWAV', data: audioBlob }); + const buffers = []; + for (let channel = 0; channel < numChannels; channel++) { + buffers.push(mergeBuffers(recBuffers[channel], recLength)); + } + let interleaved; + if (numChannels === 2) { + interleaved = interleave(buffers[0], buffers[1]); + } else { + interleaved = buffers[0]; + } + const dataview = encodeWAV(interleaved); + const audioBlob = new Blob([dataview], { type }); + + self.postMessage({ command: 'exportWAV', data: audioBlob }); } function getBuffer() { - var buffers = []; - for (var channel = 0; channel < numChannels; channel++) { - buffers.push(mergeBuffers(recBuffers[channel], recLength)); - } - self.postMessage({ command: 'getBuffer', data: buffers }); + const buffers = []; + for (let channel = 0; channel < numChannels; channel++) { + buffers.push(mergeBuffers(recBuffers[channel], recLength)); + } + self.postMessage({ command: 'getBuffer', data: buffers }); } function clear() { - recLength = 0; - recBuffers = []; - initBuffers(); + recLength = 0; + recBuffers = []; + initBuffers(); } function initBuffers() { - for (var channel = 0; channel < numChannels; channel++) { - recBuffers[channel] = []; - } + for (let channel = 0; channel < numChannels; channel++) { + recBuffers[channel] = []; + } } function mergeBuffers(recBuffers, recLength) { - var result = new Float32Array(recLength); - var offset = 0; - for (var i = 0; i < recBuffers.length; i++) { - result.set(recBuffers[i], offset); - offset += recBuffers[i].length; - } - return result; + const result = new Float32Array(recLength); + let offset = 0; + for (let i = 0; i < recBuffers.length; i++) { + result.set(recBuffers[i], offset); + offset += recBuffers[i].length; + } + return result; } function interleave(inputL, inputR) { - var length = inputL.length + inputR.length; - var result = new Float32Array(length); - - var index = 0, - inputIndex = 0; - - while (index < length) { - result[index++] = inputL[inputIndex]; - result[index++] = inputR[inputIndex]; - inputIndex++; - } - return result; + const length = inputL.length + inputR.length; + const result = new Float32Array(length); + + let index = 0, + inputIndex = 0; + + while (index < length) { + result[index++] = inputL[inputIndex]; + result[index++] = inputR[inputIndex]; + inputIndex++; + } + return result; } function floatTo16BitPCM(output, offset, input) { - for (var i = 0; i < input.length; i++, offset += 2) { - var s = Math.max(-1, Math.min(1, input[i])); - output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true); - } + for (let i = 0; i < input.length; i++, offset += 2) { + const s = Math.max(-1, Math.min(1, input[i])); + output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true); + } } function writeString(view, offset, string) { - for (var i = 0; i < string.length; i++) { - view.setUint8(offset + i, string.charCodeAt(i)); - } + for (let i = 0; i < string.length; i++) { + view.setUint8(offset + i, string.charCodeAt(i)); + } } function encodeWAV(samples) { - var buffer = new ArrayBuffer(44 + samples.length * 2); - var view = new DataView(buffer); - - /* RIFF identifier */ - writeString(view, 0, 'RIFF'); - /* RIFF chunk length */ - view.setUint32(4, 36 + samples.length * 2, true); - /* RIFF type */ - writeString(view, 8, 'WAVE'); - /* format chunk identifier */ - writeString(view, 12, 'fmt '); - /* format chunk length */ - view.setUint32(16, 16, true); - /* sample format (raw) */ - view.setUint16(20, 1, true); - /* channel count */ - view.setUint16(22, numChannels, true); - /* sample rate */ - view.setUint32(24, sampleRate, true); - /* byte rate (sample rate * block align) */ - view.setUint32(28, sampleRate * 4, true); - /* block align (channel count * bytes per sample) */ - view.setUint16(32, numChannels * 2, true); - /* bits per sample */ - view.setUint16(34, 16, true); - /* data chunk identifier */ - writeString(view, 36, 'data'); - /* data chunk length */ - view.setUint32(40, samples.length * 2, true); - - floatTo16BitPCM(view, 44, samples); - - return view; + const buffer = new ArrayBuffer(44 + samples.length * 2); + const view = new DataView(buffer); + + /* RIFF identifier */ + writeString(view, 0, 'RIFF'); + /* RIFF chunk length */ + view.setUint32(4, 36 + samples.length * 2, true); + /* RIFF type */ + writeString(view, 8, 'WAVE'); + /* format chunk identifier */ + writeString(view, 12, 'fmt '); + /* format chunk length */ + view.setUint32(16, 16, true); + /* sample format (raw) */ + view.setUint16(20, 1, true); + /* channel count */ + view.setUint16(22, numChannels, true); + /* sample rate */ + view.setUint32(24, sampleRate, true); + /* byte rate (sample rate * block align) */ + view.setUint32(28, sampleRate * 4, true); + /* block align (channel count * bytes per sample) */ + view.setUint16(32, numChannels * 2, true); + /* bits per sample */ + view.setUint16(34, 16, true); + /* data chunk identifier */ + writeString(view, 36, 'data'); + /* data chunk length */ + view.setUint32(40, samples.length * 2, true); + + floatTo16BitPCM(view, 44, samples); + + return view; } - }, self); + }), self); - this.worker.postMessage({ + this.worker.postMessage({ command: 'init', config: { - sampleRate: this.context.sampleRate, - numChannels: this.config.numChannels + sampleRate: this.context.sampleRate, + numChannels: this.config.numChannels } - }); + }); - this.worker.onmessage = function (e) { - var cb = _this.callbacks[e.data.command].pop(); - if (typeof cb == 'function') { - cb(e.data.data); + this.worker.onmessage = function (e) { + const cb = _this.callbacks[e.data.command].pop(); + if (typeof cb === 'function') { + cb(e.data.data); } - }; - } + }; + } - _createClass(Recorder, [{ - key: 'record', - value: function record() { + _createClass(Recorder, [{ + key: 'record', + value: function record() { this.recording = true; - } - }, { - key: 'stop', - value: function stop() { + } + }, { + key: 'stop', + value: function stop() { this.recording = false; - } - }, { - key: 'clear', - value: function clear() { + } + }, { + key: 'clear', + value: function clear() { this.worker.postMessage({ command: 'clear' }); - } - }, { - key: 'getBuffer', - value: function getBuffer(cb) { + } + }, { + key: 'getBuffer', + value: function getBuffer(cb) { cb = cb || this.config.callback; if (!cb) throw new Error('Callback not set'); this.callbacks.getBuffer.push(cb); this.worker.postMessage({ command: 'getBuffer' }); - } - }, { - key: 'exportWAV', - value: function exportWAV(cb, mimeType) { + } + }, { + key: 'exportWAV', + value: function exportWAV(cb, mimeType) { mimeType = mimeType || this.config.mimeType; cb = cb || this.config.callback; if (!cb) throw new Error('Callback not set'); @@ -275,83 +275,81 @@ var Recorder = exports.Recorder = (function () { this.callbacks.exportWAV.push(cb); this.worker.postMessage({ - command: 'exportWAV', - type: mimeType + command: 'exportWAV', + type: mimeType }); - } - }], [{ - key: 'forceDownload', - value: function forceDownload(blob, filename) { - var url = (window.URL || window.webkitURL).createObjectURL(blob); - var link = window.document.createElement('a'); + } + }], [{ + key: 'forceDownload', + value: function forceDownload(blob, filename) { + const url = (window.URL || window.webkitURL).createObjectURL(blob); + const link = window.document.createElement('a'); link.href = url; link.download = filename || 'output.wav'; - var click = document.createEvent("Event"); - click.initEvent("click", true, true); + const click = document.createEvent('Event'); + click.initEvent('click', true, true); link.dispatchEvent(click); - } - }]); - - return Recorder; -})(); + } + }]); -exports.default = Recorder; + return Recorder; + }()); -},{"inline-worker":3}],3:[function(require,module,exports){ -"use strict"; + exports.default = Recorder; + }, { 'inline-worker': 3 }], + 3: [function (require, module, exports) { + module.exports = require('./inline-worker'); + }, { './inline-worker': 4 }], + 4: [function (require, module, exports) { + (function (global) { + const _createClass = (function () { function defineProperties(target, props) { for (const key in props) { const prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }()); -module.exports = require("./inline-worker"); -},{"./inline-worker":4}],4:[function(require,module,exports){ -(function (global){ -"use strict"; + const _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; -var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + const WORKER_ENABLED = !!(global === global.window && global.URL && global.Blob && global.Worker); -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + const InlineWorker = (function () { + function InlineWorker(func, self) { + const _this = this; -var WORKER_ENABLED = !!(global === global.window && global.URL && global.Blob && global.Worker); + _classCallCheck(this, InlineWorker); -var InlineWorker = (function () { - function InlineWorker(func, self) { - var _this = this; + if (WORKER_ENABLED) { + const functionBody = func.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1]; + const url = global.URL.createObjectURL(new global.Blob([functionBody], { type: 'text/javascript' })); - _classCallCheck(this, InlineWorker); - - if (WORKER_ENABLED) { - var functionBody = func.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1]; - var url = global.URL.createObjectURL(new global.Blob([functionBody], { type: "text/javascript" })); - - return new global.Worker(url); - } + return new global.Worker(url); + } - this.self = self; - this.self.postMessage = function (data) { - setTimeout(function () { - _this.onmessage({ data: data }); - }, 0); - }; + this.self = self; + this.self.postMessage = function (data) { + setTimeout(() => { + _this.onmessage({ data }); + }, 0); + }; - setTimeout(function () { - func.call(self); - }, 0); - } + setTimeout(() => { + func.call(self); + }, 0); + } - _createClass(InlineWorker, { - postMessage: { - value: function postMessage(data) { - var _this = this; + _createClass(InlineWorker, { + postMessage: { + value: function postMessage(data) { + const _this = this; - setTimeout(function () { - _this.self.onmessage({ data: data }); - }, 0); - } - } - }); + setTimeout(() => { + _this.self.onmessage({ data }); + }, 0); + } + } + }); - return InlineWorker; -})(); + return InlineWorker; + }()); -module.exports = InlineWorker; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}]},{},[1])(1) -}); \ No newline at end of file + module.exports = InlineWorker; + }).call(this, typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {}); + }, {}] + }, {}, [1]))(1); +})); diff --git a/src/assets/vendor/utils/signin.js b/src/assets/vendor/utils/signin.js index 44f6ad0df..64d65a17c 100644 --- a/src/assets/vendor/utils/signin.js +++ b/src/assets/vendor/utils/signin.js @@ -1,216 +1,230 @@ -var SignInWidget; +let SignInWidget; (function () { - var el, t, verifyAttempt = 0; - SignInWidget = { - settings: { - geoIpService: "//freegeoip.net/json/", - minNumberDigits: 10, - minCodeDigits: 6, - voiceLinkAfter: 3 + let el, + t, + verifyAttempt = 0; + SignInWidget = { + settings: { + geoIpService: '//freegeoip.net/json/', + minNumberDigits: 10, + minCodeDigits: 6, + voiceLinkAfter: 3 + }, + elements: { + countryData: [], + addressDropdown: '#country', + codeInput: '#code', + codeInput2: '#code2', + telRealInput: '#number', + telRealInput2: '#number2', + telInput: '#full-number', + verify: '#verify', + timerBlock: '#timer', + resendSms: '#resendSms', + voiceCall: '#voiceCall', + sendCodeBtn: '#sendCode', + sendVerifyBtn: '#verifyCode', + step: '#step', + stepClass: '.step' + }, + init() { + t = this; + el = this.elements; + + this.subscribe(); + this.initCountry(); + this.initCodePhone(); + this.bindUIActions(); + this.initElementMasks(); + }, + subscribe() { + GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent); + GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId); + GlobalWidget.subscribe('roster.patch', this, this.toDashboard); + GlobalWidget.subscribe('io.ok2.login', this, this.login); + }, + initCodePhone() { + $(el.telInput).intlTelInput({ + allowDropdown: false, + initialCountry: 'auto', + geoIpLookup() { + $.get(t.settings.geoIpService, () => { + }, 'jsonp').always((resp) => { + const countryCode = (resp && resp.country_code) ? resp.country_code : ''; + $(el.telInput).intlTelInput('setCountry', countryCode.toLowerCase()); + }); }, - elements: { - countryData: [], - addressDropdown: '#country', - codeInput: '#code', - codeInput2: '#code2', - telRealInput: '#number', - telRealInput2: '#number2', - telInput: '#full-number', - verify: '#verify', - timerBlock: '#timer', - resendSms: '#resendSms', - voiceCall: '#voiceCall', - sendCodeBtn: '#sendCode', - sendVerifyBtn: '#verifyCode', - step: '#step', - stepClass: ".step" - }, - init: function () { - t = this; - el = this.elements; - - this.subscribe(); - this.initCountry(); - this.initCodePhone(); - this.bindUIActions(); - this.initElementMasks(); - }, - subscribe: function () { - GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent); - GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId); - GlobalWidget.subscribe('roster.patch', this, this.toDashboard); - GlobalWidget.subscribe('io.ok2.login', this, this.login); - }, - initCodePhone: function () { - $(el.telInput).intlTelInput({ - allowDropdown: false, - initialCountry: "auto", - geoIpLookup: function () { - $.get(t.settings.geoIpService, function () { - }, "jsonp").always(function (resp) { - var countryCode = (resp && resp.country_code) ? resp.country_code : ""; - $(el.telInput).intlTelInput("setCountry", countryCode.toLowerCase()); - }); - }, - utilsScript: "../../build/js/utils.js" - }); - }, - initCountry: function () { - el.countryData = $.fn.intlTelInput.getCountryData(); - $.each(el.countryData, function (i, country) { - $(el.addressDropdown).append($("").attr("value", country.iso2).text(country.name)); - }); - - $(el.addressDropdown).val($(el.telInput).intlTelInput("getSelectedCountryData").iso2); - }, - initElementMasks: function () { - $(el.codeInput).mask('+0000', {placeholder: "+----"}); - $(el.telRealInput).mask('00 0000 0000', {placeholder: "-- ---- ----"}); - $(el.verify).mask('000 000', {placeholder: "--- ---"}); - }, - bindUIActions: function () { - $(el.telInput).on("countrychange", function (e, countryData) { - $(el.addressDropdown).val(countryData.iso2); - $(el.codeInput).val('+' + countryData.dialCode); - $(el.telRealInput).focus(); - }); - $(el.addressDropdown).on('change', function () { - $(el.telInput).intlTelInput("setCountry", $(this).val()); - }); - $(el.telRealInput).on('keyup', function () { - if ($(this).val().length > t.settings.minNumberDigits) { - $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.sendCodeBtn).addClass('disabled').prop('disabled', true); - } - }).on('keypress', function (e) { - if (e.which == 13) { - $(el.sendCodeBtn).click(); - } - }); - $(el.verify).on('keyup', function () { - if ($(this).val().length > t.settings.minCodeDigits) { - $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true); - } - }).on('keypress', function (e) { - if (e.which == 13) { - $(el.sendVerifyBtn).click(); - } - }).on('focus', function () { - if (!$(el.timerBlock).hasClass('started')) { - if (verifyAttempt <= t.settings.voiceLinkAfter) { - $(el.timerBlock).addClass('started').timer([el.resendSms]); - verifyAttempt++; - } else { - $(el.timerBlock).addClass('started').timer([el.voiceCall]); - } - } - }); - - $(el.sendCodeBtn).on('click', function () { - var code = $(el.codeInput).val().replace("+", ""), - phone = $(el.telRealInput).val().split(" ").join(""); - - if (!$(this).hasClass('disabled') && code && phone) { - GlobalWidget.setPhoneCode("+" + code); - GlobalWidget.setPhone(phone); - $(el.codeInput2).val(GlobalWidget.getPhoneCode()); - $(el.telRealInput2).val(GlobalWidget.getPhone()); - - //1 - send sms - var msg = enc(encAuth({ - "type": "reg", "token": token(), "phone": GlobalWidget.getPhoneNumber(), - "client_id": client("reg_"), "dev_key": devKey() - })); - ws.send(msg); - } - }); - $(el.sendVerifyBtn).on('click', function () { - //2a - verify - var phone = GlobalWidget.getPhoneNumber(), - verifyCode = $(el.verify).val().split(" ").join(""), - msg = enc(encAuth({ - "type": "verify", "phone": phone, "token": token(), - "dev_key": devKey(), "sms_code": verifyCode - })); - ws.send(msg); - }); - $(el.resendSms).on('click', function (e) { - e.preventDefault(); - - $(el.timerMsg).removeClass('hidden'); - $(el.resendSms).addClass('hidden'); - $(el.timerBlock).removeClass('started'); - $(el.verify).val('').focus(); - - //2b - resend code - var msg = enc(encAuth({ - "type": "resend", "token": token(), "phone": GlobalWidget.getPhoneNumber(), - "client_id": client("reg_"), "dev_key": devKey() - })); - ws.send(msg); - }); - $(el.voiceCall).on('click', function (e) { - e.preventDefault(); - - $(el.timerMsg).removeClass('hidden'); - $(el.resendSms).addClass('hidden'); - $(el.timerBlock).removeClass('started'); - $(el.verify).val('').focus(); - - //2c - get code via voice call - var msg = enc(encAuth({ - "type": "voice", "token": token(), "phone": GlobalWidget.getPhoneNumber(), - "client_id": client("reg_"), "dev_key": devKey(), "services": ["ua"] - })); - ws.send(msg); - }); - - }, - nextStep: function (nextStep) { - var curStep = Number(nextStep) - 1; - localStorage.setItem('currentStep', nextStep); - - $(el.step + curStep).addClass("disabled completed").removeClass("active"); - $(el.step + nextStep).addClass("active").removeClass("disabled"); - - if (nextStep == 2) { - $(el.verify).focus(); - } - }, - smsSent: function () { - $(el.codeInput2).val(GlobalWidget.getPhoneCode()); - $(el.telRealInput2).val(GlobalWidget.getPhone()); - t.nextStep(2); - }, - login: function (res) { - if (res.code.src) { - console.log(res.code.src); - localStorage.setItem("client", res.code.src[0]); - localStorage.setItem("token", res.code.src[1]); - localStorage.removeItem('currentStep'); - - //3a. close "reg" connection - mqtt_close(); - - setTimeout(function () { - //3b. connect with gotten token - mqttOptions.password = token(); - mqttOptions.cleanSession = false; - delete mqttOptions.mqttVersion; - delete mqttOptions.mqttVersionExplicit; - - mqtt_open(mqttOptions); - }, 200); - } - }, - toDashboard: function (res) { - localStorage.removeItem('currentStep'); - location.replace("/web/dashboard.htm"); + utilsScript: '../../build/js/utils.js' + }); + }, + initCountry() { + el.countryData = $.fn.intlTelInput.getCountryData(); + $.each(el.countryData, (i, country) => { + $(el.addressDropdown).append($('').attr('value', country.iso2).text(country.name)); + }); + + $(el.addressDropdown).val($(el.telInput).intlTelInput('getSelectedCountryData').iso2); + }, + initElementMasks() { + $(el.codeInput).mask('+0000', { placeholder: '+----' }); + $(el.telRealInput).mask('00 0000 0000', { placeholder: '-- ---- ----' }); + $(el.verify).mask('000 000', { placeholder: '--- ---' }); + }, + bindUIActions() { + $(el.telInput).on('countrychange', (e, countryData) => { + $(el.addressDropdown).val(countryData.iso2); + $(el.codeInput).val(`+${countryData.dialCode}`); + $(el.telRealInput).focus(); + }); + $(el.addressDropdown).on('change', function () { + $(el.telInput).intlTelInput('setCountry', $(this).val()); + }); + $(el.telRealInput).on('keyup', function () { + if ($(this).val().length > t.settings.minNumberDigits) { + $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.sendCodeBtn).addClass('disabled').prop('disabled', true); + } + }).on('keypress', (e) => { + if (e.which == 13) { + $(el.sendCodeBtn).click(); + } + }); + $(el.verify).on('keyup', function () { + if ($(this).val().length > t.settings.minCodeDigits) { + $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true); + } + }).on('keypress', (e) => { + if (e.which == 13) { + $(el.sendVerifyBtn).click(); + } + }).on('focus', () => { + if (!$(el.timerBlock).hasClass('started')) { + if (verifyAttempt <= t.settings.voiceLinkAfter) { + $(el.timerBlock).addClass('started').timer([el.resendSms]); + verifyAttempt++; + } else { + $(el.timerBlock).addClass('started').timer([el.voiceCall]); + } + } + }); + + $(el.sendCodeBtn).on('click', function () { + let code = $(el.codeInput).val().replace('+', ''), + phone = $(el.telRealInput).val().split(' ').join(''); + + if (!$(this).hasClass('disabled') && code && phone) { + GlobalWidget.setPhoneCode(`+${code}`); + GlobalWidget.setPhone(phone); + $(el.codeInput2).val(GlobalWidget.getPhoneCode()); + $(el.telRealInput2).val(GlobalWidget.getPhone()); + + // 1 - send sms + const msg = enc(encAuth({ + type: 'reg', + token: token(), + phone: GlobalWidget.getPhoneNumber(), + client_id: client('reg_'), + dev_key: devKey() + })); + ws.send(msg); } - }; - SignInWidget.init(); -})(); + }); + $(el.sendVerifyBtn).on('click', () => { + // 2a - verify + let phone = GlobalWidget.getPhoneNumber(), + verifyCode = $(el.verify).val().split(' ').join(''), + msg = enc(encAuth({ + type: 'verify', + phone, + token: token(), + dev_key: devKey(), + sms_code: verifyCode + })); + ws.send(msg); + }); + $(el.resendSms).on('click', (e) => { + e.preventDefault(); + + $(el.timerMsg).removeClass('hidden'); + $(el.resendSms).addClass('hidden'); + $(el.timerBlock).removeClass('started'); + $(el.verify).val('').focus(); + + // 2b - resend code + const msg = enc(encAuth({ + type: 'resend', + token: token(), + phone: GlobalWidget.getPhoneNumber(), + client_id: client('reg_'), + dev_key: devKey() + })); + ws.send(msg); + }); + $(el.voiceCall).on('click', (e) => { + e.preventDefault(); + + $(el.timerMsg).removeClass('hidden'); + $(el.resendSms).addClass('hidden'); + $(el.timerBlock).removeClass('started'); + $(el.verify).val('').focus(); + + // 2c - get code via voice call + const msg = enc(encAuth({ + type: 'voice', + token: token(), + phone: GlobalWidget.getPhoneNumber(), + client_id: client('reg_'), + dev_key: devKey(), + services: ['ua'] + })); + ws.send(msg); + }); + }, + nextStep(nextStep) { + const curStep = Number(nextStep) - 1; + localStorage.setItem('currentStep', nextStep); + + $(el.step + curStep).addClass('disabled completed').removeClass('active'); + $(el.step + nextStep).addClass('active').removeClass('disabled'); + + if (nextStep == 2) { + $(el.verify).focus(); + } + }, + smsSent() { + $(el.codeInput2).val(GlobalWidget.getPhoneCode()); + $(el.telRealInput2).val(GlobalWidget.getPhone()); + t.nextStep(2); + }, + login(res) { + if (res.code.src) { + console.log(res.code.src); + localStorage.setItem('client', res.code.src[0]); + localStorage.setItem('token', res.code.src[1]); + localStorage.removeItem('currentStep'); + + // 3a. close "reg" connection + mqtt_close(); + + setTimeout(() => { + // 3b. connect with gotten token + mqttOptions.password = token(); + mqttOptions.cleanSession = false; + delete mqttOptions.mqttVersion; + delete mqttOptions.mqttVersionExplicit; + + mqtt_open(mqttOptions); + }, 200); + } + }, + toDashboard(res) { + localStorage.removeItem('currentStep'); + location.replace('/web/dashboard.htm'); + } + }; + SignInWidget.init(); +}()); diff --git a/src/assets/vendor/utils/signup.js b/src/assets/vendor/utils/signup.js index f7dcde502..60b1fa9f2 100644 --- a/src/assets/vendor/utils/signup.js +++ b/src/assets/vendor/utils/signup.js @@ -1,353 +1,367 @@ -var SignUpWidget; +let SignUpWidget; (function () { - var el, t, com, verifyAttempt = 0; - SignUpWidget = { - settings: { - geoIpService: "//freegeoip.net/json/", - minNumberDigits: 10, - minCodeDigits: 6, - voiceLinkAfter: 3 - }, - elements: { - countryData: [], - addressDropdown: '#country', - codeInput: '#code', - codeInput2: '#code2', - telRealInput: '#number', - telRealInput2: '#number2', - telInput: '#full-number', - verify: '#verify', - timerBlock: '#timer', - timerMsg: '#timerMsg', - resendSms: '#resendSms', - voiceCall: '#voiceCall', - first_name: "#first_name", - last_name: "#last_name", - sendCodeBtn: '#sendCode', - sendVerifyBtn: '#verifyCode', - doneBtn: '#doneBtn', - step: '#step', - stepClass: ".step", - termsLink: '.terms', - popup: '.n-popup', - popupText: '.n-text', - overlay: '.overlay', - close: '.close', - logo: '#logo' - }, - init: function () { - t = this; - el = this.elements; - com = this.components; - this.subscribe(); - this.initCurrentStep(); - this.initCountry(); - this.initCodePhone(); - this.bindUIActions(); - this.initElementMasks(); - }, - subscribe: function () { - GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId); - GlobalWidget.subscribe('roster.patch', this, this.toDashboard); - GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent); - GlobalWidget.subscribe('io.ok2.login', this, this.login); - }, - initCurrentStep: function () { - if (t.getRosterId()) { - location.replace('/web/dashboard.htm'); + let el, + t, + com, + verifyAttempt = 0; + SignUpWidget = { + settings: { + geoIpService: '//freegeoip.net/json/', + minNumberDigits: 10, + minCodeDigits: 6, + voiceLinkAfter: 3 + }, + elements: { + countryData: [], + addressDropdown: '#country', + codeInput: '#code', + codeInput2: '#code2', + telRealInput: '#number', + telRealInput2: '#number2', + telInput: '#full-number', + verify: '#verify', + timerBlock: '#timer', + timerMsg: '#timerMsg', + resendSms: '#resendSms', + voiceCall: '#voiceCall', + first_name: '#first_name', + last_name: '#last_name', + sendCodeBtn: '#sendCode', + sendVerifyBtn: '#verifyCode', + doneBtn: '#doneBtn', + step: '#step', + stepClass: '.step', + termsLink: '.terms', + popup: '.n-popup', + popupText: '.n-text', + overlay: '.overlay', + close: '.close', + logo: '#logo' + }, + init() { + t = this; + el = this.elements; + com = this.components; + this.subscribe(); + this.initCurrentStep(); + this.initCountry(); + this.initCodePhone(); + this.bindUIActions(); + this.initElementMasks(); + }, + subscribe() { + GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId); + GlobalWidget.subscribe('roster.patch', this, this.toDashboard); + GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent); + GlobalWidget.subscribe('io.ok2.login', this, this.login); + }, + initCurrentStep() { + if (t.getRosterId()) { + location.replace('/web/dashboard.htm'); + } + }, + initCodePhone() { + const countries = []; + $(el.telInput).intlTelInput({ + allowDropdown: false, + initialCountry: 'auto', + geoIpLookup() { + $.get(t.settings.geoIpService, () => { + }, 'jsonp').always((resp) => { + const countryCode = (resp && resp.country_code) ? resp.country_code.toLowerCase() : ''; + if (countryCode) { + SignUpWidget.setCountryMask(countryCode); } - }, - initCodePhone: function () { - var countries = []; - $(el.telInput).intlTelInput({ - allowDropdown: false, - initialCountry: "auto", - geoIpLookup: function () { - $.get(t.settings.geoIpService, function () { - }, "jsonp").always(function (resp) { - var countryCode = (resp && resp.country_code) ? resp.country_code.toLowerCase() : ""; - if (countryCode) { - SignUpWidget.setCountryMask(countryCode); - } - var countries = []; - $.each($.fn.intlTelInput.getCountryData(), function(key, item) { - typeof item === "object" ? countries.push(item) : null; + const countries = []; + $.each($.fn.intlTelInput.getCountryData(), (key, item) => { + typeof item === 'object' ? countries.push(item) : null; - if(item.iso2 === countryCode) { - Provider.registerInstance("current_country", item); - populateUI(item); - } - }); - Provider.registerInstance("countries", countries); - }); - - function populateUI(data) { - var searchCountry = com.country_search; - $(searchCountry.type + searchCountry.alias).val(searchCountry.data.escape(data.name)); - $(el.codeInput).val("+" + data.dialCode); - $(el.telInput).val(data.name); - } - }, + if (item.iso2 === countryCode) { + Provider.registerInstance('current_country', item); + populateUI(item); + } }); - }, - initCountry: function () { - el.countryData = $.fn.intlTelInput.getCountryData(); - var countries = el.countryData; - render(el.countryData); - $('#country-search').on('keyup', function(evt) { - var keyCodes = Provider.getInstance('key_codes'); - $('.countries-dropdown-wrapper').addClass('active'); + Provider.registerInstance('countries', countries); + }); - evt.keyCode !== keyCodes.up.code && evt.keyCode !== keyCodes.down.code - ? rerender($(this).val()) - : null; - }); + function populateUI(data) { + const searchCountry = com.country_search; + $(searchCountry.type + searchCountry.alias).val(searchCountry.data.escape(data.name)); + $(el.codeInput).val(`+${data.dialCode}`); + $(el.telInput).val(data.name); + } + } + }); + }, + initCountry() { + el.countryData = $.fn.intlTelInput.getCountryData(); + let countries = el.countryData; + render(el.countryData); + $('#country-search').on('keyup', function (evt) { + const keyCodes = Provider.getInstance('key_codes'); + $('.countries-dropdown-wrapper').addClass('active'); - function filterCountries(input) { - var reg = new RegExp(input.split('').join('\\w*').replace(/\W/, ""), 'i'); - !input ? countries = el.countryData : null; - return countries.filter(function(country) { - if (typeof country === 'object' - && "name" in country - && country.name.match(reg)) { - return country; - } - }); - } + evt.keyCode !== keyCodes.up.code && evt.keyCode !== keyCodes.down.code + ? rerender($(this).val()) + : null; + }); - function rerender(val) { - countries = filterCountries(val); - render(countries); - } + function filterCountries(input) { + const reg = new RegExp(input.split('').join('\\w*').replace(/\W/, ''), 'i'); + !input ? countries = el.countryData : null; + return countries.filter((country) => { + if (typeof country === 'object' + && 'name' in country + && country.name.match(reg)) { + return country; + } + }); + } - function render() { - $(el.addressDropdown).html(""); - $.each(countries, function (i, country) { - var listItem = "
  • "; - if(country.iso2 === Provider.getMutable("selected_id")) { - listItem = "
  • "; - } - $(el.addressDropdown) - .append($(listItem) - .attr("id", country.iso2) - .attr("data-code", country.dialCode) - .text(country.name.toUpperCase())); - countries.push(country.name); - }); - } + function rerender(val) { + countries = filterCountries(val); + render(countries); + } - }, - initElementMasks: function () { - $(el.codeInput).mask('+0000', {placeholder: "+————"}); - $(el.verify).mask('000000', {placeholder: "——————"}); - }, - setCountryMask: function(iso) { - /** + function render() { + $(el.addressDropdown).html(''); + $.each(countries, (i, country) => { + let listItem = '
  • '; + if (country.iso2 === Provider.getMutable('selected_id')) { + listItem = "
  • "; + } + $(el.addressDropdown) + .append($(listItem) + .attr('id', country.iso2) + .attr('data-code', country.dialCode) + .text(country.name.toUpperCase())); + countries.push(country.name); + }); + } + }, + initElementMasks() { + $(el.codeInput).mask('+0000', { placeholder: '+————' }); + $(el.verify).mask('000000', { placeholder: '——————' }); + }, + setCountryMask(iso) { + /** * number format: E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 * number type: FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4 ... */ - var maskExample = intlTelInputUtils.getExampleNumber(iso, 1, 1); - var maskPattern = maskExample.replace( /\d/g, "0" ); - var maskPlaceholder = maskPattern.replace( /0/g, "—" ); - t.settings.minNumberDigits = (maskPlaceholder.replace(/[ , (, )]/g, "").length - 1); - $(el.telRealInput).mask(maskPattern, {placeholder: maskPlaceholder}); - }, - bindUIActions: function () { - $(el.logo).on('click', function () { - location.replace('/web/welcome.htm'); - }); - $(el.termsLink).on('click', function (e) { - e.preventDefault(); - $(el.popupText).load('/web/terms.htm'); - $(el.popup).removeClass('hidden'); - $(el.overlay).removeClass('hidden'); - }); - $(el.overlay + ', ' + el.close).on('click', function () { - $(el.popupText).html(''); - $(el.popup).addClass('hidden'); - $(el.overlay).addClass('hidden'); - }); - $(el.telInput).on("countrychange", function (e, countryData) { - $(el.addressDropdown).val(countryData.iso2); - $(el.codeInput).val('+' + countryData.dialCode); - $(el.telRealInput).focus(); - SignUpWidget.setCountryMask(countryData.iso2); - }); - $(el.addressDropdown).on('change', function () { - $(el.telInput).intlTelInput("setCountry", $(this).val()); - }); - $(el.telRealInput).on('keyup', function () { - if ($(this).val().length > t.settings.minNumberDigits) { - $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.sendCodeBtn).addClass('disabled').prop('disabled', true); - } - }).on('keypress', function (e) { - if (e.which == 13) { - $(el.sendCodeBtn).click(); - } - }); - $(el.verify).on('keyup', function () { - if ($(this).val().length >= t.settings.minCodeDigits) { - $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true); - } - }).on('keypress', function (e) { - if (e.which == 13) { - $(el.sendVerifyBtn).click(); - } - }).on('focus', function () { - t.startTimer(); - }); - $(el.sendCodeBtn).on('click', function () { - var code = $(el.codeInput).val().replace("+", ""), - phone = $(el.telRealInput).val().split(" ").join(""); - - if (!$(this).hasClass('disabled') && code && phone) { - GlobalWidget.setPhoneCode("+" + code); - GlobalWidget.setPhone(phone); - $(el.codeInput2).val(GlobalWidget.getPhoneCode()); - $(el.telRealInput2).val(GlobalWidget.getPhone()); + const maskExample = intlTelInputUtils.getExampleNumber(iso, 1, 1); + const maskPattern = maskExample.replace(/\d/g, '0'); + const maskPlaceholder = maskPattern.replace(/0/g, '—'); + t.settings.minNumberDigits = (maskPlaceholder.replace(/[ , (, )]/g, '').length - 1); + $(el.telRealInput).mask(maskPattern, { placeholder: maskPlaceholder }); + }, + bindUIActions() { + $(el.logo).on('click', () => { + location.replace('/web/welcome.htm'); + }); + $(el.termsLink).on('click', (e) => { + e.preventDefault(); + $(el.popupText).load('/web/terms.htm'); + $(el.popup).removeClass('hidden'); + $(el.overlay).removeClass('hidden'); + }); + $(`${el.overlay}, ${el.close}`).on('click', () => { + $(el.popupText).html(''); + $(el.popup).addClass('hidden'); + $(el.overlay).addClass('hidden'); + }); + $(el.telInput).on('countrychange', (e, countryData) => { + $(el.addressDropdown).val(countryData.iso2); + $(el.codeInput).val(`+${countryData.dialCode}`); + $(el.telRealInput).focus(); + SignUpWidget.setCountryMask(countryData.iso2); + }); + $(el.addressDropdown).on('change', function () { + $(el.telInput).intlTelInput('setCountry', $(this).val()); + }); + $(el.telRealInput).on('keyup', function () { + if ($(this).val().length > t.settings.minNumberDigits) { + $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.sendCodeBtn).addClass('disabled').prop('disabled', true); + } + }).on('keypress', (e) => { + if (e.which == 13) { + $(el.sendCodeBtn).click(); + } + }); + $(el.verify).on('keyup', function () { + if ($(this).val().length >= t.settings.minCodeDigits) { + $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true); + } + }).on('keypress', (e) => { + if (e.which == 13) { + $(el.sendVerifyBtn).click(); + } + }).on('focus', () => { + t.startTimer(); + }); + $(el.sendCodeBtn).on('click', function () { + let code = $(el.codeInput).val().replace('+', ''), + phone = $(el.telRealInput).val().split(' ').join(''); - //1 - send sms - var msg = enc(encAuth({ - "type": "reg", "token": "", "phone": GlobalWidget.getPhoneNumber(), - "client_id": client("reg_"), "dev_key": devKey() - })); - ws.send(msg); - } - }); - $(el.sendVerifyBtn).on('click', function () { - //2a - verify - var phone = GlobalWidget.getPhoneNumber(), - verifyCode = $(el.verify).val().split(" ").join(""), - msg = enc(encAuth({ - "type": "verify", "phone": phone, "token": token(), - "dev_key": devKey(), "sms_code": verifyCode - })); - ws.send(msg); - }); - $(el.resendSms).on('click', function (e) { - e.preventDefault(); + if (!$(this).hasClass('disabled') && code && phone) { + GlobalWidget.setPhoneCode(`+${code}`); + GlobalWidget.setPhone(phone); + $(el.codeInput2).val(GlobalWidget.getPhoneCode()); + $(el.telRealInput2).val(GlobalWidget.getPhone()); - $(el.timerMsg).removeClass('hidden'); - $(el.resendSms).addClass('hidden'); - $(el.timerBlock).removeClass('started'); - $(el.verify).val('').focus(); + // 1 - send sms + const msg = enc(encAuth({ + type: 'reg', + token: '', + phone: GlobalWidget.getPhoneNumber(), + client_id: client('reg_'), + dev_key: devKey() + })); + ws.send(msg); + } + }); + $(el.sendVerifyBtn).on('click', () => { + // 2a - verify + let phone = GlobalWidget.getPhoneNumber(), + verifyCode = $(el.verify).val().split(' ').join(''), + msg = enc(encAuth({ + type: 'verify', + phone, + token: token(), + dev_key: devKey(), + sms_code: verifyCode + })); + ws.send(msg); + }); + $(el.resendSms).on('click', (e) => { + e.preventDefault(); - //2b - resend code - var msg = enc(encAuth({ - "type": "resend", "token": token(), "phone": GlobalWidget.getPhoneNumber(), - "client_id": client("reg_"), "dev_key": devKey() - })); - ws.send(msg); - }); - $(el.voiceCall).on('click', function (e) { - e.preventDefault(); + $(el.timerMsg).removeClass('hidden'); + $(el.resendSms).addClass('hidden'); + $(el.timerBlock).removeClass('started'); + $(el.verify).val('').focus(); - $(el.timerMsg).removeClass('hidden'); - $(el.resendSms).addClass('hidden'); - $(el.timerBlock).removeClass('started'); - $(el.verify).val('').focus(); + // 2b - resend code + const msg = enc(encAuth({ + type: 'resend', + token: token(), + phone: GlobalWidget.getPhoneNumber(), + client_id: client('reg_'), + dev_key: devKey() + })); + ws.send(msg); + }); + $(el.voiceCall).on('click', (e) => { + e.preventDefault(); - //2c - get code via voice call - var msg = enc(encAuth({ - "type": "voice", "token": token(), "phone": GlobalWidget.getPhoneNumber(), - "client_id": client("reg_"), "dev_key": devKey(), "services": ["ua"] - })); - ws.send(msg); - }); - $(el.first_name + "," + el.last_name).on('keyup', function () { - if ($(el.first_name).val().length) { - $(el.doneBtn).removeClass('disabled').prop('disabled', false); - } else { - $(el.doneBtn).addClass('disabled').prop('disabled', true); - } - }).on('keypress', function (e) { - if (e.which == 13) { - $(el.doneBtn).click(); - } - }); - $(el.doneBtn).click(function () { - var f = $(el.first_name).val(), - l = $(el.last_name).val(); + $(el.timerMsg).removeClass('hidden'); + $(el.resendSms).addClass('hidden'); + $(el.timerBlock).removeClass('started'); + $(el.verify).val('').focus(); - if (f) { - //4. update roster - var msg = enc(encRoster({ - "id": t.getRosterId(), - "names": f, - "surnames": l, - "phone": GlobalWidget.getPhoneNumber(), - "status": "patch" - })); - ws.send(msg); - } - }); - }, - startTimer: function () { - if (!$(el.timerBlock).hasClass('started')) { - if (verifyAttempt <= t.settings.voiceLinkAfter) { - $(el.timerBlock).addClass('started').timer([el.resendSms]); - verifyAttempt++; - } else { - $(el.timerBlock).addClass('started').timer([el.voiceCall]); - } - } - }, - currentStep: function () { - return localStorage.getItem('currentStep'); - }, - nextStep: function (nextStep) { - var curStep = Number(nextStep) - 1; - localStorage.setItem('currentStep', nextStep); + // 2c - get code via voice call + const msg = enc(encAuth({ + type: 'voice', + token: token(), + phone: GlobalWidget.getPhoneNumber(), + client_id: client('reg_'), + dev_key: devKey(), + services: ['ua'] + })); + ws.send(msg); + }); + $(`${el.first_name},${el.last_name}`).on('keyup', () => { + if ($(el.first_name).val().length) { + $(el.doneBtn).removeClass('disabled').prop('disabled', false); + } else { + $(el.doneBtn).addClass('disabled').prop('disabled', true); + } + }).on('keypress', (e) => { + if (e.which == 13) { + $(el.doneBtn).click(); + } + }); + $(el.doneBtn).click(() => { + let f = $(el.first_name).val(), + l = $(el.last_name).val(); - $(el.step + curStep).addClass("disabled completed hidden"); - $(el.step + nextStep).addClass("active").removeClass("disabled hidden"); + if (f) { + // 4. update roster + const msg = enc(encRoster({ + id: t.getRosterId(), + names: f, + surnames: l, + phone: GlobalWidget.getPhoneNumber(), + status: 'patch' + })); + ws.send(msg); + } + }); + }, + startTimer() { + if (!$(el.timerBlock).hasClass('started')) { + if (verifyAttempt <= t.settings.voiceLinkAfter) { + $(el.timerBlock).addClass('started').timer([el.resendSms]); + verifyAttempt++; + } else { + $(el.timerBlock).addClass('started').timer([el.voiceCall]); + } + } + }, + currentStep() { + return localStorage.getItem('currentStep'); + }, + nextStep(nextStep) { + const curStep = Number(nextStep) - 1; + localStorage.setItem('currentStep', nextStep); - if (nextStep == 2) { - $(el.verify).focus(); - } - }, - getRosterId: function () { - //@TODO: need to remove this function - return localStorage.getItem('rosterId'); - }, - smsSent: function () { - t.nextStep(2); - }, - login: function (res) { - if (typeof res.code.src != "undefined") { - localStorage.setItem("client", res.code.src[0]); - localStorage.setItem("token", res.code.src[1]); - localStorage.removeItem('currentStep'); + $(el.step + curStep).addClass('disabled completed hidden'); + $(el.step + nextStep).addClass('active').removeClass('disabled hidden'); - //3a. close "reg" connection - mqtt_close(); + if (nextStep == 2) { + $(el.verify).focus(); + } + }, + getRosterId() { + // @TODO: need to remove this function + return localStorage.getItem('rosterId'); + }, + smsSent() { + t.nextStep(2); + }, + login(res) { + if (typeof res.code.src !== 'undefined') { + localStorage.setItem('client', res.code.src[0]); + localStorage.setItem('token', res.code.src[1]); + localStorage.removeItem('currentStep'); - setTimeout(function () { - //3b. connect with gotten token - mqttOptions.password = token(); - mqttOptions.cleanSession = false; - delete mqttOptions.mqttVersion; - delete mqttOptions.mqttVersionExplicit; - mqtt_open(mqttOptions); + // 3a. close "reg" connection + mqtt_close(); - SignUpWidget.nextStep(3); - }, 200); - } - }, - toDashboard: function (res) { - location.replace("/web/dashboard.htm"); - } - }; + setTimeout(() => { + // 3b. connect with gotten token + mqttOptions.password = token(); + mqttOptions.cleanSession = false; + delete mqttOptions.mqttVersion; + delete mqttOptions.mqttVersionExplicit; + mqtt_open(mqttOptions); - $(document).ready(function () { - SignUpWidget.components = Provider.getInstance("components") - SignUpWidget.init(); - }); + SignUpWidget.nextStep(3); + }, 200); + } + }, + toDashboard(res) { + location.replace('/web/dashboard.htm'); + } + }; -})(); + $(document).ready(() => { + SignUpWidget.components = Provider.getInstance('components'); + SignUpWidget.init(); + }); +}()); diff --git a/src/assets/vendor/utils/spa_mq.js b/src/assets/vendor/utils/spa_mq.js index df171ba45..47a76ad23 100644 --- a/src/assets/vendor/utils/spa_mq.js +++ b/src/assets/vendor/utils/spa_mq.js @@ -1,122 +1,123 @@ - var mqtt = '', - nodes = 4, - mqttOptions = { - timeout: 2, - userName: "api", - password: token(), - cleanSession: true, - onFailure: function (m) { - console.log("%cClient{%s, %s} - connection to backend failed: %s", "color:red", client(), token(), m.errorMessage); - }, - onSuccess: function () { - console.log("%cClient{%s, %s} - connected to backend", "color:green", client(), token()); - } +let mqtt = '', + nodes = 4, + mqttOptions = { + timeout: 2, + userName: 'api', + password: token(), + cleanSession: true, + onFailure(m) { + console.log('%cClient{%s, %s} - connection to backend failed: %s', 'color:red', client(), token(), m.errorMessage); }, - ws = { - send: function (payload, qos) { - var message = new Paho.MQTT.Message(payload); - message.destinationName = topic("events"); - message.qos = qos || 2; - binPayload(payload); - - if (!mqtt.isConnected()) { - //@TODO: check this reconnect - //console.log('MQTT Reconnect') - //mqtt_open(mqttOptions); - } - mqtt.send(message); - } - }; + onSuccess() { + console.log('%cClient{%s, %s} - connected to backend', 'color:green', client(), token()); + } + }, + ws = { + send(payload, qos) { + const message = new Paho.MQTT.Message(payload); + message.destinationName = topic('events'); + message.qos = qos || 2; + binPayload(payload); + + if (!mqtt.isConnected()) { + // @TODO: check this reconnect + // console.log('MQTT Reconnect') + // mqtt_open(mqttOptions); + } + mqtt.send(message); + } + }; function gen_client() { - return Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36); + return Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36); } function client(prefix) { - var prefix = prefix || "emqttd_"; - var c = localStorage.getItem("client"); - var d = devKey() || gen_client(); - if (null == c) { - c = prefix + d; - } - localStorage.setItem("client", c); - localStorage.setItem("devKey", d); - return c; + var prefix = prefix || 'emqttd_'; + let c = localStorage.getItem('client'); + const d = devKey() || gen_client(); + if (c == null) { + c = prefix + d; + } + localStorage.setItem('client', c); + localStorage.setItem('devKey', d); + return c; } function token() { - return localStorage.getItem("token") || ''; + return localStorage.getItem('token') || ''; } function devKey() { - return localStorage.getItem("devKey") || ''; + return localStorage.getItem('devKey') || ''; } function vsn() { - return 1; + return 1; } function topic(prefix) { - return prefix + "/" + vsn() + "/" + rnd() + "/api/anon/" + client("reg_") + "/" + token(); + return `${prefix}/${vsn()}/${rnd()}/api/anon/${client('reg_')}/${token()}`; } function rnd() { - return Math.floor((Math.random() * nodes) + 1); + return Math.floor((Math.random() * nodes) + 1); } function binMsg(BERT) { - var mas = new Uint8Array(BERT); - var s = "<< rp(binary_to_term(<<"; - for (var i =0; i 0) { - timerId = setTimeout(counter, 1000); - } else { - el.parent().addClass('hidden'), - $.each(show_elements, function(k,v){ - $(v).removeClass('hidden'); - }); - el.text(start_value), - clearTimeout(timerId); - } - }, 1000); - }; -})(jQuery); \ No newline at end of file + el.text(new_value); + if (new_value > 0) { + timerId = setTimeout(counter, 1000); + } else { + el.parent().addClass('hidden'), + $.each(show_elements, (k, v) => { + $(v).removeClass('hidden'); + }); + el.text(start_value), + clearTimeout(timerId); + } + }, 1000); + }; +}(jQuery)); diff --git a/src/assets/vendor/utils/voximplant.js b/src/assets/vendor/utils/voximplant.js index df9764fcc..bd5083a17 100644 --- a/src/assets/vendor/utils/voximplant.js +++ b/src/assets/vendor/utils/voximplant.js @@ -1,7 +1,7 @@ -var initialized = false, - loggedIn = false, - connected = false, - voxImplant = VoxImplant.getInstance(); +let initialized = false, + loggedIn = false, + connected = false, + voxImplant = VoxImplant.getInstance(); // Add event listeners voxImplant.addEventListener(VoxImplant.Events.SDKReady, handleSDKReady); @@ -9,76 +9,75 @@ voxImplant.addEventListener(VoxImplant.Events.ConnectionEstablished, handleConne voxImplant.addEventListener(VoxImplant.Events.AuthResult, handleAuthResult); function handleSDKReady() { - initialized = true; - logMessage("VoxImplant SDK ready"); - // Connection with VoxImplant Cloud can be established now - voxImplant.connect(); + initialized = true; + logMessage('VoxImplant SDK ready'); + // Connection with VoxImplant Cloud can be established now + voxImplant.connect(); } function handleConnectionEstablished() { - connected = true; - logMessage("Connection established"); - login(); + connected = true; + logMessage('Connection established'); + login(); } function handleAuthResult(e) { - logMessage("AuthResult: "+e.result); - if (e.result) { - // Logged in successfully - loggedIn = true; - makeCall(); - } else { - logMessage("Authorization failed. Please specify correct username and password"); - } + logMessage(`AuthResult: ${e.result}`); + if (e.result) { + // Logged in successfully + loggedIn = true; + makeCall(); + } else { + logMessage('Authorization failed. Please specify correct username and password'); + } } -function login(){ - // Authorization required before we can use other functions - var host = '@test.nynja.voximplant.com', - email = 'befaster', //localStorage.getItem('username'), - password = 'd423327D'; //localStorage.getItem('password'); - +function login() { + // Authorization required before we can use other functions + let host = '@test.nynja.voximplant.com', + email = 'befaster', // localStorage.getItem('username'), + password = 'd423327D'; // localStorage.getItem('password'); - voxImplant.login(email + host, password); + voxImplant.login(email + host, password); } function logMessage(msg) { - document.getElementById("log").innerHTML += msg + "\n"; + document.getElementById('log').innerHTML += `${msg}\n`; } -function makeCall(username){ - // Number isn't important - our simple VoxEngine script will just playback the audio file - var call = voxImplant.call(username); +function makeCall(username) { + // Number isn't important - our simple VoxEngine script will just playback the audio file + const call = voxImplant.call(username); - // Add event listeners for call events - call.addEventListener(VoxImplant.CallEvents.Connected, handleCallConnected); - call.addEventListener(VoxImplant.CallEvents.Failed, handleCallFailed); - call.addEventListener(VoxImplant.CallEvents.Disconnected, handleCallDisconnected); + // Add event listeners for call events + call.addEventListener(VoxImplant.CallEvents.Connected, handleCallConnected); + call.addEventListener(VoxImplant.CallEvents.Failed, handleCallFailed); + call.addEventListener(VoxImplant.CallEvents.Disconnected, handleCallDisconnected); } function handleCallConnected() { - logMessage("Call Connected"); + logMessage('Call Connected'); } function handleCallFailed(e) { - logMessage("Call Failed. Code: "+e.code+" Reason: "+e.reason); + logMessage(`Call Failed. Code: ${e.code} Reason: ${e.reason}`); } function handleCallDisconnected() { - logMessage("Call Disconnected"); + logMessage('Call Disconnected'); } function testCall() { - // Initialize SDK if not it's not initialized yet - if (!initialized) voxImplant.init(); + // Initialize SDK if not it's not initialized yet + if (!initialized) voxImplant.init(); + else { + // Establish connection with VoxImplant Cloud if it's not established yet + if (!voxImplant.connected()) voxImplant.connect(); else { - // Establish connection with VoxImplant Cloud if it's not established yet - if (!voxImplant.connected()) voxImplant.connect(); - else { - // Login if not logged in yet, otherwise - make a call - if (!loggedIn) login(); - else makeCall(); - } + // Login if not logged in yet, otherwise - make a call + if (!loggedIn) login(); + else makeCall(); } -} \ No newline at end of file + } +} diff --git a/src/assets/vendor/utils/welcome.js b/src/assets/vendor/utils/welcome.js index b55a3c680..7b5c3ea6b 100644 --- a/src/assets/vendor/utils/welcome.js +++ b/src/assets/vendor/utils/welcome.js @@ -1,36 +1,36 @@ -var WelcomeWidget; +let WelcomeWidget; (function (document) { - WelcomeWidget = { - settings: {}, - elements: { - termsLink: '.terms', - popup: '.n-popup', - popupText: '.n-text', - overlay: '.overlay', - close: '.close' - }, - init: function () { - t = this; - el = this.elements; - this.bindUIActions(); - }, - bindUIActions: function () { - $(el.termsLink).on('click', function (e) { - e.preventDefault(); - $(el.popupText).load('/web/terms.htm'); - $(el.popup).removeClass('hidden'); - $(el.overlay).removeClass('hidden'); - }); - $(el.overlay + ', ' + el.close).on('click', function () { - $(el.popupText).html(''); - $(el.popup).addClass('hidden'); - $(el.overlay).addClass('hidden'); - }); - } - }; + WelcomeWidget = { + settings: {}, + elements: { + termsLink: '.terms', + popup: '.n-popup', + popupText: '.n-text', + overlay: '.overlay', + close: '.close' + }, + init() { + t = this; + el = this.elements; + this.bindUIActions(); + }, + bindUIActions() { + $(el.termsLink).on('click', (e) => { + e.preventDefault(); + $(el.popupText).load('/web/terms.htm'); + $(el.popup).removeClass('hidden'); + $(el.overlay).removeClass('hidden'); + }); + $(`${el.overlay}, ${el.close}`).on('click', () => { + $(el.popupText).html(''); + $(el.popup).addClass('hidden'); + $(el.overlay).addClass('hidden'); + }); + } + }; - $(document).ready(function () { - WelcomeWidget.init(); - }); -})(document); \ No newline at end of file + $(document).ready(() => { + WelcomeWidget.init(); + }); +}(document)); diff --git a/src/componets/ChatListItem/ChatListItem.js b/src/componets/ChatListItem/ChatListItem.js index dabbea0f7..3ca339116 100644 --- a/src/componets/ChatListItem/ChatListItem.js +++ b/src/componets/ChatListItem/ChatListItem.js @@ -1,4 +1,4 @@ -import React,{ Component} from 'react'; +import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import List, { ListItem, ListItemText } from 'material-ui/List'; @@ -6,76 +6,75 @@ import Avatar from 'material-ui/Avatar'; import ImageIcon from 'material-ui-icons/Image'; import WorkIcon from 'material-ui-icons/Work'; import BeachAccessIcon from 'material-ui-icons/BeachAccess'; -import {ExpansionPanel, ExpansionPanelDetails, ExpansionPanelSummary, Typography} from "material-ui"; -import ListItemSecondaryAction from "material-ui/es/List/ListItemSecondaryAction"; -import Button from "material-ui/es/Button/Button"; +import { ExpansionPanel, ExpansionPanelDetails, ExpansionPanelSummary, Typography } from 'material-ui'; +import ListItemSecondaryAction from 'material-ui/es/List/ListItemSecondaryAction'; +import Button from 'material-ui/es/Button/Button'; const styles = theme => ({ - root: { - width: '100%', - backgroundColor: theme.palette.background.paper, - }, - panelContent:{ - margin: 0, - display: 'flow-root' - }, - panelRoot:{ - padding: 0 - }, - panelDetails:{ - background: '#1b1c20', + root: { + width: '100%', + backgroundColor: theme.palette.background.paper + }, + panelContent: { + margin: 0, + display: 'flow-root' + }, + panelRoot: { + padding: 0 + }, + panelDetails: { + background: '#1b1c20' - }, - button: { - padding: 0, - marginRight:5, - minHeight: 25, - borderRadius: '4px', - fontSize: 10, - background: '#d8d8d8' - }, + }, + button: { + padding: 0, + marginRight: 5, + minHeight: 25, + borderRadius: '4px', + fontSize: 10, + background: '#d8d8d8' + } }); -//TODO: Move Button as component +// TODO: Move Button as component class ChatListItem extends Component { - constructor(props) { - super(props); - } + constructor(props) { + super(props); + } state = { - open: false, + open: false }; - render(){ - const { classes, data } = this.props; - const { open, handleOpenChat } = this.props; - return ( + render() { + const { classes, data } = this.props; + const { open, handleOpenChat } = this.props; + return (
    - {this.setState({open: !this.state.open})}}> - - - - - - - - - - - - - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa, earum! - - + { this.setState({ open: !this.state.open }); }}> + + + + + + + + + + + + + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa, earum! + +
    - ); + ); } - } ChatListItem.propTypes = { - classes: PropTypes.object.isRequired, - data: PropTypes.object.isRequired, - handleOpenChat: PropTypes.func + classes: PropTypes.object.isRequired, + data: PropTypes.object.isRequired, + handleOpenChat: PropTypes.func }; -export default withStyles(styles)(ChatListItem); \ No newline at end of file +export default withStyles(styles)(ChatListItem); diff --git a/src/componets/PaperWithDrop/PaperWithDrop.js b/src/componets/PaperWithDrop/PaperWithDrop.js index dc409f2ff..61907dd78 100644 --- a/src/componets/PaperWithDrop/PaperWithDrop.js +++ b/src/componets/PaperWithDrop/PaperWithDrop.js @@ -6,48 +6,48 @@ import Button from 'material-ui/Button'; import ExpandMore from 'material-ui-icons/ExpandMore'; const styles = { - item: { - borderRadius: '8px', - }, - button: { - padding: 0, - minHeight: 25, - borderRadius: '0 0 8px 8px', - background: '#34373c' - }, - itemLabel: { - margin: '0 0 5px', - fontSize: 14, - lineHeight: 1.2, - color: '#777777' - } + item: { + borderRadius: '8px' + }, + button: { + padding: 0, + minHeight: 25, + borderRadius: '0 0 8px 8px', + background: '#34373c' + }, + itemLabel: { + margin: '0 0 5px', + fontSize: 14, + lineHeight: 1.2, + color: '#777777' + } }; class PaperWithDrop extends React.Component { state = {}; render() { - const { classes, data } = this.props; + const { classes, data } = this.props; - return ( -
    -

    Lorem ipsum...

    - - { - data - } - - -
    - ); + return ( +
    +

    Lorem ipsum...

    + + { + data + } + + +
    + ); } } PaperWithDrop.propTypes = { - classes: PropTypes.object.isRequired, - data: PropTypes.array.isRequired + classes: PropTypes.object.isRequired, + data: PropTypes.array.isRequired }; -export default withStyles(styles)(PaperWithDrop); \ No newline at end of file +export default withStyles(styles)(PaperWithDrop); diff --git a/src/componets/SvgIcons/CallsIcon/CallsIcon.js b/src/componets/SvgIcons/CallsIcon/CallsIcon.js index 5c43f390b..e264baded 100644 --- a/src/componets/SvgIcons/CallsIcon/CallsIcon.js +++ b/src/componets/SvgIcons/CallsIcon/CallsIcon.js @@ -5,37 +5,38 @@ import green from 'material-ui/colors/green'; import SvgIcon from 'material-ui/SvgIcon'; const styles = { - iconHover: { - '&:hover': { - fill: green[200], - } - }, + iconHover: { + '&:hover': { + fill: green[200] + } + } }; const CallsIcon = props => ( - - - + + + ); function SvgCallsIcon(props) { - const { classes } = props; - return ( -
    - -
    - ); + const { classes } = props; + return ( +
    + +
    + ); } SvgCallsIcon.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(SvgCallsIcon); \ No newline at end of file +export default withStyles(styles)(SvgCallsIcon); diff --git a/src/componets/SvgIcons/ChatIcon/ChatIcon.js b/src/componets/SvgIcons/ChatIcon/ChatIcon.js index 47d885673..634a65741 100644 --- a/src/componets/SvgIcons/ChatIcon/ChatIcon.js +++ b/src/componets/SvgIcons/ChatIcon/ChatIcon.js @@ -5,37 +5,38 @@ import green from 'material-ui/colors/green'; import SvgIcon from 'material-ui/SvgIcon'; const styles = { - iconHover: { - '&:hover': { - fill: green[200], - } - }, + iconHover: { + '&:hover': { + fill: green[200] + } + } }; const ChatIcon = props => ( - - - + + + ); function SvgChatIcon(props) { - const { classes } = props; - return ( -
    - -
    - ); + const { classes } = props; + return ( +
    + +
    + ); } SvgChatIcon.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(SvgChatIcon); \ No newline at end of file +export default withStyles(styles)(SvgChatIcon); diff --git a/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js b/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js index ea6026469..91acc9b39 100644 --- a/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js +++ b/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js @@ -5,42 +5,43 @@ import green from 'material-ui/colors/green'; import SvgIcon from 'material-ui/SvgIcon'; const styles = { - iconHover: { - '&:hover': { - fill: green[200], - }, - }, + iconHover: { + '&:hover': { + fill: green[200] + } + } }; const ContactsIcon = props => ( - - - - - - - - + + + + + + + + ); function SvgContactsIcon(props) { - const { classes } = props; - return ( -
    - + -
    - ); + /> +
    + ); } SvgContactsIcon.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(SvgContactsIcon); \ No newline at end of file +export default withStyles(styles)(SvgContactsIcon); diff --git a/src/componets/SvgIcons/GropsIcon/GroupsIcon.js b/src/componets/SvgIcons/GropsIcon/GroupsIcon.js index e870a2570..4447c5d8d 100644 --- a/src/componets/SvgIcons/GropsIcon/GroupsIcon.js +++ b/src/componets/SvgIcons/GropsIcon/GroupsIcon.js @@ -5,37 +5,38 @@ import green from 'material-ui/colors/green'; import SvgIcon from 'material-ui/SvgIcon'; const styles = { - iconHover: { - '&:hover': { - fill: green[200], - } - }, + iconHover: { + '&:hover': { + fill: green[200] + } + } }; const GroupsIcon = props => ( - - - + + + ); function SvgGroupsIcon(props) { - const { classes } = props; - return ( -
    - -
    - ); + const { classes } = props; + return ( +
    + +
    + ); } SvgGroupsIcon.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(SvgGroupsIcon); \ No newline at end of file +export default withStyles(styles)(SvgGroupsIcon); diff --git a/src/componets/SvgIcons/LogoIcon/LogoIcon.js b/src/componets/SvgIcons/LogoIcon/LogoIcon.js index a2e6acb64..e304c1074 100644 --- a/src/componets/SvgIcons/LogoIcon/LogoIcon.js +++ b/src/componets/SvgIcons/LogoIcon/LogoIcon.js @@ -5,36 +5,37 @@ import green from 'material-ui/colors/green'; import SvgIcon from 'material-ui/SvgIcon'; const styles = { - iconHover: { - '&:hover': { - fill: green[200], - }, - }, + iconHover: { + '&:hover': { + fill: green[200] + } + } }; const LogoIcon = props => ( - - //TODO: Add path for svg icon - + + //TODO: Add path for svg icon + ); function SvgLogo(props) { - const { classes } = props; - return ( -
    - -
    - ); + const { classes } = props; + return ( +
    + +
    + ); } SvgLogo.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(SvgLogo); \ No newline at end of file +export default withStyles(styles)(SvgLogo); diff --git a/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js b/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js index dd58daaf8..d3ce04735 100644 --- a/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js +++ b/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js @@ -5,36 +5,37 @@ import green from 'material-ui/colors/green'; import SvgIcon from 'material-ui/SvgIcon'; const styles = { - iconHover: { - '&:hover': { - fill: green[200], - }, - }, + iconHover: { + '&:hover': { + fill: green[200] + } + } }; const OptionsIcon = props => ( - - - + + + ); function SvgOptionsIcon(props) { - const { classes } = props; - return ( -
    - -
    - ); + const { classes } = props; + return ( +
    + +
    + ); } SvgOptionsIcon.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(SvgOptionsIcon); \ No newline at end of file +export default withStyles(styles)(SvgOptionsIcon); diff --git a/src/componets/SvgIcons/index.js b/src/componets/SvgIcons/index.js index 7c12f639e..8de4e52f9 100644 --- a/src/componets/SvgIcons/index.js +++ b/src/componets/SvgIcons/index.js @@ -3,12 +3,13 @@ import ChatIcon from './ChatIcon/ChatIcon'; import CallsIcon from './CallsIcon/CallsIcon'; import GroupsIcon from './GropsIcon/GroupsIcon'; import ContactsIcon from './ContactsIcon/ContactsIcon'; -import OptionsIcon from './OptionsIcon/OptionsIcon' +import OptionsIcon from './OptionsIcon/OptionsIcon'; + export { - LogoIcon, - CallsIcon, - ChatIcon, - GroupsIcon, - ContactsIcon, - OptionsIcon -} \ No newline at end of file + LogoIcon, + CallsIcon, + ChatIcon, + GroupsIcon, + ContactsIcon, + OptionsIcon +}; diff --git a/src/componets/index.js b/src/componets/index.js index 61066a021..f4dbab6bc 100644 --- a/src/componets/index.js +++ b/src/componets/index.js @@ -3,7 +3,7 @@ import ChatListItem from './ChatListItem/ChatListItem'; import PaperWithDrop from './PaperWithDrop/PaperWithDrop'; export { - LogoIcon, - ChatListItem, - PaperWithDrop -}; \ No newline at end of file + LogoIcon, + ChatListItem, + PaperWithDrop +}; diff --git a/src/containers/ActionMenu/ActionMenu.js b/src/containers/ActionMenu/ActionMenu.js index e357762d1..bed2d60d4 100644 --- a/src/containers/ActionMenu/ActionMenu.js +++ b/src/containers/ActionMenu/ActionMenu.js @@ -2,126 +2,126 @@ import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import List, { - ListItem, - ListItemText, - ListItemIcon, + ListItem, + ListItemText, + ListItemIcon } from 'material-ui/List'; import FolderIcon from 'material-ui-icons/Folder'; import Divider from 'material-ui/Divider'; -import {Link} from 'react-router'; +import { Link } from 'react-router'; import Grid from 'material-ui/Grid'; -import {CallsIcon, ChatIcon, GroupsIcon, ContactsIcon, OptionsIcon} from '../../componets/SvgIcons/index'; +import { CallsIcon, ChatIcon, GroupsIcon, ContactsIcon, OptionsIcon } from '../../componets/SvgIcons/index'; import { LogoIcon } from '../../componets/index'; const styles = theme => ({ - root: { - position: 'fixed', - top: 0, - left: 0, - zIndex: 11, - width: 80, - margin: 0, - height: '100vh', - background: '#27292e', - boxShadow: '0 0 16px 0 #000' - }, - logo: { - height: 64, - background: 'linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%)' - }, - logoDevider: { - backgroundColor: '#be0211' - }, - demo: { - // backgroundColor: theme.palette.background.paper - }, - menu: { - height: '100%', - }, - title: { - margin: `${theme.spacing.unit * 4}px 0 ${theme.spacing.unit * 2}px`, - }, - item: { - flexWrap: 'wrap' - }, - itemLink: { - display: 'block', - marginRight: 0, - width: '100%', - height: 'auto', - textAlign: 'center' - }, - name: { - padding: 0, - fontSize: 12, - textAlign: 'center' - } + root: { + position: 'fixed', + top: 0, + left: 0, + zIndex: 11, + width: 80, + margin: 0, + height: '100vh', + background: '#27292e', + boxShadow: '0 0 16px 0 #000' + }, + logo: { + height: 64, + background: 'linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%)' + }, + logoDevider: { + backgroundColor: '#be0211' + }, + demo: { + // backgroundColor: theme.palette.background.paper + }, + menu: { + height: '100%' + }, + title: { + margin: `${theme.spacing.unit * 4}px 0 ${theme.spacing.unit * 2}px` + }, + item: { + flexWrap: 'wrap' + }, + itemLink: { + display: 'block', + marginRight: 0, + width: '100%', + height: 'auto', + textAlign: 'center' + }, + name: { + padding: 0, + fontSize: 12, + textAlign: 'center' + } }); class LeftMenu extends React.Component { state = { - dense: false, - secondary: false, + dense: false, + secondary: false }; render() { - const { classes } = this.props; - const { dense, secondary } = this.state; + const { classes } = this.props; + const { dense, secondary } = this.state; - return ( -
    -
    - - - -
    - -
    - - - - - - - + return ( +
    +
    + + + +
    + +
    + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - -
    -
    - ); + + + + + + +
    +
    +
    + ); } } LeftMenu.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(LeftMenu); \ No newline at end of file +export default withStyles(styles)(LeftMenu); diff --git a/src/containers/ActivityList/ActivityList.js b/src/containers/ActivityList/ActivityList.js index 3cee1cee7..c1ca3323d 100644 --- a/src/containers/ActivityList/ActivityList.js +++ b/src/containers/ActivityList/ActivityList.js @@ -4,78 +4,79 @@ import { withStyles } from 'material-ui/styles'; import Drawer from 'material-ui/Drawer'; import Button from 'material-ui/Button'; import List from 'material-ui/List'; -import { ChatListItem } from '../../componets'; +import { ChatListItem } from '../../componets'; const styles = { - list: { - width: '100%', - }, - listFull: { - width: 'auto', - }, - paper:{ - top:'auto', - position:'unset' - } + list: { + width: '100%' + }, + listFull: { + width: 'auto' + }, + paper: { + top: 'auto', + position: 'unset' + } }; class ActivityList extends React.Component { state = { - top: false, - left: true, - bottom: false, - right: false, + top: false, + left: true, + bottom: false, + right: false }; toggleDrawer = (side, open) => () => { - this.setState({ - [side]: open, - }); + this.setState({ + [side]: open + }); }; render() { - const { classes } = this.props; + const { classes } = this.props; - const mockUsers = [{name:'John Smith'},{name:'John Smith2'},{name:'John Smith3'},{name:'John Smith4'},{name:'John Smith5'}]; + const mockUsers = [{ name: 'John Smith' }, { name: 'John Smith2' }, { name: 'John Smith3' }, { name: 'John Smith4' }, { name: 'John Smith5' }]; - const sideList = ( -
    - - {mockUsers.map((item,index)=>( - - ))} - -
    - ); + const sideList = ( +
    + + {mockUsers.map((item, index) => ( + + ))} + +
    + ); - return ( -
    - + -
    { - console.log('Clicked'); - }} - onKeyDown={this.toggleDrawer('left', false)} - > - {sideList} -
    -
    + > +
    { + console.log('Clicked'); + }} + onKeyDown={this.toggleDrawer('left', false)} + > + {sideList}
    - ); +
    +
    + ); } } ActivityList.propTypes = { - classes: PropTypes.object.isRequired, + classes: PropTypes.object.isRequired }; -export default withStyles(styles)(ActivityList); \ No newline at end of file +export default withStyles(styles)(ActivityList); diff --git a/src/containers/ChatModal/ChatModal.js b/src/containers/ChatModal/ChatModal.js index 8fa651e46..81dfa9a13 100644 --- a/src/containers/ChatModal/ChatModal.js +++ b/src/containers/ChatModal/ChatModal.js @@ -1,22 +1,22 @@ import React from 'react'; import Modal from 'react-responsive-modal'; -import { withStyles } from 'material-ui/styles' +import { withStyles } from 'material-ui/styles'; -export class ChatModal extends React.Component { +export class ChatModal extends React.Component { state = { - open: false, + open: false }; render() { - const { open, onCloseChat } = this.props; - return ( -
    - {onCloseChat()}} little> -

    Simple centered modal

    -
    -
    - ); + const { open, onCloseChat } = this.props; + return ( +
    + { onCloseChat(); }} little> +

    Simple centered modal

    +
    +
    + ); } -} \ No newline at end of file +} diff --git a/src/containers/MenuAppBar/MenuAppBar.js b/src/containers/MenuAppBar/MenuAppBar.js index aff4b5b6a..7b96f3757 100644 --- a/src/containers/MenuAppBar/MenuAppBar.js +++ b/src/containers/MenuAppBar/MenuAppBar.js @@ -4,61 +4,61 @@ import AppBar from 'material-ui/AppBar'; import Toolbar from 'material-ui/Toolbar'; import IconButton from 'material-ui/IconButton'; import MenuIcon from 'material-ui-icons/Menu'; -import { Grid,Avatar, Input,InputAdornment } from 'material-ui'; +import { Grid, Avatar, Input, InputAdornment } from 'material-ui'; import { withStyles } from 'material-ui/styles'; import avatar from '../../../assets/img/Richard_Smith.png'; import Icon from 'material-ui/Icon'; import { Link } from 'react-router'; const styles = { - root: { - position: 'fixed', - top: 0, - left: 0, - zIndex: 10, - paddingLeft: 80, - width: '100%' - }, - appBar: { - background: '#24262b', - boxShadow: 'box-shadow: 0 2px 13px 0 #000' - }, - title:{ - textAlign:'center' - }, - toolBar: { - justifyContent: 'space-between' - }, - settings: { - display: 'flex' - } + root: { + position: 'fixed', + top: 0, + left: 0, + zIndex: 10, + paddingLeft: 80, + width: '100%' + }, + appBar: { + background: '#24262b', + boxShadow: 'box-shadow: 0 2px 13px 0 #000' + }, + title: { + textAlign: 'center' + }, + toolBar: { + justifyContent: 'space-between' + }, + settings: { + display: 'flex' + } }; class MenuAppBar extends React.Component { state = { - auth: true, - anchorEl: null, + auth: true, + anchorEl: null }; render() { - const { classes } = this.props; - console.log('console',this.props.classes); - return ( -
    - - -
    DashBoard
    -
    - - -
    -
    -
    -
    - ); + const { classes } = this.props; + console.log('console', this.props.classes); + return ( +
    + + +
    DashBoard
    +
    + + +
    +
    +
    +
    + ); } } -export default withStyles(styles)(MenuAppBar); \ No newline at end of file +export default withStyles(styles)(MenuAppBar); diff --git a/src/containers/index.js b/src/containers/index.js index 35e157772..a4b72d3b5 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -1,10 +1,11 @@ import ActionMenu from './ActionMenu/ActionMenu'; import MenuAppBar from './MenuAppBar/MenuAppBar'; import ActivityList from './ActivityList/ActivityList'; -import ChatModal from './ChatModal/ChatModal' +import ChatModal from './ChatModal/ChatModal'; + export { - ActionMenu, - MenuAppBar, - ActivityList, - ChatModal -} \ No newline at end of file + ActionMenu, + MenuAppBar, + ActivityList, + ChatModal +}; diff --git a/src/core/bert/Converter.bert.js b/src/core/bert/Converter.bert.js index 88045fc92..760b8e241 100644 --- a/src/core/bert/Converter.bert.js +++ b/src/core/bert/Converter.bert.js @@ -1,36 +1,37 @@ +/* eslint-disable */ + import { utf8_dec, utf8_toByteArray } from '../utils/utf8.util'; let sx; let ix; function uc(u1, u2) { - if (u1.byteLength == 0) return u2; if (u2.byteLength == 0) return u1; - var a = new Uint8Array(u1.byteLength + u2.byteLength); - a.set(u1, 0); a.set(u2, u1.byteLength); return a; -}; + if (u1.byteLength == 0) return u2; if (u2.byteLength == 0) return u1; + const a = new Uint8Array(u1.byteLength + u2.byteLength); + a.set(u1, 0); a.set(u2, u1.byteLength); return a; +} function ar(o) { - return o.v instanceof ArrayBuffer ? new Uint8Array(o.v) : o.v instanceof Uint8Array ? o.v : - Array.isArray(o.v) ? new Uint8Array(o.v) : new Uint8Array(utf8_toByteArray(o.v).v); + return o.v instanceof ArrayBuffer ? new Uint8Array(o.v) : o.v instanceof Uint8Array ? o.v : + Array.isArray(o.v) ? new Uint8Array(o.v) : new Uint8Array(utf8_toByteArray(o.v).v); } function fl(a) { - return a.reduce(function (f, t) { - return uc(f, t instanceof Uint8Array ? t : - Array.isArray(t) ? fl(t) : new Uint8Array([t])); - }, new Uint8Array()); + return a.reduce((f, t) => uc(f, t instanceof Uint8Array ? t : + Array.isArray(t) ? fl(t) : new Uint8Array([t])), new Uint8Array()); } function atom(o) { return { t: 100, v: utf8_toByteArray(o).v }; } function bin(o) { - return { - t: 109, v: o instanceof ArrayBuffer ? - new Uint8Array(o) : o instanceof Uint8Array ? o : utf8_toByteArray(o).v - }; + return { + t: 109, + v: o instanceof ArrayBuffer ? + new Uint8Array(o) : o instanceof Uint8Array ? o : utf8_toByteArray(o).v + }; } -function tuple() { return { t: 104, v: Array.apply(null, arguments) }; } -function list() { return { t: 108, v: Array.apply(null, arguments) }; } +function tuple() { return { t: 104, v: Array(...arguments) }; } +function list() { return { t: 108, v: Array(...arguments) }; } function number(o) { return { t: 98, v: o }; } function enc(o) { return fl([131, ein(o)]); } -function ein(o) { return Array.isArray(o) ? en_108({ t: 108, v: o }) : eval('en_' + o.t)(o); } +function ein(o) { return Array.isArray(o) ? en_108({ t: 108, v: o }) : eval(`en_${o.t}`)(o); } function en_undefined(o) { return [106]; } function en_98(o) { return [98, o.v >>> 24, (o.v >>> 16) & 255, (o.v >>> 8) & 255, o.v & 255]; } function en_97(o) { return [97, o.v]; } @@ -38,58 +39,66 @@ function en_106(o) { return [106]; } function en_100(o) { return [100, o.v.length >>> 8, o.v.length & 255, ar(o)]; } function en_107(o) { return [107, o.v.length >>> 8, o.v.length & 255, ar(o)]; } function en_104(o) { - var l = o.v.length, r = []; - for (var i = 0; i < l; i++)r[i] = ein(o.v[i]); return [104, l, r]; + let l = o.v.length, + r = []; + for (let i = 0; i < l; i++)r[i] = ein(o.v[i]); return [104, l, r]; } function en_109(o) { - var l = o.v instanceof ArrayBuffer ? o.v.byteLength : o.v.length; - return [109, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, ar(o)]; + const l = o.v instanceof ArrayBuffer ? o.v.byteLength : o.v.length; + return [109, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, ar(o)]; } function en_108(o) { - var l = o.v.length, r = []; for (var i = 0; i < l; i++)r.push(ein(o.v[i])); - return o.v.length == 0 ? [106] : [108, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, r, 106]; + let l = o.v.length, + r = []; for (let i = 0; i < l; i++)r.push(ein(o.v[i])); + return o.v.length == 0 ? [106] : [108, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, r, 106]; } // BERT Decoder -function nop(b) { return []; }; +function nop(b) { return []; } function big(b) { - var sk = b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a)); - var ret = 0, sig = sx.getUint8(ix++), count = sk; - while (count-- > 0) { - ret = 256 * ret + sx.getUint8(ix + count) - } - ix += sk; - return ret * (sig == 0 ? 1 : -1); + const sk = b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a)); + let ret = 0, + sig = sx.getUint8(ix++), + count = sk; + while (count-- > 0) { + ret = 256 * ret + sx.getUint8(ix + count); + } + ix += sk; + return ret * (sig == 0 ? 1 : -1); } -function int(b) { return b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a)); }; +function int(b) { return b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a)); } function dec(d) { - sx = new DataView(d); ix = 0; if (sx.getUint8(ix++) !== 131) - throw ("BERT?"); return din(); -}; + sx = new DataView(d); ix = 0; if (sx.getUint8(ix++) !== 131) { throw ('BERT?'); } return din(); +} function str(b) { - var dv, sz = (b == 2 ? sx.getUint16(ix) : sx.getInt32(ix)); ix += b; - var r = sx.buffer.slice(ix, ix += sz); return b == 2 ? utf8_dec(r) : r; -}; + let dv, + sz = (b == 2 ? sx.getUint16(ix) : sx.getInt32(ix)); ix += b; + const r = sx.buffer.slice(ix, ix += sz); return b == 2 ? utf8_dec(r) : r; +} function run(b) { - var sz = (b == 1 ? sx.getUint8(ix) : sx.getUint32(ix)), r = []; ix += b; - for (var i = 0; i < sz; i++) r.push(din()); if (b == 4) ix++; return r; -}; + let sz = (b == 1 ? sx.getUint8(ix) : sx.getUint32(ix)), + r = []; ix += b; + for (let i = 0; i < sz; i++) r.push(din()); if (b == 4) ix++; return r; +} function din() { - var c = sx.getUint8(ix++), x; switch (c) { - case 97: x = [int, 1]; break; - case 98: x = [int, 4]; break; case 100: x = [str, 2]; break; - case 110: x = [big, 1]; break; case 111: x = [big, 4]; break; - case 104: x = [run, 1]; break; case 107: x = [str, 2]; break; - case 108: x = [run, 4]; break; case 109: x = [str, 4]; break; - default: x = [nop, 0]; - } return { t: c, v: x[0](x[1]) }; -}; + let c = sx.getUint8(ix++), + x; switch (c) { + case 97: x = [int, 1]; break; + case 98: x = [int, 4]; break; case 100: x = [str, 2]; break; + case 110: x = [big, 1]; break; case 111: x = [big, 4]; break; + case 104: x = [run, 1]; break; case 107: x = [str, 2]; break; + case 108: x = [run, 4]; break; case 109: x = [str, 4]; break; + default: x = [nop, 0]; + } return { t: c, v: x[0](x[1]) }; +} -const convertToBert = (payload) => ( - payload.buffer.slice(payload.byteOffset, - payload.byteOffset + payload.length) +const convertToBert = payload => ( + payload.buffer.slice( + payload.byteOffset, + payload.byteOffset + payload.length + ) ); -export { enc as encode, dec as decode, convertToBert }; \ No newline at end of file +export { enc as encode, dec as decode, convertToBert }; diff --git a/src/core/bert/SignatureGenerator.bert.js b/src/core/bert/SignatureGenerator.bert.js index ca257e7bd..b2872e328 100644 --- a/src/core/bert/SignatureGenerator.bert.js +++ b/src/core/bert/SignatureGenerator.bert.js @@ -1,1668 +1,1910 @@ +/* eslint-disable */ + import { utf8_dec, utf8_toByteArray } from '../utils/utf8.util'; -function clean(r) { for(var k in r) if(!r[k]) delete r[k]; return r; } -function check_len(x) { try { return (eval('len'+utf8_dec(x.v[0].v))() == x.v.length) ? true : false } -catch (e) { return false; } } +function clean(r) { for (const k in r) if (!r[k]) delete r[k]; return r; } +function check_len(x) { + try { return (eval(`len${utf8_dec(x.v[0].v)}`)() == x.v.length); } catch (e) { return false; } +} -function scalar(data) { - var res = undefined; - switch (typeof data) { - case 'string': res = bin(data); break; case 'number': res = number(data); break; - default: console.log('Strange data: ' + data); } - return res; }; -function nil() { return {t: 106, v: undefined}; }; +function scalar(data) { + let res; + switch (typeof data) { + case 'string': res = bin(data); break; case 'number': res = number(data); break; + default: console.log(`Strange data: ${data}`); + } + return res; +} +function nil() { return { t: 106, v: undefined }; } function decode(x) { - if (x == undefined) { - return []; - } else if (x.t == 108) { - var r = []; x.v.forEach(function(y) { r.push(decode(y)) }); return r; - } else if (x.t == 109) { - return utf8_dec(x.v); - } else if (x.t == 104 && check_len(x)) { - return eval('dec'+x.v[0].v)(x); - } else if (x.t == 104) { - var r=[]; x.v.forEach(function(a){r.push(decode(a))}); - return Object.assign({tup:'$'}, r); - } else return x.v; + if (x == undefined) { + return []; + } else if (x.t == 108) { + var r = []; x.v.forEach((y) => { r.push(decode(y)); }); return r; + } else if (x.t == 109) { + return utf8_dec(x.v); + } else if (x.t == 104 && check_len(x)) { + return eval(`dec${x.v[0].v}`)(x); + } else if (x.t == 104) { + var r = []; x.v.forEach((a) => { r.push(decode(a)); }); + return Object.assign({ tup: '$' }, r); + } return x.v; } function encode(x) { - if (Array.isArray(x)) { - var r = []; x.forEach(function(y) { r.push(encode(y)) }); return {t:108,v:r}; - } else if (typeof x == 'object') { - switch (x.tup) { - case '$': delete x['tup']; var r=[]; - Object.keys(x).map(function(p){return x[p];}).forEach(function(a){r.push(encode(a))}); - return {t:104, v:r}; - default: return eval('enc'+x.tup)(x); } - } else return scalar(x); + if (Array.isArray(x)) { + var r = []; x.forEach((y) => { r.push(encode(y)); }); return { t: 108, v: r }; + } else if (typeof x === 'object') { + switch (x.tup) { + case '$': delete x.tup; var r = []; + Object.keys(x).map(p => x[p]).forEach((a) => { r.push(encode(a)); }); + return { t: 104, v: r }; + default: return eval(`enc${x.tup}`)(x); + } + } else return scalar(x); } function encwriter(d) { - var tup = atom('writer'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - var cache = 'cache' in d && d.cache ? encode(d.cache) : nil(); - var args = 'args' in d && d.args ? encode(d.args) : nil(); - var first = 'first' in d && d.first ? encode(d.first) : nil(); - return tuple(tup,id,count,cache,args,first); } + const tup = atom('writer'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + const cache = 'cache' in d && d.cache ? encode(d.cache) : nil(); + const args = 'args' in d && d.args ? encode(d.args) : nil(); + const first = 'first' in d && d.first ? encode(d.first) : nil(); + return tuple(tup, id, count, cache, args, first); +} function lenwriter() { return 6; } function decwriter(d) { - var r={}; r.tup = 'writer'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.count = d && d.v[2] ? d.v[2].v : undefined; - r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; - r.first = d && d.v[5] ? decode(d.v[5].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'writer'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.count = d && d.v[2] ? d.v[2].v : undefined; + r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; + r.first = d && d.v[5] ? decode(d.v[5].v) : undefined; + return clean(r); +} function encreader(d) { - var tup = atom('reader'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var pos = 'pos' in d && d.pos ? number(d.pos) : nil(); - var cache = 'cache' in d && d.cache ? number(d.cache) : nil(); - var args = 'args' in d && d.args ? encode(d.args) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); - return tuple(tup,id,pos,cache,args,feed,dir); } + const tup = atom('reader'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const pos = 'pos' in d && d.pos ? number(d.pos) : nil(); + const cache = 'cache' in d && d.cache ? number(d.cache) : nil(); + const args = 'args' in d && d.args ? encode(d.args) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); + return tuple(tup, id, pos, cache, args, feed, dir); +} function lenreader() { return 7; } function decreader(d) { - var r={}; r.tup = 'reader'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.pos = d && d.v[2] ? d.v[2].v : undefined; - r.cache = d && d.v[3] ? d.v[3].v : undefined; - r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; - r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.dir = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'reader'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.pos = d && d.v[2] ? d.v[2].v : undefined; + r.cache = d && d.v[3] ? d.v[3].v : undefined; + r.args = d && d.v[4] ? decode(d.v[4].v) : undefined; + r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.dir = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function enccur(d) { - var tup = atom('cur'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var bot = 'bot' in d && d.bot ? number(d.bot) : nil(); - var dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); - var reader = 'reader' in d && d.reader ? encode(d.reader) : nil(); - var writer = 'writer' in d && d.writer ? encode(d.writer) : nil(); - var args = []; if ('args' in d && d.args) - { d.args.forEach(function(x){ - args.push(encode(x))}); - args={t:108,v:args}; } else { args = nil() }; - return tuple(tup,id,top,bot,dir,reader,writer,args); } + const tup = atom('cur'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const bot = 'bot' in d && d.bot ? number(d.bot) : nil(); + const dir = 'dir' in d && d.dir ? encode(d.dir) : nil(); + const reader = 'reader' in d && d.reader ? encode(d.reader) : nil(); + const writer = 'writer' in d && d.writer ? encode(d.writer) : nil(); + let args = []; if ('args' in d && d.args) { + d.args.forEach((x) => { + args.push(encode(x)); + }); + args = { t: 108, v: args }; + } else { args = nil(); } + return tuple(tup, id, top, bot, dir, reader, writer, args); +} function lencur() { return 8; } function deccur(d) { - var r={}; r.tup = 'cur'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.bot = d && d.v[3] ? d.v[3].v : undefined; - r.dir = d && d.v[4] ? decode(d.v[4]) : undefined; - r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined; - r.args = []; - (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.args.push(decode(x))}) : - r.args = undefined; - return clean(r); } + const r = {}; r.tup = 'cur'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.bot = d && d.v[3] ? d.v[3].v : undefined; + r.dir = d && d.v[4] ? decode(d.v[4]) : undefined; + r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined; + r.args = []; + (d && d.v[7] && d.v[7].v) ? + d.v[7].v.forEach((x) => { r.args.push(decode(x)); }) : + r.args = undefined; + return clean(r); +} function enciter(d) { - var tup = atom('iter'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - return tuple(tup,id,container,feed,next,prev); } + const tup = atom('iter'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + return tuple(tup, id, container, feed, next, prev); +} function leniter() { return 6; } function deciter(d) { - var r={}; r.tup = 'iter'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.next = d && d.v[4] ? d.v[4].v : undefined; - r.prev = d && d.v[5] ? d.v[5].v : undefined; - return clean(r); } + const r = {}; r.tup = 'iter'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.next = d && d.v[4] ? d.v[4].v : undefined; + r.prev = d && d.v[5] ? d.v[5].v : undefined; + return clean(r); +} function enccontainer(d) { - var tup = atom('container'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('container'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lencontainer() { return 5; } function deccontainer(d) { - var r={}; r.tup = 'container'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'container'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function enciterator(d) { - var tup = atom('iterator'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - return tuple(tup,id,container,feed_id,prev,next,feeds); } + const tup = atom('iterator'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + return tuple(tup, id, container, feed_id, prev, next, feeds); +} function leniterator() { return 7; } function deciterator(d) { - var r={}; r.tup = 'iterator'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - return clean(r); } + const r = {}; r.tup = 'iterator'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + return clean(r); +} function enclog(d) { - var tup = atom('log'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('log'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lenlog() { return 5; } function declog(d) { - var r={}; r.tup = 'log'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'log'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function encoperation(d) { - var tup = atom('operation'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - return tuple(tup,id,container,feed_id,prev,next,feeds); } + const tup = atom('operation'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + return tuple(tup, id, container, feed_id, prev, next, feeds); +} function lenoperation() { return 7; } function decoperation(d) { - var r={}; r.tup = 'operation'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - return clean(r); } + const r = {}; r.tup = 'operation'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + return clean(r); +} function encchain(d) { - var tup = atom('chain'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var top = 'top' in d && d.top ? number(d.top) : nil(); - var rear = 'rear' in d && d.rear ? number(d.rear) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,id,top,rear,count); } + const tup = atom('chain'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const top = 'top' in d && d.top ? number(d.top) : nil(); + const rear = 'rear' in d && d.rear ? number(d.rear) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, id, top, rear, count); +} function lenchain() { return 5; } function decchain(d) { - var r={}; r.tup = 'chain'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.top = d && d.v[2] ? d.v[2].v : undefined; - r.rear = d && d.v[3] ? d.v[3].v : undefined; - r.count = d && d.v[4] ? d.v[4].v : undefined; - return clean(r); } + const r = {}; r.tup = 'chain'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.top = d && d.v[2] ? d.v[2].v : undefined; + r.rear = d && d.v[3] ? d.v[3].v : undefined; + r.count = d && d.v[4] ? d.v[4].v : undefined; + return clean(r); +} function encpush(d) { - var tup = atom('push'); - var model = 'model' in d && d.model ? bin(d.model) : nil(); - var type = 'type' in d && d.type ? bin(d.type) : nil(); - var title = 'title' in d && d.title ? bin(d.title) : nil(); - var alert = 'alert' in d && d.alert ? bin(d.alert) : nil(); - var badge = 'badge' in d && d.badge ? number(d.badge) : nil(); - var sound = 'sound' in d && d.sound ? bin(d.sound) : nil(); - return tuple(tup,model,type,title,alert,badge,sound); } + const tup = atom('push'); + const model = 'model' in d && d.model ? bin(d.model) : nil(); + const type = 'type' in d && d.type ? bin(d.type) : nil(); + const title = 'title' in d && d.title ? bin(d.title) : nil(); + const alert = 'alert' in d && d.alert ? bin(d.alert) : nil(); + const badge = 'badge' in d && d.badge ? number(d.badge) : nil(); + const sound = 'sound' in d && d.sound ? bin(d.sound) : nil(); + return tuple(tup, model, type, title, alert, badge, sound); +} function lenpush() { return 7; } function decpush(d) { - var r={}; r.tup = 'push'; - r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.badge = d && d.v[5] ? d.v[5].v : undefined; - r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'push'; + r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.badge = d && d.v[5] ? d.v[5].v : undefined; + r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + return clean(r); +} function encSearch(d) { - var tup = atom('Search'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var ref = 'ref' in d && d.ref ? bin(d.ref) : nil(); - var field = 'field' in d && d.field ? bin(d.field) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var value = 'value' in d && d.value ? encode(d.value) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,ref,field,type,value,status); } + const tup = atom('Search'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const ref = 'ref' in d && d.ref ? bin(d.ref) : nil(); + const field = 'field' in d && d.field ? bin(d.field) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const value = 'value' in d && d.value ? encode(d.value) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, ref, field, type, value, status); +} function lenSearch() { return 7; } function decSearch(d) { - var r={}; r.tup = 'Search'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.type = d && d.v[4] ? decode(d.v[4]) : undefined; - r.value = d && d.v[5] ? decode(d.v[5].v) : undefined; - r.status = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Search'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.type = d && d.v[4] ? decode(d.v[4]) : undefined; + r.value = d && d.v[5] ? decode(d.v[5].v) : undefined; + r.status = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function encp2p(d) { - var tup = atom('p2p'); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - return tuple(tup,from,to); } + const tup = atom('p2p'); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + return tuple(tup, from, to); +} function lenp2p() { return 3; } function decp2p(d) { - var r={}; r.tup = 'p2p'; - r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'p2p'; + r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + return clean(r); +} function encmuc(d) { - var tup = atom('muc'); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - return tuple(tup,name); } + const tup = atom('muc'); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + return tuple(tup, name); +} function lenmuc() { return 2; } function decmuc(d) { - var r={}; r.tup = 'muc'; - r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'muc'; + r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + return clean(r); +} function encCDR(d) { - var tup = atom('CDR'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - var start = 'start' in d && d.start ? number(d.start) : nil(); - var stop = 'stop' in d && d.stop ? number(d.stop) : nil(); - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); - var bill = 'bill' in d && d.bill ? number(d.bill) : nil(); - var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); - return tuple(tup,id,container,feed,next,prev,from,to,start,stop,type, - desc,bill,tariff); } + const tup = atom('CDR'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + const start = 'start' in d && d.start ? number(d.start) : nil(); + const stop = 'stop' in d && d.stop ? number(d.stop) : nil(); + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); + const bill = 'bill' in d && d.bill ? number(d.bill) : nil(); + const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); + return tuple( + tup, id, container, feed, next, prev, from, to, start, stop, type, + desc, bill, tariff + ); +} function lenCDR() { return 14; } function decCDR(d) { - var r={}; r.tup = 'CDR'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.next = d && d.v[4] ? d.v[4].v : undefined; - r.prev = d && d.v[5] ? d.v[5].v : undefined; - r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.start = d && d.v[8] ? d.v[8].v : undefined; - r.stop = d && d.v[9] ? d.v[9].v : undefined; - r.type = d && d.v[10] ? decode(d.v[10]) : undefined; - r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.bill = d && d.v[12] ? d.v[12].v : undefined; - r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'CDR'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.next = d && d.v[4] ? d.v[4].v : undefined; + r.prev = d && d.v[5] ? d.v[5].v : undefined; + r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.start = d && d.v[8] ? d.v[8].v : undefined; + r.stop = d && d.v[9] ? d.v[9].v : undefined; + r.type = d && d.v[10] ? decode(d.v[10]) : undefined; + r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.bill = d && d.v[12] ? d.v[12].v : undefined; + r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; + return clean(r); +} function encFeature(d) { - var tup = atom('Feature'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var key = 'key' in d && d.key ? bin(d.key) : nil(); - var value = 'value' in d && d.value ? bin(d.value) : nil(); - var group = 'group' in d && d.group ? bin(d.group) : nil(); - return tuple(tup,id,key,value,group); } + const tup = atom('Feature'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const key = 'key' in d && d.key ? bin(d.key) : nil(); + const value = 'value' in d && d.value ? bin(d.value) : nil(); + const group = 'group' in d && d.group ? bin(d.group) : nil(); + return tuple(tup, id, key, value, group); +} function lenFeature() { return 5; } function decFeature(d) { - var r={}; r.tup = 'Feature'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Feature'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + return clean(r); +} function encMember(d) { - var tup = atom('Member'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? encode(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var alias = 'alias' in d && d.alias ? bin(d.alias) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); - var reader = 'reader' in d && d.reader ? number(d.reader) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,feeds,phone_id,avatar,names,surnames, - alias,email,vox_id,reader,update,settings,presence,status); } + const tup = atom('Member'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? encode(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const alias = 'alias' in d && d.alias ? bin(d.alias) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); + const reader = 'reader' in d && d.reader ? number(d.reader) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, feeds, phone_id, avatar, names, surnames, + alias, email, vox_id, reader, update, settings, presence, status + ); +} function lenMember() { return 19; } function decMember(d) { - var r={}; r.tup = 'Member'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; - r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; - r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined; - r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; - r.reader = d && d.v[14] ? d.v[14].v : undefined; - r.update = d && d.v[15] ? d.v[15].v : undefined; - r.settings = []; - (d && d.v[16] && d.v[16].v) ? - d.v[16].v.forEach(function(x){r.settings.push(decode(x))}) : - r.settings = undefined; - r.presence = d && d.v[17] ? decode(d.v[17]) : undefined; - r.status = d && d.v[18] ? decode(d.v[18]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Member'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; + r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; + r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined; + r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined; + r.reader = d && d.v[14] ? d.v[14].v : undefined; + r.update = d && d.v[15] ? d.v[15].v : undefined; + r.settings = []; + (d && d.v[16] && d.v[16].v) ? + d.v[16].v.forEach((x) => { r.settings.push(decode(x)); }) : + r.settings = undefined; + r.presence = d && d.v[17] ? decode(d.v[17]) : undefined; + r.status = d && d.v[18] ? decode(d.v[18]) : undefined; + return clean(r); +} function encPerson(d) { - var tup = atom('Person'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var phonelist = []; if ('phonelist' in d && d.phonelist) - { d.phonelist.forEach(function(x){ - phonelist.push(encode(x))}); - phonelist={t:108,v:phonelist}; } else { phonelist = nil() }; - var alias = []; if ('alias' in d && d.alias) - { d.alias.forEach(function(x){ - alias.push(encode(x))}); - alias={t:108,v:alias}; } else { alias = nil() }; - var localize = []; if ('localize' in d && d.localize) - { d.localize.forEach(function(x){ - localize.push(encode(x))}); - localize={t:108,v:localize}; } else { localize = nil() }; - var NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) - { d.NotificationSettings.forEach(function(x){ - NotificationSettings.push(encode(x))}); - NotificationSettings={t:108,v:NotificationSettings}; } else { NotificationSettings = nil() }; - var SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) - { d.SoundSettings.forEach(function(x){ - SoundSettings.push(encode(x))}); - SoundSettings={t:108,v:SoundSettings}; } else { SoundSettings = nil() }; - var ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil(); - var BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) - { d.BlockUsers.forEach(function(x){ - BlockUsers.push(encode(x))}); - BlockUsers={t:108,v:BlockUsers}; } else { BlockUsers = nil() }; - var balance = 'balance' in d && d.balance ? number(d.balance) : nil(); - var isParticipants = []; if ('isParticipants' in d && d.isParticipants) - { d.isParticipants.forEach(function(x){ - isParticipants.push(encode(x))}); - isParticipants={t:108,v:isParticipants}; } else { isParticipants = nil() }; - var status = 'status' in d && d.status ? encode(d.status) : nil(); - return tuple(tup,id,phonelist,alias,localize,NotificationSettings,SoundSettings,ThemeID,BlockUsers,balance,isParticipants,status); } + const tup = atom('Person'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + let phonelist = []; if ('phonelist' in d && d.phonelist) { + d.phonelist.forEach((x) => { + phonelist.push(encode(x)); + }); + phonelist = { t: 108, v: phonelist }; + } else { phonelist = nil(); } + let alias = []; if ('alias' in d && d.alias) { + d.alias.forEach((x) => { + alias.push(encode(x)); + }); + alias = { t: 108, v: alias }; + } else { alias = nil(); } + let localize = []; if ('localize' in d && d.localize) { + d.localize.forEach((x) => { + localize.push(encode(x)); + }); + localize = { t: 108, v: localize }; + } else { localize = nil(); } + let NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) { + d.NotificationSettings.forEach((x) => { + NotificationSettings.push(encode(x)); + }); + NotificationSettings = { t: 108, v: NotificationSettings }; + } else { NotificationSettings = nil(); } + let SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) { + d.SoundSettings.forEach((x) => { + SoundSettings.push(encode(x)); + }); + SoundSettings = { t: 108, v: SoundSettings }; + } else { SoundSettings = nil(); } + const ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil(); + let BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) { + d.BlockUsers.forEach((x) => { + BlockUsers.push(encode(x)); + }); + BlockUsers = { t: 108, v: BlockUsers }; + } else { BlockUsers = nil(); } + const balance = 'balance' in d && d.balance ? number(d.balance) : nil(); + let isParticipants = []; if ('isParticipants' in d && d.isParticipants) { + d.isParticipants.forEach((x) => { + isParticipants.push(encode(x)); + }); + isParticipants = { t: 108, v: isParticipants }; + } else { isParticipants = nil(); } + const status = 'status' in d && d.status ? encode(d.status) : nil(); + return tuple(tup, id, phonelist, alias, localize, NotificationSettings, SoundSettings, ThemeID, BlockUsers, balance, isParticipants, status); +} function lenPerson() { return 12; } function decPerson(d) { - var r={}; r.tup = 'Person'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.phonelist = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.phonelist.push(decode(x))}) : - r.phonelist = undefined; - r.alias = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.alias.push(decode(x))}) : - r.alias = undefined; - r.localize = []; - (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.localize.push(decode(x))}) : - r.localize = undefined; - r.NotificationSettings = []; - (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.NotificationSettings.push(decode(x))}) : - r.NotificationSettings = undefined; - r.SoundSettings = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.SoundSettings.push(decode(x))}) : - r.SoundSettings = undefined; - r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.BlockUsers = []; - (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.BlockUsers.push(decode(x))}) : - r.BlockUsers = undefined; - r.balance = d && d.v[9] ? d.v[9].v : undefined; - r.isParticipants = []; - (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.isParticipants.push(decode(x))}) : - r.isParticipants = undefined; - r.status = d && d.v[11] ? decode(d.v[11]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Person'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.phonelist = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.phonelist.push(decode(x)); }) : + r.phonelist = undefined; + r.alias = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.alias.push(decode(x)); }) : + r.alias = undefined; + r.localize = []; + (d && d.v[4] && d.v[4].v) ? + d.v[4].v.forEach((x) => { r.localize.push(decode(x)); }) : + r.localize = undefined; + r.NotificationSettings = []; + (d && d.v[5] && d.v[5].v) ? + d.v[5].v.forEach((x) => { r.NotificationSettings.push(decode(x)); }) : + r.NotificationSettings = undefined; + r.SoundSettings = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.SoundSettings.push(decode(x)); }) : + r.SoundSettings = undefined; + r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.BlockUsers = []; + (d && d.v[8] && d.v[8].v) ? + d.v[8].v.forEach((x) => { r.BlockUsers.push(decode(x)); }) : + r.BlockUsers = undefined; + r.balance = d && d.v[9] ? d.v[9].v : undefined; + r.isParticipants = []; + (d && d.v[10] && d.v[10].v) ? + d.v[10].v.forEach((x) => { r.isParticipants.push(decode(x)); }) : + r.isParticipants = undefined; + r.status = d && d.v[11] ? decode(d.v[11]) : undefined; + return clean(r); +} function encDesc(d) { - var tup = atom('Desc'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var mime = 'mime' in d && d.mime ? bin(d.mime) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var size = 'size' in d && d.size ? number(d.size) : nil(); - var filename = 'filename' in d && d.filename ? bin(d.filename) : nil(); - var info = 'info' in d && d.info ? bin(d.info) : nil(); - return tuple(tup,id,mime,payload,size,filename,info); } + const tup = atom('Desc'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const mime = 'mime' in d && d.mime ? bin(d.mime) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const size = 'size' in d && d.size ? number(d.size) : nil(); + const filename = 'filename' in d && d.filename ? bin(d.filename) : nil(); + const info = 'info' in d && d.info ? bin(d.info) : nil(); + return tuple(tup, id, mime, payload, size, filename, info); +} function lenDesc() { return 7; } function decDesc(d) { - var r={}; r.tup = 'Desc'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.mime = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.payload = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.size = d && d.v[4] ? d.v[4].v : undefined; - r.filename = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.info = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Desc'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.mime = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.payload = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.size = d && d.v[4] ? d.v[4].v : undefined; + r.filename = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.info = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + return clean(r); +} function encMessage(d) { - var tup = atom('Message'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - //@TODO: CRASHED ANDROID VERSION - //var container = 'container' in d && d.container ? encode(d.container) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var to = 'to' in d && d.to ? bin(d.to) : nil(); - var created = 'created' in d && d.created ? encode(d.created) : nil(); - var files = []; if ('files' in d && d.files) - { d.files.forEach(function(x){ - files.push(encode(x))}); - files={t:108,v:files}; } else { files = nil() }; - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var link = 'link' in d && d.link ? number(d.link) : nil(); - var seenby = []; if ('seenby' in d && d.seenby) - { d.seenby.forEach(function(x){ - seenby.push(encode(x))}); - seenby={t:108,v:seenby}; } else { seenby = nil() }; - var repliedby = []; if ('repliedby' in d && d.repliedby) - { d.repliedby.forEach(function(x){ - repliedby.push(encode(x))}); - repliedby={t:108,v:repliedby}; } else { repliedby = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,msg_id,from,to,created,files, - type,link,seenby,repliedby,status); } + const tup = atom('Message'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + // @TODO: CRASHED ANDROID VERSION + // var container = 'container' in d && d.container ? encode(d.container) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + const to = 'to' in d && d.to ? bin(d.to) : nil(); + const created = 'created' in d && d.created ? encode(d.created) : nil(); + let files = []; if ('files' in d && d.files) { + d.files.forEach((x) => { + files.push(encode(x)); + }); + files = { t: 108, v: files }; + } else { files = nil(); } + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const link = 'link' in d && d.link ? number(d.link) : nil(); + let seenby = []; if ('seenby' in d && d.seenby) { + d.seenby.forEach((x) => { + seenby.push(encode(x)); + }); + seenby = { t: 108, v: seenby }; + } else { seenby = nil(); } + let repliedby = []; if ('repliedby' in d && d.repliedby) { + d.repliedby.forEach((x) => { + repliedby.push(encode(x)); + }); + repliedby = { t: 108, v: repliedby }; + } else { repliedby = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, msg_id, from, to, created, files, + type, link, seenby, repliedby, status + ); +} function lenMessage() { return 16; } function decMessage(d) { - var r={}; r.tup = 'Message'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; - r.created = d && d.v[9] ? decode(d.v[9]) : undefined; - r.files = []; - (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.files.push(decode(x))}) : - r.files = undefined; - r.type = d && d.v[11] ? decode(d.v[11]) : undefined; - r.link = d && d.v[12] ? d.v[12].v : undefined; - r.seenby = []; - (d && d.v[13] && d.v[13].v) ? - d.v[13].v.forEach(function(x){r.seenby.push(decode(x))}) : - r.seenby = undefined; - r.repliedby = []; - (d && d.v[14] && d.v[14].v) ? - d.v[14].v.forEach(function(x){r.repliedby.push(decode(x))}) : - r.repliedby = undefined; - r.status = d && d.v[15] ? decode(d.v[15]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Message'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined; + r.created = d && d.v[9] ? decode(d.v[9]) : undefined; + r.files = []; + (d && d.v[10] && d.v[10].v) ? + d.v[10].v.forEach((x) => { r.files.push(decode(x)); }) : + r.files = undefined; + r.type = d && d.v[11] ? decode(d.v[11]) : undefined; + r.link = d && d.v[12] ? d.v[12].v : undefined; + r.seenby = []; + (d && d.v[13] && d.v[13].v) ? + d.v[13].v.forEach((x) => { r.seenby.push(decode(x)); }) : + r.seenby = undefined; + r.repliedby = []; + (d && d.v[14] && d.v[14].v) ? + d.v[14].v.forEach((x) => { r.repliedby.push(decode(x)); }) : + r.repliedby = undefined; + r.status = d && d.v[15] ? decode(d.v[15]) : undefined; + return clean(r); +} function encRoom(d) { - var tup = atom('Room'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var description = 'description' in d && d.description ? bin(d.description) : nil(); - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var members = []; if ('members' in d && d.members) - { d.members.forEach(function(x){ - members.push(encode(x))}); - members={t:108,v:members}; } else { members = nil() }; - var admins = []; if ('admins' in d && d.admins) - { d.admins.forEach(function(x){ - admins.push(encode(x))}); - admins={t:108,v:admins}; } else { admins = nil() }; - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var tos = 'tos' in d && d.tos ? bin(d.tos) : nil(); - var tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil(); - var unread = 'unread' in d && d.unread ? number(d.unread) : nil(); - var readers = []; if ('readers' in d && d.readers) - { d.readers.forEach(function(x){ - readers.push(encode(x))}); - readers={t:108,v:readers}; } else { readers = nil() }; - var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var created = 'created' in d && d.created ? number(d.created) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,name,description,settings,members,admins,data,type,tos,tos_update, - unread,readers,last_msg,update,created,status); } + const tup = atom('Room'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const description = 'description' in d && d.description ? bin(d.description) : nil(); + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + let members = []; if ('members' in d && d.members) { + d.members.forEach((x) => { + members.push(encode(x)); + }); + members = { t: 108, v: members }; + } else { members = nil(); } + let admins = []; if ('admins' in d && d.admins) { + d.admins.forEach((x) => { + admins.push(encode(x)); + }); + admins = { t: 108, v: admins }; + } else { admins = nil(); } + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const tos = 'tos' in d && d.tos ? bin(d.tos) : nil(); + const tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil(); + const unread = 'unread' in d && d.unread ? number(d.unread) : nil(); + let readers = []; if ('readers' in d && d.readers) { + d.readers.forEach((x) => { + readers.push(encode(x)); + }); + readers = { t: 108, v: readers }; + } else { readers = nil(); } + const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const created = 'created' in d && d.created ? number(d.created) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, name, description, settings, members, admins, data, type, tos, tos_update, + unread, readers, last_msg, update, created, status + ); +} function lenRoom() { return 17; } function decRoom(d) { - var r={}; r.tup = 'Room'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.settings = []; - (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) : - r.settings = undefined; - r.members = []; - (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.members.push(decode(x))}) : - r.members = undefined; - r.admins = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.admins.push(decode(x))}) : - r.admins = undefined; - r.data = []; - (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.data.push(decode(x))}) : - r.data = undefined; - r.type = d && d.v[8] ? decode(d.v[8]) : undefined; - r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; - r.tos_update = d && d.v[10] ? d.v[10].v : undefined; - r.unread = d && d.v[11] ? d.v[11].v : undefined; - r.readers = []; - (d && d.v[12] && d.v[12].v) ? - d.v[12].v.forEach(function(x){r.readers.push(decode(x))}) : - r.readers = undefined; - r.last_msg = d && d.v[13] ? decode(d.v[13]) : undefined; - r.update = d && d.v[14] ? d.v[14].v : undefined; - r.created = d && d.v[15] ? d.v[15].v : undefined; - r.status = d && d.v[16] ? decode(d.v[16]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Room'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.settings = []; + (d && d.v[4] && d.v[4].v) ? + d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) : + r.settings = undefined; + r.members = []; + (d && d.v[5] && d.v[5].v) ? + d.v[5].v.forEach((x) => { r.members.push(decode(x)); }) : + r.members = undefined; + r.admins = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.admins.push(decode(x)); }) : + r.admins = undefined; + r.data = []; + (d && d.v[7] && d.v[7].v) ? + d.v[7].v.forEach((x) => { r.data.push(decode(x)); }) : + r.data = undefined; + r.type = d && d.v[8] ? decode(d.v[8]) : undefined; + r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined; + r.tos_update = d && d.v[10] ? d.v[10].v : undefined; + r.unread = d && d.v[11] ? d.v[11].v : undefined; + r.readers = []; + (d && d.v[12] && d.v[12].v) ? + d.v[12].v.forEach((x) => { r.readers.push(decode(x)); }) : + r.readers = undefined; + r.last_msg = d && d.v[13] ? decode(d.v[13]) : undefined; + r.update = d && d.v[14] ? d.v[14].v : undefined; + r.created = d && d.v[15] ? d.v[15].v : undefined; + r.status = d && d.v[16] ? decode(d.v[16]) : undefined; + return clean(r); +} function encTag(d) { - var tup = atom('Tag'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var color = 'color' in d && d.color ? bin(d.color) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,name,color,status); } + const tup = atom('Tag'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const color = 'color' in d && d.color ? bin(d.color) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, name, color, status); +} function lenTag() { return 5; } function decTag(d) { - var r={}; r.tup = 'Tag'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.status = d && d.v[4] ? decode(d.v[4]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Tag'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.status = d && d.v[4] ? decode(d.v[4]) : undefined; + return clean(r); +} function encStar(d) { - var tup = atom('Star'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var message = 'message' in d && d.message ? encode(d.message) : nil(); - var tags = []; if ('tags' in d && d.tags) - { d.tags.forEach(function(x){ - tags.push(encode(x))}); - tags={t:108,v:tags}; } else { tags = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,message,tags,status); } + const tup = atom('Star'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const message = 'message' in d && d.message ? encode(d.message) : nil(); + let tags = []; if ('tags' in d && d.tags) { + d.tags.forEach((x) => { + tags.push(encode(x)); + }); + tags = { t: 108, v: tags }; + } else { tags = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, message, tags, status); +} function lenStar() { return 5; } function decStar(d) { - var r={}; r.tup = 'Star'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.message = d && d.v[2] ? decode(d.v[2]) : undefined; - r.tags = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.tags.push(decode(x))}) : - r.tags = undefined; - r.status = d && d.v[4] ? decode(d.v[4]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Star'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.message = d && d.v[2] ? decode(d.v[2]) : undefined; + r.tags = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.tags.push(decode(x)); }) : + r.tags = undefined; + r.status = d && d.v[4] ? decode(d.v[4]) : undefined; + return clean(r); +} function encHistory(d) { - var tup = atom('History'); - var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); - var feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); - var size = 'size' in d && d.size ? number(d.size) : nil(); - var entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil(); - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,roster_id,feed,size,entity_id,data,status); } + const tup = atom('History'); + const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil(); + const feed = 'feed' in d && d.feed ? encode(d.feed) : nil(); + const size = 'size' in d && d.size ? number(d.size) : nil(); + const entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil(); + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, roster_id, feed, size, entity_id, data, status); +} function lenHistory() { return 7; } function decHistory(d) { - var r={}; r.tup = 'History'; - r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.feed = d && d.v[2] ? decode(d.v[2]) : undefined; - r.size = d && d.v[3] ? d.v[3].v : undefined; - r.entity_id = d && d.v[4] ? d.v[4].v : undefined; - r.data = []; - (d && d.v[5] && d.v[5].v) ? - d.v[5].v.forEach(function(x){r.data.push(decode(x))}) : - r.data = undefined; - r.status = d && d.v[6] ? decode(d.v[6]) : undefined; - return clean(r); } + const r = {}; r.tup = 'History'; + r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.feed = d && d.v[2] ? decode(d.v[2]) : undefined; + r.size = d && d.v[3] ? d.v[3].v : undefined; + r.entity_id = d && d.v[4] ? d.v[4].v : undefined; + r.data = []; + (d && d.v[5] && d.v[5].v) ? + d.v[5].v.forEach((x) => { r.data.push(decode(x)); }) : + r.data = undefined; + r.status = d && d.v[6] ? decode(d.v[6]) : undefined; + return clean(r); +} function encTyping(d) { - var tup = atom('Typing'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var comments = 'comments' in d && d.comments ? encode(d.comments) : nil(); - return tuple(tup,phone_id,comments); } + const tup = atom('Typing'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const comments = 'comments' in d && d.comments ? encode(d.comments) : nil(); + return tuple(tup, phone_id, comments); +} function lenTyping() { return 3; } function decTyping(d) { - var r={}; r.tup = 'Typing'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Typing'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined; + return clean(r); +} function encContact(d) { - var tup = atom('Contact'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); - var reader = 'reader' in d && d.reader ? number(d.reader) : nil(); - var unread = 'unread' in d && d.unread ? number(d.unread) : nil(); - var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone_id,avatar,names,surnames,nick,email,vox_id,reader,unread,last_msg, - update,settings,presence,status); } + const tup = atom('Contact'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil(); + const reader = 'reader' in d && d.reader ? number(d.reader) : nil(); + const unread = 'unread' in d && d.unread ? number(d.unread) : nil(); + const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, phone_id, avatar, names, surnames, nick, email, vox_id, reader, unread, last_msg, + update, settings, presence, status + ); +} function lenContact() { return 15; } function decContact(d) { - var r={}; r.tup = 'Contact'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.reader = d && d.v[8] ? d.v[8].v : undefined; - r.unread = d && d.v[9] ? d.v[9].v : undefined; - r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined; - r.update = d && d.v[11] ? d.v[11].v : undefined; - r.settings = []; - (d && d.v[12] && d.v[12].v) ? - d.v[12].v.forEach(function(x){r.settings.push(decode(x))}) : - r.settings = undefined; - r.presence = d && d.v[13] ? d.v[13].v : undefined; - r.status = d && d.v[14] ? decode(d.v[14]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Contact'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.reader = d && d.v[8] ? d.v[8].v : undefined; + r.unread = d && d.v[9] ? d.v[9].v : undefined; + r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined; + r.update = d && d.v[11] ? d.v[11].v : undefined; + r.settings = []; + (d && d.v[12] && d.v[12].v) ? + d.v[12].v.forEach((x) => { r.settings.push(decode(x)); }) : + r.settings = undefined; + r.presence = d && d.v[13] ? d.v[13].v : undefined; + r.status = d && d.v[14] ? decode(d.v[14]) : undefined; + return clean(r); +} function encAuth(d) { - var tup = atom('Auth'); - var client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil(); - var dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil(); - var user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil(); - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var token = 'token' in d && d.token ? bin(d.token) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil(); - var attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil(); - var services = []; if ('services' in d && d.services) - { d.services.forEach(function(x){ - services.push(encode(x))}); - services={t:108,v:services}; } else { services = nil() }; - var push = 'push' in d && d.push ? bin(d.push) : nil(); - var os = 'os' in d && d.os ? encode(d.os) : nil(); - var created = 'created' in d && d.created ? encode(d.created) : nil(); - var last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil(); - return tuple(tup,client_id,dev_key,user_id,phone,token,type,sms_code,attempts,services,push, - os,created,last_online); } + const tup = atom('Auth'); + const client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil(); + const dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil(); + const user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil(); + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + const token = 'token' in d && d.token ? bin(d.token) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil(); + const attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil(); + let services = []; if ('services' in d && d.services) { + d.services.forEach((x) => { + services.push(encode(x)); + }); + services = { t: 108, v: services }; + } else { services = nil(); } + const push = 'push' in d && d.push ? bin(d.push) : nil(); + const os = 'os' in d && d.os ? encode(d.os) : nil(); + const created = 'created' in d && d.created ? encode(d.created) : nil(); + const last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil(); + return tuple( + tup, client_id, dev_key, user_id, phone, token, type, sms_code, attempts, services, push, + os, created, last_online + ); +} function lenAuth() { return 14; } function decAuth(d) { - var r={}; r.tup = 'Auth'; - r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.type = d && d.v[6] ? d.v[6].v : undefined; - r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.attempts = d && d.v[8] ? d.v[8].v : undefined; - r.services = []; - (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.services.push(decode(x))}) : - r.services = undefined; - r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.os = d && d.v[11] ? decode(d.v[11]) : undefined; - r.created = d && d.v[12] ? decode(d.v[12]) : undefined; - r.last_online = d && d.v[13] ? d.v[13].v : undefined; - return clean(r); } + const r = {}; r.tup = 'Auth'; + r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.type = d && d.v[6] ? d.v[6].v : undefined; + r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.attempts = d && d.v[8] ? d.v[8].v : undefined; + r.services = []; + (d && d.v[9] && d.v[9].v) ? + d.v[9].v.forEach((x) => { r.services.push(decode(x)); }) : + r.services = undefined; + r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.os = d && d.v[11] ? decode(d.v[11]) : undefined; + r.created = d && d.v[12] ? decode(d.v[12]) : undefined; + r.last_online = d && d.v[13] ? d.v[13].v : undefined; + return clean(r); +} function encService(d) { - var tup = atom('Service'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - var login = 'login' in d && d.login ? bin(d.login) : nil(); - var password = 'password' in d && d.password ? bin(d.password) : nil(); - var expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,type,data,login,password,expiration,status); } + const tup = atom('Service'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + const login = 'login' in d && d.login ? bin(d.login) : nil(); + const password = 'password' in d && d.password ? bin(d.password) : nil(); + const expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, type, data, login, password, expiration, status); +} function lenService() { return 8; } function decService(d) { - var r={}; r.tup = 'Service'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.type = d && d.v[2] ? decode(d.v[2]) : undefined; - r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.expiration = d && d.v[6] ? d.v[6].v : undefined; - r.status = d && d.v[7] ? decode(d.v[7]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Service'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.type = d && d.v[2] ? decode(d.v[2]) : undefined; + r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.expiration = d && d.v[6] ? d.v[6].v : undefined; + r.status = d && d.v[7] ? decode(d.v[7]) : undefined; + return clean(r); +} function encRoster(d) { - var tup = atom('Roster'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var names = 'names' in d && d.names ? bin(d.names) : nil(); - var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); - var email = 'email' in d && d.email ? bin(d.email) : nil(); - var nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); - var userlist = []; if ('userlist' in d && d.userlist) - { d.userlist.forEach(function(x){ - userlist.push(encode(x))}); - userlist={t:108,v:userlist}; } else { userlist = nil() }; - var roomlist = []; if ('roomlist' in d && d.roomlist) - { d.roomlist.forEach(function(x){ - roomlist.push(encode(x))}); - roomlist={t:108,v:roomlist}; } else { roomlist = nil() }; - var favorite = []; if ('favorite' in d && d.favorite) - { d.favorite.forEach(function(x){ - favorite.push(encode(x))}); - favorite={t:108,v:favorite}; } else { favorite = nil() }; - var tags = []; if ('tags' in d && d.tags) - { d.tags.forEach(function(x){ - tags.push(encode(x))}); - tags={t:108,v:tags}; } else { tags = nil() }; - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); - var update = 'update' in d && d.update ? number(d.update) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,names,surnames,email,nick,userlist,roomlist,favorite,tags,phone, - avatar,update,status); } + const tup = atom('Roster'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const names = 'names' in d && d.names ? bin(d.names) : nil(); + const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil(); + const email = 'email' in d && d.email ? bin(d.email) : nil(); + const nick = 'nick' in d && d.nick ? bin(d.nick) : nil(); + let userlist = []; if ('userlist' in d && d.userlist) { + d.userlist.forEach((x) => { + userlist.push(encode(x)); + }); + userlist = { t: 108, v: userlist }; + } else { userlist = nil(); } + let roomlist = []; if ('roomlist' in d && d.roomlist) { + d.roomlist.forEach((x) => { + roomlist.push(encode(x)); + }); + roomlist = { t: 108, v: roomlist }; + } else { roomlist = nil(); } + let favorite = []; if ('favorite' in d && d.favorite) { + d.favorite.forEach((x) => { + favorite.push(encode(x)); + }); + favorite = { t: 108, v: favorite }; + } else { favorite = nil(); } + let tags = []; if ('tags' in d && d.tags) { + d.tags.forEach((x) => { + tags.push(encode(x)); + }); + tags = { t: 108, v: tags }; + } else { tags = nil(); } + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil(); + const update = 'update' in d && d.update ? number(d.update) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, names, surnames, email, nick, userlist, roomlist, favorite, tags, phone, + avatar, update, status + ); +} function lenRoster() { return 14; } function decRoster(d) { - var r={}; r.tup = 'Roster'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.userlist = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.userlist.push(decode(x))}) : - r.userlist = undefined; - r.roomlist = []; - (d && d.v[7] && d.v[7].v) ? - d.v[7].v.forEach(function(x){r.roomlist.push(decode(x))}) : - r.roomlist = undefined; - r.favorite = []; - (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.favorite.push(decode(x))}) : - r.favorite = undefined; - r.tags = []; - (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.tags.push(decode(x))}) : - r.tags = undefined; - r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.update = d && d.v[12] ? d.v[12].v : undefined; - r.status = d && d.v[13] ? decode(d.v[13]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Roster'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.userlist = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.userlist.push(decode(x)); }) : + r.userlist = undefined; + r.roomlist = []; + (d && d.v[7] && d.v[7].v) ? + d.v[7].v.forEach((x) => { r.roomlist.push(decode(x)); }) : + r.roomlist = undefined; + r.favorite = []; + (d && d.v[8] && d.v[8].v) ? + d.v[8].v.forEach((x) => { r.favorite.push(decode(x)); }) : + r.favorite = undefined; + r.tags = []; + (d && d.v[9] && d.v[9].v) ? + d.v[9].v.forEach((x) => { r.tags.push(decode(x)); }) : + r.tags = undefined; + r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.update = d && d.v[12] ? d.v[12].v : undefined; + r.status = d && d.v[13] ? decode(d.v[13]) : undefined; + return clean(r); +} function encProfile(d) { - var tup = atom('Profile'); - var phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); - var services = []; if ('services' in d && d.services) - { d.services.forEach(function(x){ - services.push(encode(x))}); - services={t:108,v:services}; } else { services = nil() }; - var rosters = []; if ('rosters' in d && d.rosters) - { d.rosters.forEach(function(x){ - rosters.push(encode(x))}); - rosters={t:108,v:rosters}; } else { rosters = nil() }; - var settings = []; if ('settings' in d && d.settings) - { d.settings.forEach(function(x){ - settings.push(encode(x))}); - settings={t:108,v:settings}; } else { settings = nil() }; - var update = 'update' in d && d.update ? number(d.update) : nil(); - var balance = 'balance' in d && d.balance ? number(d.balance) : nil(); - var presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone,services,rosters,settings,update,balance,presence,status); } + const tup = atom('Profile'); + const phone = 'phone' in d && d.phone ? bin(d.phone) : nil(); + let services = []; if ('services' in d && d.services) { + d.services.forEach((x) => { + services.push(encode(x)); + }); + services = { t: 108, v: services }; + } else { services = nil(); } + let rosters = []; if ('rosters' in d && d.rosters) { + d.rosters.forEach((x) => { + rosters.push(encode(x)); + }); + rosters = { t: 108, v: rosters }; + } else { rosters = nil(); } + let settings = []; if ('settings' in d && d.settings) { + d.settings.forEach((x) => { + settings.push(encode(x)); + }); + settings = { t: 108, v: settings }; + } else { settings = nil(); } + const update = 'update' in d && d.update ? number(d.update) : nil(); + const balance = 'balance' in d && d.balance ? number(d.balance) : nil(); + const presence = 'presence' in d && d.presence ? atom(d.presence) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, phone, services, rosters, settings, update, balance, presence, status); +} function lenProfile() { return 9; } function decProfile(d) { - var r={}; r.tup = 'Profile'; - r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.services = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.services.push(decode(x))}) : - r.services = undefined; - r.rosters = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.rosters.push(decode(x))}) : - r.rosters = undefined; - r.settings = []; - (d && d.v[4] && d.v[4].v) ? - d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) : - r.settings = undefined; - r.update = d && d.v[5] ? d.v[5].v : undefined; - r.balance = d && d.v[6] ? d.v[6].v : undefined; - r.presence = d && d.v[7] ? d.v[7].v : undefined; - r.status = d && d.v[8] ? d.v[8].v : undefined; - return clean(r); } + const r = {}; r.tup = 'Profile'; + r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.services = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.services.push(decode(x)); }) : + r.services = undefined; + r.rosters = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.rosters.push(decode(x)); }) : + r.rosters = undefined; + r.settings = []; + (d && d.v[4] && d.v[4].v) ? + d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) : + r.settings = undefined; + r.update = d && d.v[5] ? d.v[5].v : undefined; + r.balance = d && d.v[6] ? d.v[6].v : undefined; + r.presence = d && d.v[7] ? d.v[7].v : undefined; + r.status = d && d.v[8] ? d.v[8].v : undefined; + return clean(r); +} function encLoc(d) { - var tup = atom('Loc'); - var x = 'x' in d && d.x ? bin(d.x) : nil(); - var y = 'y' in d && d.y ? bin(d.y) : nil(); - var z = 'z' in d && d.z ? bin(d.z) : nil(); - return tuple(tup,x,y,z); } + const tup = atom('Loc'); + const x = 'x' in d && d.x ? bin(d.x) : nil(); + const y = 'y' in d && d.y ? bin(d.y) : nil(); + const z = 'z' in d && d.z ? bin(d.z) : nil(); + return tuple(tup, x, y, z); +} function lenLoc() { return 4; } function decLoc(d) { - var r={}; r.tup = 'Loc'; - r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'Loc'; + r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + return clean(r); +} function encFriend(d) { - var tup = atom('Friend'); - var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); - var friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,phone_id,friend_id,status); } + const tup = atom('Friend'); + const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil(); + const friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, phone_id, friend_id, status); +} function lenFriend() { return 4; } function decFriend(d) { - var r={}; r.tup = 'Friend'; - r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.status = d && d.v[3] ? decode(d.v[3]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Friend'; + r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.status = d && d.v[3] ? decode(d.v[3]) : undefined; + return clean(r); +} function encCallMember(d) { - var tup = atom('CallMember'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? encode(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var contact = 'contact' in d && d.contact ? encode(d.contact) : nil(); - var start = 'start' in d && d.start ? number(d.start) : nil(); - var stop = 'stop' in d && d.stop ? number(d.stop) : nil(); - var type = 'type' in d && d.type ? encode(d.type) : nil(); - var desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); - var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); - var bill = 'bill' in d && d.bill ? number(d.bill) : nil(); - var duration = 'duration' in d && d.duration ? number(d.duration) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,prev,next,contact,start,stop,type,desc, - tariff,bill,duration,status); } + const tup = atom('CallMember'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? encode(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const contact = 'contact' in d && d.contact ? encode(d.contact) : nil(); + const start = 'start' in d && d.start ? number(d.start) : nil(); + const stop = 'stop' in d && d.stop ? number(d.stop) : nil(); + const type = 'type' in d && d.type ? encode(d.type) : nil(); + const desc = 'desc' in d && d.desc ? bin(d.desc) : nil(); + const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil(); + const bill = 'bill' in d && d.bill ? number(d.bill) : nil(); + const duration = 'duration' in d && d.duration ? number(d.duration) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, contact, start, stop, type, desc, + tariff, bill, duration, status + ); +} function lenCallMember() { return 15; } function decCallMember(d) { - var r={}; r.tup = 'CallMember'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.contact = d && d.v[6] ? decode(d.v[6]) : undefined; - r.start = d && d.v[7] ? d.v[7].v : undefined; - r.stop = d && d.v[8] ? d.v[8].v : undefined; - r.type = d && d.v[9] ? decode(d.v[9]) : undefined; - r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; - r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; - r.bill = d && d.v[12] ? d.v[12].v : undefined; - r.duration = d && d.v[13] ? d.v[13].v : undefined; - r.status = d && d.v[14] ? decode(d.v[14]) : undefined; - return clean(r); } + const r = {}; r.tup = 'CallMember'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.contact = d && d.v[6] ? decode(d.v[6]) : undefined; + r.start = d && d.v[7] ? d.v[7].v : undefined; + r.stop = d && d.v[8] ? d.v[8].v : undefined; + r.type = d && d.v[9] ? decode(d.v[9]) : undefined; + r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined; + r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined; + r.bill = d && d.v[12] ? d.v[12].v : undefined; + r.duration = d && d.v[13] ? d.v[13].v : undefined; + r.status = d && d.v[14] ? decode(d.v[14]) : undefined; + return clean(r); +} function encCall(d) { - var tup = atom('Call'); - var id = 'id' in d && d.id ? bin(d.id) : nil(); - var from = 'from' in d && d.from ? bin(d.from) : nil(); - var members = []; if ('members' in d && d.members) - { d.members.forEach(function(x){ - members.push(encode(x))}); - members={t:108,v:members}; } else { members = nil() }; - var start = 'start' in d && d.start ? number(d.start) : nil(); - var stop = 'stop' in d && d.stop ? number(d.stop) : nil(); - var vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil(); - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,from,members,start,stop,vox_url,status); } + const tup = atom('Call'); + const id = 'id' in d && d.id ? bin(d.id) : nil(); + const from = 'from' in d && d.from ? bin(d.from) : nil(); + let members = []; if ('members' in d && d.members) { + d.members.forEach((x) => { + members.push(encode(x)); + }); + members = { t: 108, v: members }; + } else { members = nil(); } + const start = 'start' in d && d.start ? number(d.start) : nil(); + const stop = 'stop' in d && d.stop ? number(d.stop) : nil(); + const vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil(); + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, from, members, start, stop, vox_url, status); +} function lenCall() { return 8; } function decCall(d) { - var r={}; r.tup = 'Call'; - r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.members = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.members.push(decode(x))}) : - r.members = undefined; - r.start = d && d.v[4] ? d.v[4].v : undefined; - r.stop = d && d.v[5] ? d.v[5].v : undefined; - r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.status = d && d.v[7] ? decode(d.v[7]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Call'; + r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.members = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.members.push(decode(x)); }) : + r.members = undefined; + r.start = d && d.v[4] ? d.v[4].v : undefined; + r.stop = d && d.v[5] ? d.v[5].v : undefined; + r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.status = d && d.v[7] ? decode(d.v[7]) : undefined; + return clean(r); +} function encIndex(d) { - var tup = atom('Index'); - var id = 'id' in d && d.id ? encode(d.id) : nil(); - var roster = []; if ('roster' in d && d.roster) - { d.roster.forEach(function(x){ - roster.push(encode(x))}); - roster={t:108,v:roster}; } else { roster = nil() }; - return tuple(tup,id,roster); } + const tup = atom('Index'); + const id = 'id' in d && d.id ? encode(d.id) : nil(); + let roster = []; if ('roster' in d && d.roster) { + d.roster.forEach((x) => { + roster.push(encode(x)); + }); + roster = { t: 108, v: roster }; + } else { roster = nil(); } + return tuple(tup, id, roster); +} function lenIndex() { return 3; } function decIndex(d) { - var r={}; r.tup = 'Index'; - r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; - r.roster = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.roster.push(decode(x))}) : - r.roster = undefined; - return clean(r); } + const r = {}; r.tup = 'Index'; + r.id = d && d.v[1] ? decode(d.v[1].v) : undefined; + r.roster = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.roster.push(decode(x)); }) : + r.roster = undefined; + return clean(r); +} function encerror(d) { - var tup = atom('error'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - return tuple(tup,code); } + const tup = atom('error'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + return tuple(tup, code); +} function lenerror() { return 2; } function decerror(d) { - var r={}; r.tup = 'error'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - return clean(r); } + const r = {}; r.tup = 'error'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + return clean(r); +} function encok(d) { - var tup = atom('ok'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - return tuple(tup,code); } + const tup = atom('ok'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + return tuple(tup, code); +} function lenok() { return 2; } function decok(d) { - var r={}; r.tup = 'ok'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - return clean(r); } + const r = {}; r.tup = 'ok'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + return clean(r); +} function encerror2(d) { - var tup = atom('error2'); - var code = 'code' in d && d.code ? atom(d.code) : nil(); - var src = 'src' in d && d.src ? encode(d.src) : nil(); - return tuple(tup,code,src); } + const tup = atom('error2'); + const code = 'code' in d && d.code ? atom(d.code) : nil(); + const src = 'src' in d && d.src ? encode(d.src) : nil(); + return tuple(tup, code, src); +} function lenerror2() { return 3; } function decerror2(d) { - var r={}; r.tup = 'error2'; - r.code = d && d.v[1] ? d.v[1].v : undefined; - r.src = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'error2'; + r.code = d && d.v[1] ? d.v[1].v : undefined; + r.src = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encok2(d) { - var tup = atom('ok2'); - var code = 'code' in d && d.code ? atom(d.code) : nil(); - var src = 'src' in d && d.src ? encode(d.src) : nil(); - return tuple(tup,code,src); } + const tup = atom('ok2'); + const code = 'code' in d && d.code ? atom(d.code) : nil(); + const src = 'src' in d && d.src ? encode(d.src) : nil(); + return tuple(tup, code, src); +} function lenok2() { return 3; } function decok2(d) { - var r={}; r.tup = 'ok2'; - r.code = d && d.v[1] ? d.v[1].v : undefined; - r.src = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'ok2'; + r.code = d && d.v[1] ? d.v[1].v : undefined; + r.src = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encio(d) { - var tup = atom('io'); - var code = 'code' in d && d.code ? encode(d.code) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - return tuple(tup,code,data); } + const tup = atom('io'); + const code = 'code' in d && d.code ? encode(d.code) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + return tuple(tup, code, data); +} function lenio() { return 3; } function decio(d) { - var r={}; r.tup = 'io'; - r.code = d && d.v[1] ? decode(d.v[1]) : undefined; - r.data = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'io'; + r.code = d && d.v[1] ? decode(d.v[1]) : undefined; + r.data = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encmax_tour(d) { - var tup = atom('max_tour'); - var count = 'count' in d && d.count ? number(d.count) : nil(); - var joined = 'joined' in d && d.joined ? number(d.joined) : nil(); - return tuple(tup,count,joined); } + const tup = atom('max_tour'); + const count = 'count' in d && d.count ? number(d.count) : nil(); + const joined = 'joined' in d && d.joined ? number(d.joined) : nil(); + return tuple(tup, count, joined); +} function lenmax_tour() { return 3; } function decmax_tour(d) { - var r={}; r.tup = 'max_tour'; - r.count = d && d.v[1] ? d.v[1].v : undefined; - r.joined = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'max_tour'; + r.count = d && d.v[1] ? d.v[1].v : undefined; + r.joined = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function encjoin_application(d) { - var tup = atom('join_application'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - return tuple(tup,id,name,data); } + const tup = atom('join_application'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + return tuple(tup, id, name, data); +} function lenjoin_application() { return 4; } function decjoin_application(d) { - var r={}; r.tup = 'join_application'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'join_application'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.data = d && d.v[3] ? decode(d.v[3].v) : undefined; + return clean(r); +} function enctour_list(d) { - var tup = atom('tour_list'); - var users = []; if ('users' in d && d.users) - { d.users.forEach(function(x){ - users.push(encode(x))}); - users={t:108,v:users}; } else { users = nil() }; - return tuple(tup,users); } + const tup = atom('tour_list'); + let users = []; if ('users' in d && d.users) { + d.users.forEach((x) => { + users.push(encode(x)); + }); + users = { t: 108, v: users }; + } else { users = nil(); } + return tuple(tup, users); +} function lentour_list() { return 2; } function dectour_list(d) { - var r={}; r.tup = 'tour_list'; - r.users = []; - (d && d.v[1] && d.v[1].v) ? - d.v[1].v.forEach(function(x){r.users.push(decode(x))}) : - r.users = undefined; - return clean(r); } + const r = {}; r.tup = 'tour_list'; + r.users = []; + (d && d.v[1] && d.v[1].v) ? + d.v[1].v.forEach((x) => { r.users.push(decode(x)); }) : + r.users = undefined; + return clean(r); +} function enctask(d) { - var tup = atom('task'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('task'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lentask() { return 4; } function dectask(d) { - var r={}; r.tup = 'task'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'task'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encuserTask(d) { - var tup = atom('userTask'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('userTask'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lenuserTask() { return 4; } function decuserTask(d) { - var r={}; r.tup = 'userTask'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'userTask'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encserviceTask(d) { - var tup = atom('serviceTask'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('serviceTask'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lenserviceTask() { return 4; } function decserviceTask(d) { - var r={}; r.tup = 'serviceTask'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'serviceTask'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encreceiveTask(d) { - var tup = atom('receiveTask'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,roles,module); } + const tup = atom('receiveTask'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const roles = 'roles' in d && d.roles ? bin(d.roles) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, roles, module); +} function lenreceiveTask() { return 4; } function decreceiveTask(d) { - var r={}; r.tup = 'receiveTask'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.module = d && d.v[3] ? d.v[3].v : undefined; - return clean(r); } + const r = {}; r.tup = 'receiveTask'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.module = d && d.v[3] ? d.v[3].v : undefined; + return clean(r); +} function encmessageEvent(d) { - var tup = atom('messageEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); - return tuple(tup,name,payload,timeout); } + const tup = atom('messageEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); + return tuple(tup, name, payload, timeout); +} function lenmessageEvent() { return 4; } function decmessageEvent(d) { - var r={}; r.tup = 'messageEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'messageEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; + return clean(r); +} function encboundaryEvent(d) { - var tup = atom('boundaryEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); - var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); - var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); - var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); } + const tup = atom('boundaryEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); + const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); + const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); + const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module); +} function lenboundaryEvent() { return 8; } function decboundaryEvent(d) { - var r={}; r.tup = 'boundaryEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.module = d && d.v[7] ? d.v[7].v : undefined; - return clean(r); } + const r = {}; r.tup = 'boundaryEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.module = d && d.v[7] ? d.v[7].v : undefined; + return clean(r); +} function enctimeoutEvent(d) { - var tup = atom('timeoutEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); - var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); - var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); - var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); - var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); } + const tup = atom('timeoutEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const payload = 'payload' in d && d.payload ? bin(d.payload) : nil(); + const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil(); + const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil(); + const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil(); + const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module); +} function lentimeoutEvent() { return 8; } function dectimeoutEvent(d) { - var r={}; r.tup = 'timeoutEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; - r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; - r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; - r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.module = d && d.v[7] ? d.v[7].v : undefined; - return clean(r); } + const r = {}; r.tup = 'timeoutEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined; + r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined; + r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined; + r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.module = d && d.v[7] ? d.v[7].v : undefined; + return clean(r); +} function encbeginEvent(d) { - var tup = atom('beginEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,module); } + const tup = atom('beginEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, module); +} function lenbeginEvent() { return 3; } function decbeginEvent(d) { - var r={}; r.tup = 'beginEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.module = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'beginEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.module = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function encendEvent(d) { - var tup = atom('endEvent'); - var name = 'name' in d && d.name ? atom(d.name) : nil(); - var module = 'module' in d && d.module ? atom(d.module) : nil(); - return tuple(tup,name,module); } + const tup = atom('endEvent'); + const name = 'name' in d && d.name ? atom(d.name) : nil(); + const module = 'module' in d && d.module ? atom(d.module) : nil(); + return tuple(tup, name, module); +} function lenendEvent() { return 3; } function decendEvent(d) { - var r={}; r.tup = 'endEvent'; - r.name = d && d.v[1] ? d.v[1].v : undefined; - r.module = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'endEvent'; + r.name = d && d.v[1] ? d.v[1].v : undefined; + r.module = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function encsequenceFlow(d) { - var tup = atom('sequenceFlow'); - var source = 'source' in d && d.source ? atom(d.source) : nil(); - var target = 'target' in d && d.target ? atom(d.target) : nil(); - return tuple(tup,source,target); } + const tup = atom('sequenceFlow'); + const source = 'source' in d && d.source ? atom(d.source) : nil(); + const target = 'target' in d && d.target ? atom(d.target) : nil(); + return tuple(tup, source, target); +} function lensequenceFlow() { return 3; } function decsequenceFlow(d) { - var r={}; r.tup = 'sequenceFlow'; - r.source = d && d.v[1] ? d.v[1].v : undefined; - r.target = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } + const r = {}; r.tup = 'sequenceFlow'; + r.source = d && d.v[1] ? d.v[1].v : undefined; + r.target = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} function enchist(d) { - var tup = atom('hist'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var task = 'task' in d && d.task ? atom(d.task) : nil(); - var time = 'time' in d && d.time ? encode(d.time) : nil(); - return tuple(tup,id,container,feed_id,prev,next,feeds,name,task,time); } + const tup = atom('hist'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const task = 'task' in d && d.task ? atom(d.task) : nil(); + const time = 'time' in d && d.time ? encode(d.time) : nil(); + return tuple(tup, id, container, feed_id, prev, next, feeds, name, task, time); +} function lenhist() { return 10; } function dechist(d) { - var r={}; r.tup = 'hist'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.task = d && d.v[8] ? d.v[8].v : undefined; - r.time = d && d.v[9] ? decode(d.v[9].v) : undefined; - return clean(r); } + const r = {}; r.tup = 'hist'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.task = d && d.v[8] ? d.v[8].v : undefined; + r.time = d && d.v[9] ? decode(d.v[9].v) : undefined; + return clean(r); +} function encprocess(d) { - var tup = atom('process'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? atom(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var feeds = []; if ('feeds' in d && d.feeds) - { d.feeds.forEach(function(x){ - feeds.push(encode(x))}); - feeds={t:108,v:feeds}; } else { feeds = nil() }; - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var roles = []; if ('roles' in d && d.roles) - { d.roles.forEach(function(x){ - roles.push(encode(x))}); - roles={t:108,v:roles}; } else { roles = nil() }; - var tasks = []; if ('tasks' in d && d.tasks) - { d.tasks.forEach(function(x){ - tasks.push(encode(x))}); - tasks={t:108,v:tasks}; } else { tasks = nil() }; - var events = []; if ('events' in d && d.events) - { d.events.forEach(function(x){ - events.push(encode(x))}); - events={t:108,v:events}; } else { events = nil() }; - var hist = 'hist' in d && d.hist ? encode(d.hist) : nil(); - var flows = []; if ('flows' in d && d.flows) - { d.flows.forEach(function(x){ - flows.push(encode(x))}); - flows={t:108,v:flows}; } else { flows = nil() }; - var rules = 'rules' in d && d.rules ? encode(d.rules) : nil(); - var docs = []; if ('docs' in d && d.docs) - { d.docs.forEach(function(x){ - docs.push(encode(x))}); - docs={t:108,v:docs}; } else { docs = nil() }; - var options = 'options' in d && d.options ? encode(d.options) : nil(); - var task = 'task' in d && d.task ? atom(d.task) : nil(); - var timer = 'timer' in d && d.timer ? bin(d.timer) : nil(); - var notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil(); - var result = 'result' in d && d.result ? bin(d.result) : nil(); - var started = 'started' in d && d.started ? bin(d.started) : nil(); - var beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil(); - var endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil(); - return tuple(tup,id,container,feed_id,prev,next,feeds,name,roles,tasks,events, - hist,flows,rules,docs,options,task,timer,notifications,result,started,beginEvent,endEvent); } + const tup = atom('process'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? atom(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + let feeds = []; if ('feeds' in d && d.feeds) { + d.feeds.forEach((x) => { + feeds.push(encode(x)); + }); + feeds = { t: 108, v: feeds }; + } else { feeds = nil(); } + const name = 'name' in d && d.name ? bin(d.name) : nil(); + let roles = []; if ('roles' in d && d.roles) { + d.roles.forEach((x) => { + roles.push(encode(x)); + }); + roles = { t: 108, v: roles }; + } else { roles = nil(); } + let tasks = []; if ('tasks' in d && d.tasks) { + d.tasks.forEach((x) => { + tasks.push(encode(x)); + }); + tasks = { t: 108, v: tasks }; + } else { tasks = nil(); } + let events = []; if ('events' in d && d.events) { + d.events.forEach((x) => { + events.push(encode(x)); + }); + events = { t: 108, v: events }; + } else { events = nil(); } + const hist = 'hist' in d && d.hist ? encode(d.hist) : nil(); + let flows = []; if ('flows' in d && d.flows) { + d.flows.forEach((x) => { + flows.push(encode(x)); + }); + flows = { t: 108, v: flows }; + } else { flows = nil(); } + const rules = 'rules' in d && d.rules ? encode(d.rules) : nil(); + let docs = []; if ('docs' in d && d.docs) { + d.docs.forEach((x) => { + docs.push(encode(x)); + }); + docs = { t: 108, v: docs }; + } else { docs = nil(); } + const options = 'options' in d && d.options ? encode(d.options) : nil(); + const task = 'task' in d && d.task ? atom(d.task) : nil(); + const timer = 'timer' in d && d.timer ? bin(d.timer) : nil(); + const notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil(); + const result = 'result' in d && d.result ? bin(d.result) : nil(); + const started = 'started' in d && d.started ? bin(d.started) : nil(); + const beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil(); + const endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil(); + return tuple( + tup, id, container, feed_id, prev, next, feeds, name, roles, tasks, events, + hist, flows, rules, docs, options, task, timer, notifications, result, started, beginEvent, endEvent + ); +} function lenprocess() { return 23; } function decprocess(d) { - var r={}; r.tup = 'process'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? d.v[2].v : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; - r.prev = d && d.v[4] ? d.v[4].v : undefined; - r.next = d && d.v[5] ? d.v[5].v : undefined; - r.feeds = []; - (d && d.v[6] && d.v[6].v) ? - d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) : - r.feeds = undefined; - r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; - r.roles = []; - (d && d.v[8] && d.v[8].v) ? - d.v[8].v.forEach(function(x){r.roles.push(decode(x))}) : - r.roles = undefined; - r.tasks = []; - (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.tasks.push(decode(x))}) : - r.tasks = undefined; - r.events = []; - (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.events.push(decode(x))}) : - r.events = undefined; - r.hist = d && d.v[11] ? decode(d.v[11]) : undefined; - r.flows = []; - (d && d.v[12] && d.v[12].v) ? - d.v[12].v.forEach(function(x){r.flows.push(decode(x))}) : - r.flows = undefined; - r.rules = d && d.v[13] ? decode(d.v[13]) : undefined; - r.docs = []; - (d && d.v[14] && d.v[14].v) ? - d.v[14].v.forEach(function(x){r.docs.push(decode(x))}) : - r.docs = undefined; - r.options = d && d.v[15] ? decode(d.v[15].v) : undefined; - r.task = d && d.v[16] ? d.v[16].v : undefined; - r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined; - r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined; - r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined; - r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined; - r.beginEvent = d && d.v[21] ? d.v[21].v : undefined; - r.endEvent = d && d.v[22] ? d.v[22].v : undefined; - return clean(r); } + const r = {}; r.tup = 'process'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? d.v[2].v : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined; + r.prev = d && d.v[4] ? d.v[4].v : undefined; + r.next = d && d.v[5] ? d.v[5].v : undefined; + r.feeds = []; + (d && d.v[6] && d.v[6].v) ? + d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) : + r.feeds = undefined; + r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined; + r.roles = []; + (d && d.v[8] && d.v[8].v) ? + d.v[8].v.forEach((x) => { r.roles.push(decode(x)); }) : + r.roles = undefined; + r.tasks = []; + (d && d.v[9] && d.v[9].v) ? + d.v[9].v.forEach((x) => { r.tasks.push(decode(x)); }) : + r.tasks = undefined; + r.events = []; + (d && d.v[10] && d.v[10].v) ? + d.v[10].v.forEach((x) => { r.events.push(decode(x)); }) : + r.events = undefined; + r.hist = d && d.v[11] ? decode(d.v[11]) : undefined; + r.flows = []; + (d && d.v[12] && d.v[12].v) ? + d.v[12].v.forEach((x) => { r.flows.push(decode(x)); }) : + r.flows = undefined; + r.rules = d && d.v[13] ? decode(d.v[13]) : undefined; + r.docs = []; + (d && d.v[14] && d.v[14].v) ? + d.v[14].v.forEach((x) => { r.docs.push(decode(x)); }) : + r.docs = undefined; + r.options = d && d.v[15] ? decode(d.v[15].v) : undefined; + r.task = d && d.v[16] ? d.v[16].v : undefined; + r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined; + r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined; + r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined; + r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined; + r.beginEvent = d && d.v[21] ? d.v[21].v : undefined; + r.endEvent = d && d.v[22] ? d.v[22].v : undefined; + return clean(r); +} function enccomplete(d) { - var tup = atom('complete'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - return tuple(tup,id); } + const tup = atom('complete'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + return tuple(tup, id); +} function lencomplete() { return 2; } function deccomplete(d) { - var r={}; r.tup = 'complete'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - return clean(r); } + const r = {}; r.tup = 'complete'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + return clean(r); +} function encproc(d) { - var tup = atom('proc'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - return tuple(tup,id); } + const tup = atom('proc'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + return tuple(tup, id); +} function lenproc() { return 2; } function decproc(d) { - var r={}; r.tup = 'proc'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - return clean(r); } + const r = {}; r.tup = 'proc'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + return clean(r); +} function enchisto(d) { - var tup = atom('histo'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - return tuple(tup,id); } + const tup = atom('histo'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + return tuple(tup, id); +} function lenhisto() { return 2; } function dechisto(d) { - var r={}; r.tup = 'histo'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - return clean(r); } + const r = {}; r.tup = 'histo'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + return clean(r); +} function enccreate(d) { - var tup = atom('create'); - var proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); - var docs = []; if ('docs' in d && d.docs) - { d.docs.forEach(function(x){ - docs.push(encode(x))}); - docs={t:108,v:docs}; } else { docs = nil() }; - return tuple(tup,proc,docs); } + const tup = atom('create'); + const proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); + let docs = []; if ('docs' in d && d.docs) { + d.docs.forEach((x) => { + docs.push(encode(x)); + }); + docs = { t: 108, v: docs }; + } else { docs = nil(); } + return tuple(tup, proc, docs); +} function lencreate() { return 3; } function deccreate(d) { - var r={}; r.tup = 'create'; - r.proc = d && d.v[1] ? decode(d.v[1]) : undefined; - r.docs = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) : - r.docs = undefined; - return clean(r); } + const r = {}; r.tup = 'create'; + r.proc = d && d.v[1] ? decode(d.v[1]) : undefined; + r.docs = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) : + r.docs = undefined; + return clean(r); +} function encamend(d) { - var tup = atom('amend'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var docs = []; if ('docs' in d && d.docs) - { d.docs.forEach(function(x){ - docs.push(encode(x))}); - docs={t:108,v:docs}; } else { docs = nil() }; - return tuple(tup,id,docs); } + const tup = atom('amend'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + let docs = []; if ('docs' in d && d.docs) { + d.docs.forEach((x) => { + docs.push(encode(x)); + }); + docs = { t: 108, v: docs }; + } else { docs = nil(); } + return tuple(tup, id, docs); +} function lenamend() { return 3; } function decamend(d) { - var r={}; r.tup = 'amend'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.docs = []; - (d && d.v[2] && d.v[2].v) ? - d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) : - r.docs = undefined; - return clean(r); } + const r = {}; r.tup = 'amend'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.docs = []; + (d && d.v[2] && d.v[2].v) ? + d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) : + r.docs = undefined; + return clean(r); +} function encaction(d) { - var tup = atom('action'); - var name = 'name' in d && d.name ? bin(d.name) : nil(); - var data = 'data' in d && d.data ? encode(d.data) : nil(); - return tuple(tup,name,data); } + const tup = atom('action'); + const name = 'name' in d && d.name ? bin(d.name) : nil(); + const data = 'data' in d && d.data ? encode(d.data) : nil(); + return tuple(tup, name, data); +} function lenaction() { return 3; } function decaction(d) { - var r={}; r.tup = 'action'; - r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; - r.data = d && d.v[2] ? decode(d.v[2]) : undefined; - return clean(r); } + const r = {}; r.tup = 'action'; + r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined; + r.data = d && d.v[2] ? decode(d.v[2]) : undefined; + return clean(r); +} function encShedule(d) { - var tup = atom('Shedule'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - return tuple(tup,id,proc,data); } + const tup = atom('Shedule'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + return tuple(tup, id, proc, data); +} function lenShedule() { return 4; } function decShedule(d) { - var r={}; r.tup = 'Shedule'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.proc = d && d.v[2] ? decode(d.v[2]) : undefined; - r.data = []; - (d && d.v[3] && d.v[3].v) ? - d.v[3].v.forEach(function(x){r.data.push(decode(x))}) : - r.data = undefined; - return clean(r); } + const r = {}; r.tup = 'Shedule'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.proc = d && d.v[2] ? decode(d.v[2]) : undefined; + r.data = []; + (d && d.v[3] && d.v[3].v) ? + d.v[3].v.forEach((x) => { r.data.push(decode(x)); }) : + r.data = undefined; + return clean(r); +} function encJob(d) { - var tup = atom('Job'); - var id = 'id' in d && d.id ? number(d.id) : nil(); - var container = 'container' in d && d.container ? encode(d.container) : nil(); - var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); - var next = 'next' in d && d.next ? number(d.next) : nil(); - var prev = 'prev' in d && d.prev ? number(d.prev) : nil(); - var context = 'context' in d && d.context ? bin(d.context) : nil(); - var proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); - var time = 'time' in d && d.time ? number(d.time) : nil(); - var data = []; if ('data' in d && d.data) - { d.data.forEach(function(x){ - data.push(encode(x))}); - data={t:108,v:data}; } else { data = nil() }; - var events = []; if ('events' in d && d.events) - { d.events.forEach(function(x){ - events.push(encode(x))}); - events={t:108,v:events}; } else { events = nil() }; - var status = 'status' in d && d.status ? atom(d.status) : nil(); - return tuple(tup,id,container,feed_id,next,prev,context,proc,time,data,events,status); } + const tup = atom('Job'); + const id = 'id' in d && d.id ? number(d.id) : nil(); + const container = 'container' in d && d.container ? encode(d.container) : nil(); + const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil(); + const next = 'next' in d && d.next ? number(d.next) : nil(); + const prev = 'prev' in d && d.prev ? number(d.prev) : nil(); + const context = 'context' in d && d.context ? bin(d.context) : nil(); + const proc = 'proc' in d && d.proc ? encode(d.proc) : nil(); + const time = 'time' in d && d.time ? number(d.time) : nil(); + let data = []; if ('data' in d && d.data) { + d.data.forEach((x) => { + data.push(encode(x)); + }); + data = { t: 108, v: data }; + } else { data = nil(); } + let events = []; if ('events' in d && d.events) { + d.events.forEach((x) => { + events.push(encode(x)); + }); + events = { t: 108, v: events }; + } else { events = nil(); } + const status = 'status' in d && d.status ? atom(d.status) : nil(); + return tuple(tup, id, container, feed_id, next, prev, context, proc, time, data, events, status); +} function lenJob() { return 12; } function decJob(d) { - var r={}; r.tup = 'Job'; - r.id = d && d.v[1] ? d.v[1].v : undefined; - r.container = d && d.v[2] ? decode(d.v[2]) : undefined; - r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; - r.next = d && d.v[4] ? d.v[4].v : undefined; - r.prev = d && d.v[5] ? d.v[5].v : undefined; - r.context = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; - r.proc = d && d.v[7] ? decode(d.v[7]) : undefined; - r.time = d && d.v[8] ? d.v[8].v : undefined; - r.data = []; - (d && d.v[9] && d.v[9].v) ? - d.v[9].v.forEach(function(x){r.data.push(decode(x))}) : - r.data = undefined; - r.events = []; - (d && d.v[10] && d.v[10].v) ? - d.v[10].v.forEach(function(x){r.events.push(decode(x))}) : - r.events = undefined; - r.status = d && d.v[11] ? decode(d.v[11]) : undefined; - return clean(r); } + const r = {}; r.tup = 'Job'; + r.id = d && d.v[1] ? d.v[1].v : undefined; + r.container = d && d.v[2] ? decode(d.v[2]) : undefined; + r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined; + r.next = d && d.v[4] ? d.v[4].v : undefined; + r.prev = d && d.v[5] ? d.v[5].v : undefined; + r.context = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined; + r.proc = d && d.v[7] ? decode(d.v[7]) : undefined; + r.time = d && d.v[8] ? d.v[8].v : undefined; + r.data = []; + (d && d.v[9] && d.v[9].v) ? + d.v[9].v.forEach((x) => { r.data.push(decode(x)); }) : + r.data = undefined; + r.events = []; + (d && d.v[10] && d.v[10].v) ? + d.v[10].v.forEach((x) => { r.events.push(decode(x)); }) : + r.events = undefined; + r.status = d && d.v[11] ? decode(d.v[11]) : undefined; + return clean(r); +} function encTest(d) { - var tup = atom('Test'); - var type = 'type' in d && d.type ? atom(d.type) : nil(); - var count = 'count' in d && d.count ? number(d.count) : nil(); - return tuple(tup,type,count); } + const tup = atom('Test'); + const type = 'type' in d && d.type ? atom(d.type) : nil(); + const count = 'count' in d && d.count ? number(d.count) : nil(); + return tuple(tup, type, count); +} function lenTest() { return 3; } function decTest(d) { - var r={}; r.tup = 'Test'; - r.type = d && d.v[1] ? decode(d.v[1]) : undefined; - r.count = d && d.v[2] ? d.v[2].v : undefined; - return clean(r); } - -const mapper = (len, decode, encode ) => ({ - len: len, - decode: decode, - encode: encode + const r = {}; r.tup = 'Test'; + r.type = d && d.v[1] ? decode(d.v[1]) : undefined; + r.count = d && d.v[2] ? d.v[2].v : undefined; + return clean(r); +} + +const mapper = (len, decode, encode) => ({ + len, + decode, + encode }); const personUtils = mapper( - lenPerson, - decPerson, - encPerson + lenPerson, + decPerson, + encPerson ); const profileUtils = mapper( - lenProfile, - decProfile, - encProfile + lenProfile, + decProfile, + encProfile ); const rosterUtils = mapper( - lenRoster, - decRoster, - encRoster + lenRoster, + decRoster, + encRoster ); const contactUtils = mapper( - lenContact, - decContact, - encContact + lenContact, + decContact, + encContact ); const friendUtils = mapper( - lenFriend, - decFriend, - encFriend + lenFriend, + decFriend, + encFriend ); const historyUtils = mapper( - lenHistory, - decHistory, - encHistory + lenHistory, + decHistory, + encHistory ); const ioUtils = mapper( - lenio, - decio, - encio + lenio, + decio, + encio ); const messageUtils = mapper( - lenMessage, - decMessage, - encMessage + lenMessage, + decMessage, + encMessage ); const authUtils = mapper( - lenAuth, - decAuth, - encAuth + lenAuth, + decAuth, + encAuth ); export { - decode, - encode, - - authUtils, - personUtils, - profileUtils, - rosterUtils, - ioUtils, - contactUtils, - historyUtils, - friendUtils, - messageUtils -} \ No newline at end of file + decode, + encode, + + authUtils, + personUtils, + profileUtils, + rosterUtils, + ioUtils, + contactUtils, + historyUtils, + friendUtils, + messageUtils +}; diff --git a/src/core/configs/BrowserStorage.config.js b/src/core/configs/BrowserStorage.config.js index 80fc8fe45..724f0376f 100644 --- a/src/core/configs/BrowserStorage.config.js +++ b/src/core/configs/BrowserStorage.config.js @@ -1,4 +1,4 @@ -export const STORAGE_NAME = "store"; +export const STORAGE_NAME = 'store'; export const SAVE_TIME_DELAY = 1000; export const CLIENT = 'client'; export const DEV_KEY = 'devKey'; diff --git a/src/core/configs/MqttEvents.config.js b/src/core/configs/MqttEvents.config.js index 9567f76fa..38c6d4e12 100644 --- a/src/core/configs/MqttEvents.config.js +++ b/src/core/configs/MqttEvents.config.js @@ -3,4 +3,4 @@ export const CLOSE = 'close'; export const MESSAGE = 'message'; export const ERROR = 'error'; export const PACKETSEND = 'packetsend'; -export const PACKETRECEIVE = 'packetreceive'; \ No newline at end of file +export const PACKETRECEIVE = 'packetreceive'; diff --git a/src/core/configs/MqttInit.config.js b/src/core/configs/MqttInit.config.js index 9c8421eea..46d761787 100644 --- a/src/core/configs/MqttInit.config.js +++ b/src/core/configs/MqttInit.config.js @@ -1,19 +1,19 @@ export default ({ - username: 'api', - loggedPrefix: 'emqttd_', - authPrefix: 'reg_', - host: location.hostname, - port: 8083, - queueQoSZero: true, - resubscribe: true, - cleanSession: true, - provider: 'mqtt', - protocol: 'ws', - timeout: 2, - reconnectPeriod: 3000, - will : { - topic: 'version/1', - payload:'version/1', - qos: '2' - } + username: 'api', + loggedPrefix: 'emqttd_', + authPrefix: 'reg_', + host: location.hostname, + port: 8083, + queueQoSZero: true, + resubscribe: true, + cleanSession: true, + provider: 'mqtt', + protocol: 'ws', + timeout: 2, + reconnectPeriod: 3000, + will: { + topic: 'version/1', + payload: 'version/1', + qos: '2' + } }); diff --git a/src/core/configs/ProtocolHandlers.config.js b/src/core/configs/ProtocolHandlers.config.js index 609e02112..bd5007ed0 100644 --- a/src/core/configs/ProtocolHandlers.config.js +++ b/src/core/configs/ProtocolHandlers.config.js @@ -6,4 +6,4 @@ export const MESSAGE = 'message'; export const PERSON = 'person'; export const PROFILE = 'profile'; export const ROSTER = 'roster'; -export const SERVER = 'server'; \ No newline at end of file +export const SERVER = 'server'; diff --git a/src/core/loggers/SentryError.logger b/src/core/loggers/SentryError.logger index 6e39bd9de..0ff0a0657 100644 --- a/src/core/loggers/SentryError.logger +++ b/src/core/loggers/SentryError.logger @@ -1,3 +1,5 @@ +/* eslint-disable */ + import Raven from 'raven-js'; export default ( diff --git a/src/core/messages/Converter.message.js b/src/core/messages/Converter.message.js index 25bbee314..1082f43e4 100644 --- a/src/core/messages/Converter.message.js +++ b/src/core/messages/Converter.message.js @@ -1,12 +1,12 @@ import { decode, convertToBert } from '../bert/Converter.bert'; const formatter = (packet = {}) => { - const bert = convertToBert(packet.payload); - try { - return decode(bert); - } catch(e) { - //notify store, user, server - } + const bert = convertToBert(packet.payload); + try { + return decode(bert); + } catch (e) { + // notify store, user, server + } }; -export { formatter }; \ No newline at end of file +export { formatter }; diff --git a/src/core/middlewares/ErrorHandler.middleware.js b/src/core/middlewares/ErrorHandler.middleware.js index 6afbff249..de5d28d02 100644 --- a/src/core/middlewares/ErrorHandler.middleware.js +++ b/src/core/middlewares/ErrorHandler.middleware.js @@ -1,20 +1,20 @@ import Raven from 'raven-js'; -const crashReporter = store => next => action => { - try { - return next(action) - } catch (err) { - console.error('Caught an exception!', err); - Raven.captureException(err, { - extra: { - action, - state: store.getState() - } - }); - throw err - } +const crashReporter = store => next => (action) => { + try { + return next(action); + } catch (err) { + console.error('Caught an exception!', err); + Raven.captureException(err, { + extra: { + action, + state: store.getState() + } + }); + throw err; + } }; /* then call func(Raven); - */ \ No newline at end of file + */ diff --git a/src/core/offline/service-worker/register.service-worker.js b/src/core/offline/service-worker/register.service-worker.js index 84f5e39bc..87781e4b4 100644 --- a/src/core/offline/service-worker/register.service-worker.js +++ b/src/core/offline/service-worker/register.service-worker.js @@ -1,35 +1,34 @@ +/* eslint-disable */ import * as validator from './validator.service-worker'; export default function register() { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL(process.env.PUBLIC_URL, window.location); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 - return; - } + if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL(process.env.PUBLIC_URL, window.location); + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 + return; + } - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + window.addEventListener('load', () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - if (isLocalhost) { - // This is running on localhost. Lets check if a service worker still exists or not. - checkValidServiceWorker(swUrl); + if (isLocalhost) { + // This is running on localhost. Lets check if a service worker still exists or not. + checkValidServiceWorker(swUrl); - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://goo.gl/SC7cgQ' - ); - }); - } else { - // Is not local host. Just register service worker - registerValidSW(swUrl); - } + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log('This web app is being served cache-first by a service ' + + 'worker. To learn more, visit https://goo.gl/SC7cgQ'); }); - } + } else { + // Is not local host. Just register service worker + registerValidSW(swUrl); + } + }); + } } diff --git a/src/core/offline/service-worker/unregister.service-worker.js b/src/core/offline/service-worker/unregister.service-worker.js index 43d0970a1..bf53e82fc 100644 --- a/src/core/offline/service-worker/unregister.service-worker.js +++ b/src/core/offline/service-worker/unregister.service-worker.js @@ -1,7 +1,9 @@ +/* eslint-disable */ + export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready.then(registration => { - registration.unregister(); - }); - } -} \ No newline at end of file + if ('serviceWorker' in navigator) { + navigator.serviceWorker.ready.then((registration) => { + registration.unregister(); + }); + } +} diff --git a/src/core/offline/service-worker/validator.service-worker.js b/src/core/offline/service-worker/validator.service-worker.js index 904f2dc2e..9c56d4baf 100644 --- a/src/core/offline/service-worker/validator.service-worker.js +++ b/src/core/offline/service-worker/validator.service-worker.js @@ -1,61 +1,57 @@ +/* eslint-disable */ + export const isLocalhost = () => ( - Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. + Boolean(window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. window.location.hostname === '[::1]' || - // 127.0.0.1/8 is considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) - ) + // 127.0.0.1/8 is considered localhost for IPv4. + window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ); export function registerValidSW(swUrl) { - navigator.serviceWorker - .register(swUrl) - .then(registration => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - console.log('New content is available; please refresh.'); - } else { - console.log('Content is cached for offline use.'); - } - } - }; - }; - }) - .catch(error => { - console.error('Error during service worker registration:', error); - }); + navigator.serviceWorker + .register(swUrl) + .then((registration) => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + installingWorker.onstatechange = () => { + if (installingWorker.state === 'installed') { + if (navigator.serviceWorker.controller) { + console.log('New content is available; please refresh.'); + } else { + console.log('Content is cached for offline use.'); + } + } + }; + }; + }) + .catch((error) => { + console.error('Error during service worker registration:', error); + }); } export function checkValidServiceWorker(swUrl) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl) - .then(response => { - // Ensure service worker exists, and that we really are getting a JS file. - if ( - response.status === 404 || + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl) + .then((response) => { + // Ensure service worker exists, and that we really are getting a JS file. + if ( + response.status === 404 || response.headers.get('content-type').indexOf('javascript') === -1 - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl); - } - }) - .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then((registration) => { + registration.unregister().then(() => { + window.location.reload(); + }); }); -} \ No newline at end of file + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl); + } + }) + .catch(() => { + console.log('No internet connection found. App is running in offline mode.'); + }); +} diff --git a/src/core/protocols/Index.protocol.js b/src/core/protocols/Index.protocol.js index 75334d45b..7dd309aef 100644 --- a/src/core/protocols/Index.protocol.js +++ b/src/core/protocols/Index.protocol.js @@ -1,149 +1,135 @@ import * as protocolsName from '../configs/ProtocolHandlers.config'; import { - profileUtils, - personUtils, - rosterUtils, - contactUtils, - messageUtils, - historyUtils, - ioUtils, - friendUtils, + profileUtils, + personUtils, + rosterUtils, + contactUtils, + messageUtils, + historyUtils, + ioUtils, + friendUtils } from '../bert/SignatureGenerator.bert'; const lenServer = () => (2); -const check = node => { - if(typeof node == 'undefined') { - return; - } - return node; +const check = (node) => { + if (typeof node === 'undefined') { + return; + } + return node; }; const factory = (name = '', utils = {}, eventFormer = null, ...args) => { - let response; - const delimiter = '/'; - const eventFormerCopy = eventFormer; - const prepareEvent = (pipe = []) => { - if(!Array.isArray(pipe)) { - return; - } - return pipe.join(delimiter) - }; - - if(!eventFormer) { - eventFormer = (res = []) => { - response = utils.decode(res); - return prepareEvent([ - name, - response.status - ]); - } - } else { - eventFormer = (res = []) => { - response = utils.decode(res); - prepareEvent(eventFormerCopy(response)); - } + let response; + const delimiter = '/'; + const eventFormerCopy = eventFormer; + const prepareEvent = (pipe = []) => { + if (!Array.isArray(pipe)) { + return; } - return { + return pipe.join(delimiter); + }; + + if (!eventFormer) { + eventFormer = (res = []) => { + response = utils.decode(res); + return prepareEvent([ name, - ...utils, - eventFormer, - response, - ...args - } + response.status + ]); + }; + } else { + eventFormer = (res = []) => { + response = utils.decode(res); + prepareEvent(eventFormerCopy(response)); + }; + } + return { + name, + ...utils, + eventFormer, + response, + ...args + }; }; -const io = () => { - return factory( - protocolsName.IO, - ioUtils, - (res) => { - let pipe = [ - protocolsName.IO, - res.code.tup, - check(res.code.code) - ]; - res.data +const io = () => factory( + protocolsName.IO, + ioUtils, + (res) => { + const pipe = [ + protocolsName.IO, + res.code.tup, + check(res.code.code) + ]; + res.data && res.data.tup == 'Roster' && check(res.data.status) && pipe.push(res.data.tup.toLowerCase()) && pipe.push(res.data.status); - return pipe; - } - ); -}; + return pipe; + } +); const server = () => { - const util = { - length: lenServer, - decode: v => v, - encode: v => v - }; - return factory( - protocolsName.SERVER, - util, - v => v - ) + const util = { + length: lenServer, + decode: v => v, + encode: v => v + }; + return factory( + protocolsName.SERVER, + util, + v => v + ); }; -const contact = () => { - return factory( - protocolsName.CONTACT, - contactUtils - ); -}; +const contact = () => factory( + protocolsName.CONTACT, + contactUtils +); -const friend = () => { - return factory( - protocolsName.FRIEND, - friendUtils - ); -}; +const friend = () => factory( + protocolsName.FRIEND, + friendUtils +); -const profile = () => { - return factory( - protocolsName.PROFILE, - profileUtils - ) -}; +const profile = () => factory( + protocolsName.PROFILE, + profileUtils +); const person = () => { - const name = 'person'; - return factory( - protocolsName.PERSON, - personUtils - ) + const name = 'person'; + return factory( + protocolsName.PERSON, + personUtils + ); }; -const history = () => { - return factory( - protocolsName.HISTORY, - historyUtils - ) -}; +const history = () => factory( + protocolsName.HISTORY, + historyUtils +); -const message = () => { - return factory( - protocolsName.MESSAGE, - messageUtils - ) -}; +const message = () => factory( + protocolsName.MESSAGE, + messageUtils +); -const roster = () => { - return factory( - protocolsName.ROSTER, - rosterUtils - ); -}; +const roster = () => factory( + protocolsName.ROSTER, + rosterUtils +); export { - profile, - person, - roster, - contact, - message, - history, - io, - friend, -}; \ No newline at end of file + profile, + person, + roster, + contact, + message, + history, + io, + friend +}; diff --git a/src/core/protocols/Topic.protocol.js b/src/core/protocols/Topic.protocol.js index 3d70b2f1a..f50bf3e53 100644 --- a/src/core/protocols/Topic.protocol.js +++ b/src/core/protocols/Topic.protocol.js @@ -1,21 +1,21 @@ import { setupClientEntry } from '../store'; import * as config from '../configs/ProtocolTopic.config'; -import { browserStorage } from '../store' +import { browserStorage } from '../store'; const generateNumber = () => ( - Math.floor((Math.random() * config.NODES) + 1) + Math.floor((Math.random() * config.NODES) + 1) ); const topic = (prefix, ...args) => { - let pipe = [ - prefix, - ...args, - config.VERSION, - generateNumber(), - config.DIRECTION, - setupClientEntry() - ]; - return pipe.join('/') + '/'; + const pipe = [ + prefix, + ...args, + config.VERSION, + generateNumber(), + config.DIRECTION, + setupClientEntry() + ]; + return `${pipe.join('/')}/`; }; -export { topic }; \ No newline at end of file +export { topic }; diff --git a/src/core/protocols/Validator.protocol.js b/src/core/protocols/Validator.protocol.js index b5a56e583..5df9fa99f 100644 --- a/src/core/protocols/Validator.protocol.js +++ b/src/core/protocols/Validator.protocol.js @@ -1,27 +1,26 @@ import * as protocols from './Index.protocol'; const isCorrespond = (x, num, name) => ( - x == undefined + x == undefined ? false : (x.t == 106 ? false : (x.v.length === num && x.v[0].v === name)) ); const validate = (res) => { - for(let protocol in protocols) { - let node = protocols[protocol](); - if(isCorrespond(res, node.len(), node.name)) { - return { - event: node.eventFormer(res), - response: node.response - }; - } + for (const protocol in protocols) { + const node = protocols[protocol](); + if (isCorrespond(res, node.len(), node.name)) { + return { + event: node.eventFormer(res), + response: node.response + }; } - return; + } }; export { - isCorrespond, - validate -}; \ No newline at end of file + isCorrespond, + validate +}; diff --git a/src/core/protocols/index.js b/src/core/protocols/index.js index e168f8dda..57e1d80c3 100644 --- a/src/core/protocols/index.js +++ b/src/core/protocols/index.js @@ -1,3 +1,3 @@ import { topic } from './Topic.protocol'; -export { topic }; \ No newline at end of file +export { topic }; diff --git a/src/core/resource/Auth.resource.js b/src/core/resource/Auth.resource.js index 2192b2c46..73a7c0e6a 100644 --- a/src/core/resource/Auth.resource.js +++ b/src/core/resource/Auth.resource.js @@ -4,7 +4,7 @@ const REGISTER = 'REGISTER'; const REGISTERED = 'REGISTER'; const login = (time, token) => ({ - type: LOGIN, - token + type: LOGIN, + token }); diff --git a/src/core/resource/Init.resource.js b/src/core/resource/Init.resource.js index 4176d3b49..84c551041 100644 --- a/src/core/resource/Init.resource.js +++ b/src/core/resource/Init.resource.js @@ -3,28 +3,28 @@ export const CONNECTED = 'CONNECTED'; export const CLOSE = 'CLOSE'; export const ERROR = 'ERROR'; -export const connecting = (time) =>({ - type: CONNECTING, - time +export const connecting = time => ({ + type: CONNECTING, + time }); export const connected = () => ({ - type: CONNECTED + type: CONNECTED }); -export const close = (time) =>({ - type: CLOSE +export const close = time => ({ + type: CLOSE }); export const provider = (state = {}, action) => { - switch (action.type) { - case CONNECTING: - return { - updated: action.time, - ...state - }; - break; - default: - return state; - } -}; \ No newline at end of file + switch (action.type) { + case CONNECTING: + return { + updated: action.time, + ...state + }; + break; + default: + return state; + } +}; diff --git a/src/core/resource/Messages.resource.js b/src/core/resource/Messages.resource.js index 6d0ed2365..0eaa1b782 100644 --- a/src/core/resource/Messages.resource.js +++ b/src/core/resource/Messages.resource.js @@ -1,64 +1,66 @@ export const MESSAGE_SEND = 'MESSAGE_SEND'; export const MESSAGE_DELIVERED = 'MESSAGE_DELIVERED'; export const MESSAGE_RECEIVE = 'MESSAGE_RECEIVE'; -export const ERROR = "ERROR"; +export const ERROR = 'ERROR'; -const send = (topic, message, status, packet) =>({ - type: MESSAGE_SEND, - topic, - message, - status +const send = (topic, message, status, packet) => ({ + type: MESSAGE_SEND, + topic, + message, + status }); const dilivered = (topic, message, time) => ({ - type: MESSAGE_DELIVERED, - topic, - message, - time + type: MESSAGE_DELIVERED, + topic, + message, + time }); const receive = (topic, message, status, time) => ({ - type: MESSAGE_RECEIVE, - topic, - message + type: MESSAGE_RECEIVE, + topic, + message }); -const messageSendSelector = ({message, status, sentTime, id}) => ({ - [id]: { - content, - status, - sentTime - } +const messageSendSelector = ({ + message, status, sentTime, id +}) => ({ + [id]: { + content, + status, + sentTime + } }); const messageDelivered = ({ id, status }) => ({ - [id]: { - status - } + [id]: { + status + } }); const messages = (state = {}, action) => { - switch(action.type) { - case MESSAGE_SEND: - return [ - ...state, - ...messageSendSelector(action.payload) - ]; - break; - case MESSAGE_DELIVERED: - return [ - ...state, - ...messageDelivered(action.payload) - ]; - default: - return state; - } + switch (action.type) { + case MESSAGE_SEND: + return [ + ...state, + ...messageSendSelector(action.payload) + ]; + break; + case MESSAGE_DELIVERED: + return [ + ...state, + ...messageDelivered(action.payload) + ]; + default: + return state; + } }; export { - send, - receive, - dilivered, - messages -} \ No newline at end of file + send, + receive, + dilivered, + messages +}; diff --git a/src/core/resource/Registry.resource.js b/src/core/resource/Registry.resource.js index fabfa3c80..46d7fbe19 100644 --- a/src/core/resource/Registry.resource.js +++ b/src/core/resource/Registry.resource.js @@ -1,27 +1,27 @@ import { createAction, createReducer } from 'redux-act'; class ReducerRegistry { - constructor() { - this._emitChange = null; - this._reducers = {}; - } + constructor() { + this._emitChange = null; + this._reducers = {}; + } - getReducers() { - return { ...this._reducers }; - } + getReducers() { + return { ...this._reducers }; + } - register(name, reducer) { - this._reducers = { ...this._reducers, [name]: reducer }; - if (this._emitChange) { - this._emitChange(this.getReducers()); - } + register(name, reducer) { + this._reducers = { ...this._reducers, [name]: reducer }; + if (this._emitChange) { + this._emitChange(this.getReducers()); } + } - setChangeListener(listener) { - this._emitChange = listener; - } + setChangeListener(listener) { + this._emitChange = listener; + } } const reducerRegistry = new ReducerRegistry(); -export { reducerRegistry }; \ No newline at end of file +export { reducerRegistry }; diff --git a/src/core/resource/Users.resource.js b/src/core/resource/Users.resource.js index 7f85f659c..99c33392d 100644 --- a/src/core/resource/Users.resource.js +++ b/src/core/resource/Users.resource.js @@ -2,43 +2,38 @@ const SMS_SENT = 'io/ok/sms_sent'; const LOGIN = 'io/ok2/login'; const LOGOUT = 'io/ok/logout'; -const sentSMS = (data) => { - return { - type: SMS_SENT, - ...data - } -}; +const sentSMS = data => ({ + type: SMS_SENT, + ...data +}); -const login = (data) => { - return { - type: LOGIN, - ...data - } -}; +const login = data => ({ + type: LOGIN, + ...data +}); const initialState = { - auth: { - token: '', - readyState: false, - status: 'uncomplete' - }, + auth: { + token: '', + readyState: false, + status: 'uncomplete' + } }; const user = (state = initialState, action) => { - switch(action.type) { - case SMS_SENT: - return { - ...state, - status: action.status, - ...action.payload - }; - case LOGIN: - return { - ...state, - readyState: !action.readyState - }; - default: - return state; - } + switch (action.type) { + case SMS_SENT: + return { + ...state, + status: action.status, + ...action.payload + }; + case LOGIN: + return { + ...state, + readyState: !action.readyState + }; + default: + return state; + } }; - diff --git a/src/core/resource/index.js b/src/core/resource/index.js index 494f08b5a..3c7e61f07 100644 --- a/src/core/resource/index.js +++ b/src/core/resource/index.js @@ -4,8 +4,8 @@ import { messages } from './Messages.resource'; const rootReducer = combineReducers({ - provider, - messages + provider, + messages }); export { rootReducer }; diff --git a/src/core/sagas/Connector.saga.js b/src/core/sagas/Connector.saga.js index f6ed40402..0e9ea7037 100644 --- a/src/core/sagas/Connector.saga.js +++ b/src/core/sagas/Connector.saga.js @@ -1,21 +1,22 @@ import { takeEvery, takeLatest, fork } from 'redux-saga/effects'; -import { effects } from 'redux-saga' +import { effects } from 'redux-saga'; import { providerEventChannel } from '../services'; import { CONNECTING } from '../resource/Init.resource'; + const { call, put, take } = effects; const mqttSaga = function* (action) { - const socketChannel = yield call(providerEventChannel, action); - while (true) { - const eventAction = yield take(socketChannel); - yield put(eventAction); - } + const socketChannel = yield call(providerEventChannel, action); + while (true) { + const eventAction = yield take(socketChannel); + yield put(eventAction); + } }; const connector = function* (params) { - yield take(CONNECTING, mqttSaga); - yield fork(mqttSaga); + yield take(CONNECTING, mqttSaga); + yield fork(mqttSaga); }; -export { connector }; \ No newline at end of file +export { connector }; diff --git a/src/core/sagas/Messages.saga.js b/src/core/sagas/Messages.saga.js index 3310dc3b7..7a0caed85 100644 --- a/src/core/sagas/Messages.saga.js +++ b/src/core/sagas/Messages.saga.js @@ -2,11 +2,11 @@ import { takeEvery, take } from 'redux-saga/effects'; import { MESSAGE_SEND } from '../resource/Messages.resource'; function* handleSend(action) { - console.log() + console.log(); } function* watchSendRequest(params) { - const { request } = yield take("*"); + const { request } = yield take('*'); } -export { watchSendRequest }; \ No newline at end of file +export { watchSendRequest }; diff --git a/src/core/sagas/Root.saga.js b/src/core/sagas/Root.saga.js index b56d60bed..914b3232a 100644 --- a/src/core/sagas/Root.saga.js +++ b/src/core/sagas/Root.saga.js @@ -3,10 +3,10 @@ import { connector } from './Connector.saga'; import { watchSendRequest } from './Messages.saga'; function* rootSaga() { - yield all([ - connector, - watchSendRequest - ]) + yield all([ + connector, + watchSendRequest + ]); } -export { rootSaga }; \ No newline at end of file +export { rootSaga }; diff --git a/src/core/sagas/index.js b/src/core/sagas/index.js index bce69eba2..76e99fcc1 100644 --- a/src/core/sagas/index.js +++ b/src/core/sagas/index.js @@ -1,3 +1,3 @@ import { rootSaga } from './Root.saga'; -export { rootSaga }; \ No newline at end of file +export { rootSaga }; diff --git a/src/core/services/MqttClient.service.js b/src/core/services/MqttClient.service.js index 15c6aba07..3d4b6bcea 100644 --- a/src/core/services/MqttClient.service.js +++ b/src/core/services/MqttClient.service.js @@ -6,40 +6,39 @@ import { MqttLocaforageStore } from '../store'; import { incomeDB, browserStorage } from '../store'; import mqttConfig from '../configs/MqttInit.config'; -let client; -const setPrefix = (id) => (mqttConfig.authPrefix + id); +const setPrefix = id => (mqttConfig.authPrefix + id); export const genClientId = () => ( - Math.random().toString(36).substring(2) + Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36) ); const initProvider = () => { - let connectPath = `${ mqttConfig.protocol }://${ mqttConfig.host }:${ mqttConfig.port }/${ mqttConfig.provider }`; - let config = { - clientId: setPrefix(genClientId()), - password: browserStorage.getItem('token'), - ...mqttConfig - }; - let client = mqtt.connect(connectPath, config); - - const xtendedClient = Object.assign(client, { - onClose: () => { - - }, - - send: (...args) => { - args[0] = topic(args[0]); - const message = args[1]; - if(message) { - args[1] = encode(message) - } - return client.publish(...args); - } - }); - - return xtendedClient; + const connectPath = `${mqttConfig.protocol}://${mqttConfig.host}:${mqttConfig.port}/${mqttConfig.provider}`; + const config = { + clientId: setPrefix(genClientId()), + password: browserStorage.getItem('token'), + ...mqttConfig + }; + const client = mqtt.connect(connectPath, config); + + const xtendedClient = Object.assign(client, { + onClose: () => { + + }, + + send: (...args) => { + args[0] = topic(args[0]); + const message = args[1]; + if (message) { + args[1] = encode(message); + } + return client.publish(...args); + } + }); + + return xtendedClient; }; -export default initProvider; \ No newline at end of file +export default initProvider; diff --git a/src/core/services/MqttEventChannel.service.js b/src/core/services/MqttEventChannel.service.js index 720d69236..1ed8db855 100644 --- a/src/core/services/MqttEventChannel.service.js +++ b/src/core/services/MqttEventChannel.service.js @@ -1,9 +1,9 @@ import mqtt from 'mqtt'; -import { buffers, eventChannel } from 'redux-saga' +import { buffers, eventChannel } from 'redux-saga'; import { put } from 'redux-saga/effects'; -import { bindActionCreators } from 'redux' +import { bindActionCreators } from 'redux'; import { topic } from '../protocols'; -//import { Store as MQTTLocalForageStore } from 'mqtt-localforage-store'; +// import { Store as MQTTLocalForageStore } from 'mqtt-localforage-store'; import { formatter } from '../messages/Converter.message'; import { validate } from '../protocols/Validator.protocol'; import initProvider from './MqttClient.service'; @@ -14,43 +14,41 @@ import { mockReceivePacket } from '../../../tools/ErlangDebugger.tools'; const bufferSize = 100; -const providerEventChannel = () => eventChannel( - emitter => { - const client = initProvider(); - const boundEventHandlers = bindActionCreators(eventHandlers, emitter); - client.on(eventTypes.CONNECT, function() { - boundEventHandlers.connected(); - //redux log - }); - client.on(eventTypes.CLOSE, function() { - //redux log - boundEventHandlers.close(); - }); - client.on(eventTypes.ERROR, function(e) { - console.log('Error', e); - boundEventHandlers.error(e) - }); - client.on(eventTypes.MESSAGE, function(topic, message, packet) { - boundEventHandlers.publish(topic, message, packet) - }); - client.on(eventTypes.PACKETRECEIVE, function (packet = {}) { - if(!packet.payload) { - return; - } - const processedResponse = formatter(mockReceivePacket); - let { event, response } = validate(processedResponse); +const providerEventChannel = () => eventChannel((emitter) => { + const client = initProvider(); + const boundEventHandlers = bindActionCreators(eventHandlers, emitter); + client.on(eventTypes.CONNECT, () => { + boundEventHandlers.connected(); + // redux log + }); + client.on(eventTypes.CLOSE, () => { + // redux log + boundEventHandlers.close(); + }); + client.on(eventTypes.ERROR, (e) => { + console.log('Error', e); + boundEventHandlers.error(e); + }); + client.on(eventTypes.MESSAGE, (topic, message, packet) => { + boundEventHandlers.publish(topic, message, packet); + }); + client.on(eventTypes.PACKETRECEIVE, (packet = {}) => { + if (!packet.payload) { + return; + } + const processedResponse = formatter(mockReceivePacket); + const { event, response } = validate(processedResponse); - console.log('PACKETRECEIVE', packet); - }); - client.on(eventTypes.PACKETSEND, function(packet) { - console.log('PACKETSEND', packet); - }); + console.log('PACKETRECEIVE', packet); + }); + client.on(eventTypes.PACKETSEND, (packet) => { + console.log('PACKETSEND', packet); + }); - //buffers.expanding(bufferSize); - return client.end - } -); + // buffers.expanding(bufferSize); + return client.end; +}); -export default providerEventChannel; \ No newline at end of file +export default providerEventChannel; diff --git a/src/core/services/index.js b/src/core/services/index.js index 4c6198970..d370b0f44 100644 --- a/src/core/services/index.js +++ b/src/core/services/index.js @@ -1,4 +1,4 @@ import initProvider, { genClientId } from './MqttClient.service'; import providerEventChannel from './MqttEventChannel.service'; -export { initProvider, providerEventChannel, genClientId }; \ No newline at end of file +export { initProvider, providerEventChannel, genClientId }; diff --git a/src/core/store/Browser.store.js b/src/core/store/Browser.store.js index 4132cc1d6..54013bf8d 100644 --- a/src/core/store/Browser.store.js +++ b/src/core/store/Browser.store.js @@ -1,24 +1,24 @@ import { browserStorage } from './index'; import { genClientId } from '../services'; -import { DEV_KEY, CLIENT} from '../configs/BrowserStorage.config'; +import { DEV_KEY, CLIENT } from '../configs/BrowserStorage.config'; const setupDevEntry = () => { - let devKey = browserStorage.getItem(DEV_KEY) || genClientId(); + const devKey = browserStorage.getItem(DEV_KEY) || genClientId(); - browserStorage.setItem(DEV_KEY, devKey); + browserStorage.setItem(DEV_KEY, devKey); - return devKey; + return devKey; }; -//emqttd_ -const setupClientEntry = (prefix = "reg_") => { - let devKey = setupDevEntry(); +// emqttd_ +const setupClientEntry = (prefix = 'reg_') => { + const devKey = setupDevEntry(); - let clientKey = browserStorage.getItem(CLIENT) || prefix + devKey; - browserStorage.setItem(CLIENT, clientKey); + const clientKey = browserStorage.getItem(CLIENT) || prefix + devKey; + browserStorage.setItem(CLIENT, clientKey); - return clientKey; + return clientKey; }; -export { setupClientEntry, setupDevEntry }; \ No newline at end of file +export { setupClientEntry, setupDevEntry }; diff --git a/src/core/store/Configure.dev.store.js b/src/core/store/Configure.dev.store.js index 8336f6704..8c17a2f97 100644 --- a/src/core/store/Configure.dev.store.js +++ b/src/core/store/Configure.dev.store.js @@ -1,6 +1,6 @@ import { applyMiddleware, createStore, compose } from 'redux'; import createSagaMiddleware from 'redux-saga'; -import { loadingBarMiddleware } from 'react-redux-loading-bar' +import { loadingBarMiddleware } from 'react-redux-loading-bar'; import reduxImmutableStateInvariant from 'redux-immutable-state-invariant'; import logger from 'redux-logger'; import trottle from 'lodash/throttle'; @@ -15,15 +15,12 @@ const configureStore = () => { const middlewares = [ reduxImmutableStateInvariant(), sagaMiddleware, - //loadingBarMiddleware({ scope: 'page' }), + // loadingBarMiddleware({ scope: 'page' }), logger ]; const composeExtenders = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; - const store = createStore(rootReducer, {}, composeExtenders( - applyMiddleware(...middlewares) - ) - ); + const store = createStore(rootReducer, {}, composeExtenders(applyMiddleware(...middlewares))); sagaMiddleware.run(rootSaga); diff --git a/src/core/store/ConfigureBrowser.store.js b/src/core/store/ConfigureBrowser.store.js index ce78caa20..cefb38c9b 100644 --- a/src/core/store/ConfigureBrowser.store.js +++ b/src/core/store/ConfigureBrowser.store.js @@ -1,11 +1,11 @@ import localforage from 'localforage'; const config = { - driver: localforage.INDEXEDDB, - version: 1 + driver: localforage.INDEXEDDB, + version: 1 }; -const incomeDB = localforage.createInstance({name: 'incomeDB',...config}); -const outcomeDB = localforage.createInstance({name: 'outcomeDB',...config}); +const incomeDB = localforage.createInstance({ name: 'incomeDB', ...config }); +const outcomeDB = localforage.createInstance({ name: 'outcomeDB', ...config }); -export { incomeDB, outcomeDB }; \ No newline at end of file +export { incomeDB, outcomeDB }; diff --git a/src/core/store/MqttLocaforage.store.js b/src/core/store/MqttLocaforage.store.js index 80474ee04..ea1dff9d0 100644 --- a/src/core/store/MqttLocaforage.store.js +++ b/src/core/store/MqttLocaforage.store.js @@ -1,77 +1,76 @@ import { Readable } from 'readable-stream'; class MqttLocaforageStore { - constructor(localForageDb, options) { - this.inflights = localForageDb; - this.options = options || {}; - this.options.clean = this.options.clean || true; - } - - put(packet, cb) { - this.inflights.setItem(`msgid_${packet.messageId}`, packet, cb); - return this; - } - - createStream() { - const stream = new Readable({ objectMode: true }); - const inflights = this.inflights; - let destroyed = false; - - stream._read = function() { - if (destroyed === true) { - this.push(null); - return; - } - - inflights.iterate((value, key) => { - this.push(value); - return; - }); - }; - - stream._destroy = function(err, cb) { - if (destroyed) return; - - destroyed = true; - - this.emit('close'); - cb(); + constructor(localForageDb, options) { + this.inflights = localForageDb; + this.options = options || {}; + this.options.clean = this.options.clean || true; + } + + put(packet, cb) { + this.inflights.setItem(`msgid_${packet.messageId}`, packet, cb); + return this; + } + + createStream() { + const stream = new Readable({ objectMode: true }); + const inflights = this.inflights; + let destroyed = false; + + stream._read = function () { + if (destroyed === true) { + this.push(null); + return; + } + + inflights.iterate((value, key) => { + this.push(value); + }); + }; + + stream._destroy = function (err, cb) { + if (destroyed) return; + + destroyed = true; + + this.emit('close'); + cb(); + }; + + return stream; + } + + get(packet, cb) { + this.inflights.getItem(`msgid_${packet.messageId}`, cb); + return this; + } + + del(packet, cb) { + this.inflights.getItem(`msgid_${packet.messageId}`, (err, result) => { + this.inflights.removeItem(`msgid_${packet.messageId}`, (err) => { + if (err) { + cb(err); + return; } - return stream; - } - - get(packet, cb) { - this.inflights.getItem(`msgid_${packet.messageId}`, cb); - return this; - } + cb(null, result); + }); + }); - del(packet, cb) { - this.inflights.getItem(`msgid_${packet.messageId}`, (err, result) => { - this.inflights.removeItem(`msgid_${packet.messageId}`, (err) => { - if (err) { - cb(err); - return; - } + return this; + } - cb(null, result); - }); - }); + close(cb) { + const callback = cb || (() => {}); - return this; + if (this.options.clean === false) { + callback(null); + return this; } - close(cb) { - const callback = cb || (() => {}); - - if (this.options.clean === false) { - callback(null); - return this; - } - - this.inflights.clear(callback); - return this; - } + this.inflights.clear(callback); + return this; + } } export default MqttLocaforageStore; diff --git a/src/core/store/index.js b/src/core/store/index.js index 99700df55..1ba3ec14f 100644 --- a/src/core/store/index.js +++ b/src/core/store/index.js @@ -4,15 +4,15 @@ import MqttLocaforageStore from './MqttLocaforage.store'; console.log(process.env.NODE_ENV); -const configureStore = process.env.NODE_ENV === "development" - ? require('./Configure.dev.store') - : ''; +const configureStore = process.env.NODE_ENV === 'development' + ? require('./Configure.dev.store') + : ''; const browserStorage = localStorage !== 'undefined' ? localStorage : outcomeDB; - export { - setupClientEntry, - browserStorage, - configureStore, - MqttLocaforageStore +export { + setupClientEntry, + browserStorage, + configureStore, + MqttLocaforageStore }; diff --git a/src/core/utils/utf8.util.js b/src/core/utils/utf8.util.js index a9f83a6bc..9633ae64c 100644 --- a/src/core/utils/utf8.util.js +++ b/src/core/utils/utf8.util.js @@ -1,5 +1,9 @@ -function utf8_toByteArray(str) { return { t: 107, v: (new TextEncoder("utf-8")).encode(str) }; }; -function utf8_dec(ab) { if (!(ab instanceof ArrayBuffer)) ab = new Uint8Array(utf8_toByteArray(ab).v).buffer; - return (new TextDecoder()).decode(ab); } +/* eslint-disable */ -export { utf8_dec, utf8_toByteArray } +function utf8_toByteArray(str) { return { t: 107, v: (new TextEncoder('utf-8')).encode(str) }; } +function utf8_dec(ab) { + if (!(ab instanceof ArrayBuffer)) ab = new Uint8Array(utf8_toByteArray(ab).v).buffer; + return (new TextDecoder()).decode(ab); +} + +export { utf8_dec, utf8_toByteArray }; diff --git a/src/index.js b/src/index.js index 0c537a1c0..42a08b200 100644 --- a/src/index.js +++ b/src/index.js @@ -1,20 +1,21 @@ -import "regenerator-runtime/runtime"; -import Raven from './core/loggers/SentryError.logger'; -import React from 'react'; -import { render } from 'react-dom'; -import Root from './root'; +import 'regenerator-runtime/runtime'; + -import { configureStore } from './core/store' +import React from 'react'; +import Root from './root'; import Reboot from 'material-ui/Reboot'; +import { configureStore } from './core/store'; +import { render } from 'react-dom'; + require('./favicon.ico'); render( -
    - - -
    , +
    + + +
    , - document.getElementById('app') + document.getElementById('app') ); diff --git a/src/modules/Chats/Chats.js b/src/modules/Chats/Chats.js index 7c0176e91..b505f0f26 100644 --- a/src/modules/Chats/Chats.js +++ b/src/modules/Chats/Chats.js @@ -1,13 +1,14 @@ import React, { PureComponent } from 'react'; import { ActivityList } from './../../containers'; -export default class Chats extends PureComponent { - render() { - return ( -
    - + +export default class Chats extends PureComponent { + render() { + return ( +
    + hdfghdfghd -
    - ); - } +
    + ); + } } diff --git a/src/modules/Dashboard/Dashboard.js b/src/modules/Dashboard/Dashboard.js index d12220628..4e6748782 100644 --- a/src/modules/Dashboard/Dashboard.js +++ b/src/modules/Dashboard/Dashboard.js @@ -1,55 +1,51 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { PaperWithDrop } from '../../componets'; -import {ChatListItem} from '../../componets'; -import { withStyles } from 'material-ui/styles' -import { List, Grid } from 'material-ui' ; -import {ChatModal} from "../../containers/ChatModal/ChatModal"; +import { ChatListItem } from '../../componets'; +import { withStyles } from 'material-ui/styles'; +import { List, Grid } from 'material-ui'; +import { ChatModal } from '../../containers/ChatModal/ChatModal'; const styles = { - item: { - marginRight: 8, - width: 'calc(33.33% - 16px)' - } -} + item: { + marginRight: 8, + width: 'calc(33.33% - 16px)' + } +}; export class Dashboard extends Component { - constructor(props) { - super(props); + constructor(props) { + super(props); - this.state ={ - openChat: false - } - } + this.state = { + openChat: false + }; + } static propTypes = { - classes: PropTypes.object.isRequired + classes: PropTypes.object.isRequired }; render() { - const mockUsers = [{name:'John Smith'},{name:'John Smith2'},{name:'John Smith3'},{name:'John Smith4'},{name:'John Smith5'}] - let sideList = []; - - mockUsers.map((item,index)=>( - sideList.push( - - {this.setState({openChat: !this.state.openChat})}}/> - - - )) - ); - - const { classes } = this.props; - const { openChat } = this.state; - return ( - - - - - this.setState({openChat: false})} /> - - - ); + const mockUsers = [{ name: 'John Smith' }, { name: 'John Smith2' }, { name: 'John Smith3' }, { name: 'John Smith4' }, { name: 'John Smith5' }]; + const sideList = []; + + mockUsers.map((item, index) => ( + sideList.push( + { this.setState({ openChat: !this.state.openChat }); }} /> + ))); + + const { classes } = this.props; + const { openChat } = this.state; + return ( + + + + + this.setState({ openChat: false })} /> + + + ); } } -export default withStyles(styles)(Dashboard); \ No newline at end of file +export default withStyles(styles)(Dashboard); diff --git a/src/modules/Home/Home.js b/src/modules/Home/Home.js index 5b5c98d10..3f35b5357 100644 --- a/src/modules/Home/Home.js +++ b/src/modules/Home/Home.js @@ -1,10 +1,10 @@ import React, { PureComponent } from 'react'; -export default class Home extends PureComponent { - render() { - return ( -
    HomePage
    - ); - } +export default class Home extends PureComponent { + render() { + return ( +
    HomePage
    + ); + } } diff --git a/src/modules/Login/Login.js b/src/modules/Login/Login.js index 526e5482e..47f414b2f 100644 --- a/src/modules/Login/Login.js +++ b/src/modules/Login/Login.js @@ -7,72 +7,71 @@ import TextField from 'material-ui/TextField'; import Button from 'material-ui/Button'; const styles = theme => ({ - root: { - flexGrow: 1, - marginTop: 30, - }, - paper: { - padding: 16, - textAlign: 'center', - color: blue[500] - // color: theme.palette.text.secondary, - }, - textField: { - marginLeft: theme.spacing.unit, - marginRight: theme.spacing.unit, - width: 200, - }, - button: { - margin: theme.spacing.unit, - }, + root: { + flexGrow: 1, + marginTop: 30 + }, + paper: { + padding: 16, + textAlign: 'center', + color: blue[500] + // color: theme.palette.text.secondary, + }, + textField: { + marginLeft: theme.spacing.unit, + marginRight: theme.spacing.unit, + width: 200 + }, + button: { + margin: theme.spacing.unit + } }); -export class Login extends PureComponent { +export class Login extends PureComponent { + constructor(props) { + super(props); + } - constructor(props) { - super(props); - } + render() { + const { classes } = this.props; - render() { - const { classes } = this.props; - - return ( -
    - - - + return ( +
    + + + Login Test Container - - - - - - - - - - - - -
    - ); - } + +
    + +
    + +
    + ); + } } -export default withStyles(styles)(Login); \ No newline at end of file +export default withStyles(styles)(Login); diff --git a/src/modules/SignUp/SignUp.js b/src/modules/SignUp/SignUp.js index 7a3e1e8d3..04a0e2c78 100644 --- a/src/modules/SignUp/SignUp.js +++ b/src/modules/SignUp/SignUp.js @@ -5,123 +5,124 @@ export default class SignUp extends Component { }; constructor(props) { - super(props); - this.state = { + super(props); + this.state = { - }; + }; } render() { - return (
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -

    Phone Number

    -
    -

    Please choose your country and enter your phone number.

    -
    -
    -
    - - - -
    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Security Code

    -
    -

    We've sent a security code to your phone.

    -

    You should receive it within 60 seconds.

    -

    - Haven't received the code? - Haven't received the code? -

    -
    -
    -
    - - -
    -
    - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Your Name

    -
    -

    How would you like to be called?

    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    + return (
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +

    Phone Number

    +
    +

    Please choose your country and enter your phone number.

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Security Code

    +
    +

    We've sent a security code to your phone.

    +

    You should receive it within 60 seconds.

    +

    + Haven't received the code? + Haven't received the code? +

    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Your Name

    +
    +

    How would you like to be called?

    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    By signing in, you acknowledge that you have read and accept our Terms of - Service. -
    -
    -
    -
    -
    -
    -
    -
    ) + Service. + +
    +
    +
    +
    +
    +
    +
    +
    ); } -} \ No newline at end of file +} diff --git a/src/modules/index.js b/src/modules/index.js index 8411bd6a5..71c5755c0 100644 --- a/src/modules/index.js +++ b/src/modules/index.js @@ -5,9 +5,9 @@ import Dashboard from './Dashboard/Dashboard'; import Chats from './Chats/Chats'; export { - Home, - Login, - SignUp, - Dashboard, - Chats -}; \ No newline at end of file + Home, + Login, + SignUp, + Dashboard, + Chats +}; diff --git a/src/pages/App/App.js b/src/pages/App/App.js index 7bd594e7c..15ab462a3 100644 --- a/src/pages/App/App.js +++ b/src/pages/App/App.js @@ -1,43 +1,41 @@ import React, { Component, PropTypes } from 'react'; import { MuiThemeProvider } from 'material-ui'; -import {createMuiTheme} from "material-ui/styles/index"; +import { createMuiTheme } from 'material-ui/styles/index'; export default class App extends Component { - constructor(props) { super(props); } static propTypes = { }; - componentWillMount(){ + componentWillMount() { } renderChildren(globalProps, childProps) { - return React.cloneElement(globalProps, childProps); + return React.cloneElement(globalProps, childProps); } render() { - const theme = createMuiTheme({ - palette: { - type:'dark', - primary: { - main: '#1b1c20' - }, - background:{ - paper: '#24262b' - } - }, - }); - console.log(theme); + const theme = createMuiTheme({ + palette: { + type: 'dark', + primary: { + main: '#1b1c20' + }, + background: { + paper: '#24262b' + } + } + }); + console.log(theme); return ( -
    - - { this.renderChildren(this.props.children, {}) } - -
    +
    + + { this.renderChildren(this.props.children, {}) } + +
    - ) + ); } } - diff --git a/src/pages/NinjaApp/NinjaApp.js b/src/pages/NinjaApp/NinjaApp.js index 7a3fafa25..1aee7c893 100644 --- a/src/pages/NinjaApp/NinjaApp.js +++ b/src/pages/NinjaApp/NinjaApp.js @@ -1,53 +1,52 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect, dispatch } from 'react-redux'; -import { MenuAppBar,ActionMenu } from '../../containers'; -import {Grid} from 'material-ui'; -import {withStyles} from 'material-ui/styles'; +import { MenuAppBar, ActionMenu } from '../../containers'; +import { Grid } from 'material-ui'; +import { withStyles } from 'material-ui/styles'; const styles = theme => ({ - wrapper: { - padding: '73px 0 0 107px', - minHeight: '100vh', - background: theme.palette.primary.main - }, + wrapper: { + padding: '73px 0 0 107px', + minHeight: '100vh', + background: theme.palette.primary.main + } -}) +}); export class Dashboard extends Component { - - constructor(props) { - super(props); - } + constructor(props) { + super(props); + } static propTypes = { - classes: PropTypes.object.isRequired + classes: PropTypes.object.isRequired }; - componentWillMount(){ + componentWillMount() { } renderChildren(globalProps, childProps) { - return React.cloneElement(globalProps, childProps); + return React.cloneElement(globalProps, childProps); } render() { - console.log(this.props) - const { classes } = this.props; + console.log(this.props); + const { classes } = this.props; - return ( -
    - - + return ( +
    + + - { this.renderChildren(this.props.children, {}) } + { this.renderChildren(this.props.children, {}) } -
    +
    - ) + ); } } -export default withStyles(styles)(Dashboard) +export default withStyles(styles)(Dashboard); diff --git a/src/pages/NotFound/NotFoundPage.js b/src/pages/NotFound/NotFoundPage.js index a805b3c8f..5ba368f02 100644 --- a/src/pages/NotFound/NotFoundPage.js +++ b/src/pages/NotFound/NotFoundPage.js @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react'; export default class NotFoundPage extends PureComponent { render() { return ( -
    404
    +
    404
    ); } } diff --git a/src/pages/Unauthorized/UnauthorizedPage.js b/src/pages/Unauthorized/UnauthorizedPage.js index 99feeb7ce..4daf6f912 100644 --- a/src/pages/Unauthorized/UnauthorizedPage.js +++ b/src/pages/Unauthorized/UnauthorizedPage.js @@ -11,15 +11,15 @@ export default class UnauthorizedPage extends Component { } renderChildren(globalProps, childProps) { - return React.cloneElement(globalProps, childProps); + return React.cloneElement(globalProps, childProps); } render() { console.log(this.props.children); return ( -
    - { this.renderChildren(this.props.children, {}) } -
    - ) +
    + { this.renderChildren(this.props.children, {}) } +
    + ); } } diff --git a/src/pages/index.js b/src/pages/index.js index f624d2e2c..621042484 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -4,8 +4,8 @@ import UnauthorizedPage from './Unauthorized/UnauthorizedPage'; import NinjaApp from './NinjaApp/NinjaApp'; export { - App, - NotFoundPage, - UnauthorizedPage, - NinjaApp -}; \ No newline at end of file + App, + NotFoundPage, + UnauthorizedPage, + NinjaApp +}; diff --git a/src/root.js b/src/root.js index 856620694..cacdb418b 100644 --- a/src/root.js +++ b/src/root.js @@ -1,26 +1,26 @@ import React, { Component } from 'react'; import Reboot from 'material-ui/Reboot'; import { Provider } from 'react-redux'; -//import LoadingBar from 'react-redux-loading-bar' +// import LoadingBar from 'react-redux-loading-bar' import { Router, browserHistory } from 'react-router'; import routes from './routes'; -import { connecting } from './core/resource/Init.resource' +import { connecting } from './core/resource/Init.resource'; class Root extends Component { - componentDidMount() { - let t = new Date(); - // this.props.store.dispatch(connecting(t)) - } - render() { - const { store } = this.props; - return ( - - - { routes(store) } - - - ) - } + componentDidMount() { + const t = new Date(); + // this.props.store.dispatch(connecting(t)) + } + render() { + const { store } = this.props; + return ( + + + { routes(store) } + + + ); + } } -export default Root; \ No newline at end of file +export default Root; diff --git a/src/routes.js b/src/routes.js index ed61dfc91..0c9a3b0d3 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1,26 +1,27 @@ import React from 'react'; import { IndexRoute, Route } from 'react-router'; import { App, NotFoundPage, UnauthorizedPage, NinjaApp } from './pages'; -import { Home, Login, SignUp,Dashboard, Chats } from './modules'; -export default () => { - /** +import { Home, Login, SignUp, Dashboard, Chats } from './modules'; + +export default () => +/** * Please keep routes in alphabetical order */ - return ( - - - - - - + ( + + + + + + + + + + - - - + - + + + ); - - - ); -}; \ No newline at end of file diff --git a/src/vendors.js b/src/vendors.js index 938e7f84a..5b12117b8 100644 --- a/src/vendors.js +++ b/src/vendors.js @@ -5,5 +5,5 @@ module.exports = [ 'react-redux', 'react-router', 'react-select', - 'redux', -]; \ No newline at end of file + 'redux' +]; diff --git a/tools/ErlangDebugger.tools.js b/tools/ErlangDebugger.tools.js index b83aa6b29..963918e8b 100644 --- a/tools/ErlangDebugger.tools.js +++ b/tools/ErlangDebugger.tools.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + function binPayload(mas) { var s = ">> rp(binary_to_term(<<"; for (var i =0; i