From 23deb1066cfb2f461b7cf9bb952670e2b60b1750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Mon, 19 Feb 2024 15:39:17 +0000 Subject: [PATCH] refactor: Migrate from CJS to ESM Implement #400 --- .eslintrc.yml | 32 ++ src/.jshintrc => .jshintrc | 0 src/.prettierignore => .prettierignore | 0 src/.prettierrc.yaml => .prettierrc.yaml | 0 src/.snyk => .snyk | 0 jest.config.js => jest.config.cjs | 0 package-lock.json | 367 ++++++++++++++++-- package.json | 13 +- src/.eslintrc.yml | 21 - src/__tests__/app_cert.test.js | 14 +- src/__tests__/app_export_cert.test.js | 9 +- src/__tests__/app_export_jwt.test.js | 9 +- src/__tests__/app_import_cert.test.js | 6 +- src/__tests__/app_import_jwt.test.js | 6 +- src/__tests__/app_jwt.test.js | 8 +- src/__tests__/bookmark_get_cert.test.js | 4 +- src/__tests__/bookmark_get_jwt.test.js | 4 +- src/__tests__/connection_test_cert.test.js | 4 +- src/__tests__/connection_test_jwt.test.js | 4 +- src/__tests__/script_get_cert.test.js | 4 +- src/__tests__/script_get_jwt.test.js | 4 +- src/__tests__/task_cert.test.js | 14 +- .../task_custom_property_set_cert.test.js | 6 +- .../task_custom_property_set_jwt.test.js | 6 +- src/__tests__/task_get_cert.test.js | 8 +- src/__tests__/task_get_jwt.test.js | 8 +- src/__tests__/task_import_cert.test.js | 8 +- src/__tests__/task_import_jwt.tes.js | 8 +- src/__tests__/task_jwt.test.js | 14 +- src/ctrl-q.js | 55 ++- src/globals.js | 100 +++-- src/lib/app/class_allapps.js | 35 +- src/lib/app/class_app.js | 4 +- src/lib/cmd/createdim.js | 11 +- src/lib/cmd/createuseractivitycp.js | 14 +- src/lib/cmd/deletedim.js | 11 +- src/lib/cmd/deletemeasure.js | 11 +- src/lib/cmd/deletevariable.js | 12 +- src/lib/cmd/exportapp.js | 16 +- src/lib/cmd/getbookmark.js | 70 +++- src/lib/cmd/getdim.js | 12 +- src/lib/cmd/getmeasure.js | 12 +- src/lib/cmd/getscript.js | 11 +- src/lib/cmd/gettask.js | 25 +- src/lib/cmd/getvariable.js | 14 +- src/lib/cmd/import-masteritem-excel.js | 14 +- src/lib/cmd/importapp.js | 16 +- src/lib/cmd/importtask.js | 26 +- src/lib/cmd/scramblefield.js | 11 +- src/lib/cmd/settaskcp.js | 11 +- src/lib/cmd/testconnection.js | 8 +- src/lib/cmd/useractivity.js | 23 +- src/lib/cmd/vistask.js | 20 +- src/lib/task/class_allcompositeevents.js | 15 +- src/lib/task/class_allschemaevents.js | 15 +- src/lib/task/class_alltasks.js | 34 +- src/lib/task/class_compositeevent.js | 6 +- src/lib/task/class_schemaevent.js | 7 +- src/lib/task/class_task.js | 12 +- src/lib/task/task_qrs.js | 23 +- src/lib/util/about.js | 13 +- src/lib/util/app.js | 27 +- src/lib/util/assert-options.js | 13 +- src/lib/util/cert.js | 9 +- src/lib/util/customproperties.js | 33 +- src/lib/util/enigma.js | 54 ++- src/lib/util/log.js | 6 +- src/lib/util/lookups.js | 32 +- src/lib/util/qrs.js | 9 +- src/lib/util/tag.js | 22 +- src/lib/util/task.js | 31 +- src/static/vis-network.min.js | 4 +- 72 files changed, 881 insertions(+), 607 deletions(-) create mode 100644 .eslintrc.yml rename src/.jshintrc => .jshintrc (100%) rename src/.prettierignore => .prettierignore (100%) rename src/.prettierrc.yaml => .prettierrc.yaml (100%) rename src/.snyk => .snyk (100%) rename jest.config.js => jest.config.cjs (100%) delete mode 100644 src/.eslintrc.yml diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..e5f9d88 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,32 @@ +env: + # es6: true + es2023: true + node: true + # commonjs: false +extends: + - airbnb-base + # - eslint:recommended + - prettier +parserOptions: + ecmaVersion: 2023 + sourceType: module + requireConfigFile: false + babelOptions: + plugins: + - '@babel/plugin-syntax-import-assertions' +parser: '@babel/eslint-parser' +rules: + prettier/prettier: error + import/no-unresolved: 2 + import/no-commonjs: 2 + import/extensions: [2, "ignorePackages"] +plugins: + - prettier + - import +globals: + beforeAll: readonly + afterAll: readonly + describe: readonly + expect: readonly + test: readonly + it: readonly diff --git a/src/.jshintrc b/.jshintrc similarity index 100% rename from src/.jshintrc rename to .jshintrc diff --git a/src/.prettierignore b/.prettierignore similarity index 100% rename from src/.prettierignore rename to .prettierignore diff --git a/src/.prettierrc.yaml b/.prettierrc.yaml similarity index 100% rename from src/.prettierrc.yaml rename to .prettierrc.yaml diff --git a/src/.snyk b/.snyk similarity index 100% rename from src/.snyk rename to .snyk diff --git a/jest.config.js b/jest.config.cjs similarity index 100% rename from jest.config.js rename to jest.config.cjs diff --git a/package-lock.json b/package-lock.json index 5c07ff1..45994bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,11 +15,6 @@ "csv-stringify": "^6.4.5", "enigma.js": "^2.12.0", "esbuild": "^0.20.1", - "eslint": "^8.56.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-prettier": "^5.1.3", "form-data": "^4.0.0", "fs-extra": "^11.2.0", "handlebars": "^4.7.8", @@ -38,7 +33,14 @@ "yesno": "^0.4.0" }, "devDependencies": { + "@babel/eslint-parser": "^7.23.10", + "@babel/plugin-syntax-import-assertions": "^7.23.3", "@jest/globals": "^29.7.0", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-prettier": "^5.1.3", "jest": "^29.7.0", "prettier": "^3.2.5", "snyk": "^1.1280.0" @@ -48,6 +50,7 @@ "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -200,6 +203,33 @@ "node": ">=6" } }, + "node_modules/@babel/eslint-parser": { + "version": "7.23.10", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.23.10.tgz", + "integrity": "sha512-3wSYDPZVnhseRnxRJH6ZVTNknBz76AEnyC+AYYhasjP3Yy23qz0ERR7Fcd2SHmYuSFJ2kY9gaaDd3vyqU09eSw==", + "dev": true, + "dependencies": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || >=14.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0", + "eslint": "^7.5.0 || ^8.0.0" + } + }, + "node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/@babel/generator": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", @@ -518,6 +548,21 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz", + "integrity": "sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", @@ -1090,6 +1135,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.3.0.tgz", "integrity": "sha512-v3oplH6FYCULtFuCeqyuTd9D2WKO937Dxdq+GmHOLL72TTRriLxz2VLlNfkZRsvj6PKnOPAtuT6dwrs/pA5DvA==", + "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" }, @@ -1104,6 +1150,7 @@ "version": "4.7.0", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.7.0.tgz", "integrity": "sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==", + "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -1112,6 +1159,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -1134,6 +1182,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1148,12 +1197,14 @@ "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/@eslint/js": { "version": "8.56.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -1162,6 +1213,7 @@ "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", @@ -1175,6 +1227,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, "engines": { "node": ">=12.22" }, @@ -1186,7 +1239,8 @@ "node_modules/@humanwhocodes/object-schema": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==" + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", @@ -1576,10 +1630,42 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "dependencies": { + "eslint-scope": "5.1.1" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1592,6 +1678,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "engines": { "node": ">= 8" } @@ -1600,6 +1687,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1612,6 +1700,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", + "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "fast-glob": "^3.3.0", @@ -1630,7 +1719,8 @@ "node_modules/@pkgr/utils/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/@sentry/core": { "version": "7.42.0", @@ -1787,7 +1877,8 @@ "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true }, "node_modules/@types/node": { "version": "20.6.5", @@ -1819,12 +1910,14 @@ "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true }, "node_modules/acorn": { "version": "8.11.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -1836,6 +1929,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -1932,12 +2026,14 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -1950,6 +2046,7 @@ "version": "3.1.7", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -1968,6 +2065,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -1986,6 +2084,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -2003,6 +2102,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -2020,6 +2120,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", @@ -2057,6 +2158,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -2184,12 +2286,14 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/big-integer": { "version": "1.6.52", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz", "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==", + "dev": true, "engines": { "node": ">=0.6" } @@ -2209,6 +2313,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dev": true, "dependencies": { "big-integer": "^1.6.44" }, @@ -2220,6 +2325,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2229,6 +2335,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -2287,6 +2394,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", + "dev": true, "dependencies": { "run-applescript": "^5.0.0" }, @@ -2301,6 +2409,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -2313,6 +2422,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { "node": ">=6" } @@ -2350,6 +2460,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2499,12 +2610,14 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "node_modules/confusing-browser-globals": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", - "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==" + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true }, "node_modules/convert-source-map": { "version": "2.0.0", @@ -2546,6 +2659,7 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2569,6 +2683,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -2584,7 +2699,8 @@ "node_modules/debug/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/dedent": { "version": "1.5.1", @@ -2603,7 +2719,8 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "node_modules/deepmerge": { "version": "4.3.1", @@ -2618,6 +2735,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", + "dev": true, "dependencies": { "bundle-name": "^3.0.0", "default-browser-id": "^3.0.0", @@ -2635,6 +2753,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", + "dev": true, "dependencies": { "bplist-parser": "^0.2.0", "untildify": "^4.0.0" @@ -2650,6 +2769,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", @@ -2672,6 +2792,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "dev": true, "engines": { "node": ">=14.18.0" } @@ -2680,6 +2801,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -2691,6 +2813,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, "engines": { "node": ">=12" }, @@ -2702,6 +2825,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "dev": true, "dependencies": { "path-key": "^4.0.0" }, @@ -2716,6 +2840,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, "dependencies": { "mimic-fn": "^4.0.0" }, @@ -2730,6 +2855,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, "engines": { "node": ">=12" }, @@ -2741,6 +2867,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, "engines": { "node": ">=12" }, @@ -2752,6 +2879,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, "engines": { "node": ">=12" }, @@ -2763,6 +2891,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dev": true, "dependencies": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" @@ -2810,6 +2939,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -2869,6 +2999,7 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", + "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "arraybuffer.prototype.slice": "^1.0.1", @@ -2921,6 +3052,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, "dependencies": { "get-intrinsic": "^1.1.3", "has": "^1.0.3", @@ -2934,6 +3066,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, "dependencies": { "hasown": "^2.0.0" } @@ -2942,6 +3075,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -3010,6 +3144,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { "node": ">=10" }, @@ -3021,6 +3156,7 @@ "version": "8.56.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -3075,6 +3211,7 @@ "version": "15.0.0", "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, "dependencies": { "confusing-browser-globals": "^1.0.10", "object.assign": "^4.1.2", @@ -3093,6 +3230,7 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -3104,6 +3242,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -3114,6 +3253,7 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -3122,6 +3262,7 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, "dependencies": { "debug": "^3.2.7" }, @@ -3138,6 +3279,7 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -3146,6 +3288,7 @@ "version": "2.29.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, "dependencies": { "array-includes": "^3.1.7", "array.prototype.findlastindex": "^1.2.3", @@ -3176,6 +3319,7 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -3184,6 +3328,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -3195,6 +3340,7 @@ "version": "5.1.3", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.8.6" @@ -3224,6 +3370,7 @@ "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -3239,6 +3386,7 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -3250,6 +3398,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3265,6 +3414,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -3279,12 +3429,14 @@ "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/eslint/node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -3299,6 +3451,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -3313,6 +3466,7 @@ "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -3342,6 +3496,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -3353,6 +3508,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -3364,6 +3520,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } @@ -3372,6 +3529,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3380,6 +3538,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -3436,12 +3595,14 @@ "node_modules/fast-diff": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==" + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -3457,6 +3618,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -3467,17 +3629,20 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -3500,6 +3665,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, "dependencies": { "flat-cache": "^3.0.4" }, @@ -3519,6 +3685,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3543,6 +3710,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" @@ -3554,7 +3722,8 @@ "node_modules/flatted": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true }, "node_modules/fn.name": { "version": "1.1.0", @@ -3584,6 +3753,7 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -3617,7 +3787,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", @@ -3637,6 +3808,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3645,6 +3817,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -3662,6 +3835,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3688,6 +3862,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -3711,6 +3886,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, "engines": { "node": ">=10" }, @@ -3722,6 +3898,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -3737,6 +3914,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3756,6 +3934,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -3799,6 +3978,7 @@ "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -3813,6 +3993,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, "dependencies": { "define-properties": "^1.1.3" }, @@ -3827,6 +4008,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -3842,7 +4024,8 @@ "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true }, "node_modules/handlebars": { "version": "4.7.8", @@ -3868,6 +4051,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -3879,6 +4063,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3887,6 +4072,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -3895,6 +4081,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, "dependencies": { "get-intrinsic": "^1.1.1" }, @@ -3906,6 +4093,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -3917,6 +4105,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -3928,6 +4117,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -3942,6 +4132,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -3972,6 +4163,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, "engines": { "node": ">=10.17.0" } @@ -3980,6 +4172,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "dev": true, "engines": { "node": ">= 4" } @@ -3988,6 +4181,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -4022,6 +4216,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, "engines": { "node": ">=0.8.19" } @@ -4030,6 +4225,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4044,6 +4240,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "dev": true, "dependencies": { "get-intrinsic": "^1.2.0", "has": "^1.0.3", @@ -4057,6 +4254,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -4075,6 +4273,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, "dependencies": { "has-bigints": "^1.0.1" }, @@ -4086,6 +4285,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4101,6 +4301,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -4112,6 +4313,7 @@ "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, "dependencies": { "hasown": "^2.0.0" }, @@ -4123,6 +4325,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4137,6 +4340,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, "bin": { "is-docker": "cli.js" }, @@ -4151,6 +4355,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -4176,6 +4381,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -4187,6 +4393,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, "dependencies": { "is-docker": "^3.0.0" }, @@ -4204,6 +4411,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -4215,6 +4423,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -4223,6 +4432,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4237,6 +4447,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -4245,6 +4456,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4260,6 +4472,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -4279,6 +4492,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4293,6 +4507,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -4307,6 +4522,7 @@ "version": "1.1.10", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -4325,6 +4541,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -4336,6 +4553,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -4347,6 +4565,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, "bin": { "is-docker": "cli.js" }, @@ -4360,12 +4579,14 @@ "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", @@ -5037,6 +5258,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -5070,7 +5292,8 @@ "node_modules/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=" + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", @@ -5082,6 +5305,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, "dependencies": { "minimist": "^1.2.0" }, @@ -5127,6 +5351,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -5156,7 +5381,8 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "node_modules/lodash.truncate": { "version": "4.4.2", @@ -5255,12 +5481,14 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "engines": { "node": ">= 8" } @@ -5269,6 +5497,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -5300,6 +5529,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, "engines": { "node": ">=6" } @@ -5308,6 +5538,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5339,7 +5570,8 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true }, "node_modules/neo-async": { "version": "2.6.2", @@ -5385,6 +5617,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, "dependencies": { "path-key": "^3.0.0" }, @@ -5404,6 +5637,7 @@ "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5412,6 +5646,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, "engines": { "node": ">= 0.4" } @@ -5420,6 +5655,7 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -5437,6 +5673,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -5450,6 +5687,7 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -5466,6 +5704,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -5477,6 +5716,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -5493,6 +5733,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "dependencies": { "wrappy": "1" } @@ -5509,6 +5750,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -5523,6 +5765,7 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", + "dev": true, "dependencies": { "default-browser": "^4.0.0", "define-lazy-prop": "^3.0.0", @@ -5540,6 +5783,7 @@ "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, "dependencies": { "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", @@ -5556,6 +5800,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -5606,6 +5851,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "dependencies": { "callsites": "^3.0.0" }, @@ -5635,6 +5881,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -5643,6 +5890,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5651,6 +5899,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "engines": { "node": ">=8" } @@ -5658,17 +5907,20 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -5701,6 +5953,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, "engines": { "node": ">= 0.8.0" } @@ -5709,6 +5962,7 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -5723,6 +5977,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, "dependencies": { "fast-diff": "^1.1.2" }, @@ -5811,6 +6066,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -5857,6 +6113,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -5890,6 +6147,7 @@ "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -5927,6 +6185,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, "engines": { "node": ">=4" } @@ -5955,6 +6214,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -5964,6 +6224,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -5995,6 +6256,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dev": true, "dependencies": { "execa": "^5.0.0" }, @@ -6009,6 +6271,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -6031,6 +6294,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -6067,6 +6331,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -6093,6 +6358,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -6134,6 +6400,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -6145,6 +6412,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, "engines": { "node": ">=8" } @@ -6153,6 +6421,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -6165,7 +6434,8 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/simple-swizzle": { "version": "0.2.2", @@ -6314,6 +6584,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -6330,6 +6601,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -6343,6 +6615,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -6367,6 +6640,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, "engines": { "node": ">=4" } @@ -6375,6 +6649,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, "engines": { "node": ">=6" } @@ -6383,6 +6658,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "engines": { "node": ">=8" }, @@ -6394,6 +6670,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -6405,6 +6682,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -6416,6 +6694,7 @@ "version": "0.8.6", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.6.tgz", "integrity": "sha512-laHF2savN6sMeHCjLRkheIU4wo3Zg9Ln5YOjOo7sZ5dVQW8yF5pPE5SIw1dsPhq3TRp1jisKRCdPhfs/1WMqDA==", + "dev": true, "dependencies": { "@pkgr/utils": "^2.4.2", "tslib": "^2.6.2" @@ -6430,7 +6709,8 @@ "node_modules/synckit/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/table": { "version": "6.8.1", @@ -6469,7 +6749,8 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true }, "node_modules/text-treeview": { "version": "1.0.2", @@ -6480,6 +6761,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", + "dev": true, "engines": { "node": ">=12" }, @@ -6506,6 +6788,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -6525,6 +6808,7 @@ "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -6542,6 +6826,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -6562,6 +6847,7 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, "engines": { "node": ">=10" }, @@ -6573,6 +6859,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1", @@ -6586,6 +6873,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", @@ -6603,6 +6891,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -6621,6 +6910,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", @@ -6646,6 +6936,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -6668,6 +6959,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, "engines": { "node": ">=8" } @@ -6769,6 +7061,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -6783,6 +7076,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -6798,6 +7092,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -6896,7 +7191,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "node_modules/write-file-atomic": { "version": "4.0.2", @@ -6994,6 +7290,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index a23bab1..1e207be 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "url": "https://github.com/ptarmiganlabs/ctrl-q/issues" }, "license": "MIT", + "type": "module", "dependencies": { "axios": "^1.6.7", "commander": "^12.0.0", @@ -35,11 +36,6 @@ "csv-stringify": "^6.4.5", "enigma.js": "^2.12.0", "esbuild": "^0.20.1", - "eslint": "^8.56.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-prettier": "^5.1.3", "form-data": "^4.0.0", "fs-extra": "^11.2.0", "handlebars": "^4.7.8", @@ -58,6 +54,13 @@ "yesno": "^0.4.0" }, "devDependencies": { + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", + "@babel/eslint-parser": "^7.23.10", + "@babel/plugin-syntax-import-assertions": "^7.23.3", + "eslint-plugin-import": "^2.29.1", "@jest/globals": "^29.7.0", "jest": "^29.7.0", "prettier": "^3.2.5", diff --git a/src/.eslintrc.yml b/src/.eslintrc.yml deleted file mode 100644 index 0f3f576..0000000 --- a/src/.eslintrc.yml +++ /dev/null @@ -1,21 +0,0 @@ -env: - es6: true - es2021: true - node: true -extends: - - airbnb-base - - prettier -parserOptions: - ecmaVersion: 12 - sourceType: module -rules: - prettier/prettier: error -plugins: - - prettier -globals: - beforeAll: readonly - afterAll: readonly - describe: readonly - expect: readonly - test: readonly - it: readonly diff --git a/src/__tests__/app_cert.test.js b/src/__tests__/app_cert.test.js index 11526f7..074ee37 100644 --- a/src/__tests__/app_cert.test.js +++ b/src/__tests__/app_cert.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getApps, getAppById } = require('../lib/util/app'); +import { getApps, getAppById } from '../lib/util/app.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', @@ -24,11 +24,11 @@ console.log(`Jest timeout: ${defaultTestTimeout}`); jest.setTimeout(defaultTestTimeout); // Mock logger -global.console = { - log: jest.fn(), - info: jest.fn(), - error: jest.fn(), -}; +// global.console = { +// log: jest.fn(), +// info: jest.fn(), +// error: jest.fn(), +// }; // Define existing and non-existing tasks const existingAppId1 = 'c840670c-7178-4a5e-8409-ba2da69127e2'; diff --git a/src/__tests__/app_export_cert.test.js b/src/__tests__/app_export_cert.test.js index 9bd2f0a..bc7b266 100644 --- a/src/__tests__/app_export_cert.test.js +++ b/src/__tests__/app_export_cert.test.js @@ -1,10 +1,9 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const fs = require('fs'); -const path = require('path'); - -const { exportAppToFile } = require('../lib/cmd/exportapp'); +import fs from 'fs'; +import path from 'path'; +import exportAppToFile from '../lib/cmd/exportapp.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/app_export_jwt.test.js b/src/__tests__/app_export_jwt.test.js index 035a663..3c1ffd3 100644 --- a/src/__tests__/app_export_jwt.test.js +++ b/src/__tests__/app_export_jwt.test.js @@ -1,10 +1,9 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const fs = require('fs'); -const path = require('path'); - -const { exportAppToFile } = require('../lib/cmd/exportapp'); +import fs from 'fs'; +import path from 'path'; +import exportAppToFile from '../lib/cmd/exportapp.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/app_import_cert.test.js b/src/__tests__/app_import_cert.test.js index f7ac652..7dd9f55 100644 --- a/src/__tests__/app_import_cert.test.js +++ b/src/__tests__/app_import_cert.test.js @@ -1,8 +1,8 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { importAppFromFile } = require('../lib/cmd/importapp'); -const { appExistById, deleteAppById } = require('../lib/util/app'); +import importAppFromFile from '../lib/cmd/importapp.js'; +import { appExistById, deleteAppById } from '../lib/util/app.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/app_import_jwt.test.js b/src/__tests__/app_import_jwt.test.js index 3ef8224..6e16dd5 100644 --- a/src/__tests__/app_import_jwt.test.js +++ b/src/__tests__/app_import_jwt.test.js @@ -1,8 +1,8 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { importAppFromFile } = require('../lib/cmd/importapp'); -const { appExistById, deleteAppById } = require('../lib/util/app'); +import importAppFromFile from '../lib/cmd/importapp.js'; +import { appExistById, deleteAppById } from '../lib/util/app.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/app_jwt.test.js b/src/__tests__/app_jwt.test.js index e16f549..03803c8 100644 --- a/src/__tests__/app_jwt.test.js +++ b/src/__tests__/app_jwt.test.js @@ -1,9 +1,9 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getApps, getAppById, appExistById, deleteAppById } = require('../lib/util/app'); -const { importAppFromFile } = require('../lib/cmd/importapp'); -const { sleep } = require('../globals'); +import { getApps, getAppById, appExistById, deleteAppById } from '../lib/util/app.js'; +import importAppFromFile from '../lib/cmd/importapp.js'; +import { sleep } from '../globals.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/bookmark_get_cert.test.js b/src/__tests__/bookmark_get_cert.test.js index 6ee1c38..7b41e3b 100644 --- a/src/__tests__/bookmark_get_cert.test.js +++ b/src/__tests__/bookmark_get_cert.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getBookmark } = require('../lib/cmd/getbookmark'); +import getBookmark from '../lib/cmd/getbookmark.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/bookmark_get_jwt.test.js b/src/__tests__/bookmark_get_jwt.test.js index 1fdb329..48b8244 100644 --- a/src/__tests__/bookmark_get_jwt.test.js +++ b/src/__tests__/bookmark_get_jwt.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getBookmark } = require('../lib/cmd/getbookmark'); +import getBookmark from '../lib/cmd/getbookmark.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/connection_test_cert.test.js b/src/__tests__/connection_test_cert.test.js index 2224c51..1546c83 100644 --- a/src/__tests__/connection_test_cert.test.js +++ b/src/__tests__/connection_test_cert.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { testConnection } = require('../lib/cmd/testconnection'); +import testConnection from '../lib/cmd/testconnection.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/connection_test_jwt.test.js b/src/__tests__/connection_test_jwt.test.js index e0963cc..d5a672d 100644 --- a/src/__tests__/connection_test_jwt.test.js +++ b/src/__tests__/connection_test_jwt.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { testConnection } = require('../lib/cmd/testconnection'); +import testConnection from '../lib/cmd/testconnection.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/script_get_cert.test.js b/src/__tests__/script_get_cert.test.js index 84e33a9..f608a37 100644 --- a/src/__tests__/script_get_cert.test.js +++ b/src/__tests__/script_get_cert.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getScript } = require('../lib/cmd/getscript'); +import getScript from '../lib/cmd/getscript.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/script_get_jwt.test.js b/src/__tests__/script_get_jwt.test.js index 307afab..3709957 100644 --- a/src/__tests__/script_get_jwt.test.js +++ b/src/__tests__/script_get_jwt.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getScript } = require('../lib/cmd/getscript'); +import getScript from '../lib/cmd/getscript.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/task_cert.test.js b/src/__tests__/task_cert.test.js index 7f27de4..858f44a 100644 --- a/src/__tests__/task_cert.test.js +++ b/src/__tests__/task_cert.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { taskExistById, getTaskByName, getTaskById } = require('../lib/util/task'); +import { taskExistById, getTaskByName, getTaskById } from '../lib/util/task.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', @@ -23,11 +23,11 @@ const defaultTestTimeout = process.env.CTRL_Q_TEST_TIMEOUT || 600000; // 10 minu jest.setTimeout(defaultTestTimeout); // Mock logger -global.console = { - log: jest.fn(), - info: jest.fn(), - error: jest.fn(), -}; +// global.console = { +// log: jest.fn(), +// info: jest.fn(), +// error: jest.fn(), +// }; // Define existing and non-existing tasks const existingTaskId = 'e9100e69-4e8e-414b-bf88-10a1110c43a9'; diff --git a/src/__tests__/task_custom_property_set_cert.test.js b/src/__tests__/task_custom_property_set_cert.test.js index 2f6e589..6b2892c 100644 --- a/src/__tests__/task_custom_property_set_cert.test.js +++ b/src/__tests__/task_custom_property_set_cert.test.js @@ -1,8 +1,8 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { setTaskCustomProperty } = require('../lib/cmd/settaskcp'); -const { getTaskById } = require('../lib/util/task'); +import setTaskCustomProperty from '../lib/cmd/settaskcp.js'; +import { getTaskById } from '../lib/util/task.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/task_custom_property_set_jwt.test.js b/src/__tests__/task_custom_property_set_jwt.test.js index c373f6d..c69bf98 100644 --- a/src/__tests__/task_custom_property_set_jwt.test.js +++ b/src/__tests__/task_custom_property_set_jwt.test.js @@ -1,8 +1,8 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { setTaskCustomProperty } = require('../lib/cmd/settaskcp'); -const { getTaskById } = require('../lib/util/task'); +import setTaskCustomProperty from '../lib/cmd/settaskcp.js'; +import { getTaskById } from '../lib/util/task.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/task_get_cert.test.js b/src/__tests__/task_get_cert.test.js index f642af0..0a9bf33 100644 --- a/src/__tests__/task_get_cert.test.js +++ b/src/__tests__/task_get_cert.test.js @@ -1,9 +1,9 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); -const fs = require('fs'); -const path = require('path'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getTask } = require('../lib/cmd/gettask'); +import fs from 'fs'; +import path from 'path'; +import getTask from '../lib/cmd/gettask.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/task_get_jwt.test.js b/src/__tests__/task_get_jwt.test.js index b09ac31..b6540a2 100644 --- a/src/__tests__/task_get_jwt.test.js +++ b/src/__tests__/task_get_jwt.test.js @@ -1,9 +1,9 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); -const fs = require('fs'); -const path = require('path'); +import { jest, test, expect, describe } from '@jest/globals'; -const { getTask } = require('../lib/cmd/gettask'); +import fs from 'fs'; +import path from 'path'; +import getTask from '../lib/cmd/gettask.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/task_import_cert.test.js b/src/__tests__/task_import_cert.test.js index 48b68e6..dfbfc49 100644 --- a/src/__tests__/task_import_cert.test.js +++ b/src/__tests__/task_import_cert.test.js @@ -1,10 +1,10 @@ /* eslint-disable no-await-in-loop */ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { importTaskFromFile } = require('../lib/cmd/importtask'); -const { getTaskById, deleteExternalProgramTaskById, deleteReloadTaskById } = require('../lib/util/task'); -const { mapTaskType } = require('../lib/util/lookups'); +import importTaskFromFile from '../lib/cmd/importtask.js'; +import { getTaskById, deleteExternalProgramTaskById, deleteReloadTaskById } from '../lib/util/task.js'; +import { mapTaskType } from '../lib/util/lookups.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/task_import_jwt.tes.js b/src/__tests__/task_import_jwt.tes.js index 44d6913..87d88dc 100644 --- a/src/__tests__/task_import_jwt.tes.js +++ b/src/__tests__/task_import_jwt.tes.js @@ -1,10 +1,10 @@ /* eslint-disable no-await-in-loop */ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { importTaskFromFile } = require('../lib/cmd/importtask'); -const { getTaskById, deleteExternalProgramTaskById, deleteReloadTaskById } = require('../lib/util/task'); -const { mapTaskType } = require('../lib/util/lookups'); +import importTaskFromFile from '../lib/cmd/importtask.js'; +import { getTaskById, deleteExternalProgramTaskById, deleteReloadTaskById } from '../lib/util/task.js'; +import { mapTaskType } from '../lib/util/lookups.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', diff --git a/src/__tests__/task_jwt.test.js b/src/__tests__/task_jwt.test.js index 7f27de4..858f44a 100644 --- a/src/__tests__/task_jwt.test.js +++ b/src/__tests__/task_jwt.test.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ -const { test, expect, describe } = require('@jest/globals'); +import { jest, test, expect, describe } from '@jest/globals'; -const { taskExistById, getTaskByName, getTaskById } = require('../lib/util/task'); +import { taskExistById, getTaskByName, getTaskById } from '../lib/util/task.js'; const options = { logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info', @@ -23,11 +23,11 @@ const defaultTestTimeout = process.env.CTRL_Q_TEST_TIMEOUT || 600000; // 10 minu jest.setTimeout(defaultTestTimeout); // Mock logger -global.console = { - log: jest.fn(), - info: jest.fn(), - error: jest.fn(), -}; +// global.console = { +// log: jest.fn(), +// info: jest.fn(), +// error: jest.fn(), +// }; // Define existing and non-existing tasks const existingTaskId = 'e9100e69-4e8e-414b-bf88-10a1110c43a9'; diff --git a/src/ctrl-q.js b/src/ctrl-q.js index 7ead5da..bd8f1dc 100644 --- a/src/ctrl-q.js +++ b/src/ctrl-q.js @@ -1,37 +1,30 @@ -const { Command, Option } = require('commander'); - -const { logger, appVersion, setLoggingLevel, setCliOptions } = require('./globals'); -const { logStartupInfo } = require('./lib/util/log'); +import { Command, Option } from 'commander'; +import { logger, appVersion, setLoggingLevel, setCliOptions } from './globals.js'; +import logStartupInfo from './lib/util/log.js'; // const { createUserActivityCustomProperty } = require('./lib/createuseractivitycp'); -const { getMasterDimension } = require('./lib/cmd/getdim'); -const { deleteMasterDimension } = require('./lib/cmd/deletedim'); - -const { getMasterMeasure } = require('./lib/cmd/getmeasure'); -const { deleteMasterMeasure } = require('./lib/cmd/deletemeasure'); - -const { getVariable } = require('./lib/cmd/getvariable'); -const { deleteVariable } = require('./lib/cmd/deletevariable'); - -const { getBookmark } = require('./lib/cmd/getbookmark'); - -const { importMasterItemFromFile } = require('./lib/cmd/import-masteritem-excel'); - -const { scrambleField } = require('./lib/cmd/scramblefield'); -const { getScript } = require('./lib/cmd/getscript'); - -const { getTask } = require('./lib/cmd/gettask'); -const { setTaskCustomProperty } = require('./lib/cmd/settaskcp'); -const { importTaskFromFile } = require('./lib/cmd/importtask'); -const { importAppFromFile } = require('./lib/cmd/importapp'); -const { exportAppToFile } = require('./lib/cmd/exportapp'); -const { testConnection } = require('./lib/cmd/testconnection'); -const { visTask } = require('./lib/cmd/vistask'); - -const { +import { getMasterDimension } from './lib/cmd/getdim.js'; + +import { deleteMasterDimension } from './lib/cmd/deletedim.js'; +import { getMasterMeasure } from './lib/cmd/getmeasure.js'; +import { deleteMasterMeasure } from './lib/cmd/deletemeasure.js'; +import { getVariable } from './lib/cmd/getvariable.js'; +import { deleteVariable } from './lib/cmd/deletevariable.js'; +import { getBookmark } from './lib/cmd/getbookmark.js'; +import { importMasterItemFromFile } from './lib/cmd/import-masteritem-excel.js'; +import { scrambleField } from './lib/cmd/scramblefield.js'; +import { getScript } from './lib/cmd/getscript.js'; +import { getTask } from './lib/cmd/gettask.js'; +import { setTaskCustomProperty } from './lib/cmd/settaskcp.js'; +import { importTaskFromFile } from './lib/cmd/importtask.js'; +import { importAppFromFile } from './lib/cmd/importapp.js'; +import { exportAppToFile } from './lib/cmd/exportapp.js'; +import { jest, testConnection } from './lib/cmd/testconnection.js'; +import { visTask } from './lib/cmd/vistask.js'; + +import { sharedParamAssertOptions, - // userActivityCustomPropertyAssertOptions, masterItemImportAssertOptions, masterItemMeasureDeleteAssertOptions, masterItemDimDeleteAssertOptions, @@ -45,7 +38,7 @@ const { taskImportAssertOptions, appImportAssertOptions, appExportAssertOptions, -} = require('./lib/util/assert-options'); +} from './lib/util/assert-options.js'; const program = new Command(); diff --git a/src/globals.js b/src/globals.js index b8402f2..0d1794c 100644 --- a/src/globals.js +++ b/src/globals.js @@ -1,11 +1,38 @@ -const winston = require('winston'); -const upath = require('upath'); -const { promises: Fs } = require('fs'); -const fs = require('fs'); -require('winston-daily-rotate-file'); +import winston from 'winston'; +import upath from 'upath'; +import { fileURLToPath } from 'url'; +import { readFileSync, promises as Fs } from 'fs'; +import 'winston-daily-rotate-file'; // Get app version from package.json file -const appVersion = require('../package.json').version; +// Get app version from package.json file +const filenamePackage = `./package.json`; +let a; +let b; +let c; +// Are we running as a packaged app? +if (process.pkg) { + // Get path to JS file + a = process.pkg.defaultEntrypoint; + + // Strip off the filename + b = upath.dirname(a); + + // Add path to package.json file + c = upath.join(b, filenamePackage); +} else { + // Get path to JS file + a = fileURLToPath(import.meta.url); + + // Strip off the filename + b = upath.dirname(a); + + // Add path to package.json file + c = upath.join(b, '..', filenamePackage); +} + +const { version } = JSON.parse(readFileSync(c)); +export const appVersion = version; // Set up logger with timestamps and colors, and optional logging to disk file const logTransports = []; @@ -27,7 +54,7 @@ logTransports.push( }) ); -const logger = winston.createLogger({ +export const logger = winston.createLogger({ transports: logTransports, format: winston.format.combine( winston.format.errors({ stack: true }), @@ -37,17 +64,17 @@ const logger = winston.createLogger({ }); // Are we running as standalone app or not? -const isPkg = typeof process.pkg !== 'undefined'; -const execPath = isPkg ? upath.dirname(process.execPath) : process.cwd(); +export const isPkg = typeof process.pkg !== 'undefined'; +export const execPath = isPkg ? upath.dirname(process.execPath) : process.cwd(); // Functions to get/set current console logging level -const getLoggingLevel = () => logTransports.find((transport) => transport.name === 'console').level; +export const getLoggingLevel = () => logTransports.find((transport) => transport.name === 'console').level; -const setLoggingLevel = (newLevel) => { +export const setLoggingLevel = (newLevel) => { logTransports.find((transport) => transport.name === 'console').level = newLevel; }; -const verifyFileExists = async (file) => { +export const verifyFileExists = async (file) => { let exists = false; try { await Fs.stat(file); @@ -59,7 +86,7 @@ const verifyFileExists = async (file) => { return exists; }; -const mergeDirFilePath = (pathElements) => { +export const mergeDirFilePath = (pathElements) => { let fullPath = ''; if (isPkg) { fullPath = upath.resolve(upath.dirname(process.execPath), ...pathElements); @@ -70,7 +97,7 @@ const mergeDirFilePath = (pathElements) => { return fullPath; }; -const generateXrfKey = () => { +export const generateXrfKey = () => { let xrfString = ''; // eslint-disable-next-line no-plusplus for (let i = 0; i < 16; i++) { @@ -94,10 +121,10 @@ const generateXrfKey = () => { * @param {*} filename * @returns */ -const readCert = (filename) => fs.readFileSync(filename); +export const readCert = (filename) => readFileSync(filename); // https://stackoverflow.com/questions/175739/how-can-i-check-if-a-string-is-a-valid-number -function isNumeric(str) { +export function isNumeric(str) { if (typeof str !== 'string') return false; // we only process strings! return ( !Number.isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)... @@ -105,35 +132,34 @@ function isNumeric(str) { ); // ...and ensure strings of whitespace fail } -function sleep(ms) { +export function sleep(ms) { // eslint-disable-next-line no-promise-executor-return return new Promise((resolve) => setTimeout(resolve, ms)); } // Function to set CLI options. Clear any existing options first. -const setCliOptions = (options) => { +export const setCliOptions = (options) => { cliOptions = {}; Object.assign(cliOptions, options); }; // Function to get CLI options -const getCliOptions = () => cliOptions; - -module.exports = { - logger, - appVersion, - getLoggingLevel, - setLoggingLevel, - execPath, - isPkg, - verifyFileExists, - generateXrfKey, - readCert, - isNumeric, - mergeDirFilePath, - sleep, - getCliOptions, - setCliOptions, -}; - +export const getCliOptions = () => cliOptions; + +// export default { +// logger, +// appVersion, +// getLoggingLevel, +// setLoggingLevel, +// execPath, +// isPkg, +// verifyFileExists, +// generateXrfKey, +// readCert, +// isNumeric, +// mergeDirFilePath, +// sleep, +// getCliOptions, +// setCliOptions, +// }; diff --git a/src/lib/app/class_allapps.js b/src/lib/app/class_allapps.js index 0f611ed..476fd2a 100644 --- a/src/lib/app/class_allapps.js +++ b/src/lib/app/class_allapps.js @@ -1,19 +1,18 @@ -const rax = require('retry-axios'); -const axios = require('axios'); -const path = require('path'); -const FormData = require('form-data'); -const fs = require('fs/promises'); -const fs2 = require('fs'); -const { v4: uuidv4, validate } = require('uuid'); -const yesno = require('yesno'); - -const { logger, execPath, mergeDirFilePath, verifyFileExists, sleep } = require('../../globals'); -const { setupQRSConnection } = require('../util/qrs'); -const { getAppColumnPosFromHeaderRow } = require('../util/lookups'); -const { QlikSenseApp } = require('./class_app'); -const { getTagIdByName } = require('../util/tag'); -const { getAppById, deleteAppById } = require('../util/app'); -const { getCustomPropertyDefinitionByName, doesCustomPropertyValueExist } = require('../util/customproperties'); +import rax from 'retry-axios'; +import axios from 'axios'; +import path from 'path'; +import FormData from 'form-data'; +import fs from 'fs/promises'; +import fs2 from 'fs'; +import { v4 as uuidv4, validate } from 'uuid'; +import yesno from 'yesno'; +import { logger, execPath, mergeDirFilePath, verifyFileExists, sleep } from '../../globals.js'; +import setupQRSConnection from '../util/qrs.js'; +import { getAppColumnPosFromHeaderRow } from '../util/lookups.js'; +import QlikSenseApp from './class_app.js'; +import { getTagIdByName } from '../util/tag.js'; +import { getAppById, deleteAppById } from '../util/app.js'; +import { getCustomPropertyDefinitionByName, doesCustomPropertyValueExist } from '../util/customproperties.js'; class QlikSenseApps { // eslint-disable-next-line no-useless-constructor @@ -1486,6 +1485,4 @@ class QlikSenseApps { } } -module.exports = { - QlikSenseApps, -}; +export default QlikSenseApps; diff --git a/src/lib/app/class_app.js b/src/lib/app/class_app.js index aa0f9d9..c95a58f 100644 --- a/src/lib/app/class_app.js +++ b/src/lib/app/class_app.js @@ -35,6 +35,4 @@ class QlikSenseApp { } } -module.exports = { - QlikSenseApp, -}; +export default QlikSenseApp; diff --git a/src/lib/cmd/createdim.js b/src/lib/cmd/createdim.js index d899103..a2c2bc2 100644 --- a/src/lib/cmd/createdim.js +++ b/src/lib/cmd/createdim.js @@ -1,7 +1,6 @@ -const enigma = require('enigma.js'); - -const { setupEnigmaConnection } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import enigma from 'enigma.js'; +import setupEnigmaConnection from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; /** * @@ -256,6 +255,4 @@ const createMasterDimension = async (options) => { } }; -module.exports = { - createMasterDimension, -}; +export default createMasterDimension; diff --git a/src/lib/cmd/createuseractivitycp.js b/src/lib/cmd/createuseractivitycp.js index 953677e..1fa5665 100644 --- a/src/lib/cmd/createuseractivitycp.js +++ b/src/lib/cmd/createuseractivitycp.js @@ -1,15 +1,15 @@ -const qrsInteract = require('qrs-interact'); -const path = require('path'); +import qrsInteract from 'qrs-interact'; +import path from 'path'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); -const { +import { getUserActivityProfessional, getUserActivityAnalyzer, getUserActivityAnalyzerTime, getUserActivityLogin, getUserActivityUser, getUsersLastActivity, -} = require('./useractivity'); +} from './useractivity.js'; const _MS_PER_DAY = 1000 * 60 * 60 * 24; @@ -212,6 +212,4 @@ const createUserActivityCustomProperty = async (options) => { } }; -module.exports = { - createUserActivityCustomProperty, -}; +export default createUserActivityCustomProperty; diff --git a/src/lib/cmd/deletedim.js b/src/lib/cmd/deletedim.js index d71c68f..1675e7d 100644 --- a/src/lib/cmd/deletedim.js +++ b/src/lib/cmd/deletedim.js @@ -1,7 +1,6 @@ -const enigma = require('enigma.js'); - -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import enigma from 'enigma.js'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; // Variable to keep track of how many dimensions have been deleted let deleteCount = 0; @@ -156,6 +155,4 @@ const deleteMasterDimension = async (options) => { } }; -module.exports = { - deleteMasterDimension, -}; +export default deleteMasterDimension; diff --git a/src/lib/cmd/deletemeasure.js b/src/lib/cmd/deletemeasure.js index f0507c9..aa64dee 100644 --- a/src/lib/cmd/deletemeasure.js +++ b/src/lib/cmd/deletemeasure.js @@ -1,7 +1,6 @@ -const enigma = require('enigma.js'); - -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import enigma from 'enigma.js'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; // Variable to keep track of how many measures have been deleted let deleteCount = 0; @@ -150,6 +149,4 @@ const deleteMasterMeasure = async (options) => { } }; -module.exports = { - deleteMasterMeasure, -}; +export default deleteMasterMeasure; diff --git a/src/lib/cmd/deletevariable.js b/src/lib/cmd/deletevariable.js index 626801d..9f07971 100644 --- a/src/lib/cmd/deletevariable.js +++ b/src/lib/cmd/deletevariable.js @@ -1,10 +1,10 @@ /* eslint-disable no-restricted-syntax */ /* eslint-disable no-await-in-loop */ -const enigma = require('enigma.js'); +import enigma from 'enigma.js'; -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { getApps } = require('../util/app'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { getApps } from '../util/app.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; /** * @@ -163,6 +163,4 @@ const deleteVariable = async (options) => { } }; -module.exports = { - deleteVariable, -}; +export default deleteVariable; diff --git a/src/lib/cmd/exportapp.js b/src/lib/cmd/exportapp.js index c21954c..7f84e30 100644 --- a/src/lib/cmd/exportapp.js +++ b/src/lib/cmd/exportapp.js @@ -1,10 +1,10 @@ -const xlsx = require('node-xlsx').default; -const fs = require('fs'); -const path = require('path'); -const yesno = require('yesno'); +import xlsx from 'node-xlsx'; +import fs from 'fs'; +import path from 'path'; +import yesno from 'yesno'; -const { logger, setLoggingLevel, isPkg, execPath, mergeDirFilePath, verifyFileExists, isNumeric, sleep } = require('../../globals'); -const { QlikSenseApps } = require('../app/class_allapps'); +import { logger, setLoggingLevel, isPkg, execPath, mergeDirFilePath, verifyFileExists, isNumeric, sleep } from '../../globals.js'; +import QlikSenseApps from '../app/class_allapps.js'; const exportAppToFile = async (options) => { try { @@ -155,6 +155,4 @@ const exportAppToFile = async (options) => { } }; -module.exports = { - exportAppToFile, -}; +export default exportAppToFile; diff --git a/src/lib/cmd/getbookmark.js b/src/lib/cmd/getbookmark.js index a6a968f..0be2716 100644 --- a/src/lib/cmd/getbookmark.js +++ b/src/lib/cmd/getbookmark.js @@ -1,8 +1,7 @@ -const enigma = require('enigma.js'); -const { table } = require('table'); - -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import enigma from 'enigma.js'; +import { table } from 'table'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; const consoleTableConfig = { border: { @@ -60,7 +59,20 @@ const getBookmark = async (options) => { session = await enigma.create(configEnigma); logger.verbose(`Created session to server ${options.host}.`); } catch (err) { - logger.error(`Error creating session to server ${options.host}: ${err}`); + // Show more brief info if running as a stand-alone binary. + if (isPkg) { + if (err.message) { + logger.error(`Error creating session to server ${options.host}: ${err.message}`); + } else { + logger.error(`Error creating session to server ${options.host}: ${err}`); + } + } else if (err.stack) { + logger.error(`Error creating session to server ${options.host}: ${err.stack}`); + } else if (err.message) { + logger.error(`Error creating session to server ${options.host}: ${err.message}`); + } else { + logger.error(`Error creating session to server ${options.host}: ${err}`); + } process.exit(1); } @@ -71,7 +83,19 @@ const getBookmark = async (options) => { try { global = await session.open(); } catch (err) { - logger.error(`Error opening session to server ${options.host}: ${err}`); + if (isPkg) { + if (err.message) { + logger.error(`Error opening session to server ${options.host}: ${err.message}`); + } else { + logger.error(`Error opening session to server ${options.host}: ${err}`); + } + } else if (err.stack) { + logger.error(`Error opening session to server ${options.host}: ${err.stack}`); + } else if (err.message) { + logger.error(`Error opening session to server ${options.host}: ${err.message}`); + } else { + logger.error(`Error opening session to server ${options.host}: ${err}`); + } process.exit(1); } @@ -80,7 +104,19 @@ const getBookmark = async (options) => { engineVersion = await global.engineVersion(); logger.verbose(`Server ${options.host} has engine version ${engineVersion.qComponentVersion}.`); } catch (err) { - logger.error(`Error getting engine version from server ${options.host}: ${err}`); + if (isPkg) { + if (err.message) { + logger.error(`Error getting engine version from server ${options.host}: ${err.message}`); + } else { + logger.error(`Error getting engine version from server ${options.host}: ${err}`); + } + } else if (err.stack) { + logger.error(`Error getting engine version from server ${options.host}: ${err.stack}`); + } else if (err.message) { + logger.error(`Error getting engine version from server ${options.host}: ${err.message}`); + } else { + logger.error(`Error getting engine version from server ${options.host}: ${err}`); + } process.exit(1); } @@ -204,7 +240,19 @@ const getBookmark = async (options) => { logger.error(`Error destroying session object for bookmarks`); return false; } catch (err) { - logger.error(err.stack); + if (isPkg) { + if (err.message) { + logger.error(`Error getting bookmarks in app ${options.appId} on host ${options.host}: ${err.message}`); + } else { + logger.error(`Error getting bookmarks in app ${options.appId} on host ${options.host}: ${err}`); + } + } else if (err.stack) { + logger.error(`Error getting bookmarks in app ${options.appId} on host ${options.host}: ${err.stack}`); + } else if (err.message) { + logger.error(`Error getting bookmarks in app ${options.appId} on host ${options.host}: ${err.message}`); + } else { + logger.error(`Error getting bookmarks in app ${options.appId} on host ${options.host}: ${err}`); + } // Is there an active session? Close it if so. if (session !== undefined) { @@ -219,6 +267,4 @@ const getBookmark = async (options) => { } }; -module.exports = { - getBookmark, -}; +export default getBookmark; diff --git a/src/lib/cmd/getdim.js b/src/lib/cmd/getdim.js index c55b2dd..89c72c8 100644 --- a/src/lib/cmd/getdim.js +++ b/src/lib/cmd/getdim.js @@ -1,10 +1,10 @@ /* eslint-disable no-restricted-syntax */ /* eslint-disable no-await-in-loop */ -const enigma = require('enigma.js'); -const { table } = require('table'); +import enigma from 'enigma.js'; -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import { table } from 'table'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; const consoleTableConfig = { border: { @@ -271,6 +271,4 @@ const getMasterDimension = async (options) => { } }; -module.exports = { - getMasterDimension, -}; +export default getMasterDimension; diff --git a/src/lib/cmd/getmeasure.js b/src/lib/cmd/getmeasure.js index 14a75dc..ec54e88 100644 --- a/src/lib/cmd/getmeasure.js +++ b/src/lib/cmd/getmeasure.js @@ -1,9 +1,9 @@ /* eslint-disable no-restricted-syntax */ -const enigma = require('enigma.js'); -const { table } = require('table'); +import enigma from 'enigma.js'; -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import { table } from 'table'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; const consoleTableConfig = { border: { @@ -244,6 +244,4 @@ const getMasterMeasure = async (options) => { } }; -module.exports = { - getMasterMeasure, -}; +export default getMasterMeasure; diff --git a/src/lib/cmd/getscript.js b/src/lib/cmd/getscript.js index 07f4ac5..1d5fec5 100644 --- a/src/lib/cmd/getscript.js +++ b/src/lib/cmd/getscript.js @@ -1,7 +1,6 @@ -const enigma = require('enigma.js'); - -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import enigma from 'enigma.js'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; /** * @@ -87,6 +86,4 @@ const getScript = async (options) => { } }; -module.exports = { - getScript, -}; +export default getScript; diff --git a/src/lib/cmd/gettask.js b/src/lib/cmd/gettask.js index 34fa64a..038470a 100644 --- a/src/lib/cmd/gettask.js +++ b/src/lib/cmd/gettask.js @@ -1,14 +1,13 @@ -const tree = require('text-treeview'); -const { table } = require('table'); -const { promises: Fs } = require('fs'); -const xlsx = require('node-xlsx').default; -const { stringify } = require('csv-stringify'); -const yesno = require('yesno'); - -const { logger, setLoggingLevel, isPkg, execPath, verifyFileExists } = require('../../globals'); -const { QlikSenseTasks } = require('../task/class_alltasks'); -const { mapEventType, mapIncrementOption, mapDaylightSavingTime, mapRuleState } = require('../util/lookups'); -const { getTagsFromQseow } = require('../util/tag'); +import tree from 'text-treeview'; +import { table } from 'table'; +import { promises as Fs } from 'fs'; +import xlsx from 'node-xlsx'; +import { stringify } from 'csv-stringify'; +import yesno from 'yesno'; +import { logger, setLoggingLevel, isPkg, execPath, verifyFileExists } from '../../globals.js'; +import QlikSenseTasks from '../task/class_alltasks.js'; +import { mapEventType, mapIncrementOption, mapDaylightSavingTime, mapRuleState } from '../util/lookups.js'; +import { getTagsFromQseow } from '../util/tag.js'; const consoleTableConfig = { border: { @@ -775,6 +774,4 @@ const getTask = async (options) => { } }; -module.exports = { - getTask, -}; +export default getTask; diff --git a/src/lib/cmd/getvariable.js b/src/lib/cmd/getvariable.js index 7a8853f..6a61421 100644 --- a/src/lib/cmd/getvariable.js +++ b/src/lib/cmd/getvariable.js @@ -1,11 +1,11 @@ /* eslint-disable no-restricted-syntax */ /* eslint-disable no-await-in-loop */ -const enigma = require('enigma.js'); -const { table } = require('table'); +import enigma from 'enigma.js'; -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { getApps } = require('../util/app'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import { table } from 'table'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { getApps } from '../util/app.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; const consoleTableConfig = { border: { @@ -251,6 +251,4 @@ const getVariable = async (options) => { } }; -module.exports = { - getVariable, -}; +export default getVariable; diff --git a/src/lib/cmd/import-masteritem-excel.js b/src/lib/cmd/import-masteritem-excel.js index c2c950f..bb2d15f 100644 --- a/src/lib/cmd/import-masteritem-excel.js +++ b/src/lib/cmd/import-masteritem-excel.js @@ -1,11 +1,11 @@ /* eslint-disable no-console */ /* eslint-disable no-await-in-loop */ -const enigma = require('enigma.js'); -const xlsx = require('node-xlsx').default; -const uuidCreate = require('uuid').v4; +import enigma from 'enigma.js'; -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath, verifyFileExists, sleep } = require('../../globals'); +import xlsx from 'node-xlsx'; +import { v4 as uuidCreate } from 'uuid'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath, verifyFileExists, sleep } from '../../globals.js'; let importCount = 0; @@ -1149,6 +1149,4 @@ const importMasterItemFromFile = async (options) => { } }; -module.exports = { - importMasterItemFromFile, -}; +export default importMasterItemFromFile; diff --git a/src/lib/cmd/importapp.js b/src/lib/cmd/importapp.js index adb7348..3aca61d 100644 --- a/src/lib/cmd/importapp.js +++ b/src/lib/cmd/importapp.js @@ -1,12 +1,12 @@ // import { csvParse } from 'csv-parse'; -const xlsx = require('node-xlsx').default; +import xlsx from 'node-xlsx'; -const { logger, setLoggingLevel, isPkg, execPath, verifyFileExists, isNumeric } = require('../../globals'); -const { QlikSenseApps } = require('../app/class_allapps'); -const { getAppColumnPosFromHeaderRow } = require('../util/lookups'); -const { getTagsFromQseow } = require('../util/tag'); -const { getCustomPropertiesFromQseow } = require('../util/customproperties'); +import { logger, setLoggingLevel, isPkg, execPath, verifyFileExists, isNumeric } from '../../globals.js'; +import QlikSenseApps from '../app/class_allapps.js'; +import { getAppColumnPosFromHeaderRow } from '../util/lookups.js'; +import { getTagsFromQseow } from '../util/tag.js'; +import { getCustomPropertiesFromQseow } from '../util/customproperties.js'; const importAppFromFile = async (options) => { try { @@ -87,6 +87,4 @@ const importAppFromFile = async (options) => { } }; -module.exports = { - importAppFromFile, -}; +export default importAppFromFile; diff --git a/src/lib/cmd/importtask.js b/src/lib/cmd/importtask.js index 489189f..aadee57 100644 --- a/src/lib/cmd/importtask.js +++ b/src/lib/cmd/importtask.js @@ -1,17 +1,19 @@ -const xlsx = require('node-xlsx').default; -const { parse } = require('csv-parse'); +import xlsx from 'node-xlsx'; +import { parse } from 'csv-parse'; + // const { parse } = require('csv-parse/lib/sync'); -const fs = require('fs'); +import fs from 'fs'; + // const fsp = require('fs').promises; -const { finished } = require('stream/promises'); +import { finished } from 'stream/promises'; -const { logger, setLoggingLevel, isPkg, execPath, verifyFileExists, isNumeric } = require('../../globals'); -const { QlikSenseTasks } = require('../task/class_alltasks'); -const { QlikSenseApps } = require('../app/class_allapps'); -const { getTaskColumnPosFromHeaderRow } = require('../util/lookups'); -const { getTagsFromQseow } = require('../util/tag'); -const { getCustomPropertiesFromQseow } = require('../util/customproperties'); +import { logger, setLoggingLevel, isPkg, execPath, verifyFileExists, isNumeric } from '../../globals.js'; +import QlikSenseTasks from '../task/class_alltasks.js'; +import QlikSenseApps from '../app/class_allapps.js'; +import { getTaskColumnPosFromHeaderRow } from '../util/lookups.js'; +import { getTagsFromQseow } from '../util/tag.js'; +import { getCustomPropertiesFromQseow } from '../util/customproperties.js'; const getHeaders = async (options) => { const records = []; @@ -423,6 +425,4 @@ const importTaskFromFile = async (options) => { } }; -module.exports = { - importTaskFromFile, -}; +export default importTaskFromFile; diff --git a/src/lib/cmd/scramblefield.js b/src/lib/cmd/scramblefield.js index df0991d..19e3eb5 100644 --- a/src/lib/cmd/scramblefield.js +++ b/src/lib/cmd/scramblefield.js @@ -1,7 +1,6 @@ -const enigma = require('enigma.js'); - -const { setupEnigmaConnection, addTrafficLogging } = require('../util/enigma'); -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); +import enigma from 'enigma.js'; +import { setupEnigmaConnection, addTrafficLogging } from '../util/enigma.js'; +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; /** * @@ -91,6 +90,4 @@ const scrambleField = async (options) => { } }; -module.exports = { - scrambleField, -}; +export default scrambleField; diff --git a/src/lib/cmd/settaskcp.js b/src/lib/cmd/settaskcp.js index 2f69705..ab04cce 100644 --- a/src/lib/cmd/settaskcp.js +++ b/src/lib/cmd/settaskcp.js @@ -1,7 +1,6 @@ -const yesno = require('yesno'); - -const { logger } = require('../../globals'); -const { getCustomProperty, getTasksFromQseow, updateReloadTask } = require('../task/task_qrs'); +import yesno from 'yesno'; +import { logger } from '../../globals.js'; +import { getCustomProperty, getTasksFromQseow, updateReloadTask } from '../task/task_qrs.js'; const updateTask = async (options, customPropertyDef, task) => new Promise(async (resolve, reject) => { @@ -219,6 +218,4 @@ const setTaskCustomProperty = async (options) => { } }; -module.exports = { - setTaskCustomProperty, -}; +export default setTaskCustomProperty; diff --git a/src/lib/cmd/testconnection.js b/src/lib/cmd/testconnection.js index 9b7a719..0f489e4 100644 --- a/src/lib/cmd/testconnection.js +++ b/src/lib/cmd/testconnection.js @@ -1,5 +1,5 @@ -const { logger, setLoggingLevel, isPkg, execPath } = require('../../globals'); -const { getAboutFromQseow } = require('../util/about'); +import { logger, setLoggingLevel, isPkg, execPath } from '../../globals.js'; +import getAboutFromQseow from '../util/about.js'; const testConnection = async (options) => { try { @@ -30,6 +30,4 @@ const testConnection = async (options) => { } }; -module.exports = { - testConnection, -}; +export default testConnection; diff --git a/src/lib/cmd/useractivity.js b/src/lib/cmd/useractivity.js index 11e8c9b..28df133 100644 --- a/src/lib/cmd/useractivity.js +++ b/src/lib/cmd/useractivity.js @@ -1,6 +1,6 @@ -const { logger } = require('../../globals'); +import { logger } from '../../globals.js'; -function getUserActivityProfessional(qrsInteractInstance) { +export function getUserActivityProfessional(qrsInteractInstance) { // eslint-disable-next-line no-unused-vars, no-async-promise-executor return new Promise(async (resolve, _reject) => { let result; @@ -14,7 +14,7 @@ function getUserActivityProfessional(qrsInteractInstance) { }); } -function getUserActivityAnalyzer(qrsInteractInstance) { +export function getUserActivityAnalyzer(qrsInteractInstance) { // eslint-disable-next-line no-unused-vars, no-async-promise-executor return new Promise(async (resolve, _reject) => { let result; @@ -28,7 +28,7 @@ function getUserActivityAnalyzer(qrsInteractInstance) { }); } -function getUserActivityAnalyzerTime(qrsInteractInstance) { +export getUserActivityAnalyzerTime(qrsInteractInstance) { // eslint-disable-next-line no-unused-vars, no-async-promise-executor return new Promise(async (resolve, _reject) => { let result; @@ -42,7 +42,7 @@ function getUserActivityAnalyzerTime(qrsInteractInstance) { }); } -function getUserActivityLogin(qrsInteractInstance) { +export function getUserActivityLogin(qrsInteractInstance) { // eslint-disable-next-line no-unused-vars, no-async-promise-executor return new Promise(async (resolve, _reject) => { let result; @@ -56,7 +56,7 @@ function getUserActivityLogin(qrsInteractInstance) { }); } -function getUserActivityUser(qrsInteractInstance) { +export function getUserActivityUser(qrsInteractInstance) { // eslint-disable-next-line no-unused-vars, no-async-promise-executor return new Promise(async (resolve, _reject) => { let result; @@ -70,7 +70,7 @@ function getUserActivityUser(qrsInteractInstance) { }); } -function getUsersLastActivity(activityProfessional, activityAnalyzer, activityAnalyzerTime, activityLogin, activityUser) { +export function getUsersLastActivity(activityProfessional, activityAnalyzer, activityAnalyzerTime, activityLogin, activityUser) { // eslint-disable-next-line no-unused-vars, no-async-promise-executor return new Promise(async (resolve, _reject) => { const usersActivity = []; @@ -184,12 +184,3 @@ function getUsersLastActivity(activityProfessional, activityAnalyzer, activityAn resolve(usersActivity); }); } - -module.exports = { - getUserActivityProfessional, - getUserActivityAnalyzer, - getUserActivityAnalyzerTime, - getUserActivityLogin, - getUserActivityUser, - getUsersLastActivity, -}; diff --git a/src/lib/cmd/vistask.js b/src/lib/cmd/vistask.js index 87860c7..319d566 100644 --- a/src/lib/cmd/vistask.js +++ b/src/lib/cmd/vistask.js @@ -1,11 +1,11 @@ -const http = require('http'); -const path = require('path'); -const fs = require('fs'); -const handlebars = require('handlebars'); -const { Readable } = require('stream'); -const { appVersion, logger, setLoggingLevel, isPkg, execPath, verifyFileExists } = require('../../globals'); -const { QlikSenseTasks } = require('../task/class_alltasks'); -const { log } = require('console'); +import http from 'http'; +import path from 'path'; +import fs from 'fs'; +import handlebars from 'handlebars'; +import { Readable } from 'stream'; +import { appVersion, logger, setLoggingLevel, isPkg, execPath, verifyFileExists } from '../../globals.js'; +import QlikSenseTasks from '../task/class_alltasks.js'; +import { log } from 'console'; // js: 'application/javascript', const MIME_TYPES = { @@ -398,6 +398,4 @@ const visTask = async (options) => { return true; }; -module.exports = { - visTask, -}; +export default visTask; diff --git a/src/lib/task/class_allcompositeevents.js b/src/lib/task/class_allcompositeevents.js index 1c92b6c..71da34f 100644 --- a/src/lib/task/class_allcompositeevents.js +++ b/src/lib/task/class_allcompositeevents.js @@ -1,9 +1,8 @@ -const axios = require('axios'); -const path = require('path'); - -const { logger, execPath, verifyFileExists } = require('../../globals'); -const { setupQRSConnection } = require('../util/qrs'); -const { QlikSenseCompositeEvent } = require('./class_compositeevent'); +import axios from 'axios'; +import path from 'path'; +import { logger, execPath, verifyFileExists } from '../../globals.js'; +import setupQRSConnection from '../util/qrs.js'; +import QlikSenseCompositeEvent from './class_compositeevent.js'; class QlikSenseCompositeEvents { // eslint-disable-next-line no-useless-constructor @@ -74,6 +73,4 @@ class QlikSenseCompositeEvents { } } -module.exports = { - QlikSenseCompositeEvents, -}; +export default QlikSenseCompositeEvents; diff --git a/src/lib/task/class_allschemaevents.js b/src/lib/task/class_allschemaevents.js index a4198f7..376596c 100644 --- a/src/lib/task/class_allschemaevents.js +++ b/src/lib/task/class_allschemaevents.js @@ -1,9 +1,8 @@ -const axios = require('axios'); -const path = require('path'); - -const { logger, execPath } = require('../../globals'); -const { setupQRSConnection } = require('../util/qrs'); -const { QlikSenseSchemaEvent } = require('./class_schemaevent'); +import axios from 'axios'; +import path from 'path'; +import { logger, execPath } from '../../globals.js'; +import setupQRSConnection from '../util/qrs.js'; +import QlikSenseSchemaEvent from './class_schemaevent.js'; class QlikSenseSchemaEvents { // eslint-disable-next-line no-useless-constructor @@ -91,6 +90,4 @@ class QlikSenseSchemaEvents { } } -module.exports = { - QlikSenseSchemaEvents, -}; +export default QlikSenseSchemaEvents; diff --git a/src/lib/task/class_alltasks.js b/src/lib/task/class_alltasks.js index 174ab25..1dcda2a 100644 --- a/src/lib/task/class_alltasks.js +++ b/src/lib/task/class_alltasks.js @@ -1,25 +1,25 @@ -const axios = require('axios'); -const path = require('path'); -const { v4: uuidv4, validate } = require('uuid'); +import axios from 'axios'; +import path from 'path'; +import { v4 as uuidv4, validate } from 'uuid'; +import { logger, execPath } from '../../globals.js'; +import setupQRSConnection from '../util/qrs.js'; -const { logger, execPath } = require('../../globals'); -const { setupQRSConnection } = require('../util/qrs'); -const { +import { mapTaskType, mapDaylightSavingTime, mapEventType, mapIncrementOption, mapRuleState, getTaskColumnPosFromHeaderRow, -} = require('../util/lookups'); -const { QlikSenseTask } = require('./class_task'); -const { QlikSenseSchemaEvents } = require('./class_allschemaevents'); -const { QlikSenseCompositeEvents } = require('./class_allcompositeevents'); -const { getTagIdByName } = require('../util/tag'); -const { getCustomPropertyIdByName } = require('../util/customproperties'); -const { taskExistById } = require('../util/task'); -const { getAppById } = require('../util/app'); -const { getTaskById, getTaskByName } = require('../util/task'); +} from '../util/lookups.js'; + +import QlikSenseTask from './class_task.js'; +import QlikSenseSchemaEvents from './class_allschemaevents.js'; +import QlikSenseCompositeEvents from './class_allcompositeevents.js'; +import { getTagIdByName } from '../util/tag.js'; +import { getCustomPropertyIdByName } from '../util/customproperties.js'; +import { getAppById } from '../util/app.js'; +import { taskExistById, getTaskById } from '../util/task.js'; class QlikSenseTasks { // eslint-disable-next-line no-useless-constructor @@ -2423,6 +2423,4 @@ class QlikSenseTasks { } } -module.exports = { - QlikSenseTasks, -}; +export default QlikSenseTasks; diff --git a/src/lib/task/class_compositeevent.js b/src/lib/task/class_compositeevent.js index 69e1918..414f402 100644 --- a/src/lib/task/class_compositeevent.js +++ b/src/lib/task/class_compositeevent.js @@ -1,4 +1,4 @@ -const { logger } = require('../../globals'); +import { logger } from '../../globals.js'; class QlikSenseCompositeEvent { constructor(compositeEvent) { @@ -10,6 +10,4 @@ class QlikSenseCompositeEvent { // Other methods } -module.exports = { - QlikSenseCompositeEvent, -}; +export default QlikSenseCompositeEvent; diff --git a/src/lib/task/class_schemaevent.js b/src/lib/task/class_schemaevent.js index c6f64ff..2893ead 100644 --- a/src/lib/task/class_schemaevent.js +++ b/src/lib/task/class_schemaevent.js @@ -1,5 +1,4 @@ -// eslint-disable-next-line no-unused-vars -const { logger } = require('../../globals'); +import { logger } from '../../globals.js'; class QlikSenseSchemaEvent { constructor(schemaEvent) { @@ -11,6 +10,4 @@ class QlikSenseSchemaEvent { // Other methods } -module.exports = { - QlikSenseSchemaEvent, -}; +export default QlikSenseSchemaEvent; diff --git a/src/lib/task/class_task.js b/src/lib/task/class_task.js index f3aed7d..17548c7 100644 --- a/src/lib/task/class_task.js +++ b/src/lib/task/class_task.js @@ -1,8 +1,10 @@ -const { Duration } = require('luxon'); +import { Duration } from 'luxon'; + // const { randomWords } = require('random-words'); -const { logger } = require('../../globals'); -const { mapTaskExecutionStatus } = require('../util/lookups'); +import { logger } from '../../globals.js'; + +import { mapTaskExecutionStatus } from '../util/lookups.js'; // const randomWords2 = (...args) => import('random-words').then(({ default: randomWords }) => randomWords(...args)); @@ -187,6 +189,4 @@ class QlikSenseTask { } } -module.exports = { - QlikSenseTask, -}; +export default QlikSenseTask; diff --git a/src/lib/task/task_qrs.js b/src/lib/task/task_qrs.js index 565d04e..12909e7 100644 --- a/src/lib/task/task_qrs.js +++ b/src/lib/task/task_qrs.js @@ -1,12 +1,13 @@ -const axios = require('axios'); -const path = require('path'); +import axios from 'axios'; +import path from 'path'; // const { promises: Fs } = require('fs'); // const yesno = require('yesno'); -const { logger, execPath } = require('../../globals'); -const { setupQRSConnection } = require('../util/qrs'); -const { getCertFilePaths } = require('../util/cert'); +import { logger, execPath } from '../../globals.js'; + +import setupQRSConnection from '../util/qrs.js'; +import getCertFilePaths from '../util/cert.js'; // const { QlikSenseTasks } = require('./class_alltasks'); // const { mapEventType, mapIncrementOption, mapDaylightSavingTime, mapRuleState } = require('../util/lookups'); @@ -20,7 +21,7 @@ function uniqueByTaskKeys(array, keys) { return filtered; } -const getCustomProperty = async (options) => { +export const getCustomProperty = async (options) => { let cp; try { @@ -60,7 +61,7 @@ const getCustomProperty = async (options) => { return cp; }; -const getTasksFromQseow = async (options) => { +export const getTasksFromQseow = async (options) => { let taskList; try { @@ -133,7 +134,7 @@ const getTasksFromQseow = async (options) => { } }; -const updateReloadTask = async (options, payload) => { +export const updateReloadTask = async (options, payload) => { try { // Get cert files const certFilesFullPath = await getCertFilePaths(options); @@ -155,9 +156,3 @@ const updateReloadTask = async (options, payload) => { } return true; }; - -module.exports = { - getCustomProperty, - getTasksFromQseow, - updateReloadTask, -}; diff --git a/src/lib/util/about.js b/src/lib/util/about.js index 9a70d01..b6ea131 100644 --- a/src/lib/util/about.js +++ b/src/lib/util/about.js @@ -1,8 +1,7 @@ -const axios = require('axios'); -const path = require('path'); - -const { logger, execPath } = require('../../globals'); -const { setupQRSConnection } = require('./qrs'); +import axios from 'axios'; +import path from 'path'; +import { logger, execPath } from '../../globals.js'; +import setupQRSConnection from './qrs.js'; function getAboutFromQseow(options) { return new Promise((resolve, reject) => { @@ -47,6 +46,4 @@ function getAboutFromQseow(options) { }); } -module.exports = { - getAboutFromQseow, -}; +export default getAboutFromQseow; diff --git a/src/lib/util/app.js b/src/lib/util/app.js index 857e630..eda7cbf 100644 --- a/src/lib/util/app.js +++ b/src/lib/util/app.js @@ -1,12 +1,10 @@ -const axios = require('axios'); -const path = require('path'); -const { validate } = require('uuid'); -const { error } = require('console'); +import axios from 'axios'; +import path from 'path'; +import { validate } from 'uuid'; +import { logger, execPath, getCliOptions } from '../../globals.js'; +import setupQRSConnection from './qrs.js'; -const { logger, execPath, getCliOptions } = require('../../globals'); -const { setupQRSConnection } = require('./qrs'); - -async function getApps(options, idArray, tagArray) { +export async function getApps(options, idArray, tagArray) { try { logger.debug(`Getting app IDs from appId and appTag arrays`); @@ -99,7 +97,7 @@ async function getApps(options, idArray, tagArray) { } // Function to get app info from QRS, given app ID -async function getAppById(appId, optionsParam) { +export async function getAppById(appId, optionsParam) { try { logger.debug(`GET APP BY ID: Starting get app from QSEoW for app id ${appId}`); // Did we get any options as parameter? @@ -168,7 +166,7 @@ async function getAppById(appId, optionsParam) { } // Function to delete app given app ID -async function deleteAppById(appId, options) { +export async function deleteAppById(appId, options) { // Ensuire options are specified. Exit if not if (!options) { logger.error(`DELETE APP: No options specified. Exiting.`); @@ -223,7 +221,7 @@ async function deleteAppById(appId, options) { } // Check if an app with a given id exists -async function appExistById(appId, options) { +export async function appExistById(appId, options) { try { logger.debug(`Checking if app with id ${appId} exists in QSEoW`); @@ -290,10 +288,3 @@ async function appExistById(appId, options) { return false; } } - -module.exports = { - getApps, - getAppById, - deleteAppById, - appExistById, -}; diff --git a/src/lib/util/assert-options.js b/src/lib/util/assert-options.js index 4efea24..bcae94e 100644 --- a/src/lib/util/assert-options.js +++ b/src/lib/util/assert-options.js @@ -1,9 +1,8 @@ -const path = require('path'); -const uuidVersion = require('uuid').version; -const uuidValidate = require('uuid').validate; -const fs = require('fs'); - -const { logger, execPath, mergeDirFilePath, verifyFileExists } = require('../../globals'); +import path from 'path'; +import { version as uuidVersion } from 'uuid'; +import { validate as uuidValidate } from 'uuid'; +import fs from 'fs'; +import { logger, execPath, mergeDirFilePath, verifyFileExists } from '../../globals.js'; const sharedParamAssertOptions = async (options) => { // Ensure that parameters common to all commands are valid @@ -296,7 +295,7 @@ const variableDeleteAssertOptions = (options) => { } }; -module.exports = { +export default { sharedParamAssertOptions, userActivityCustomPropertyAssertOptions, masterItemImportAssertOptions, diff --git a/src/lib/util/cert.js b/src/lib/util/cert.js index 23fb426..f607621 100644 --- a/src/lib/util/cert.js +++ b/src/lib/util/cert.js @@ -1,6 +1,5 @@ -const path = require('path'); - -const { logger, execPath } = require('../../globals'); +import path from 'path'; +import { logger, execPath } from '../../globals.js'; const getCertFilePaths = async (options) => { let fileCert; @@ -16,6 +15,4 @@ const getCertFilePaths = async (options) => { return { fileCert, fileCertKey }; }; -module.exports = { - getCertFilePaths, -}; +export default getCertFilePaths; diff --git a/src/lib/util/customproperties.js b/src/lib/util/customproperties.js index 5043063..cafce4b 100644 --- a/src/lib/util/customproperties.js +++ b/src/lib/util/customproperties.js @@ -1,11 +1,10 @@ -const axios = require('axios'); -const path = require('path'); +import axios from 'axios'; +import path from 'path'; +import { logger, execPath } from '../../globals.js'; +import setupQRSConnection from './qrs.js'; -const { logger, execPath } = require('../../globals'); -const { setupQRSConnection } = require('./qrs'); - -function getCustomPropertiesFromQseow(options) { - return new Promise((resolve, reject) => { +export function getCustomPropertiesFromQseow(options) { + return new Promise((resolve, _reject) => { logger.verbose(`Getting custom properties from QSEoW...`); // Should cerrificates be used for authentication? @@ -46,8 +45,8 @@ function getCustomPropertiesFromQseow(options) { }); } -function getCustomPropertyIdByName(objectType, customPropertyName, cpExisting) { - return new Promise((resolve, reject) => { +export function getCustomPropertyIdByName(objectType, customPropertyName, cpExisting) { + return new Promise((resolve, _reject) => { logger.debug(`Looking up ID for custom property named "${customPropertyName}" on object type "${objectType}"`); const cp = cpExisting.filter((item) => item.name === customPropertyName); @@ -107,8 +106,8 @@ function getCustomPropertyIdByName(objectType, customPropertyName, cpExisting) { // }); // } -function getCustomPropertyDefinitionByName(objectType, customPropertyName, cpExisting) { - return new Promise((resolve, reject) => { +export function getCustomPropertyDefinitionByName(objectType, customPropertyName, cpExisting) { + return new Promise((resolve, _reject) => { logger.debug(`Looking up definition for custom property named "${customPropertyName}" on object type "${objectType}"`); const cp = cpExisting.filter((item) => item.name === customPropertyName); @@ -168,8 +167,8 @@ function getCustomPropertyDefinitionByName(objectType, customPropertyName, cpExi // }); // } -function doesCustomPropertyValueExist(objectType, customPropertyName, customPropertyValue, cpExisting) { - return new Promise((resolve, reject) => { +export function doesCustomPropertyValueExist(objectType, customPropertyName, customPropertyValue, cpExisting) { + return new Promise((resolve, _reject) => { logger.debug( `Checking if value "${customPropertyValue}" is valid for custom property "${customPropertyName}" on object type "${objectType}"` ); @@ -202,6 +201,7 @@ function doesCustomPropertyValueExist(objectType, customPropertyName, customProp } }); } + // function doesCustomPropertyValueExist2(objectType, customPropertyName, customPropertyValue, options, fileCert, fileCertKey) { // return new Promise((resolve, reject) => { // logger.debug( @@ -250,10 +250,3 @@ function doesCustomPropertyValueExist(objectType, customPropertyName, customProp // }); // }); // } - -module.exports = { - getCustomPropertiesFromQseow, - getCustomPropertyIdByName, - getCustomPropertyDefinitionByName, - doesCustomPropertyValueExist, -}; diff --git a/src/lib/util/enigma.js b/src/lib/util/enigma.js index 60b62c3..e17a63b 100644 --- a/src/lib/util/enigma.js +++ b/src/lib/util/enigma.js @@ -1,14 +1,47 @@ -const SenseUtilities = require('enigma.js/sense-utilities'); -const WebSocket = require('ws'); -const path = require('path'); +import SenseUtilities from 'enigma.js/sense-utilities'; +import WebSocket from 'ws'; +import path from 'path'; +import { readFileSync } from 'fs'; +import { fileURLToPath } from 'url'; +import upath from 'upath'; +import { logger, execPath, readCert } from '../../globals.js'; + +export const setupEnigmaConnection = async (options, sessionId) => { + logger.debug('Prepping for Enigma connection...'); -const { logger, execPath, readCert } = require('../../globals'); + // Set up enigma.js configuration + const schemaFile = `../node_modules/enigma.js/schemas/${options.schemaVersion}.json`; + let a; + let b; + let c; + // Are we running as a packaged app? + if (process.pkg) { + // Yes, we are running as a packaged app + // Get path to JS file const + a = process.pkg.defaultEntrypoint; + + // Strip off the filename + b = upath.dirname(a); + + // Add path to package.json file + c = upath.join(b, schemaFile); + } else { + // No, we are running as native Node.js + // Get path to JS file + a = fileURLToPath(import.meta.url); + + // Strip off the filename + b = upath.dirname(a); + + // Add path to package.json file + c = upath.join(b, '..', '..', schemaFile); + } -const setupEnigmaConnection = async (options, sessionId) => { - logger.debug('Prepping for Enigma connection...'); + logger.verbose(`APPDUMP: Using engine schema in file: ${c}`); + const qixSchema = JSON.parse(readFileSync(c)); // eslint-disable-next-line global-require, import/no-dynamic-require - const qixSchema = require(`enigma.js/schemas/${options.schemaVersion}`); + // const qixSchema = require(`enigma.js/schemas/${options.schemaVersion}`); let enigmaConfig; // Should certificates be used for authentication? @@ -86,7 +119,7 @@ const setupEnigmaConnection = async (options, sessionId) => { }; // Function to add logging of session's websocket traffic -const addTrafficLogging = (session, options) => { +export const addTrafficLogging = (session, options) => { session.on('notification:*', (eventName, data) => { // console.log(`SESSION EVENT=${eventName}: `, data); @@ -151,8 +184,3 @@ const addTrafficLogging = (session, options) => { }); } }; - -module.exports = { - setupEnigmaConnection, - addTrafficLogging, -}; diff --git a/src/lib/util/log.js b/src/lib/util/log.js index df6a7b2..ff2f0e1 100644 --- a/src/lib/util/log.js +++ b/src/lib/util/log.js @@ -1,4 +1,4 @@ -const { logger, appVersion, isPkg, execPath } = require('../../globals'); +import { logger, appVersion, isPkg, execPath } from '../../globals.js'; const logStartupInfo = (options, cmd, cmdDesc) => { logger.info('-----------------------------------------------------------'); @@ -21,6 +21,4 @@ const logStartupInfo = (options, cmd, cmdDesc) => { logger.verbose(``); }; -module.exports = { - logStartupInfo, -}; +export default logStartupInfo; diff --git a/src/lib/util/lookups.js b/src/lib/util/lookups.js index 35cb0cd..392050c 100644 --- a/src/lib/util/lookups.js +++ b/src/lib/util/lookups.js @@ -1,4 +1,4 @@ -const mapDaylightSavingTime = new Map([ +export const mapDaylightSavingTime = new Map([ [0, 'ObserveDaylightSavingTime'], [1, 'PermanentStandardTime'], [2, 'PermanentDaylightSavingTime'], @@ -7,14 +7,14 @@ const mapDaylightSavingTime = new Map([ ['PermanentDaylightSavingTime', 2], ]); -const mapEventType = new Map([ +export const mapEventType = new Map([ [0, 'Schema'], [1, 'Composite'], ['Schema', 0], ['Composite', 1], ]); -const mapIncrementOption = new Map([ +export const mapIncrementOption = new Map([ [0, 'once'], [1, 'hourly'], [2, 'daily'], @@ -29,7 +29,7 @@ const mapIncrementOption = new Map([ ['custom', 5], ]); -const mapRuleState = new Map([ +export const mapRuleState = new Map([ [0, 'Undefined'], [1, 'TaskSuccessful'], [2, 'TaskFail'], @@ -38,7 +38,7 @@ const mapRuleState = new Map([ ['TaskFail', 2], ]); -const mapTaskExecutionStatus = new Map([ +export const mapTaskExecutionStatus = new Map([ [0, 'NeverStarted'], [1, 'Triggered'], [2, 'Started'], @@ -67,7 +67,7 @@ const mapTaskExecutionStatus = new Map([ ['Reset', 11], ]); -const mapTaskType = new Map([ +export const mapTaskType = new Map([ [0, 'Reload'], [1, 'ExternalProgram'], [2, 'UserSync'], @@ -81,7 +81,7 @@ const mapTaskType = new Map([ // Used to find the column position in the source csv/Excel file containing the task definition // position=999 may be set later in the code and means that a certain column is not present in the source file. // It is then up to the code to handle this situation. -const taskFileColumnHeaders = { +export const taskFileColumnHeaders = { taskCounter: { name: 'Task counter', pos: -1 }, taskType: { name: 'Task type', pos: -1 }, taskName: { name: 'Task name', pos: -1 }, @@ -135,7 +135,7 @@ const taskFileColumnHeaders = { ruleTaskId: { name: 'Rule task id', pos: -1 }, }; -const appFileColumnHeaders = { +export const appFileColumnHeaders = { appCounter: { name: 'App counter', pos: -1 }, appName: { name: 'App name', pos: -1 }, qvfDirectory: { name: 'QVF directory', pos: -1 }, @@ -149,7 +149,7 @@ const appFileColumnHeaders = { appPublishToStreamOption: { name: 'Publish options', pos: -1 }, }; -function getTaskColumnPosFromHeaderRow(headerRow) { +export function getTaskColumnPosFromHeaderRow(headerRow) { taskFileColumnHeaders.taskCounter.pos = headerRow.findIndex((item) => item === taskFileColumnHeaders.taskCounter.name); taskFileColumnHeaders.taskType.pos = headerRow.findIndex((item) => item === taskFileColumnHeaders.taskType.name); taskFileColumnHeaders.taskName.pos = headerRow.findIndex((item) => item === taskFileColumnHeaders.taskName.name); @@ -212,7 +212,7 @@ function getTaskColumnPosFromHeaderRow(headerRow) { return taskFileColumnHeaders; } -function getAppColumnPosFromHeaderRow(headerRow) { +export function getAppColumnPosFromHeaderRow(headerRow) { appFileColumnHeaders.appCounter.pos = headerRow.findIndex((item) => item === appFileColumnHeaders.appCounter.name); appFileColumnHeaders.appName.pos = headerRow.findIndex((item) => item === appFileColumnHeaders.appName.name); appFileColumnHeaders.qvfDirectory.pos = headerRow.findIndex((item) => item === appFileColumnHeaders.qvfDirectory.name); @@ -233,15 +233,3 @@ function getAppColumnPosFromHeaderRow(headerRow) { return appFileColumnHeaders; } - -module.exports = { - mapDaylightSavingTime, - mapEventType, - mapIncrementOption, - mapRuleState, - mapTaskExecutionStatus, - mapTaskType, - taskFileColumnHeaders, - getTaskColumnPosFromHeaderRow, - getAppColumnPosFromHeaderRow, -}; diff --git a/src/lib/util/qrs.js b/src/lib/util/qrs.js index 2638a33..cf797b8 100644 --- a/src/lib/util/qrs.js +++ b/src/lib/util/qrs.js @@ -1,6 +1,5 @@ -const https = require('https'); - -const { logger, generateXrfKey, readCert } = require('../../globals'); +import https from 'https'; +import { logger, generateXrfKey, readCert } from '../../globals.js'; const setupQRSConnection = (options, param) => { // eslint-disable-next-line no-unused-vars @@ -108,6 +107,4 @@ const setupQRSConnection = (options, param) => { return axiosConfig; }; -module.exports = { - setupQRSConnection, -}; +export default setupQRSConnection; diff --git a/src/lib/util/tag.js b/src/lib/util/tag.js index 745ef2a..07dca3e 100644 --- a/src/lib/util/tag.js +++ b/src/lib/util/tag.js @@ -1,11 +1,10 @@ -const axios = require('axios'); -const path = require('path'); +import axios from 'axios'; +import path from 'path'; +import { logger, execPath } from '../../globals.js'; +import setupQRSConnection from './qrs.js'; -const { logger, execPath } = require('../../globals'); -const { setupQRSConnection } = require('./qrs'); - -function getTagsFromQseow(options) { - return new Promise((resolve, reject) => { +export function getTagsFromQseow(options) { + return new Promise((resolve, _reject) => { logger.verbose(`Getting tags from QSEoW...`); // Should cerrificates be used for authentication? @@ -47,8 +46,8 @@ function getTagsFromQseow(options) { }); } -function getTagIdByName(tagName, tagsExisting) { - return new Promise((resolve, reject) => { +export function getTagIdByName(tagName, tagsExisting) { + return new Promise((resolve, _reject) => { logger.debug(`Looking up ID for tag named "${tagName}"`); let tag; @@ -95,8 +94,3 @@ function getTagIdByName(tagName, tagsExisting) { // }); // }); // } - -module.exports = { - getTagIdByName, - getTagsFromQseow, -}; diff --git a/src/lib/util/task.js b/src/lib/util/task.js index 806248a..dce4aa6 100644 --- a/src/lib/util/task.js +++ b/src/lib/util/task.js @@ -1,14 +1,13 @@ -const axios = require('axios'); -const fs = require('fs'); -const path = require('path'); -const { validate } = require('uuid'); - -const { logger, execPath, getCliOptions } = require('../../globals'); -const { setupQRSConnection } = require('./qrs'); +import axios from 'axios'; +import fs from 'fs'; +import path from 'path'; +import { validate } from 'uuid'; +import { logger, execPath, getCliOptions } from '../../globals.js'; +import setupQRSConnection from './qrs.js'; // Check if a task with a given id exists // Look for all kinds of tasks, not just reload tasks -async function taskExistById(taskId, optionsParam) { +export async function taskExistById(taskId, optionsParam) { try { logger.debug(`Checking if task with ID ${taskId} exists`); @@ -90,7 +89,7 @@ async function taskExistById(taskId, optionsParam) { // Returs: // - false if task does not exist or if multiple tasks with the same name exist // - task metadata if task exists -async function getTaskByName(taskName, optionsParam) { +export async function getTaskByName(taskName, optionsParam) { try { logger.debug(`Get task with name ${taskName}`); @@ -157,7 +156,7 @@ async function getTaskByName(taskName, optionsParam) { // Function to get task metadata, given a task ID // If the task ID is a valid GUID it is assumed to be a task ID that exists in Sense. Report an error if not. -async function getTaskById(taskId, optionsParam) { +export async function getTaskById(taskId, optionsParam) { try { logger.debug(`Get task with ID ${taskId}`); @@ -235,7 +234,7 @@ async function getTaskById(taskId, optionsParam) { // Delete a reload task given its ID // If the reload task ID is a valid GUID it is assumed to be a reload task ID that exists in Sense. Report an error if not. -async function deleteReloadTaskById(taskId, optionsParam) { +export async function deleteReloadTaskById(taskId, optionsParam) { try { logger.debug(`Delete reload task with ID ${taskId}`); @@ -311,7 +310,7 @@ async function deleteReloadTaskById(taskId, optionsParam) { // Delete a external program task given its ID // If the task ID is a valid GUID it is assumed to be a ext pgm task ID that exists in Sense. Report an error if not. -async function deleteExternalProgramTaskById(taskId, optionsParam) { +export async function deleteExternalProgramTaskById(taskId, optionsParam) { try { logger.debug(`Delete external program task with ID ${taskId}`); @@ -384,11 +383,3 @@ async function deleteExternalProgramTaskById(taskId, optionsParam) { return false; } } - -module.exports = { - taskExistById, - getTaskByName, - getTaskById, - deleteReloadTaskById, - deleteExternalProgramTaskById, -}; diff --git a/src/static/vis-network.min.js b/src/static/vis-network.min.js index e9a4003..f57ab26 100644 --- a/src/static/vis-network.min.js +++ b/src/static/vis-network.min.js @@ -23,12 +23,12 @@ * * vis.js may be distributed under either license. */ -!function(g,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((g="undefined"!=typeof globalThis?globalThis:g||self).vis=g.vis||{})}(this,(function(g){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var e=function(g){return g&&g.Math===Math&&g},C=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||t||Function("return this")(),I=function(g){try{return!!g()}catch(g){return!0}},i=!I((function(){var g=function(){}.bind();return"function"!=typeof g||g.hasOwnProperty("prototype")})),o=i,n=Function.prototype,r=n.apply,s=n.call,a="object"==typeof Reflect&&Reflect.apply||(o?s.bind(r):function(){return s.apply(r,arguments)}),d=i,h=Function.prototype,l=h.call,c=d&&h.bind.bind(l,l),u=d?c:function(g){return function(){return l.apply(g,arguments)}},p=u,f=p({}.toString),v=p("".slice),y=function(g){return v(f(g),8,-1)},m=y,b=u,w=function(g){if("Function"===m(g))return b(g)},k="object"==typeof document&&document.all,x={all:k,IS_HTMLDDA:void 0===k&&void 0!==k},E=x.all,O=x.IS_HTMLDDA?function(g){return"function"==typeof g||g===E}:function(g){return"function"==typeof g},T={},D=!I((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),N=i,R=Function.prototype.call,P=N?R.bind(R):function(){return R.apply(R,arguments)},M={},B={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,S=z&&!B.call({1:2},1);M.f=S?function(g){var t=z(this,g);return!!t&&t.enumerable}:B;var Z,F,G=function(g,t){return{enumerable:!(1&g),configurable:!(2&g),writable:!(4&g),value:t}},j=I,L=y,V=Object,Y=u("".split),W=j((function(){return!V("z").propertyIsEnumerable(0)}))?function(g){return"String"===L(g)?Y(g,""):V(g)}:V,Q=function(g){return null==g},U=Q,_=TypeError,K=function(g){if(U(g))throw new _("Can't call method on "+g);return g},H=W,X=K,J=function(g){return H(X(g))},q=O,$=x.all,gg=x.IS_HTMLDDA?function(g){return"object"==typeof g?null!==g:q(g)||g===$}:function(g){return"object"==typeof g?null!==g:q(g)},tg={},Ag=tg,eg=C,Cg=O,Ig=function(g){return Cg(g)?g:void 0},ig=function(g,t){return arguments.length<2?Ig(Ag[g])||Ig(eg[g]):Ag[g]&&Ag[g][t]||eg[g]&&eg[g][t]},og=u({}.isPrototypeOf),ng="undefined"!=typeof navigator&&String(navigator.userAgent)||"",rg=C,sg=ng,ag=rg.process,dg=rg.Deno,hg=ag&&ag.versions||dg&&dg.version,lg=hg&&hg.v8;lg&&(F=(Z=lg.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!F&&sg&&(!(Z=sg.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=sg.match(/Chrome\/(\d+)/))&&(F=+Z[1]);var cg=F,ug=cg,pg=I,fg=C.String,vg=!!Object.getOwnPropertySymbols&&!pg((function(){var g=Symbol("symbol detection");return!fg(g)||!(Object(g)instanceof Symbol)||!Symbol.sham&&ug&&ug<41})),yg=vg&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,mg=ig,bg=O,wg=og,kg=Object,xg=yg?function(g){return"symbol"==typeof g}:function(g){var t=mg("Symbol");return bg(t)&&wg(t.prototype,kg(g))},Eg=String,Og=function(g){try{return Eg(g)}catch(g){return"Object"}},Tg=O,Dg=Og,Ng=TypeError,Rg=function(g){if(Tg(g))return g;throw new Ng(Dg(g)+" is not a function")},Pg=Rg,Mg=Q,Bg=function(g,t){var A=g[t];return Mg(A)?void 0:Pg(A)},zg=P,Sg=O,Zg=gg,Fg=TypeError,Gg={exports:{}},jg=C,Lg=Object.defineProperty,Vg=function(g,t){try{Lg(jg,g,{value:t,configurable:!0,writable:!0})}catch(A){jg[g]=t}return t},Yg="__core-js_shared__",Wg=C[Yg]||Vg(Yg,{}),Qg=Wg;(Gg.exports=function(g,t){return Qg[g]||(Qg[g]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ug=Gg.exports,_g=K,Kg=Object,Hg=function(g){return Kg(_g(g))},Xg=Hg,Jg=u({}.hasOwnProperty),qg=Object.hasOwn||function(g,t){return Jg(Xg(g),t)},$g=u,gt=0,tt=Math.random(),At=$g(1..toString),et=function(g){return"Symbol("+(void 0===g?"":g)+")_"+At(++gt+tt,36)},Ct=Ug,It=qg,it=et,ot=vg,nt=yg,rt=C.Symbol,st=Ct("wks"),at=nt?rt.for||rt:rt&&rt.withoutSetter||it,dt=function(g){return It(st,g)||(st[g]=ot&&It(rt,g)?rt[g]:at("Symbol."+g)),st[g]},ht=P,lt=gg,ct=xg,ut=Bg,pt=function(g,t){var A,e;if("string"===t&&Sg(A=g.toString)&&!Zg(e=zg(A,g)))return e;if(Sg(A=g.valueOf)&&!Zg(e=zg(A,g)))return e;if("string"!==t&&Sg(A=g.toString)&&!Zg(e=zg(A,g)))return e;throw new Fg("Can't convert object to primitive value")},ft=TypeError,vt=dt("toPrimitive"),yt=function(g,t){if(!lt(g)||ct(g))return g;var A,e=ut(g,vt);if(e){if(void 0===t&&(t="default"),A=ht(e,g,t),!lt(A)||ct(A))return A;throw new ft("Can't convert object to primitive value")}return void 0===t&&(t="number"),pt(g,t)},mt=xg,bt=function(g){var t=yt(g,"string");return mt(t)?t:t+""},wt=gg,kt=C.document,xt=wt(kt)&&wt(kt.createElement),Et=function(g){return xt?kt.createElement(g):{}},Ot=Et,Tt=!D&&!I((function(){return 7!==Object.defineProperty(Ot("div"),"a",{get:function(){return 7}}).a})),Dt=D,Nt=P,Rt=M,Pt=G,Mt=J,Bt=bt,zt=qg,St=Tt,Zt=Object.getOwnPropertyDescriptor;T.f=Dt?Zt:function(g,t){if(g=Mt(g),t=Bt(t),St)try{return Zt(g,t)}catch(g){}if(zt(g,t))return Pt(!Nt(Rt.f,g,t),g[t])};var Ft=I,Gt=O,jt=/#|\.prototype\./,Lt=function(g,t){var A=Yt[Vt(g)];return A===Qt||A!==Wt&&(Gt(t)?Ft(t):!!t)},Vt=Lt.normalize=function(g){return String(g).replace(jt,".").toLowerCase()},Yt=Lt.data={},Wt=Lt.NATIVE="N",Qt=Lt.POLYFILL="P",Ut=Lt,_t=Rg,Kt=i,Ht=w(w.bind),Xt=function(g,t){return _t(g),void 0===t?g:Kt?Ht(g,t):function(){return g.apply(t,arguments)}},Jt={},qt=D&&I((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$t=gg,gA=String,tA=TypeError,AA=function(g){if($t(g))return g;throw new tA(gA(g)+" is not an object")},eA=D,CA=Tt,IA=qt,iA=AA,oA=bt,nA=TypeError,rA=Object.defineProperty,sA=Object.getOwnPropertyDescriptor,aA="enumerable",dA="configurable",hA="writable";Jt.f=eA?IA?function(g,t,A){if(iA(g),t=oA(t),iA(A),"function"==typeof g&&"prototype"===t&&"value"in A&&hA in A&&!A[hA]){var e=sA(g,t);e&&e[hA]&&(g[t]=A.value,A={configurable:dA in A?A[dA]:e[dA],enumerable:aA in A?A[aA]:e[aA],writable:!1})}return rA(g,t,A)}:rA:function(g,t,A){if(iA(g),t=oA(t),iA(A),CA)try{return rA(g,t,A)}catch(g){}if("get"in A||"set"in A)throw new nA("Accessors not supported");return"value"in A&&(g[t]=A.value),g};var lA=Jt,cA=G,uA=D?function(g,t,A){return lA.f(g,t,cA(1,A))}:function(g,t,A){return g[t]=A,g},pA=C,fA=a,vA=w,yA=O,mA=T.f,bA=Ut,wA=tg,kA=Xt,xA=uA,EA=qg,OA=function(g){var t=function(A,e,C){if(this instanceof t){switch(arguments.length){case 0:return new g;case 1:return new g(A);case 2:return new g(A,e)}return new g(A,e,C)}return fA(g,this,arguments)};return t.prototype=g.prototype,t},TA=function(g,t){var A,e,C,I,i,o,n,r,s,a=g.target,d=g.global,h=g.stat,l=g.proto,c=d?pA:h?pA[a]:(pA[a]||{}).prototype,u=d?wA:wA[a]||xA(wA,a,{})[a],p=u.prototype;for(I in t)e=!(A=bA(d?I:a+(h?".":"#")+I,g.forced))&&c&&EA(c,I),o=u[I],e&&(n=g.dontCallGetSet?(s=mA(c,I))&&s.value:c[I]),i=e&&n?n:t[I],e&&typeof o==typeof i||(r=g.bind&&e?kA(i,pA):g.wrap&&e?OA(i):l&&yA(i)?vA(i):i,(g.sham||i&&i.sham||o&&o.sham)&&xA(r,"sham",!0),xA(u,I,r),l&&(EA(wA,C=a+"Prototype")||xA(wA,C,{}),xA(wA[C],I,i),g.real&&p&&(A||!p[I])&&xA(p,I,i)))},DA=Math.ceil,NA=Math.floor,RA=Math.trunc||function(g){var t=+g;return(t>0?NA:DA)(t)},PA=function(g){var t=+g;return t!=t||0===t?0:RA(t)},MA=PA,BA=Math.max,zA=Math.min,SA=function(g,t){var A=MA(g);return A<0?BA(A+t,0):zA(A,t)},ZA=PA,FA=Math.min,GA=function(g){return g>0?FA(ZA(g),9007199254740991):0},jA=function(g){return GA(g.length)},LA=J,VA=SA,YA=jA,WA=function(g){return function(t,A,e){var C,I=LA(t),i=YA(I),o=VA(e,i);if(g&&A!=A){for(;i>o;)if((C=I[o++])!=C)return!0}else for(;i>o;o++)if((g||o in I)&&I[o]===A)return g||o||0;return!g&&-1}},QA={includes:WA(!0),indexOf:WA(!1)},UA={},_A=qg,KA=J,HA=QA.indexOf,XA=UA,JA=u([].push),qA=function(g,t){var A,e=KA(g),C=0,I=[];for(A in e)!_A(XA,A)&&_A(e,A)&&JA(I,A);for(;t.length>C;)_A(e,A=t[C++])&&(~HA(I,A)||JA(I,A));return I},$A=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=qA,te=$A,Ae=Object.keys||function(g){return ge(g,te)},ee={};ee.f=Object.getOwnPropertySymbols;var Ce=D,Ie=u,ie=P,oe=I,ne=Ae,re=ee,se=M,ae=Hg,de=W,he=Object.assign,le=Object.defineProperty,ce=Ie([].concat),ue=!he||oe((function(){if(Ce&&1!==he({b:1},he(le({},"a",{enumerable:!0,get:function(){le(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var g={},t={},A=Symbol("assign detection"),e="abcdefghijklmnopqrst";return g[A]=7,e.split("").forEach((function(g){t[g]=g})),7!==he({},g)[A]||ne(he({},t)).join("")!==e}))?function(g,t){for(var A=ae(g),e=arguments.length,C=1,I=re.f,i=se.f;e>C;)for(var o,n=de(arguments[C++]),r=I?ce(ne(n),I(n)):ne(n),s=r.length,a=0;s>a;)o=r[a++],Ce&&!ie(i,n,o)||(A[o]=n[o]);return A}:he,pe=ue;TA({target:"Object",stat:!0,arity:2,forced:Object.assign!==pe},{assign:pe});var fe=A(tg.Object.assign),ve=u([].slice),ye=u,me=Rg,be=gg,we=qg,ke=ve,xe=i,Ee=Function,Oe=ye([].concat),Te=ye([].join),De={},Ne=xe?Ee.bind:function(g){var t=me(this),A=t.prototype,e=ke(arguments,1),C=function(){var A=Oe(e,ke(arguments));return this instanceof C?function(g,t,A){if(!we(De,t)){for(var e=[],C=0;C=.1;)(l=+I[a++%i])>s&&(l=s),h=Math.sqrt(l*l/(1+r*r)),t+=h=o<0?-h:h,A+=r*h,!0===d?g.lineTo(t,A):g.moveTo(t,A),s-=l,d=!d}var Ue={circle:Le,dashedLine:Qe,database:We,diamond:function(g,t,A,e){g.beginPath(),g.lineTo(t,A+e),g.lineTo(t+e,A),g.lineTo(t,A-e),g.lineTo(t-e,A),g.closePath()},ellipse:Ye,ellipse_vis:Ye,hexagon:function(g,t,A,e){g.beginPath();var C=2*Math.PI/6;g.moveTo(t+e,A);for(var I=1;I<6;I++)g.lineTo(t+e*Math.cos(C*I),A+e*Math.sin(C*I));g.closePath()},roundRect:Ve,square:function(g,t,A,e){g.beginPath(),g.rect(t-e,A-e,2*e,2*e),g.closePath()},star:function(g,t,A,e){g.beginPath(),A+=.1*(e*=.82);for(var C=0;C<10;C++){var I=C%2==0?1.3*e:.5*e;g.lineTo(t+I*Math.sin(2*C*Math.PI/10),A-I*Math.cos(2*C*Math.PI/10))}g.closePath()},triangle:function(g,t,A,e){g.beginPath(),A+=.275*(e*=1.15);var C=2*e,I=C/2,i=Math.sqrt(3)/6*C,o=Math.sqrt(C*C-I*I);g.moveTo(t,A-(o-i)),g.lineTo(t+I,A+i),g.lineTo(t-I,A+i),g.lineTo(t,A-(o-i)),g.closePath()},triangleDown:function(g,t,A,e){g.beginPath(),A-=.275*(e*=1.15);var C=2*e,I=C/2,i=Math.sqrt(3)/6*C,o=Math.sqrt(C*C-I*I);g.moveTo(t,A+(o-i)),g.lineTo(t+I,A-i),g.lineTo(t-I,A-i),g.lineTo(t,A+(o-i)),g.closePath()}};function _e(g,t){void 0===t&&(t={});var A=t.insertAt;if(g&&"undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css","top"===A&&e.firstChild?e.insertBefore(C,e.firstChild):e.appendChild(C),C.styleSheet?C.styleSheet.cssText=g:C.appendChild(document.createTextNode(g))}}_e(".vis-overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}");_e(".vis [class*=span]{min-height:0;width:auto}");_e('div.vis-color-picker{background-color:#fff;border-radius:15px;box-shadow:0 0 10px 0 rgba(0,0,0,.5);display:none;height:444px;left:30px;margin-left:30px;margin-top:-140px;padding:10px;position:absolute;top:0;width:310px;z-index:1}div.vis-color-picker div.vis-arrow{left:5px;position:absolute;top:147px}div.vis-color-picker div.vis-arrow:after,div.vis-color-picker div.vis-arrow:before{border:solid transparent;content:" ";height:0;pointer-events:none;position:absolute;right:100%;top:50%;width:0}div.vis-color-picker div.vis-arrow:after{border-color:hsla(0,0%,100%,0) #fff hsla(0,0%,100%,0) hsla(0,0%,100%,0);border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{cursor:pointer;height:289px;position:absolute;width:289px}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(180deg,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);border:1px solid #fff;border-radius:15px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#4c4c4c",endColorstr="#131313",GradientType=0);height:15px;left:137px;position:absolute;top:137px;width:15px}div.vis-color-picker div.vis-new-color{left:159px;padding-right:2px;text-align:right}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;color:rgba(0,0,0,.4);font-size:10px;height:20px;line-height:20px;position:absolute;top:380px;vertical-align:middle;width:140px}div.vis-color-picker div.vis-initial-color{left:10px;padding-left:2px;text-align:left}div.vis-color-picker div.vis-label{left:10px;position:absolute;width:300px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{background-color:#f7f7f7;border:2px solid #d9d9d9;border-radius:10px;cursor:pointer;height:25px;line-height:25px;position:absolute;text-align:center;top:410px;vertical-align:middle;width:68px}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{height:20px;width:290px}');_e('div.vis-configuration{display:block;float:left;font-size:12px;position:relative}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;display:block;left:10px;margin-top:20px;padding-left:5px;width:495px}div.vis-configuration.vis-config-button{background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;cursor:pointer;display:block;height:25px;left:10px;line-height:25px;margin-bottom:30px;margin-top:20px;padding-left:5px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;height:25px;line-height:25px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-item.vis-config-s2{background-color:#f7f8fa;border-radius:3px;left:10px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s3{background-color:#e4e9f0;border-radius:3px;left:20px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s4{background-color:#cfd8e6;border-radius:3px;left:30px;padding-left:5px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{height:25px;line-height:25px;width:120px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{border:1px solid #444;border-radius:2px;cursor:pointer;height:19px;margin:0;padding:0;top:1px;width:30px}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{margin:0;padding:1px;pointer-events:none;position:relative;top:-5px;width:60px}input.vis-configuration.vis-config-range{-webkit-appearance:none;background-color:transparent;border:0 solid #fff;height:20px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:5px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2,#385380);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(180deg,#3876c2 0,#385380);border:1px solid #14334b;border-radius:50%;box-shadow:0 0 1px 0 #111927;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#3876c2",endColorstr="#385380",GradientType=0);height:17px;margin-top:-7px;width:17px}input.vis-configuration.vis-config-range:focus{outline:none}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(180deg,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#9d9d9d",endColorstr="#c8c8c8",GradientType=0)}input.vis-configuration.vis-config-range::-moz-range-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:10px;width:300px}input.vis-configuration.vis-config-range::-moz-range-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{background:transparent;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:300px}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{background:rgba(57,76,89,.85);border:2px solid #f2faff;border-radius:4px;color:#fff;font-size:14px;height:30px;line-height:30px;position:absolute;text-align:center;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;width:150px}.vis-configuration-popup:after,.vis-configuration-popup:before{border:solid transparent;content:" ";height:0;left:100%;pointer-events:none;position:absolute;top:50%;width:0}.vis-configuration-popup:after{border-color:rgba(136,183,213,0) rgba(136,183,213,0) rgba(136,183,213,0) rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0) rgba(194,225,245,0) rgba(194,225,245,0) #f2faff;border-width:12px;margin-top:-12px}');_e("div.vis-tooltip{background-color:#f5f4ed;border:1px solid #808074;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;box-shadow:3px 3px 10px rgba(0,0,0,.2);color:#000;font-family:verdana;font-size:14px;padding:5px;pointer-events:none;position:absolute;visibility:hidden;white-space:nowrap;z-index:5}");var Ke={exports:{}};!function(g){function t(g){if(g)return function(g){for(var A in t.prototype)g[A]=t.prototype[A];return g}(g)}g.exports=t,t.prototype.on=t.prototype.addEventListener=function(g,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(t),this},t.prototype.once=function(g,t){function A(){this.off(g,A),t.apply(this,arguments)}return A.fn=t,this.on(g,A),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(g,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var A,e=this._callbacks["$"+g];if(!e)return this;if(1==arguments.length)return delete this._callbacks["$"+g],this;for(var C=0;C=o?g?"":void 0:(e=uC(I,i))<55296||e>56319||i+1===o||(C=uC(I,i+1))<56320||C>57343?g?cC(I,i):e:g?pC(I,i,i+2):C-56320+(e-55296<<10)+65536}},vC={codeAt:fC(!1),charAt:fC(!0)},yC=O,mC=C.WeakMap,bC=yC(mC)&&/native code/.test(String(mC)),wC=et,kC=Ug("keys"),xC=function(g){return kC[g]||(kC[g]=wC(g))},EC=bC,OC=C,TC=gg,DC=uA,NC=qg,RC=Wg,PC=xC,MC=UA,BC="Object already initialized",zC=OC.TypeError,SC=OC.WeakMap;if(EC||RC.state){var ZC=RC.state||(RC.state=new SC);ZC.get=ZC.get,ZC.has=ZC.has,ZC.set=ZC.set,Je=function(g,t){if(ZC.has(g))throw new zC(BC);return t.facade=g,ZC.set(g,t),t},qe=function(g){return ZC.get(g)||{}},$e=function(g){return ZC.has(g)}}else{var FC=PC("state");MC[FC]=!0,Je=function(g,t){if(NC(g,FC))throw new zC(BC);return t.facade=g,DC(g,FC,t),t},qe=function(g){return NC(g,FC)?g[FC]:{}},$e=function(g){return NC(g,FC)}}var GC={set:Je,get:qe,has:$e,enforce:function(g){return $e(g)?qe(g):Je(g,{})},getterFor:function(g){return function(t){var A;if(!TC(t)||(A=qe(t)).type!==g)throw new zC("Incompatible receiver, "+g+" required");return A}}},jC=D,LC=qg,VC=Function.prototype,YC=jC&&Object.getOwnPropertyDescriptor,WC=LC(VC,"name"),QC={EXISTS:WC,PROPER:WC&&"something"===function(){}.name,CONFIGURABLE:WC&&(!jC||jC&&YC(VC,"name").configurable)},UC={},_C=D,KC=qt,HC=Jt,XC=AA,JC=J,qC=Ae;UC.f=_C&&!KC?Object.defineProperties:function(g,t){XC(g);for(var A,e=JC(t),C=qC(t),I=C.length,i=0;I>i;)HC.f(g,A=C[i++],e[A]);return g};var $C,gI=ig("document","documentElement"),tI=AA,AI=UC,eI=$A,CI=UA,II=gI,iI=Et,oI="prototype",nI="script",rI=xC("IE_PROTO"),sI=function(){},aI=function(g){return"<"+nI+">"+g+""},dI=function(g){g.write(aI("")),g.close();var t=g.parentWindow.Object;return g=null,t},hI=function(){try{$C=new ActiveXObject("htmlfile")}catch(g){}var g,t,A;hI="undefined"!=typeof document?document.domain&&$C?dI($C):(t=iI("iframe"),A="java"+nI+":",t.style.display="none",II.appendChild(t),t.src=String(A),(g=t.contentWindow.document).open(),g.write(aI("document.F=Object")),g.close(),g.F):dI($C);for(var e=eI.length;e--;)delete hI[oI][eI[e]];return hI()};CI[rI]=!0;var lI,cI,uI,pI=Object.create||function(g,t){var A;return null!==g?(sI[oI]=tI(g),A=new sI,sI[oI]=null,A[rI]=g):A=hI(),void 0===t?A:AI.f(A,t)},fI=!I((function(){function g(){}return g.prototype.constructor=null,Object.getPrototypeOf(new g)!==g.prototype})),vI=qg,yI=O,mI=Hg,bI=fI,wI=xC("IE_PROTO"),kI=Object,xI=kI.prototype,EI=bI?kI.getPrototypeOf:function(g){var t=mI(g);if(vI(t,wI))return t[wI];var A=t.constructor;return yI(A)&&t instanceof A?A.prototype:t instanceof kI?xI:null},OI=uA,TI=function(g,t,A,e){return e&&e.enumerable?g[t]=A:OI(g,t,A),g},DI=I,NI=O,RI=gg,PI=pI,MI=EI,BI=TI,zI=dt("iterator"),SI=!1;[].keys&&("next"in(uI=[].keys())?(cI=MI(MI(uI)))!==Object.prototype&&(lI=cI):SI=!0);var ZI=!RI(lI)||DI((function(){var g={};return lI[zI].call(g)!==g}));NI((lI=ZI?{}:PI(lI))[zI])||BI(lI,zI,(function(){return this}));var FI={IteratorPrototype:lI,BUGGY_SAFARI_ITERATORS:SI},GI=oC,jI=gC?{}.toString:function(){return"[object "+GI(this)+"]"},LI=gC,VI=Jt.f,YI=uA,WI=qg,QI=jI,UI=dt("toStringTag"),_I=function(g,t,A,e){if(g){var C=A?g:g.prototype;WI(C,UI)||VI(C,UI,{configurable:!0,value:t}),e&&!LI&&YI(C,"toString",QI)}},KI={},HI=FI.IteratorPrototype,XI=pI,JI=G,qI=_I,$I=KI,gi=function(){return this},ti=u,Ai=Rg,ei=O,Ci=String,Ii=TypeError,ii=function(g,t,A){try{return ti(Ai(Object.getOwnPropertyDescriptor(g,t)[A]))}catch(g){}},oi=AA,ni=function(g){if("object"==typeof g||ei(g))return g;throw new Ii("Can't set "+Ci(g)+" as a prototype")},ri=Object.setPrototypeOf||("__proto__"in{}?function(){var g,t=!1,A={};try{(g=ii(Object.prototype,"__proto__","set"))(A,[]),t=A instanceof Array}catch(g){}return function(A,e){return oi(A),ni(e),t?g(A,e):A.__proto__=e,A}}():void 0),si=TA,ai=P,di=QC,hi=function(g,t,A,e){var C=t+" Iterator";return g.prototype=XI(HI,{next:JI(+!e,A)}),qI(g,C,!1,!0),$I[C]=gi,g},li=EI,ci=_I,ui=TI,pi=KI,fi=FI,vi=di.PROPER,yi=fi.BUGGY_SAFARI_ITERATORS,mi=dt("iterator"),bi="keys",wi="values",ki="entries",xi=function(){return this},Ei=function(g,t,A,e,C,I,i){hi(A,t,e);var o,n,r,s=function(g){if(g===C&&c)return c;if(!yi&&g&&g in h)return h[g];switch(g){case bi:case wi:case ki:return function(){return new A(this,g)}}return function(){return new A(this)}},a=t+" Iterator",d=!1,h=g.prototype,l=h[mi]||h["@@iterator"]||C&&h[C],c=!yi&&l||s(C),u="Array"===t&&h.entries||l;if(u&&(o=li(u.call(new g)))!==Object.prototype&&o.next&&(ci(o,a,!0,!0),pi[a]=xi),vi&&C===wi&&l&&l.name!==wi&&(d=!0,c=function(){return ai(l,this)}),C)if(n={values:s(wi),keys:I?c:s(bi),entries:s(ki)},i)for(r in n)(yi||d||!(r in h))&&ui(h,r,n[r]);else si({target:t,proto:!0,forced:yi||d},n);return i&&h[mi]!==c&&ui(h,mi,c,{name:C}),pi[t]=c,n},Oi=function(g,t){return{value:g,done:t}},Ti=vC.charAt,Di=sC,Ni=GC,Ri=Ei,Pi=Oi,Mi="String Iterator",Bi=Ni.set,zi=Ni.getterFor(Mi);Ri(String,"String",(function(g){Bi(this,{type:Mi,string:Di(g),index:0})}),(function(){var g,t=zi(this),A=t.string,e=t.index;return e>=A.length?Pi(void 0,!0):(g=Ti(A,e),t.index+=g.length,Pi(g,!1))}));var Si=P,Zi=AA,Fi=Bg,Gi=function(g,t,A){var e,C;Zi(g);try{if(!(e=Fi(g,"return"))){if("throw"===t)throw A;return A}e=Si(e,g)}catch(g){C=!0,e=g}if("throw"===t)throw A;if(C)throw e;return Zi(e),A},ji=AA,Li=Gi,Vi=KI,Yi=dt("iterator"),Wi=Array.prototype,Qi=function(g){return void 0!==g&&(Vi.Array===g||Wi[Yi]===g)},Ui=O,_i=Wg,Ki=u(Function.toString);Ui(_i.inspectSource)||(_i.inspectSource=function(g){return Ki(g)});var Hi=_i.inspectSource,Xi=u,Ji=I,qi=O,$i=oC,go=Hi,to=function(){},Ao=[],eo=ig("Reflect","construct"),Co=/^\s*(?:class|function)\b/,Io=Xi(Co.exec),io=!Co.test(to),oo=function(g){if(!qi(g))return!1;try{return eo(to,Ao,g),!0}catch(g){return!1}},no=function(g){if(!qi(g))return!1;switch($i(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return io||!!Io(Co,go(g))}catch(g){return!0}};no.sham=!0;var ro=!eo||Ji((function(){var g;return oo(oo.call)||!oo(Object)||!oo((function(){g=!0}))||g}))?no:oo,so=bt,ao=Jt,ho=G,lo=function(g,t,A){var e=so(t);e in g?ao.f(g,e,ho(0,A)):g[e]=A},co=oC,uo=Bg,po=Q,fo=KI,vo=dt("iterator"),yo=function(g){if(!po(g))return uo(g,vo)||uo(g,"@@iterator")||fo[co(g)]},mo=P,bo=Rg,wo=AA,ko=Og,xo=yo,Eo=TypeError,Oo=function(g,t){var A=arguments.length<2?xo(g):t;if(bo(A))return wo(mo(A,g));throw new Eo(ko(g)+" is not iterable")},To=Xt,Do=P,No=Hg,Ro=function(g,t,A,e){try{return e?t(ji(A)[0],A[1]):t(A)}catch(t){Li(g,"throw",t)}},Po=Qi,Mo=ro,Bo=jA,zo=lo,So=Oo,Zo=yo,Fo=Array,Go=dt("iterator"),jo=!1;try{var Lo=0,Vo={next:function(){return{done:!!Lo++}},return:function(){jo=!0}};Vo[Go]=function(){return this},Array.from(Vo,(function(){throw 2}))}catch(g){}var Yo=function(g,t){try{if(!t&&!jo)return!1}catch(g){return!1}var A=!1;try{var e={};e[Go]=function(){return{next:function(){return{done:A=!0}}}},g(e)}catch(g){}return A},Wo=function(g){var t=No(g),A=Mo(this),e=arguments.length,C=e>1?arguments[1]:void 0,I=void 0!==C;I&&(C=To(C,e>2?arguments[2]:void 0));var i,o,n,r,s,a,d=Zo(t),h=0;if(!d||this===Fo&&Po(d))for(i=Bo(t),o=A?new this(i):Fo(i);i>h;h++)a=I?C(t[h],h):t[h],zo(o,h,a);else for(s=(r=So(t,d)).next,o=A?new this:[];!(n=Do(s,r)).done;h++)a=I?Ro(r,C,[n.value,h],!0):n.value,zo(o,h,a);return o.length=h,o};TA({target:"Array",stat:!0,forced:!Yo((function(g){Array.from(g)}))},{from:Wo});var Qo=tg.Array.from,Uo=A(Qo),_o=J,Ko=KI,Ho=GC;Jt.f;var Xo=Ei,Jo=Oi,qo="Array Iterator",$o=Ho.set,gn=Ho.getterFor(qo);Xo(Array,"Array",(function(g,t){$o(this,{type:qo,target:_o(g),index:0,kind:t})}),(function(){var g=gn(this),t=g.target,A=g.kind,e=g.index++;if(!t||e>=t.length)return g.target=void 0,Jo(void 0,!0);switch(A){case"keys":return Jo(e,!1);case"values":return Jo(t[e],!1)}return Jo([e,t[e]],!1)}),"values"),Ko.Arguments=Ko.Array;var tn=yo,An={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},en=C,Cn=oC,In=uA,on=KI,nn=dt("toStringTag");for(var rn in An){var sn=en[rn],an=sn&&sn.prototype;an&&Cn(an)!==nn&&In(an,nn,rn),on[rn]=on.Array}var dn=tn,hn=A(dn),ln=A(dn);function cn(g,t){if(!(g instanceof t))throw new TypeError("Cannot call a class as a function")}var un={exports:{}},pn=TA,fn=D,vn=Jt.f;pn({target:"Object",stat:!0,forced:Object.defineProperty!==vn,sham:!fn},{defineProperty:vn});var yn=tg.Object,mn=un.exports=function(g,t,A){return yn.defineProperty(g,t,A)};yn.defineProperty.sham&&(mn.sham=!0);var bn=un.exports,wn=bn,kn=A(wn),xn=y,En=Array.isArray||function(g){return"Array"===xn(g)},On=TypeError,Tn=function(g){if(g>9007199254740991)throw On("Maximum allowed index exceeded");return g},Dn=En,Nn=ro,Rn=gg,Pn=dt("species"),Mn=Array,Bn=function(g){var t;return Dn(g)&&(t=g.constructor,(Nn(t)&&(t===Mn||Dn(t.prototype))||Rn(t)&&null===(t=t[Pn]))&&(t=void 0)),void 0===t?Mn:t},zn=function(g,t){return new(Bn(g))(0===t?0:t)},Sn=I,Zn=cg,Fn=dt("species"),Gn=function(g){return Zn>=51||!Sn((function(){var t=[];return(t.constructor={})[Fn]=function(){return{foo:1}},1!==t[g](Boolean).foo}))},jn=TA,Ln=I,Vn=En,Yn=gg,Wn=Hg,Qn=jA,Un=Tn,_n=lo,Kn=zn,Hn=Gn,Xn=cg,Jn=dt("isConcatSpreadable"),qn=Xn>=51||!Ln((function(){var g=[];return g[Jn]=!1,g.concat()[0]!==g})),$n=function(g){if(!Yn(g))return!1;var t=g[Jn];return void 0!==t?!!t:Vn(g)};jn({target:"Array",proto:!0,arity:1,forced:!qn||!Hn("concat")},{concat:function(g){var t,A,e,C,I,i=Wn(this),o=Kn(i,0),n=0;for(t=-1,e=arguments.length;tf;f++)if((o||f in c)&&(h=u(d=c[f],f,l),g))if(t)y[f]=h;else if(h)switch(g){case 3:return!0;case 5:return d;case 6:return f;case 2:Br(y,d)}else switch(g){case 4:return!1;case 7:Br(y,d)}return I?-1:e||C?C:y}},Sr={forEach:zr(0),map:zr(1),filter:zr(2),some:zr(3),every:zr(4),find:zr(5),findIndex:zr(6),filterReject:zr(7)},Zr=TA,Fr=C,Gr=P,jr=u,Lr=D,Vr=vg,Yr=I,Wr=qg,Qr=og,Ur=AA,_r=J,Kr=bt,Hr=sC,Xr=G,Jr=pI,qr=Ae,$r=gr,gs=er,ts=ee,As=T,es=Jt,Cs=UC,Is=M,is=TI,os=ur,ns=Ug,rs=UA,ss=et,as=dt,ds=pr,hs=wr,ls=Tr,cs=_I,us=GC,ps=Sr.forEach,fs=xC("hidden"),vs="Symbol",ys="prototype",ms=us.set,bs=us.getterFor(vs),ws=Object[ys],ks=Fr.Symbol,xs=ks&&ks[ys],Es=Fr.RangeError,Os=Fr.TypeError,Ts=Fr.QObject,Ds=As.f,Ns=es.f,Rs=gs.f,Ps=Is.f,Ms=jr([].push),Bs=ns("symbols"),zs=ns("op-symbols"),Ss=ns("wks"),Zs=!Ts||!Ts[ys]||!Ts[ys].findChild,Fs=function(g,t,A){var e=Ds(ws,t);e&&delete ws[t],Ns(g,t,A),e&&g!==ws&&Ns(ws,t,e)},Gs=Lr&&Yr((function(){return 7!==Jr(Ns({},"a",{get:function(){return Ns(this,"a",{value:7}).a}})).a}))?Fs:Ns,js=function(g,t){var A=Bs[g]=Jr(xs);return ms(A,{type:vs,tag:g,description:t}),Lr||(A.description=t),A},Ls=function(g,t,A){g===ws&&Ls(zs,t,A),Ur(g);var e=Kr(t);return Ur(A),Wr(Bs,e)?(A.enumerable?(Wr(g,fs)&&g[fs][e]&&(g[fs][e]=!1),A=Jr(A,{enumerable:Xr(0,!1)})):(Wr(g,fs)||Ns(g,fs,Xr(1,{})),g[fs][e]=!0),Gs(g,e,A)):Ns(g,e,A)},Vs=function(g,t){Ur(g);var A=_r(t),e=qr(A).concat(Us(A));return ps(e,(function(t){Lr&&!Gr(Ys,A,t)||Ls(g,t,A[t])})),g},Ys=function(g){var t=Kr(g),A=Gr(Ps,this,t);return!(this===ws&&Wr(Bs,t)&&!Wr(zs,t))&&(!(A||!Wr(this,t)||!Wr(Bs,t)||Wr(this,fs)&&this[fs][t])||A)},Ws=function(g,t){var A=_r(g),e=Kr(t);if(A!==ws||!Wr(Bs,e)||Wr(zs,e)){var C=Ds(A,e);return!C||!Wr(Bs,e)||Wr(A,fs)&&A[fs][e]||(C.enumerable=!0),C}},Qs=function(g){var t=Rs(_r(g)),A=[];return ps(t,(function(g){Wr(Bs,g)||Wr(rs,g)||Ms(A,g)})),A},Us=function(g){var t=g===ws,A=Rs(t?zs:_r(g)),e=[];return ps(A,(function(g){!Wr(Bs,g)||t&&!Wr(ws,g)||Ms(e,Bs[g])})),e};Vr||(ks=function(){if(Qr(xs,this))throw new Os("Symbol is not a constructor");var g=arguments.length&&void 0!==arguments[0]?Hr(arguments[0]):void 0,t=ss(g),A=function(g){this===ws&&Gr(A,zs,g),Wr(this,fs)&&Wr(this[fs],t)&&(this[fs][t]=!1);var e=Xr(1,g);try{Gs(this,t,e)}catch(g){if(!(g instanceof Es))throw g;Fs(this,t,e)}};return Lr&&Zs&&Gs(ws,t,{configurable:!0,set:A}),js(t,g)},is(xs=ks[ys],"toString",(function(){return bs(this).tag})),is(ks,"withoutSetter",(function(g){return js(ss(g),g)})),Is.f=Ys,es.f=Ls,Cs.f=Vs,As.f=Ws,$r.f=gs.f=Qs,ts.f=Us,ds.f=function(g){return js(as(g),g)},Lr&&os(xs,"description",{configurable:!0,get:function(){return bs(this).description}})),Zr({global:!0,constructor:!0,wrap:!0,forced:!Vr,sham:!Vr},{Symbol:ks}),ps(qr(Ss),(function(g){hs(g)})),Zr({target:vs,stat:!0,forced:!Vr},{useSetter:function(){Zs=!0},useSimple:function(){Zs=!1}}),Zr({target:"Object",stat:!0,forced:!Vr,sham:!Lr},{create:function(g,t){return void 0===t?Jr(g):Vs(Jr(g),t)},defineProperty:Ls,defineProperties:Vs,getOwnPropertyDescriptor:Ws}),Zr({target:"Object",stat:!0,forced:!Vr},{getOwnPropertyNames:Qs}),ls(),cs(ks,vs),rs[fs]=!0;var _s=vg&&!!Symbol.for&&!!Symbol.keyFor,Ks=TA,Hs=ig,Xs=qg,Js=sC,qs=Ug,$s=_s,ga=qs("string-to-symbol-registry"),ta=qs("symbol-to-string-registry");Ks({target:"Symbol",stat:!0,forced:!$s},{for:function(g){var t=Js(g);if(Xs(ga,t))return ga[t];var A=Hs("Symbol")(t);return ga[t]=A,ta[A]=t,A}});var Aa=TA,ea=qg,Ca=xg,Ia=Og,ia=_s,oa=Ug("symbol-to-string-registry");Aa({target:"Symbol",stat:!0,forced:!ia},{keyFor:function(g){if(!Ca(g))throw new TypeError(Ia(g)+" is not a symbol");if(ea(oa,g))return oa[g]}});var na=En,ra=O,sa=y,aa=sC,da=u([].push),ha=TA,la=ig,ca=a,ua=P,pa=u,fa=I,va=O,ya=xg,ma=ve,ba=function(g){if(ra(g))return g;if(na(g)){for(var t=g.length,A=[],e=0;eg.length)&&(t=g.length);for(var A=0,e=new Array(t);A1?arguments[1]:void 0)}});var Mh=Me("Array").map,Bh=og,zh=Mh,Sh=Array.prototype,Zh=function(g){var t=g.map;return g===Sh||Bh(Sh,g)&&t===Sh.map?zh:t},Fh=A(Zh),Gh=Hg,jh=Ae;TA({target:"Object",stat:!0,forced:I((function(){jh(1)}))},{keys:function(g){return jh(Gh(g))}});var Lh=A(tg.Object.keys),Vh=TA,Yh=Date,Wh=u(Yh.prototype.getTime);Vh({target:"Date",stat:!0},{now:function(){return Wh(new Yh)}});var Qh=A(tg.Date.now),Uh=I,_h=function(g,t){var A=[][g];return!!A&&Uh((function(){A.call(null,t||function(){return 1},1)}))},Kh=Sr.forEach,Hh=_h("forEach")?[].forEach:function(g){return Kh(this,g,arguments.length>1?arguments[1]:void 0)};TA({target:"Array",proto:!0,forced:[].forEach!==Hh},{forEach:Hh});var Xh=Me("Array").forEach,Jh=oC,qh=qg,$h=og,gl=Xh,tl=Array.prototype,Al={DOMTokenList:!0,NodeList:!0},el=function(g){var t=g.forEach;return g===tl||$h(tl,g)&&t===tl.forEach||qh(Al,Jh(g))?gl:t},Cl=A(el),Il=TA,il=En,ol=u([].reverse),nl=[1,2];Il({target:"Array",proto:!0,forced:String(nl)===String(nl.reverse())},{reverse:function(){return il(this)&&(this.length=this.length),ol(this)}});var rl=Me("Array").reverse,sl=og,al=rl,dl=Array.prototype,hl=function(g){var t=g.reverse;return g===dl||sl(dl,g)&&t===dl.reverse?al:t},ll=hl,cl=A(ll),ul=Og,pl=TypeError,fl=function(g,t){if(!delete g[t])throw new pl("Cannot delete property "+ul(t)+" of "+ul(g))},vl=TA,yl=Hg,ml=SA,bl=PA,wl=jA,kl=Rd,xl=Tn,El=zn,Ol=lo,Tl=fl,Dl=Gn("splice"),Nl=Math.max,Rl=Math.min;vl({target:"Array",proto:!0,forced:!Dl},{splice:function(g,t){var A,e,C,I,i,o,n=yl(this),r=wl(n),s=ml(g,r),a=arguments.length;for(0===a?A=e=0:1===a?(A=0,e=r-s):(A=a-2,e=Rl(Nl(bl(t),0),r-s)),xl(r+A-e),C=El(n,e),I=0;Ir-e+A;I--)Tl(n,I-1)}else if(A>e)for(I=r-e;I>s;I--)o=I+A-1,(i=I+e-1)in n?n[o]=n[i]:Tl(n,o);for(I=0;I1?arguments[1]:void 0)}});var Gl=Me("Array").includes,jl=gg,Ll=y,Vl=dt("match"),Yl=function(g){var t;return jl(g)&&(void 0!==(t=g[Vl])?!!t:"RegExp"===Ll(g))},Wl=TypeError,Ql=dt("match"),Ul=TA,_l=function(g){if(Yl(g))throw new Wl("The method doesn't accept regular expressions");return g},Kl=K,Hl=sC,Xl=function(g){var t=/./;try{"/./"[g](t)}catch(A){try{return t[Ql]=!1,"/./"[g](t)}catch(g){}}return!1},Jl=u("".indexOf);Ul({target:"String",proto:!0,forced:!Xl("includes")},{includes:function(g){return!!~Jl(Hl(Kl(this)),Hl(_l(g)),arguments.length>1?arguments[1]:void 0)}});var ql=Me("String").includes,$l=og,gc=Gl,tc=ql,Ac=Array.prototype,ec=String.prototype,Cc=function(g){var t=g.includes;return g===Ac||$l(Ac,g)&&t===Ac.includes?gc:"string"==typeof g||g===ec||$l(ec,g)&&t===ec.includes?tc:t},Ic=A(Cc),ic=Hg,oc=EI,nc=fI;TA({target:"Object",stat:!0,forced:I((function(){oc(1)})),sham:!nc},{getPrototypeOf:function(g){return oc(ic(g))}});var rc=tg.Object.getPrototypeOf,sc=A(rc),ac=Sr.filter;TA({target:"Array",proto:!0,forced:!Gn("filter")},{filter:function(g){return ac(this,g,arguments.length>1?arguments[1]:void 0)}});var dc=Me("Array").filter,hc=og,lc=dc,cc=Array.prototype,uc=function(g){var t=g.filter;return g===cc||hc(cc,g)&&t===cc.filter?lc:t},pc=A(uc),fc="\t\n\v\f\r                 \u2028\u2029\ufeff",vc=K,yc=sC,mc=fc,bc=u("".replace),wc=RegExp("^["+mc+"]+"),kc=RegExp("(^|[^"+mc+"])["+mc+"]+$"),xc=function(g){return function(t){var A=yc(vc(t));return 1&g&&(A=bc(A,wc,"")),2&g&&(A=bc(A,kc,"$1")),A}},Ec={start:xc(1),end:xc(2),trim:xc(3)},Oc=C,Tc=I,Dc=u,Nc=sC,Rc=Ec.trim,Pc=fc,Mc=Oc.parseInt,Bc=Oc.Symbol,zc=Bc&&Bc.iterator,Sc=/^[+-]?0x/i,Zc=Dc(Sc.exec),Fc=8!==Mc(Pc+"08")||22!==Mc(Pc+"0x16")||zc&&!Tc((function(){Mc(Object(zc))}))?function(g,t){var A=Rc(Nc(g));return Mc(A,t>>>0||(Zc(Sc,A)?16:10))}:Mc;TA({global:!0,forced:parseInt!==Fc},{parseInt:Fc});var Gc=A(tg.parseInt),jc=TA,Lc=QA.indexOf,Vc=_h,Yc=w([].indexOf),Wc=!!Yc&&1/Yc([1],1,-0)<0;jc({target:"Array",proto:!0,forced:Wc||!Vc("indexOf")},{indexOf:function(g){var t=arguments.length>1?arguments[1]:void 0;return Wc?Yc(this,g,t)||0:Lc(this,g,t)}});var Qc=Me("Array").indexOf,Uc=og,_c=Qc,Kc=Array.prototype,Hc=function(g){var t=g.indexOf;return g===Kc||Uc(Kc,g)&&t===Kc.indexOf?_c:t},Xc=A(Hc);TA({target:"Object",stat:!0,sham:!D},{create:pI});var Jc=tg.Object,qc=function(g,t){return Jc.create(g,t)},$c=A(qc),gu=tg,tu=a;gu.JSON||(gu.JSON={stringify:JSON.stringify});var Au=function(g,t,A){return tu(gu.JSON.stringify,null,arguments)},eu=A(Au),Cu="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Iu=TypeError,iu=function(g,t){if(gA,i=ru(e)?e:lu(e),o=I?du(arguments,A):[],n=I?function(){nu(i,this,o)}:i;return t?g(n,C):g(n)}:g},pu=TA,fu=C,vu=uu(fu.setInterval,!0);pu({global:!0,bind:!0,forced:fu.setInterval!==vu},{setInterval:vu});var yu=TA,mu=C,bu=uu(mu.setTimeout,!0);yu({global:!0,bind:!0,forced:mu.setTimeout!==bu},{setTimeout:bu});var wu=A(tg.setTimeout),ku=Hg,xu=SA,Eu=jA,Ou=function(g){for(var t=ku(this),A=Eu(t),e=arguments.length,C=xu(e>1?arguments[1]:void 0,A),I=e>2?arguments[2]:void 0,i=void 0===I?A:xu(I,A);i>C;)t[C++]=g;return t};TA({target:"Array",proto:!0},{fill:Ou});var Tu,Du=Me("Array").fill,Nu=og,Ru=Du,Pu=Array.prototype,Mu=function(g){var t=g.fill;return g===Pu||Nu(Pu,g)&&t===Pu.fill?Ru:t},Bu=A(Mu); +!function(g,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((g="undefined"!=typeof globalThis?globalThis:g||self).vis=g.vis||{})}(this,(function(g){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var e=function(g){return g&&g.Math===Math&&g},C=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||t||Function("return this")(),I=function(g){try{return!!g()}catch(g){return!0}},i=!I((function(){var g=function(){}.bind();return"function"!=typeof g||g.hasOwnProperty("prototype")})),o=i,n=Function.prototype,r=n.apply,s=n.call,a="object"==typeof Reflect&&Reflect.apply||(o?s.bind(r):function(){return s.apply(r,arguments)}),d=i,h=Function.prototype,l=h.call,c=d&&h.bind.bind(l,l),u=d?c:function(g){return function(){return l.apply(g,arguments)}},p=u,f=p({}.toString),v=p("".slice),y=function(g){return v(f(g),8,-1)},m=y,b=u,w=function(g){if("Function"===m(g))return b(g)},k="object"==typeof document&&document.all,x={all:k,IS_HTMLDDA:void 0===k&&void 0!==k},E=x.all,O=x.IS_HTMLDDA?function(g){return"function"==typeof g||g===E}:function(g){return"function"==typeof g},T={},D=!I((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),N=i,R=Function.prototype.call,P=N?R.bind(R):function(){return R.apply(R,arguments)},M={},B={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,S=z&&!B.call({1:2},1);M.f=S?function(g){var t=z(this,g);return!!t&&t.enumerable}:B;var Z,F,G=function(g,t){return{enumerable:!(1&g),configurable:!(2&g),writable:!(4&g),value:t}},j=I,L=y,V=Object,Y=u("".split),W=j((function(){return!V("z").propertyIsEnumerable(0)}))?function(g){return"String"===L(g)?Y(g,""):V(g)}:V,Q=function(g){return null==g},U=Q,_=TypeError,K=function(g){if(U(g))throw new _("Can't call method on "+g);return g},H=W,X=K,J=function(g){return H(X(g))},q=O,$=x.all,gg=x.IS_HTMLDDA?function(g){return"object"==typeof g?null!==g:q(g)||g===$}:function(g){return"object"==typeof g?null!==g:q(g)},tg={},Ag=tg,eg=C,Cg=O,Ig=function(g){return Cg(g)?g:void 0},ig=function(g,t){return arguments.length<2?Ig(Ag[g])||Ig(eg[g]):Ag[g]&&Ag[g][t]||eg[g]&&eg[g][t]},og=u({}.isPrototypeOf),ng="undefined"!=typeof navigator&&String(navigator.userAgent)||"",rg=C,sg=ng,ag=rg.process,dg=rg.Deno,hg=ag&&ag.versions||dg&&dg.version,lg=hg&&hg.v8;lg&&(F=(Z=lg.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!F&&sg&&(!(Z=sg.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=sg.match(/Chrome\/(\d+)/))&&(F=+Z[1]);var cg=F,ug=cg,pg=I,fg=C.String,vg=!!Object.getOwnPropertySymbols&&!pg((function(){var g=Symbol("symbol detection");return!fg(g)||!(Object(g)instanceof Symbol)||!Symbol.sham&&ug&&ug<41})),yg=vg&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,mg=ig,bg=O,wg=og,kg=Object,xg=yg?function(g){return"symbol"==typeof g}:function(g){var t=mg("Symbol");return bg(t)&&wg(t.prototype,kg(g))},Eg=String,Og=function(g){try{return Eg(g)}catch(g){return"Object"}},Tg=O,Dg=Og,Ng=TypeError,Rg=function(g){if(Tg(g))return g;throw new Ng(Dg(g)+" is not a function")},Pg=Rg,Mg=Q,Bg=function(g,t){var A=g[t];return Mg(A)?void 0:Pg(A)},zg=P,Sg=O,Zg=gg,Fg=TypeError,Gg={exports:{}},jg=C,Lg=Object.defineProperty,Vg=function(g,t){try{Lg(jg,g,{value:t,configurable:!0,writable:!0})}catch(A){jg[g]=t}return t},Yg="__core-js_shared__",Wg=C[Yg]||Vg(Yg,{}),Qg=Wg;(Gg.exports=function(g,t){return Qg[g]||(Qg[g]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ug=Gg.exports,_g=K,Kg=Object,Hg=function(g){return Kg(_g(g))},Xg=Hg,Jg=u({}.hasOwnProperty),qg=Object.hasOwn||function(g,t){return Jg(Xg(g),t)},$g=u,gt=0,tt=Math.random(),At=$g((1.).toString),et=function(g){return"Symbol("+(void 0===g?"":g)+")_"+At(++gt+tt,36)},Ct=Ug,It=qg,it=et,ot=vg,nt=yg,rt=C.Symbol,st=Ct("wks"),at=nt?rt.for||rt:rt&&rt.withoutSetter||it,dt=function(g){return It(st,g)||(st[g]=ot&&It(rt,g)?rt[g]:at("Symbol."+g)),st[g]},ht=P,lt=gg,ct=xg,ut=Bg,pt=function(g,t){var A,e;if("string"===t&&Sg(A=g.toString)&&!Zg(e=zg(A,g)))return e;if(Sg(A=g.valueOf)&&!Zg(e=zg(A,g)))return e;if("string"!==t&&Sg(A=g.toString)&&!Zg(e=zg(A,g)))return e;throw new Fg("Can't convert object to primitive value")},ft=TypeError,vt=dt("toPrimitive"),yt=function(g,t){if(!lt(g)||ct(g))return g;var A,e=ut(g,vt);if(e){if(void 0===t&&(t="default"),A=ht(e,g,t),!lt(A)||ct(A))return A;throw new ft("Can't convert object to primitive value")}return void 0===t&&(t="number"),pt(g,t)},mt=xg,bt=function(g){var t=yt(g,"string");return mt(t)?t:t+""},wt=gg,kt=C.document,xt=wt(kt)&&wt(kt.createElement),Et=function(g){return xt?kt.createElement(g):{}},Ot=Et,Tt=!D&&!I((function(){return 7!==Object.defineProperty(Ot("div"),"a",{get:function(){return 7}}).a})),Dt=D,Nt=P,Rt=M,Pt=G,Mt=J,Bt=bt,zt=qg,St=Tt,Zt=Object.getOwnPropertyDescriptor;T.f=Dt?Zt:function(g,t){if(g=Mt(g),t=Bt(t),St)try{return Zt(g,t)}catch(g){}if(zt(g,t))return Pt(!Nt(Rt.f,g,t),g[t])};var Ft=I,Gt=O,jt=/#|\.prototype\./,Lt=function(g,t){var A=Yt[Vt(g)];return A===Qt||A!==Wt&&(Gt(t)?Ft(t):!!t)},Vt=Lt.normalize=function(g){return String(g).replace(jt,".").toLowerCase()},Yt=Lt.data={},Wt=Lt.NATIVE="N",Qt=Lt.POLYFILL="P",Ut=Lt,_t=Rg,Kt=i,Ht=w(w.bind),Xt=function(g,t){return _t(g),void 0===t?g:Kt?Ht(g,t):function(){return g.apply(t,arguments)}},Jt={},qt=D&&I((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$t=gg,gA=String,tA=TypeError,AA=function(g){if($t(g))return g;throw new tA(gA(g)+" is not an object")},eA=D,CA=Tt,IA=qt,iA=AA,oA=bt,nA=TypeError,rA=Object.defineProperty,sA=Object.getOwnPropertyDescriptor,aA="enumerable",dA="configurable",hA="writable";Jt.f=eA?IA?function(g,t,A){if(iA(g),t=oA(t),iA(A),"function"==typeof g&&"prototype"===t&&"value"in A&&hA in A&&!A[hA]){var e=sA(g,t);e&&e[hA]&&(g[t]=A.value,A={configurable:dA in A?A[dA]:e[dA],enumerable:aA in A?A[aA]:e[aA],writable:!1})}return rA(g,t,A)}:rA:function(g,t,A){if(iA(g),t=oA(t),iA(A),CA)try{return rA(g,t,A)}catch(g){}if("get"in A||"set"in A)throw new nA("Accessors not supported");return"value"in A&&(g[t]=A.value),g};var lA=Jt,cA=G,uA=D?function(g,t,A){return lA.f(g,t,cA(1,A))}:function(g,t,A){return g[t]=A,g},pA=C,fA=a,vA=w,yA=O,mA=T.f,bA=Ut,wA=tg,kA=Xt,xA=uA,EA=qg,OA=function(g){var t=function(A,e,C){if(this instanceof t){switch(arguments.length){case 0:return new g;case 1:return new g(A);case 2:return new g(A,e)}return new g(A,e,C)}return fA(g,this,arguments)};return t.prototype=g.prototype,t},TA=function(g,t){var A,e,C,I,i,o,n,r,s,a=g.target,d=g.global,h=g.stat,l=g.proto,c=d?pA:h?pA[a]:(pA[a]||{}).prototype,u=d?wA:wA[a]||xA(wA,a,{})[a],p=u.prototype;for(I in t)e=!(A=bA(d?I:a+(h?".":"#")+I,g.forced))&&c&&EA(c,I),o=u[I],e&&(n=g.dontCallGetSet?(s=mA(c,I))&&s.value:c[I]),i=e&&n?n:t[I],e&&typeof o==typeof i||(r=g.bind&&e?kA(i,pA):g.wrap&&e?OA(i):l&&yA(i)?vA(i):i,(g.sham||i&&i.sham||o&&o.sham)&&xA(r,"sham",!0),xA(u,I,r),l&&(EA(wA,C=a+"Prototype")||xA(wA,C,{}),xA(wA[C],I,i),g.real&&p&&(A||!p[I])&&xA(p,I,i)))},DA=Math.ceil,NA=Math.floor,RA=Math.trunc||function(g){var t=+g;return(t>0?NA:DA)(t)},PA=function(g){var t=+g;return t!=t||0===t?0:RA(t)},MA=PA,BA=Math.max,zA=Math.min,SA=function(g,t){var A=MA(g);return A<0?BA(A+t,0):zA(A,t)},ZA=PA,FA=Math.min,GA=function(g){return g>0?FA(ZA(g),9007199254740991):0},jA=function(g){return GA(g.length)},LA=J,VA=SA,YA=jA,WA=function(g){return function(t,A,e){var C,I=LA(t),i=YA(I),o=VA(e,i);if(g&&A!=A){for(;i>o;)if((C=I[o++])!=C)return!0}else for(;i>o;o++)if((g||o in I)&&I[o]===A)return g||o||0;return!g&&-1}},QA={includes:WA(!0),indexOf:WA(!1)},UA={},_A=qg,KA=J,HA=QA.indexOf,XA=UA,JA=u([].push),qA=function(g,t){var A,e=KA(g),C=0,I=[];for(A in e)!_A(XA,A)&&_A(e,A)&&JA(I,A);for(;t.length>C;)_A(e,A=t[C++])&&(~HA(I,A)||JA(I,A));return I},$A=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=qA,te=$A,Ae=Object.keys||function(g){return ge(g,te)},ee={};ee.f=Object.getOwnPropertySymbols;var Ce=D,Ie=u,ie=P,oe=I,ne=Ae,re=ee,se=M,ae=Hg,de=W,he=Object.assign,le=Object.defineProperty,ce=Ie([].concat),ue=!he||oe((function(){if(Ce&&1!==he({b:1},he(le({},"a",{enumerable:!0,get:function(){le(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var g={},t={},A=Symbol("assign detection"),e="abcdefghijklmnopqrst";return g[A]=7,e.split("").forEach((function(g){t[g]=g})),7!==he({},g)[A]||ne(he({},t)).join("")!==e}))?function(g,t){for(var A=ae(g),e=arguments.length,C=1,I=re.f,i=se.f;e>C;)for(var o,n=de(arguments[C++]),r=I?ce(ne(n),I(n)):ne(n),s=r.length,a=0;s>a;)o=r[a++],Ce&&!ie(i,n,o)||(A[o]=n[o]);return A}:he,pe=ue;TA({target:"Object",stat:!0,arity:2,forced:Object.assign!==pe},{assign:pe});var fe=A(tg.Object.assign),ve=u([].slice),ye=u,me=Rg,be=gg,we=qg,ke=ve,xe=i,Ee=Function,Oe=ye([].concat),Te=ye([].join),De={},Ne=xe?Ee.bind:function(g){var t=me(this),A=t.prototype,e=ke(arguments,1),C=function(){var A=Oe(e,ke(arguments));return this instanceof C?function(g,t,A){if(!we(De,t)){for(var e=[],C=0;C=.1;)(l=+I[a++%i])>s&&(l=s),h=Math.sqrt(l*l/(1+r*r)),t+=h=o<0?-h:h,A+=r*h,!0===d?g.lineTo(t,A):g.moveTo(t,A),s-=l,d=!d}var Ue={circle:Le,dashedLine:Qe,database:We,diamond:function(g,t,A,e){g.beginPath(),g.lineTo(t,A+e),g.lineTo(t+e,A),g.lineTo(t,A-e),g.lineTo(t-e,A),g.closePath()},ellipse:Ye,ellipse_vis:Ye,hexagon:function(g,t,A,e){g.beginPath();var C=2*Math.PI/6;g.moveTo(t+e,A);for(var I=1;I<6;I++)g.lineTo(t+e*Math.cos(C*I),A+e*Math.sin(C*I));g.closePath()},roundRect:Ve,square:function(g,t,A,e){g.beginPath(),g.rect(t-e,A-e,2*e,2*e),g.closePath()},star:function(g,t,A,e){g.beginPath(),A+=.1*(e*=.82);for(var C=0;C<10;C++){var I=C%2==0?1.3*e:.5*e;g.lineTo(t+I*Math.sin(2*C*Math.PI/10),A-I*Math.cos(2*C*Math.PI/10))}g.closePath()},triangle:function(g,t,A,e){g.beginPath(),A+=.275*(e*=1.15);var C=2*e,I=C/2,i=Math.sqrt(3)/6*C,o=Math.sqrt(C*C-I*I);g.moveTo(t,A-(o-i)),g.lineTo(t+I,A+i),g.lineTo(t-I,A+i),g.lineTo(t,A-(o-i)),g.closePath()},triangleDown:function(g,t,A,e){g.beginPath(),A-=.275*(e*=1.15);var C=2*e,I=C/2,i=Math.sqrt(3)/6*C,o=Math.sqrt(C*C-I*I);g.moveTo(t,A+(o-i)),g.lineTo(t+I,A-i),g.lineTo(t-I,A-i),g.lineTo(t,A+(o-i)),g.closePath()}};function _e(g,t){void 0===t&&(t={});var A=t.insertAt;if(g&&"undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css","top"===A&&e.firstChild?e.insertBefore(C,e.firstChild):e.appendChild(C),C.styleSheet?C.styleSheet.cssText=g:C.appendChild(document.createTextNode(g))}}_e(".vis-overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}");_e(".vis [class*=span]{min-height:0;width:auto}");_e('div.vis-color-picker{background-color:#fff;border-radius:15px;box-shadow:0 0 10px 0 rgba(0,0,0,.5);display:none;height:444px;left:30px;margin-left:30px;margin-top:-140px;padding:10px;position:absolute;top:0;width:310px;z-index:1}div.vis-color-picker div.vis-arrow{left:5px;position:absolute;top:147px}div.vis-color-picker div.vis-arrow:after,div.vis-color-picker div.vis-arrow:before{border:solid transparent;content:" ";height:0;pointer-events:none;position:absolute;right:100%;top:50%;width:0}div.vis-color-picker div.vis-arrow:after{border-color:hsla(0,0%,100%,0) #fff hsla(0,0%,100%,0) hsla(0,0%,100%,0);border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{cursor:pointer;height:289px;position:absolute;width:289px}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(180deg,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);border:1px solid #fff;border-radius:15px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#4c4c4c",endColorstr="#131313",GradientType=0);height:15px;left:137px;position:absolute;top:137px;width:15px}div.vis-color-picker div.vis-new-color{left:159px;padding-right:2px;text-align:right}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;color:rgba(0,0,0,.4);font-size:10px;height:20px;line-height:20px;position:absolute;top:380px;vertical-align:middle;width:140px}div.vis-color-picker div.vis-initial-color{left:10px;padding-left:2px;text-align:left}div.vis-color-picker div.vis-label{left:10px;position:absolute;width:300px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{background-color:#f7f7f7;border:2px solid #d9d9d9;border-radius:10px;cursor:pointer;height:25px;line-height:25px;position:absolute;text-align:center;top:410px;vertical-align:middle;width:68px}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{height:20px;width:290px}');_e('div.vis-configuration{display:block;float:left;font-size:12px;position:relative}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;display:block;left:10px;margin-top:20px;padding-left:5px;width:495px}div.vis-configuration.vis-config-button{background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;cursor:pointer;display:block;height:25px;left:10px;line-height:25px;margin-bottom:30px;margin-top:20px;padding-left:5px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;height:25px;line-height:25px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-item.vis-config-s2{background-color:#f7f8fa;border-radius:3px;left:10px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s3{background-color:#e4e9f0;border-radius:3px;left:20px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s4{background-color:#cfd8e6;border-radius:3px;left:30px;padding-left:5px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{height:25px;line-height:25px;width:120px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{border:1px solid #444;border-radius:2px;cursor:pointer;height:19px;margin:0;padding:0;top:1px;width:30px}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{margin:0;padding:1px;pointer-events:none;position:relative;top:-5px;width:60px}input.vis-configuration.vis-config-range{-webkit-appearance:none;background-color:transparent;border:0 solid #fff;height:20px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:5px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2,#385380);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(180deg,#3876c2 0,#385380);border:1px solid #14334b;border-radius:50%;box-shadow:0 0 1px 0 #111927;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#3876c2",endColorstr="#385380",GradientType=0);height:17px;margin-top:-7px;width:17px}input.vis-configuration.vis-config-range:focus{outline:none}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(180deg,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#9d9d9d",endColorstr="#c8c8c8",GradientType=0)}input.vis-configuration.vis-config-range::-moz-range-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:10px;width:300px}input.vis-configuration.vis-config-range::-moz-range-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{background:transparent;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:300px}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{background:rgba(57,76,89,.85);border:2px solid #f2faff;border-radius:4px;color:#fff;font-size:14px;height:30px;line-height:30px;position:absolute;text-align:center;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;width:150px}.vis-configuration-popup:after,.vis-configuration-popup:before{border:solid transparent;content:" ";height:0;left:100%;pointer-events:none;position:absolute;top:50%;width:0}.vis-configuration-popup:after{border-color:rgba(136,183,213,0) rgba(136,183,213,0) rgba(136,183,213,0) rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0) rgba(194,225,245,0) rgba(194,225,245,0) #f2faff;border-width:12px;margin-top:-12px}');_e("div.vis-tooltip{background-color:#f5f4ed;border:1px solid #808074;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;box-shadow:3px 3px 10px rgba(0,0,0,.2);color:#000;font-family:verdana;font-size:14px;padding:5px;pointer-events:none;position:absolute;visibility:hidden;white-space:nowrap;z-index:5}");var Ke={exports:{}};!function(g){function t(g){if(g)return function(g){for(var A in t.prototype)g[A]=t.prototype[A];return g}(g)}g.exports=t,t.prototype.on=t.prototype.addEventListener=function(g,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(t),this},t.prototype.once=function(g,t){function A(){this.off(g,A),t.apply(this,arguments)}return A.fn=t,this.on(g,A),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(g,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var A,e=this._callbacks["$"+g];if(!e)return this;if(1==arguments.length)return delete this._callbacks["$"+g],this;for(var C=0;C=o?g?"":void 0:(e=uC(I,i))<55296||e>56319||i+1===o||(C=uC(I,i+1))<56320||C>57343?g?cC(I,i):e:g?pC(I,i,i+2):C-56320+(e-55296<<10)+65536}},vC={codeAt:fC(!1),charAt:fC(!0)},yC=O,mC=C.WeakMap,bC=yC(mC)&&/native code/.test(String(mC)),wC=et,kC=Ug("keys"),xC=function(g){return kC[g]||(kC[g]=wC(g))},EC=bC,OC=C,TC=gg,DC=uA,NC=qg,RC=Wg,PC=xC,MC=UA,BC="Object already initialized",zC=OC.TypeError,SC=OC.WeakMap;if(EC||RC.state){var ZC=RC.state||(RC.state=new SC);ZC.get=ZC.get,ZC.has=ZC.has,ZC.set=ZC.set,Je=function(g,t){if(ZC.has(g))throw new zC(BC);return t.facade=g,ZC.set(g,t),t},qe=function(g){return ZC.get(g)||{}},$e=function(g){return ZC.has(g)}}else{var FC=PC("state");MC[FC]=!0,Je=function(g,t){if(NC(g,FC))throw new zC(BC);return t.facade=g,DC(g,FC,t),t},qe=function(g){return NC(g,FC)?g[FC]:{}},$e=function(g){return NC(g,FC)}}var GC={set:Je,get:qe,has:$e,enforce:function(g){return $e(g)?qe(g):Je(g,{})},getterFor:function(g){return function(t){var A;if(!TC(t)||(A=qe(t)).type!==g)throw new zC("Incompatible receiver, "+g+" required");return A}}},jC=D,LC=qg,VC=Function.prototype,YC=jC&&Object.getOwnPropertyDescriptor,WC=LC(VC,"name"),QC={EXISTS:WC,PROPER:WC&&"something"===function(){}.name,CONFIGURABLE:WC&&(!jC||jC&&YC(VC,"name").configurable)},UC={},_C=D,KC=qt,HC=Jt,XC=AA,JC=J,qC=Ae;UC.f=_C&&!KC?Object.defineProperties:function(g,t){XC(g);for(var A,e=JC(t),C=qC(t),I=C.length,i=0;I>i;)HC.f(g,A=C[i++],e[A]);return g};var $C,gI=ig("document","documentElement"),tI=AA,AI=UC,eI=$A,CI=UA,II=gI,iI=Et,oI="prototype",nI="script",rI=xC("IE_PROTO"),sI=function(){},aI=function(g){return"<"+nI+">"+g+""},dI=function(g){g.write(aI("")),g.close();var t=g.parentWindow.Object;return g=null,t},hI=function(){try{$C=new ActiveXObject("htmlfile")}catch(g){}var g,t,A;hI="undefined"!=typeof document?document.domain&&$C?dI($C):(t=iI("iframe"),A="java"+nI+":",t.style.display="none",II.appendChild(t),t.src=String(A),(g=t.contentWindow.document).open(),g.write(aI("document.F=Object")),g.close(),g.F):dI($C);for(var e=eI.length;e--;)delete hI[oI][eI[e]];return hI()};CI[rI]=!0;var lI,cI,uI,pI=Object.create||function(g,t){var A;return null!==g?(sI[oI]=tI(g),A=new sI,sI[oI]=null,A[rI]=g):A=hI(),void 0===t?A:AI.f(A,t)},fI=!I((function(){function g(){}return g.prototype.constructor=null,Object.getPrototypeOf(new g)!==g.prototype})),vI=qg,yI=O,mI=Hg,bI=fI,wI=xC("IE_PROTO"),kI=Object,xI=kI.prototype,EI=bI?kI.getPrototypeOf:function(g){var t=mI(g);if(vI(t,wI))return t[wI];var A=t.constructor;return yI(A)&&t instanceof A?A.prototype:t instanceof kI?xI:null},OI=uA,TI=function(g,t,A,e){return e&&e.enumerable?g[t]=A:OI(g,t,A),g},DI=I,NI=O,RI=gg,PI=pI,MI=EI,BI=TI,zI=dt("iterator"),SI=!1;[].keys&&("next"in(uI=[].keys())?(cI=MI(MI(uI)))!==Object.prototype&&(lI=cI):SI=!0);var ZI=!RI(lI)||DI((function(){var g={};return lI[zI].call(g)!==g}));NI((lI=ZI?{}:PI(lI))[zI])||BI(lI,zI,(function(){return this}));var FI={IteratorPrototype:lI,BUGGY_SAFARI_ITERATORS:SI},GI=oC,jI=gC?{}.toString:function(){return"[object "+GI(this)+"]"},LI=gC,VI=Jt.f,YI=uA,WI=qg,QI=jI,UI=dt("toStringTag"),_I=function(g,t,A,e){if(g){var C=A?g:g.prototype;WI(C,UI)||VI(C,UI,{configurable:!0,value:t}),e&&!LI&&YI(C,"toString",QI)}},KI={},HI=FI.IteratorPrototype,XI=pI,JI=G,qI=_I,$I=KI,gi=function(){return this},ti=u,Ai=Rg,ei=O,Ci=String,Ii=TypeError,ii=function(g,t,A){try{return ti(Ai(Object.getOwnPropertyDescriptor(g,t)[A]))}catch(g){}},oi=AA,ni=function(g){if("object"==typeof g||ei(g))return g;throw new Ii("Can't set "+Ci(g)+" as a prototype")},ri=Object.setPrototypeOf||("__proto__"in{}?function(){var g,t=!1,A={};try{(g=ii(Object.prototype,"__proto__","set"))(A,[]),t=A instanceof Array}catch(g){}return function(A,e){return oi(A),ni(e),t?g(A,e):A.__proto__=e,A}}():void 0),si=TA,ai=P,di=QC,hi=function(g,t,A,e){var C=t+" Iterator";return g.prototype=XI(HI,{next:JI(+!e,A)}),qI(g,C,!1,!0),$I[C]=gi,g},li=EI,ci=_I,ui=TI,pi=KI,fi=FI,vi=di.PROPER,yi=fi.BUGGY_SAFARI_ITERATORS,mi=dt("iterator"),bi="keys",wi="values",ki="entries",xi=function(){return this},Ei=function(g,t,A,e,C,I,i){hi(A,t,e);var o,n,r,s=function(g){if(g===C&&c)return c;if(!yi&&g&&g in h)return h[g];switch(g){case bi:case wi:case ki:return function(){return new A(this,g)}}return function(){return new A(this)}},a=t+" Iterator",d=!1,h=g.prototype,l=h[mi]||h["@@iterator"]||C&&h[C],c=!yi&&l||s(C),u="Array"===t&&h.entries||l;if(u&&(o=li(u.call(new g)))!==Object.prototype&&o.next&&(ci(o,a,!0,!0),pi[a]=xi),vi&&C===wi&&l&&l.name!==wi&&(d=!0,c=function(){return ai(l,this)}),C)if(n={values:s(wi),keys:I?c:s(bi),entries:s(ki)},i)for(r in n)(yi||d||!(r in h))&&ui(h,r,n[r]);else si({target:t,proto:!0,forced:yi||d},n);return i&&h[mi]!==c&&ui(h,mi,c,{name:C}),pi[t]=c,n},Oi=function(g,t){return{value:g,done:t}},Ti=vC.charAt,Di=sC,Ni=GC,Ri=Ei,Pi=Oi,Mi="String Iterator",Bi=Ni.set,zi=Ni.getterFor(Mi);Ri(String,"String",(function(g){Bi(this,{type:Mi,string:Di(g),index:0})}),(function(){var g,t=zi(this),A=t.string,e=t.index;return e>=A.length?Pi(void 0,!0):(g=Ti(A,e),t.index+=g.length,Pi(g,!1))}));var Si=P,Zi=AA,Fi=Bg,Gi=function(g,t,A){var e,C;Zi(g);try{if(!(e=Fi(g,"return"))){if("throw"===t)throw A;return A}e=Si(e,g)}catch(g){C=!0,e=g}if("throw"===t)throw A;if(C)throw e;return Zi(e),A},ji=AA,Li=Gi,Vi=KI,Yi=dt("iterator"),Wi=Array.prototype,Qi=function(g){return void 0!==g&&(Vi.Array===g||Wi[Yi]===g)},Ui=O,_i=Wg,Ki=u(Function.toString);Ui(_i.inspectSource)||(_i.inspectSource=function(g){return Ki(g)});var Hi=_i.inspectSource,Xi=u,Ji=I,qi=O,$i=oC,go=Hi,to=function(){},Ao=[],eo=ig("Reflect","construct"),Co=/^\s*(?:class|function)\b/,Io=Xi(Co.exec),io=!Co.test(to),oo=function(g){if(!qi(g))return!1;try{return eo(to,Ao,g),!0}catch(g){return!1}},no=function(g){if(!qi(g))return!1;switch($i(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return io||!!Io(Co,go(g))}catch(g){return!0}};no.sham=!0;var ro=!eo||Ji((function(){var g;return oo(oo.call)||!oo(Object)||!oo((function(){g=!0}))||g}))?no:oo,so=bt,ao=Jt,ho=G,lo=function(g,t,A){var e=so(t);e in g?ao.f(g,e,ho(0,A)):g[e]=A},co=oC,uo=Bg,po=Q,fo=KI,vo=dt("iterator"),yo=function(g){if(!po(g))return uo(g,vo)||uo(g,"@@iterator")||fo[co(g)]},mo=P,bo=Rg,wo=AA,ko=Og,xo=yo,Eo=TypeError,Oo=function(g,t){var A=arguments.length<2?xo(g):t;if(bo(A))return wo(mo(A,g));throw new Eo(ko(g)+" is not iterable")},To=Xt,Do=P,No=Hg,Ro=function(g,t,A,e){try{return e?t(ji(A)[0],A[1]):t(A)}catch(t){Li(g,"throw",t)}},Po=Qi,Mo=ro,Bo=jA,zo=lo,So=Oo,Zo=yo,Fo=Array,Go=dt("iterator"),jo=!1;try{var Lo=0,Vo={next:function(){return{done:!!Lo++}},return:function(){jo=!0}};Vo[Go]=function(){return this},Array.from(Vo,(function(){throw 2}))}catch(g){}var Yo=function(g,t){try{if(!t&&!jo)return!1}catch(g){return!1}var A=!1;try{var e={};e[Go]=function(){return{next:function(){return{done:A=!0}}}},g(e)}catch(g){}return A},Wo=function(g){var t=No(g),A=Mo(this),e=arguments.length,C=e>1?arguments[1]:void 0,I=void 0!==C;I&&(C=To(C,e>2?arguments[2]:void 0));var i,o,n,r,s,a,d=Zo(t),h=0;if(!d||this===Fo&&Po(d))for(i=Bo(t),o=A?new this(i):Fo(i);i>h;h++)a=I?C(t[h],h):t[h],zo(o,h,a);else for(s=(r=So(t,d)).next,o=A?new this:[];!(n=Do(s,r)).done;h++)a=I?Ro(r,C,[n.value,h],!0):n.value,zo(o,h,a);return o.length=h,o};TA({target:"Array",stat:!0,forced:!Yo((function(g){Array.from(g)}))},{from:Wo});var Qo=tg.Array.from,Uo=A(Qo),_o=J,Ko=KI,Ho=GC;Jt.f;var Xo=Ei,Jo=Oi,qo="Array Iterator",$o=Ho.set,gn=Ho.getterFor(qo);Xo(Array,"Array",(function(g,t){$o(this,{type:qo,target:_o(g),index:0,kind:t})}),(function(){var g=gn(this),t=g.target,A=g.kind,e=g.index++;if(!t||e>=t.length)return g.target=void 0,Jo(void 0,!0);switch(A){case"keys":return Jo(e,!1);case"values":return Jo(t[e],!1)}return Jo([e,t[e]],!1)}),"values"),Ko.Arguments=Ko.Array;var tn=yo,An={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},en=C,Cn=oC,In=uA,on=KI,nn=dt("toStringTag");for(var rn in An){var sn=en[rn],an=sn&&sn.prototype;an&&Cn(an)!==nn&&In(an,nn,rn),on[rn]=on.Array}var dn=tn,hn=A(dn),ln=A(dn);function cn(g,t){if(!(g instanceof t))throw new TypeError("Cannot call a class as a function")}var un={exports:{}},pn=TA,fn=D,vn=Jt.f;pn({target:"Object",stat:!0,forced:Object.defineProperty!==vn,sham:!fn},{defineProperty:vn});var yn=tg.Object,mn=un.exports=function(g,t,A){return yn.defineProperty(g,t,A)};yn.defineProperty.sham&&(mn.sham=!0);var bn=un.exports,wn=bn,kn=A(wn),xn=y,En=Array.isArray||function(g){return"Array"===xn(g)},On=TypeError,Tn=function(g){if(g>9007199254740991)throw On("Maximum allowed index exceeded");return g},Dn=En,Nn=ro,Rn=gg,Pn=dt("species"),Mn=Array,Bn=function(g){var t;return Dn(g)&&(t=g.constructor,(Nn(t)&&(t===Mn||Dn(t.prototype))||Rn(t)&&null===(t=t[Pn]))&&(t=void 0)),void 0===t?Mn:t},zn=function(g,t){return new(Bn(g))(0===t?0:t)},Sn=I,Zn=cg,Fn=dt("species"),Gn=function(g){return Zn>=51||!Sn((function(){var t=[];return(t.constructor={})[Fn]=function(){return{foo:1}},1!==t[g](Boolean).foo}))},jn=TA,Ln=I,Vn=En,Yn=gg,Wn=Hg,Qn=jA,Un=Tn,_n=lo,Kn=zn,Hn=Gn,Xn=cg,Jn=dt("isConcatSpreadable"),qn=Xn>=51||!Ln((function(){var g=[];return g[Jn]=!1,g.concat()[0]!==g})),$n=function(g){if(!Yn(g))return!1;var t=g[Jn];return void 0!==t?!!t:Vn(g)};jn({target:"Array",proto:!0,arity:1,forced:!qn||!Hn("concat")},{concat:function(g){var t,A,e,C,I,i=Wn(this),o=Kn(i,0),n=0;for(t=-1,e=arguments.length;tf;f++)if((o||f in c)&&(h=u(d=c[f],f,l),g))if(t)y[f]=h;else if(h)switch(g){case 3:return!0;case 5:return d;case 6:return f;case 2:Br(y,d)}else switch(g){case 4:return!1;case 7:Br(y,d)}return I?-1:e||C?C:y}},Sr={forEach:zr(0),map:zr(1),filter:zr(2),some:zr(3),every:zr(4),find:zr(5),findIndex:zr(6),filterReject:zr(7)},Zr=TA,Fr=C,Gr=P,jr=u,Lr=D,Vr=vg,Yr=I,Wr=qg,Qr=og,Ur=AA,_r=J,Kr=bt,Hr=sC,Xr=G,Jr=pI,qr=Ae,$r=gr,gs=er,ts=ee,As=T,es=Jt,Cs=UC,Is=M,is=TI,os=ur,ns=Ug,rs=UA,ss=et,as=dt,ds=pr,hs=wr,ls=Tr,cs=_I,us=GC,ps=Sr.forEach,fs=xC("hidden"),vs="Symbol",ys="prototype",ms=us.set,bs=us.getterFor(vs),ws=Object[ys],ks=Fr.Symbol,xs=ks&&ks[ys],Es=Fr.RangeError,Os=Fr.TypeError,Ts=Fr.QObject,Ds=As.f,Ns=es.f,Rs=gs.f,Ps=Is.f,Ms=jr([].push),Bs=ns("symbols"),zs=ns("op-symbols"),Ss=ns("wks"),Zs=!Ts||!Ts[ys]||!Ts[ys].findChild,Fs=function(g,t,A){var e=Ds(ws,t);e&&delete ws[t],Ns(g,t,A),e&&g!==ws&&Ns(ws,t,e)},Gs=Lr&&Yr((function(){return 7!==Jr(Ns({},"a",{get:function(){return Ns(this,"a",{value:7}).a}})).a}))?Fs:Ns,js=function(g,t){var A=Bs[g]=Jr(xs);return ms(A,{type:vs,tag:g,description:t}),Lr||(A.description=t),A},Ls=function(g,t,A){g===ws&&Ls(zs,t,A),Ur(g);var e=Kr(t);return Ur(A),Wr(Bs,e)?(A.enumerable?(Wr(g,fs)&&g[fs][e]&&(g[fs][e]=!1),A=Jr(A,{enumerable:Xr(0,!1)})):(Wr(g,fs)||Ns(g,fs,Xr(1,{})),g[fs][e]=!0),Gs(g,e,A)):Ns(g,e,A)},Vs=function(g,t){Ur(g);var A=_r(t),e=qr(A).concat(Us(A));return ps(e,(function(t){Lr&&!Gr(Ys,A,t)||Ls(g,t,A[t])})),g},Ys=function(g){var t=Kr(g),A=Gr(Ps,this,t);return!(this===ws&&Wr(Bs,t)&&!Wr(zs,t))&&(!(A||!Wr(this,t)||!Wr(Bs,t)||Wr(this,fs)&&this[fs][t])||A)},Ws=function(g,t){var A=_r(g),e=Kr(t);if(A!==ws||!Wr(Bs,e)||Wr(zs,e)){var C=Ds(A,e);return!C||!Wr(Bs,e)||Wr(A,fs)&&A[fs][e]||(C.enumerable=!0),C}},Qs=function(g){var t=Rs(_r(g)),A=[];return ps(t,(function(g){Wr(Bs,g)||Wr(rs,g)||Ms(A,g)})),A},Us=function(g){var t=g===ws,A=Rs(t?zs:_r(g)),e=[];return ps(A,(function(g){!Wr(Bs,g)||t&&!Wr(ws,g)||Ms(e,Bs[g])})),e};Vr||(ks=function(){if(Qr(xs,this))throw new Os("Symbol is not a constructor");var g=arguments.length&&void 0!==arguments[0]?Hr(arguments[0]):void 0,t=ss(g),A=function(g){this===ws&&Gr(A,zs,g),Wr(this,fs)&&Wr(this[fs],t)&&(this[fs][t]=!1);var e=Xr(1,g);try{Gs(this,t,e)}catch(g){if(!(g instanceof Es))throw g;Fs(this,t,e)}};return Lr&&Zs&&Gs(ws,t,{configurable:!0,set:A}),js(t,g)},is(xs=ks[ys],"toString",(function(){return bs(this).tag})),is(ks,"withoutSetter",(function(g){return js(ss(g),g)})),Is.f=Ys,es.f=Ls,Cs.f=Vs,As.f=Ws,$r.f=gs.f=Qs,ts.f=Us,ds.f=function(g){return js(as(g),g)},Lr&&os(xs,"description",{configurable:!0,get:function(){return bs(this).description}})),Zr({global:!0,constructor:!0,wrap:!0,forced:!Vr,sham:!Vr},{Symbol:ks}),ps(qr(Ss),(function(g){hs(g)})),Zr({target:vs,stat:!0,forced:!Vr},{useSetter:function(){Zs=!0},useSimple:function(){Zs=!1}}),Zr({target:"Object",stat:!0,forced:!Vr,sham:!Lr},{create:function(g,t){return void 0===t?Jr(g):Vs(Jr(g),t)},defineProperty:Ls,defineProperties:Vs,getOwnPropertyDescriptor:Ws}),Zr({target:"Object",stat:!0,forced:!Vr},{getOwnPropertyNames:Qs}),ls(),cs(ks,vs),rs[fs]=!0;var _s=vg&&!!Symbol.for&&!!Symbol.keyFor,Ks=TA,Hs=ig,Xs=qg,Js=sC,qs=Ug,$s=_s,ga=qs("string-to-symbol-registry"),ta=qs("symbol-to-string-registry");Ks({target:"Symbol",stat:!0,forced:!$s},{for:function(g){var t=Js(g);if(Xs(ga,t))return ga[t];var A=Hs("Symbol")(t);return ga[t]=A,ta[A]=t,A}});var Aa=TA,ea=qg,Ca=xg,Ia=Og,ia=_s,oa=Ug("symbol-to-string-registry");Aa({target:"Symbol",stat:!0,forced:!ia},{keyFor:function(g){if(!Ca(g))throw new TypeError(Ia(g)+" is not a symbol");if(ea(oa,g))return oa[g]}});var na=En,ra=O,sa=y,aa=sC,da=u([].push),ha=TA,la=ig,ca=a,ua=P,pa=u,fa=I,va=O,ya=xg,ma=ve,ba=function(g){if(ra(g))return g;if(na(g)){for(var t=g.length,A=[],e=0;eg.length)&&(t=g.length);for(var A=0,e=new Array(t);A1?arguments[1]:void 0)}});var Mh=Me("Array").map,Bh=og,zh=Mh,Sh=Array.prototype,Zh=function(g){var t=g.map;return g===Sh||Bh(Sh,g)&&t===Sh.map?zh:t},Fh=A(Zh),Gh=Hg,jh=Ae;TA({target:"Object",stat:!0,forced:I((function(){jh(1)}))},{keys:function(g){return jh(Gh(g))}});var Lh=A(tg.Object.keys),Vh=TA,Yh=Date,Wh=u(Yh.prototype.getTime);Vh({target:"Date",stat:!0},{now:function(){return Wh(new Yh)}});var Qh=A(tg.Date.now),Uh=I,_h=function(g,t){var A=[][g];return!!A&&Uh((function(){A.call(null,t||function(){return 1},1)}))},Kh=Sr.forEach,Hh=_h("forEach")?[].forEach:function(g){return Kh(this,g,arguments.length>1?arguments[1]:void 0)};TA({target:"Array",proto:!0,forced:[].forEach!==Hh},{forEach:Hh});var Xh=Me("Array").forEach,Jh=oC,qh=qg,$h=og,gl=Xh,tl=Array.prototype,Al={DOMTokenList:!0,NodeList:!0},el=function(g){var t=g.forEach;return g===tl||$h(tl,g)&&t===tl.forEach||qh(Al,Jh(g))?gl:t},Cl=A(el),Il=TA,il=En,ol=u([].reverse),nl=[1,2];Il({target:"Array",proto:!0,forced:String(nl)===String(nl.reverse())},{reverse:function(){return il(this)&&(this.length=this.length),ol(this)}});var rl=Me("Array").reverse,sl=og,al=rl,dl=Array.prototype,hl=function(g){var t=g.reverse;return g===dl||sl(dl,g)&&t===dl.reverse?al:t},ll=hl,cl=A(ll),ul=Og,pl=TypeError,fl=function(g,t){if(!delete g[t])throw new pl("Cannot delete property "+ul(t)+" of "+ul(g))},vl=TA,yl=Hg,ml=SA,bl=PA,wl=jA,kl=Rd,xl=Tn,El=zn,Ol=lo,Tl=fl,Dl=Gn("splice"),Nl=Math.max,Rl=Math.min;vl({target:"Array",proto:!0,forced:!Dl},{splice:function(g,t){var A,e,C,I,i,o,n=yl(this),r=wl(n),s=ml(g,r),a=arguments.length;for(0===a?A=e=0:1===a?(A=0,e=r-s):(A=a-2,e=Rl(Nl(bl(t),0),r-s)),xl(r+A-e),C=El(n,e),I=0;Ir-e+A;I--)Tl(n,I-1)}else if(A>e)for(I=r-e;I>s;I--)o=I+A-1,(i=I+e-1)in n?n[o]=n[i]:Tl(n,o);for(I=0;I1?arguments[1]:void 0)}});var Gl=Me("Array").includes,jl=gg,Ll=y,Vl=dt("match"),Yl=function(g){var t;return jl(g)&&(void 0!==(t=g[Vl])?!!t:"RegExp"===Ll(g))},Wl=TypeError,Ql=dt("match"),Ul=TA,_l=function(g){if(Yl(g))throw new Wl("The method doesn't accept regular expressions");return g},Kl=K,Hl=sC,Xl=function(g){var t=/./;try{"/./"[g](t)}catch(A){try{return t[Ql]=!1,"/./"[g](t)}catch(g){}}return!1},Jl=u("".indexOf);Ul({target:"String",proto:!0,forced:!Xl("includes")},{includes:function(g){return!!~Jl(Hl(Kl(this)),Hl(_l(g)),arguments.length>1?arguments[1]:void 0)}});var ql=Me("String").includes,$l=og,gc=Gl,tc=ql,Ac=Array.prototype,ec=String.prototype,Cc=function(g){var t=g.includes;return g===Ac||$l(Ac,g)&&t===Ac.includes?gc:"string"==typeof g||g===ec||$l(ec,g)&&t===ec.includes?tc:t},Ic=A(Cc),ic=Hg,oc=EI,nc=fI;TA({target:"Object",stat:!0,forced:I((function(){oc(1)})),sham:!nc},{getPrototypeOf:function(g){return oc(ic(g))}});var rc=tg.Object.getPrototypeOf,sc=A(rc),ac=Sr.filter;TA({target:"Array",proto:!0,forced:!Gn("filter")},{filter:function(g){return ac(this,g,arguments.length>1?arguments[1]:void 0)}});var dc=Me("Array").filter,hc=og,lc=dc,cc=Array.prototype,uc=function(g){var t=g.filter;return g===cc||hc(cc,g)&&t===cc.filter?lc:t},pc=A(uc),fc="\t\n\v\f\r                 \u2028\u2029\ufeff",vc=K,yc=sC,mc=fc,bc=u("".replace),wc=RegExp("^["+mc+"]+"),kc=RegExp("(^|[^"+mc+"])["+mc+"]+$"),xc=function(g){return function(t){var A=yc(vc(t));return 1&g&&(A=bc(A,wc,"")),2&g&&(A=bc(A,kc,"$1")),A}},Ec={start:xc(1),end:xc(2),trim:xc(3)},Oc=C,Tc=I,Dc=u,Nc=sC,Rc=Ec.trim,Pc=fc,Mc=Oc.parseInt,Bc=Oc.Symbol,zc=Bc&&Bc.iterator,Sc=/^[+-]?0x/i,Zc=Dc(Sc.exec),Fc=8!==Mc(Pc+"08")||22!==Mc(Pc+"0x16")||zc&&!Tc((function(){Mc(Object(zc))}))?function(g,t){var A=Rc(Nc(g));return Mc(A,t>>>0||(Zc(Sc,A)?16:10))}:Mc;TA({global:!0,forced:parseInt!==Fc},{parseInt:Fc});var Gc=A(tg.parseInt),jc=TA,Lc=QA.indexOf,Vc=_h,Yc=w([].indexOf),Wc=!!Yc&&1/Yc([1],1,-0)<0;jc({target:"Array",proto:!0,forced:Wc||!Vc("indexOf")},{indexOf:function(g){var t=arguments.length>1?arguments[1]:void 0;return Wc?Yc(this,g,t)||0:Lc(this,g,t)}});var Qc=Me("Array").indexOf,Uc=og,_c=Qc,Kc=Array.prototype,Hc=function(g){var t=g.indexOf;return g===Kc||Uc(Kc,g)&&t===Kc.indexOf?_c:t},Xc=A(Hc);TA({target:"Object",stat:!0,sham:!D},{create:pI});var Jc=tg.Object,qc=function(g,t){return Jc.create(g,t)},$c=A(qc),gu=tg,tu=a;gu.JSON||(gu.JSON={stringify:JSON.stringify});var Au=function(g,t,A){return tu(gu.JSON.stringify,null,arguments)},eu=A(Au),Cu="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Iu=TypeError,iu=function(g,t){if(gA,i=ru(e)?e:lu(e),o=I?du(arguments,A):[],n=I?function(){nu(i,this,o)}:i;return t?g(n,C):g(n)}:g},pu=TA,fu=C,vu=uu(fu.setInterval,!0);pu({global:!0,bind:!0,forced:fu.setInterval!==vu},{setInterval:vu});var yu=TA,mu=C,bu=uu(mu.setTimeout,!0);yu({global:!0,bind:!0,forced:mu.setTimeout!==bu},{setTimeout:bu});var wu=A(tg.setTimeout),ku=Hg,xu=SA,Eu=jA,Ou=function(g){for(var t=ku(this),A=Eu(t),e=arguments.length,C=xu(e>1?arguments[1]:void 0,A),I=e>2?arguments[2]:void 0,i=void 0===I?A:xu(I,A);i>C;)t[C++]=g;return t};TA({target:"Array",proto:!0},{fill:Ou});var Tu,Du=Me("Array").fill,Nu=og,Ru=Du,Pu=Array.prototype,Mu=function(g){var t=g.fill;return g===Pu||Nu(Pu,g)&&t===Pu.fill?Ru:t},Bu=A(Mu); /*! Hammer.JS - v2.0.17-rc - 2019-12-16 * http://naver.github.io/egjs * * Forked By Naver egjs * Copyright (c) hammerjs * Licensed under the MIT license */ -function zu(){return zu=Object.assign||function(g){for(var t=1;t-1}var wp=function(){function g(g,t){this.manager=g,this.set(t)}var t=g.prototype;return t.set=function(g){g===Ku&&(g=this.compute()),_u&&this.manager.element.style&&gp[g]&&(this.manager.element.style[Uu]=g),this.actions=g.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var g=[];return yp(this.manager.recognizers,(function(t){mp(t.options.enable,[t])&&(g=g.concat(t.getTouchAction()))})),function(g){if(bp(g,Ju))return Ju;var t=bp(g,qu),A=bp(g,$u);return t&&A?Ju:t||A?t?qu:$u:bp(g,Xu)?Xu:Hu}(g.join(" "))},t.preventDefaults=function(g){var t=g.srcEvent,A=g.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var e=this.actions,C=bp(e,Ju)&&!gp[Ju],I=bp(e,$u)&&!gp[$u],i=bp(e,qu)&&!gp[qu];if(C){var o=1===g.pointers.length,n=g.distance<2,r=g.deltaTime<250;if(o&&n&&r)return}if(!i||!I)return C||I&&A&cp||i&&A&up?this.preventSrc(t):void 0}},t.preventSrc=function(g){this.manager.session.prevented=!0,g.preventDefault()},g}();function kp(g,t){for(;g;){if(g===t)return!0;g=g.parentNode}return!1}function xp(g){var t=g.length;if(1===t)return{x:Vu(g[0].clientX),y:Vu(g[0].clientY)};for(var A=0,e=0,C=0;C=Yu(t)?g<0?ap:dp:t<0?hp:lp}function Np(g,t,A){return{x:t/g||0,y:A/g||0}}function Rp(g,t){var A=g.session,e=t.pointers,C=e.length;A.firstInput||(A.firstInput=Ep(t)),C>1&&!A.firstMultiple?A.firstMultiple=Ep(t):1===C&&(A.firstMultiple=!1);var I=A.firstInput,i=A.firstMultiple,o=i?i.center:I.center,n=t.center=xp(e);t.timeStamp=Wu(),t.deltaTime=t.timeStamp-I.timeStamp,t.angle=Tp(o,n),t.distance=Op(o,n),function(g,t){var A=t.center,e=g.offsetDelta||{},C=g.prevDelta||{},I=g.prevInput||{};t.eventType!==op&&I.eventType!==np||(C=g.prevDelta={x:I.deltaX||0,y:I.deltaY||0},e=g.offsetDelta={x:A.x,y:A.y}),t.deltaX=C.x+(A.x-e.x),t.deltaY=C.y+(A.y-e.y)}(A,t),t.offsetDirection=Dp(t.deltaX,t.deltaY);var r,s,a=Np(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=a.x,t.overallVelocityY=a.y,t.overallVelocity=Yu(a.x)>Yu(a.y)?a.x:a.y,t.scale=i?(r=i.pointers,Op((s=e)[0],s[1],vp)/Op(r[0],r[1],vp)):1,t.rotation=i?function(g,t){return Tp(t[1],t[0],vp)+Tp(g[1],g[0],vp)}(i.pointers,e):0,t.maxPointers=A.prevInput?t.pointers.length>A.prevInput.maxPointers?t.pointers.length:A.prevInput.maxPointers:t.pointers.length,function(g,t){var A,e,C,I,i=g.lastInterval||t,o=t.timeStamp-i.timeStamp;if(t.eventType!==rp&&(o>ip||void 0===i.velocity)){var n=t.deltaX-i.deltaX,r=t.deltaY-i.deltaY,s=Np(o,n,r);e=s.x,C=s.y,A=Yu(s.x)>Yu(s.y)?s.x:s.y,I=Dp(n,r),g.lastInterval=t}else A=i.velocity,e=i.velocityX,C=i.velocityY,I=i.direction;t.velocity=A,t.velocityX=e,t.velocityY=C,t.direction=I}(A,t);var d,h=g.element,l=t.srcEvent;kp(d=l.composedPath?l.composedPath()[0]:l.path?l.path[0]:l.target,h)&&(h=d),t.target=h}function Pp(g,t,A){var e=A.pointers.length,C=A.changedPointers.length,I=t&op&&e-C==0,i=t&(np|rp)&&e-C==0;A.isFirst=!!I,A.isFinal=!!i,I&&(g.session={}),A.eventType=t,Rp(g,A),g.emit("hammer.input",A),g.recognize(A),g.session.prevInput=A}function Mp(g){return g.trim().split(/\s+/g)}function Bp(g,t,A){yp(Mp(t),(function(t){g.addEventListener(t,A,!1)}))}function zp(g,t,A){yp(Mp(t),(function(t){g.removeEventListener(t,A,!1)}))}function Sp(g){var t=g.ownerDocument||g;return t.defaultView||t.parentWindow||window}var Zp=function(){function g(g,t){var A=this;this.manager=g,this.callback=t,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(t){mp(g.options.enable,[g])&&A.handler(t)},this.init()}var t=g.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Bp(this.element,this.evEl,this.domHandler),this.evTarget&&Bp(this.target,this.evTarget,this.domHandler),this.evWin&&Bp(Sp(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&zp(this.element,this.evEl,this.domHandler),this.evTarget&&zp(this.target,this.evTarget,this.domHandler),this.evWin&&zp(Sp(this.element),this.evWin,this.domHandler)},g}();function Fp(g,t,A){if(g.indexOf&&!A)return g.indexOf(t);for(var e=0;eA[t]})):e.sort()),e}var Up={touchstart:op,touchmove:2,touchend:np,touchcancel:rp},_p=function(g){function t(){var A;return t.prototype.evTarget="touchstart touchmove touchend touchcancel",(A=g.apply(this,arguments)||this).targetIds={},A}return Su(t,g),t.prototype.handler=function(g){var t=Up[g.type],A=Kp.call(this,g,t);A&&this.callback(this.manager,t,{pointers:A[0],changedPointers:A[1],pointerType:Cp,srcEvent:g})},t}(Zp);function Kp(g,t){var A,e,C=Wp(g.touches),I=this.targetIds;if(t&(2|op)&&1===C.length)return I[C[0].identifier]=!0,[C,C];var i=Wp(g.changedTouches),o=[],n=this.target;if(e=C.filter((function(g){return kp(g.target,n)})),t===op)for(A=0;A-1&&e.splice(g,1)}),Jp)}}function $p(g,t){g&op?(this.primaryTouch=t.changedPointers[0].identifier,qp.call(this,t)):g&(np|rp)&&qp.call(this,t)}function gf(g){for(var t=g.srcEvent.clientX,A=g.srcEvent.clientY,e=0;e-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(g){return!!this.simultaneous[g.id]},t.emit=function(g){var t=this,A=this.state;function e(A){t.manager.emit(A,g)}A<8&&e(t.options.event+of(A)),e(t.options.event),g.additionalEvent&&e(g.additionalEvent),A>=8&&e(t.options.event+of(A))},t.tryEmit=function(g){if(this.canEmit())return this.emit(g);this.state=ef},t.canEmit=function(){for(var g=0;gt.threshold&&C&t.direction},A.attrTest=function(g){return sf.prototype.attrTest.call(this,g)&&(2&this.state||!(2&this.state)&&this.directionTest(g))},A.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var A=af(t.direction);A&&(t.additionalEvent=this.options.event+A),g.prototype.emit.call(this,t)},t}(sf),hf=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"swipe",threshold:10,velocity:.3,direction:cp|up,pointers:1},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return df.prototype.getTouchAction.call(this)},A.attrTest=function(t){var A,e=this.options.direction;return e&(cp|up)?A=t.overallVelocity:e&cp?A=t.overallVelocityX:e&up&&(A=t.overallVelocityY),g.prototype.attrTest.call(this,t)&&e&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Yu(A)>this.options.velocity&&t.eventType&np},A.emit=function(g){var t=af(g.offsetDirection);t&&this.manager.emit(this.options.event+t,g),this.manager.emit(this.options.event,g)},t}(sf),lf=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"pinch",threshold:0,pointers:2},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Ju]},A.attrTest=function(t){return g.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},A.emit=function(t){if(1!==t.scale){var A=t.scale<1?"in":"out";t.additionalEvent=this.options.event+A}g.prototype.emit.call(this,t)},t}(sf),cf=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"rotate",threshold:0,pointers:2},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Ju]},A.attrTest=function(t){return g.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)},t}(sf),uf=function(g){function t(t){var A;return void 0===t&&(t={}),(A=g.call(this,zu({event:"press",pointers:1,time:251,threshold:9},t))||this)._timer=null,A._input=null,A}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Hu]},A.process=function(g){var t=this,A=this.options,e=g.pointers.length===A.pointers,C=g.distanceA.time;if(this._input=g,!C||!e||g.eventType&(np|rp)&&!I)this.reset();else if(g.eventType&op)this.reset(),this._timer=setTimeout((function(){t.state=8,t.tryEmit()}),A.time);else if(g.eventType&np)return 8;return ef},A.reset=function(){clearTimeout(this._timer)},A.emit=function(g){8===this.state&&(g&&g.eventType&np?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=Wu(),this.manager.emit(this.options.event,this._input)))},t}(nf),pf={domEvents:!1,touchAction:Ku,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ff=[[cf,{enable:!1}],[lf,{enable:!1},["rotate"]],[hf,{direction:cp}],[df,{direction:cp},["swipe"]],[rf],[rf,{event:"doubletap",taps:2},["tap"]],[uf]];function vf(g,t){var A,e=g.element;e.style&&(yp(g.options.cssProps,(function(C,I){A=Qu(e.style,I),t?(g.oldCssProps[A]=e.style[A],e.style[A]=C):e.style[A]=g.oldCssProps[A]||""})),t||(g.oldCssProps={}))}var yf=function(){function g(g,t){var A,e=this;this.options=Gu({},pf,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=new((A=this).options.inputClass||(Ap?Yp:ep?_p:tp?tf:Xp))(A,Pp),this.touchAction=new wp(this,this.options.touchAction),vf(this,!0),yp(this.options.recognizers,(function(g){var t=e.add(new g[0](g[1]));g[2]&&t.recognizeWith(g[2]),g[3]&&t.requireFailure(g[3])}),this)}var t=g.prototype;return t.set=function(g){return Gu(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},t.stop=function(g){this.session.stopped=g?2:1},t.recognize=function(g){var t=this.session;if(!t.stopped){var A;this.touchAction.preventDefaults(g);var e=this.recognizers,C=t.curRecognizer;(!C||C&&8&C.state)&&(t.curRecognizer=null,C=null);for(var I=0;I\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",C=window.console&&(window.console.warn||window.console.log);return C&&C.call(window.console,e,A),g.apply(this,arguments)}}var xf=kf((function(g,t,A){for(var e=Object.keys(t),C=0;C=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function Pf(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A2)return zf.apply(void 0,bh(e=[Bf(t[0],t[1])]).call(e,ch(wh(t).call(t,2))));var C=t[0],I=t[1];if(C instanceof Date&&I instanceof Date)return C.setTime(I.getTime()),C;var i,o=Rf(Nh(I));try{for(o.s();!(i=o.n()).done;){var n=i.value;Object.prototype.propertyIsEnumerable.call(I,n)&&(I[n]===Mf?delete C[n]:null===C[n]||null===I[n]||"object"!==yd(C[n])||"object"!==yd(I[n])||Rh(C[n])||Rh(I[n])?C[n]=Sf(I[n]):C[n]=zf(C[n],I[n]))}}catch(g){o.e(g)}finally{o.f()}return C}function Sf(g){return Rh(g)?Fh(g).call(g,(function(g){return Sf(g)})):"object"===yd(g)&&null!==g?g instanceof Date?new Date(g.getTime()):zf({},g):g}function Zf(g){for(var t=0,A=Lh(g);t>>0,g=(C*=g)>>>0,g+=4294967296*(C-=g)}return 2.3283064365386963e-10*(g>>>0)}}(),t=g(" "),A=g(" "),e=g(" "),C=0;C2&&void 0!==arguments[2]&&arguments[2];for(var e in g)if(void 0!==t[e])if(null===t[e]||"object"!==yd(t[e]))Kf(g,t,e,A);else{var C=g[e],I=t[e];_f(C)&&_f(I)&&Hf(C,I,A)}}function Xf(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rh(A))throw new TypeError("Arrays are not supported by deepExtend");for(var C=0;C3&&void 0!==arguments[3]&&arguments[3];if(Rh(A))throw new TypeError("Arrays are not supported by deepExtend");for(var C in A)if(Object.prototype.hasOwnProperty.call(A,C)&&!Ic(g).call(g,C))if(A[C]&&A[C].constructor===Object)void 0===t[C]&&(t[C]={}),t[C].constructor===Object?qf(t[C],A[C]):Kf(t,A,C,e);else if(Rh(A[C])){t[C]=[];for(var I=0;I2&&void 0!==arguments[2]&&arguments[2],e=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var C in t)if(Object.prototype.hasOwnProperty.call(t,C)||!0===A)if("object"===yd(t[C])&&null!==t[C]&&sc(t[C])===Object.prototype)void 0===g[C]?g[C]=qf({},t[C],A):"object"===yd(g[C])&&null!==g[C]&&sc(g[C])===Object.prototype?qf(g[C],t[C],A):Kf(g,t,C,e);else if(Rh(t[C])){var I;g[C]=wh(I=t[C]).call(I)}else Kf(g,t,C,e);return g}function $f(g,t){var A;return bh(A=[]).call(A,ch(g),[t])}function gv(g){return g.getBoundingClientRect().top}function tv(g,t){if(Rh(g))for(var A=g.length,e=0;e3&&void 0!==arguments[3]?arguments[3]:{},C=function(g){return null!=g},I=function(g){return null!==g&&"object"===yd(g)};if(!I(g))throw new Error("Parameter mergeTarget must be an object");if(!I(t))throw new Error("Parameter options must be an object");if(!C(A))throw new Error("Parameter option must have a value");if(!I(e))throw new Error("Parameter globalOptions must be an object");var i=t[A],o=I(e)&&!function(g){for(var t in g)if(Object.prototype.hasOwnProperty.call(g,t))return!1;return!0}(e)?e[A]:void 0,n=o?o.enabled:void 0;if(void 0!==i){if("boolean"==typeof i)return I(g[A])||(g[A]={}),void(g[A].enabled=i);if(null===i&&!I(g[A])){if(!C(o))return;g[A]=$c(o)}if(I(i)){var r=!0;void 0!==i.enabled?r=i.enabled:void 0!==n&&(r=o.enabled),function(g,t,A){I(g[A])||(g[A]={});var e=t[A],C=g[A];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(C[i]=e[i])}(g,t,A),g[A].enabled=r}}}var hv={linear:function(g){return g},easeInQuad:function(g){return g*g},easeOutQuad:function(g){return g*(2-g)},easeInOutQuad:function(g){return g<.5?2*g*g:(4-2*g)*g-1},easeInCubic:function(g){return g*g*g},easeOutCubic:function(g){return--g*g*g+1},easeInOutCubic:function(g){return g<.5?4*g*g*g:(g-1)*(2*g-2)*(2*g-2)+1},easeInQuart:function(g){return g*g*g*g},easeOutQuart:function(g){return 1- --g*g*g*g},easeInOutQuart:function(g){return g<.5?8*g*g*g*g:1-8*--g*g*g*g},easeInQuint:function(g){return g*g*g*g*g},easeOutQuint:function(g){return 1+--g*g*g*g*g},easeInOutQuint:function(g){return g<.5?16*g*g*g*g*g:1+16*--g*g*g*g*g}};function lv(g,t){var A;Rh(t)||(t=[t]);var e,C=Rf(g);try{for(C.s();!(e=C.n()).done;){var I=e.value;if(I){A=I[t[0]];for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:1;cn(this,g),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return kd(g,[{key:"insertTo",value:function(g){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=g,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=g}},{key:"setCloseCallback",value:function(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=g}},{key:"_isColorString",value:function(g){if("string"==typeof g)return cv[g]}},{key:"setColor",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==g){var A,e=this._isColorString(g);if(void 0!==e&&(g=e),!0===Uf(g)){if(!0===sv(g)){var C=g.substr(4).substr(0,g.length-5).split(",");A={r:C[0],g:C[1],b:C[2],a:1}}else if(!0===function(g){return Wf.test(g)}(g)){var I=g.substr(5).substr(0,g.length-6).split(",");A={r:I[0],g:I[1],b:I[2],a:I[3]}}else if(!0===rv(g)){var i=Av(g);A={r:i.r,g:i.g,b:i.b,a:1}}}else if(g instanceof Object&&void 0!==g.r&&void 0!==g.g&&void 0!==g.b){var o=void 0!==g.a?g.a:"1.0";A={r:g.r,g:g.g,b:g.b,a:o}}if(void 0===A)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+eu(g));this._setColor(A,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var g=this;!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=fe({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",wu((function(){void 0!==g.closeCallback&&(g.closeCallback(),g.closeCallback=void 0)}),0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(g){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=fe({},g)),this.color=g;var t=iv(g.r,g.g,g.b),A=2*Math.PI,e=this.r*t.s,C=this.centerCoordinates.x+e*Math.sin(A*t.h),I=this.centerCoordinates.y+e*Math.cos(A*t.h);this.colorPickerSelector.style.left=C-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=I-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(g)}},{key:"_setOpacity",value:function(g){this.color.a=g/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(g){var t=iv(this.color.r,this.color.g,this.color.b);t.v=g/100;var A=ov(t.h,t.s,t.v);A.a=this.color.a,this.color=A,this._updatePicker()}},{key:"_updatePicker",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=iv(g.r,g.g,g.b),A=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(A.webkitBackingStorePixelRatio||A.mozBackingStorePixelRatio||A.msBackingStorePixelRatio||A.oBackingStorePixelRatio||A.backingStorePixelRatio||1)),A.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;A.clearRect(0,0,e,C),A.putImageData(this.hueCircle,0,0),A.fillStyle="rgba(0,0,0,"+(1-t.v)+")",A.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Bu(A).call(A),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*g.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var g,t,A,e;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var C=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var I=document.createElement("DIV");I.style.color="red",I.style.fontWeight="bold",I.style.padding="10px",I.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(I)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(g){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(g){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var i=this;this.opacityRange.onchange=function(){i._setOpacity(this.value)},this.opacityRange.oninput=function(){i._setOpacity(this.value)},this.brightnessRange.onchange=function(){i._setBrightness(this.value)},this.brightnessRange.oninput=function(){i._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=je(g=this._hide).call(g,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=je(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=je(A=this._save).call(A,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=je(e=this._loadLast).call(e,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var g=this;this.drag={},this.pinch={},this.hammer=new Gf(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(function(t){t.isFirst&&g._moveSelector(t)})),this.hammer.on("tap",(function(t){g._moveSelector(t)})),this.hammer.on("panstart",(function(t){g._moveSelector(t)})),this.hammer.on("panmove",(function(t){g._moveSelector(t)})),this.hammer.on("panend",(function(t){g._moveSelector(t)}))}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var g=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)),g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t,A,e,C,I=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;g.clearRect(0,0,I,i),this.centerCoordinates={x:.5*I,y:.5*i},this.r=.49*I;var o,n=2*Math.PI/360,r=1/this.r;for(e=0;e<360;e++)for(C=0;C3&&void 0!==arguments[3]?arguments[3]:1,I=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1};cn(this,g),this.parent=t,this.changedOptions=[],this.container=A,this.allowCreation=!1,this.hideOption=I,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},fe(this.options,this.defaultOptions),this.configureOptions=e,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new uv(C),this.wrapper=void 0}return kd(g,[{key:"setOptions",value:function(g){if(void 0!==g){this.popupHistory={},this._removePopup();var t=!0;if("string"==typeof g)this.options.filter=g;else if(Rh(g))this.options.filter=g.join();else if("object"===yd(g)){if(null==g)throw new TypeError("options cannot be null");void 0!==g.container&&(this.options.container=g.container),void 0!==pc(g)&&(this.options.filter=pc(g)),void 0!==g.showButton&&(this.options.showButton=g.showButton),void 0!==g.enabled&&(t=g.enabled)}else"boolean"==typeof g?(this.options.filter=!0,t=g):"function"==typeof g&&(this.options.filter=g,t=!0);!1===pc(this.options)&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(g){this.moduleOptions=g,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var g=pc(this.options),t=0,A=!1;for(var e in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,e)&&(this.allowCreation=!1,A=!1,"function"==typeof g?A=(A=g(e,[]))||this._handleObject(this.configureOptions[e],[e],!0):!0!==g&&-1===Xc(g).call(g,e)||(A=!0),!1!==A&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(e),this._handleObject(this.configureOptions[e],[e])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var g=0;g1?A-1:0),C=1;C2&&void 0!==arguments[2]&&arguments[2],e=document.createElement("div");if(e.className="vis-configuration vis-config-label vis-config-s"+t.length,!0===A){for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(pv("i","b",g))}else e.innerText=g+":";return e}},{key:"_makeDropdown",value:function(g,t,A){var e=document.createElement("select");e.className="vis-configuration vis-config-select";var C=0;void 0!==t&&-1!==Xc(g).call(g,t)&&(C=Xc(g).call(g,t));for(var I=0;II&&1!==I&&(o.max=Math.ceil(t*s),r=o.max,n="range increased"),o.value=t}else o.value=e;var a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=o.value;var d=this;o.onchange=function(){a.value=this.value,d._update(Number(this.value),A)},o.oninput=function(){a.value=this.value};var h=this._makeLabel(A[A.length-1],A),l=this._makeItem(A,h,o,a);""!==n&&this.popupHistory[l]!==r&&(this.popupHistory[l]=r,this._setupPopup(n,l))}},{key:"_makeButton",value:function(){var g=this;if(!0===this.options.showButton){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=function(){g._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{key:"_setupPopup",value:function(g,t){var A=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e=!1,C=pc(this.options),I=!1;for(var i in g)if(Object.prototype.hasOwnProperty.call(g,i)){e=!0;var o=g[i],n=$f(t,i);if("function"==typeof C&&!1===(e=C(i,t))&&!Rh(o)&&"string"!=typeof o&&"boolean"!=typeof o&&o instanceof Object&&(this.allowCreation=!1,e=this._handleObject(o,n,!0),this.allowCreation=!1===A),!1!==e){I=!0;var r=this._getValue(n);if(Rh(o))this._handleArray(o,r,n);else if("string"==typeof o)this._makeTextInput(o,r,n);else if("boolean"==typeof o)this._makeCheckbox(o,r,n);else if(o instanceof Object){if(!this.hideOption(t,i,this.moduleOptions))if(void 0!==o.enabled){var s=$f(n,"enabled"),a=this._getValue(s);if(!0===a){var d=this._makeLabel(i,n,!0);this._makeItem(n,d),I=this._handleObject(o,n)||I}else this._makeCheckbox(o,a,n)}else{var h=this._makeLabel(i,n,!0);this._makeItem(n,h),I=this._handleObject(o,n)||I}}else console.error("dont know how to handle",o,i,n)}}return I}},{key:"_handleArray",value:function(g,t,A){"string"==typeof g[0]&&"color"===g[0]?(this._makeColorField(g,t,A),g[1]!==t&&this.changedOptions.push({path:A,value:t})):"string"==typeof g[0]?(this._makeDropdown(g,t,A),g[0]!==t&&this.changedOptions.push({path:A,value:t})):"number"==typeof g[0]&&(this._makeRange(g,t,A),g[0]!==t&&this.changedOptions.push({path:A,value:Number(t)}))}},{key:"_update",value:function(g,t){var A=this._constructOptions(g,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",A),this.initialized=!0,this.parent.setOptions(A)}},{key:"_constructOptions",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=A;g="false"!==(g="true"===g||g)&&g;for(var C=0;CC-this.padding&&(o=!0),I=o?this.x-A:this.x,i=n?this.y-t:this.y}else(i=this.y-t)+t+this.padding>e&&(i=e-t-this.padding),iC&&(I=C-A-this.padding),Ii.distance?" in "+g.printLocation(I.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+g.printLocation(i.path,i.closestMatch,""):I.distance<=8?'. Did you mean "'+I.closestMatch+'"?'+g.printLocation(I.path,t):". Did you mean one of these: "+g.print(Lh(A))+g.printLocation(e,t),console.error('%cUnknown option detected: "'+t+'"'+C,bv),mv=!0}},{key:"findInOptions",value:function(t,A,e){var C,I=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=1e9,o="",n=[],r=t.toLowerCase(),s=void 0;for(var a in A){var d=void 0;if(void 0!==A[a].__type__&&!0===I){var h=g.findInOptions(t,A[a],$f(e,a));i>h.distance&&(o=h.closestMatch,n=h.path,i=h.distance,s=h.indexMatch)}else{var l;-1!==Xc(l=a.toLowerCase()).call(l,r)&&(s=a),i>(d=g.levenshteinDistance(t,a))&&(o=a,n=wh(C=e).call(C),i=d)}}return{closestMatch:o,path:n,distance:i,indexMatch:s}}},{key:"printLocation",value:function(g,t){for(var A="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n",e=0;e":!0,"--":!0},zv="",Sv=0,Zv="",Fv="",Gv=Mv.NULL;function jv(){Sv++,Zv=zv.charAt(Sv)}function Lv(){return zv.charAt(Sv+1)}function Vv(g){var t=g.charCodeAt(0);return t<47?35===t||46===t:t<59?t>47:t<91?t>64:t<96?95===t:t<123&&t>96}function Yv(g,t){if(g||(g={}),t)for(var A in t)t.hasOwnProperty(A)&&(g[A]=t[A]);return g}function Wv(g,t,A){for(var e=t.split("."),C=g;e.length;){var I=e.shift();e.length?(C[I]||(C[I]={}),C=C[I]):C[I]=A}}function Qv(g,t){for(var A,e,C=null,I=[g],i=g;i.parent;)I.push(i.parent),i=i.parent;if(i.nodes)for(A=0,e=i.nodes.length;A=0;A--){var o,n=I[A];n.nodes||(n.nodes=[]),-1===Xc(o=n.nodes).call(o,C)&&n.nodes.push(C)}t.attr&&(C.attr=Yv(C.attr,t.attr))}function Uv(g,t){if(g.edges||(g.edges=[]),g.edges.push(t),g.edge){var A=Yv({},g.edge);t.attr=Yv(A,t.attr)}}function _v(g,t,A,e,C){var I={from:t,to:A,type:e};return g.edge&&(I.attr=Yv({},g.edge)),I.attr=Yv(I.attr||{},C),null!=C&&C.hasOwnProperty("arrows")&&null!=C.arrows&&(I.arrows={to:{enabled:!0,type:C.arrows.type}},C.arrows=null),I}function Kv(){for(Gv=Mv.NULL,Fv="";" "===Zv||"\t"===Zv||"\n"===Zv||"\r"===Zv;)jv();do{var g=!1;if("#"===Zv){for(var t=Sv-1;" "===zv.charAt(t)||"\t"===zv.charAt(t);)t--;if("\n"===zv.charAt(t)||""===zv.charAt(t)){for(;""!=Zv&&"\n"!=Zv;)jv();g=!0}}if("/"===Zv&&"/"===Lv()){for(;""!=Zv&&"\n"!=Zv;)jv();g=!0}if("/"===Zv&&"*"===Lv()){for(;""!=Zv;){if("*"===Zv&&"/"===Lv()){jv(),jv();break}jv()}g=!0}for(;" "===Zv||"\t"===Zv||"\n"===Zv||"\r"===Zv;)jv()}while(g);if(""!==Zv){var A=Zv+Lv();if(Bv[A])return Gv=Mv.DELIMITER,Fv=A,jv(),void jv();if(Bv[Zv])return Gv=Mv.DELIMITER,Fv=Zv,void jv();if(Vv(Zv)||"-"===Zv){for(Fv+=Zv,jv();Vv(Zv);)Fv+=Zv,jv();return"false"===Fv?Fv=!1:"true"===Fv?Fv=!0:isNaN(Number(Fv))||(Fv=Number(Fv)),void(Gv=Mv.IDENTIFIER)}if('"'===Zv){for(jv();""!=Zv&&('"'!=Zv||'"'===Zv&&'"'===Lv());)'"'===Zv?(Fv+=Zv,jv()):"\\"===Zv&&"n"===Lv()?(Fv+="\n",jv()):Fv+=Zv,jv();if('"'!=Zv)throw gy('End of string " expected');return jv(),void(Gv=Mv.IDENTIFIER)}for(Gv=Mv.UNKNOWN;""!=Zv;)Fv+=Zv,jv();throw new SyntaxError('Syntax error in part "'+ty(Fv,30)+'"')}Gv=Mv.DELIMITER}function Hv(g){for(;""!==Fv&&"}"!=Fv;)Xv(g),";"===Fv&&Kv()}function Xv(g){var t=Jv(g);if(t)qv(g,t);else{var A=function(g){if("node"===Fv)return Kv(),g.node=$v(),"node";if("edge"===Fv)return Kv(),g.edge=$v(),"edge";if("graph"===Fv)return Kv(),g.graph=$v(),"graph";return null}(g);if(!A){if(Gv!=Mv.IDENTIFIER)throw gy("Identifier expected");var e=Fv;if(Kv(),"="===Fv){if(Kv(),Gv!=Mv.IDENTIFIER)throw gy("Identifier expected");g[e]=Fv,Kv()}else!function(g,t){var A={id:t},e=$v();e&&(A.attr=e);Qv(g,A),qv(g,t)}(g,e)}}}function Jv(g){var t=null;if("subgraph"===Fv&&((t={}).type="subgraph",Kv(),Gv===Mv.IDENTIFIER&&(t.id=Fv,Kv())),"{"===Fv){if(Kv(),t||(t={}),t.parent=g,t.node=g.node,t.edge=g.edge,t.graph=g.graph,Hv(t),"}"!=Fv)throw gy("Angle bracket } expected");Kv(),delete t.node,delete t.edge,delete t.graph,delete t.parent,g.subgraphs||(g.subgraphs=[]),g.subgraphs.push(t)}return t}function qv(g,t){for(;"->"===Fv||"--"===Fv;){var A,e=Fv;Kv();var C=Jv(g);if(C)A=C;else{if(Gv!=Mv.IDENTIFIER)throw gy("Identifier or subgraph expected");Qv(g,{id:A=Fv}),Kv()}Uv(g,_v(g,t,A,e,$v())),t=A}}function $v(){for(var g,t,A=null,e={dashed:!0,solid:!1,dotted:[1,5]},C={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},I=new Array,i=new Array;"["===Fv;){for(Kv(),A={};""!==Fv&&"]"!=Fv;){if(Gv!=Mv.IDENTIFIER)throw gy("Attribute name expected");var o=Fv;if(Kv(),"="!=Fv)throw gy("Equal sign = expected");if(Kv(),Gv!=Mv.IDENTIFIER)throw gy("Attribute value expected");var n=Fv;"style"===o&&(n=e[n]),"arrowhead"===o&&(o="arrows",n={to:{enabled:!0,type:C[n]}}),"arrowtail"===o&&(o="arrows",n={from:{enabled:!0,type:C[n]}}),I.push({attr:A,name:o,value:n}),i.push(o),Kv(),","==Fv&&Kv()}if("]"!=Fv)throw gy("Bracket ] expected");Kv()}if(Ic(i).call(i,"dir")){var r={arrows:{}};for(g=0;g"===g.type&&(t.arrows="to"),t};Cl(C=A.edges).call(C,(function(g){var t,A,C,i,o,n,r;(t=g.from instanceof Object?g.from.nodes:{id:g.from},A=g.to instanceof Object?g.to.nodes:{id:g.to},g.from instanceof Object&&g.from.edges)&&Cl(C=g.from.edges).call(C,(function(g){var t=I(g);e.edges.push(t)}));(o=A,n=function(t,A){var C=_v(e,t.id,A.id,g.type,g.attr),i=I(C);e.edges.push(i)},Rh(i=t)?Cl(i).call(i,(function(g){Rh(o)?Cl(o).call(o,(function(t){n(g,t)})):n(g,o)})):Rh(o)?Cl(o).call(o,(function(g){n(i,g)})):n(i,o),g.to instanceof Object&&g.to.edges)&&Cl(r=g.to.edges).call(r,(function(g){var t=I(g);e.edges.push(t)}))}))}return A.attr&&(e.options=A.attr),e}var Iy=Object.freeze({__proto__:null,DOTToGraph:Cy,parseDOT:Nv});function iy(g,t){var A,e={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=t&&(null!=t.fixed&&(e.nodes.fixed=t.fixed),null!=t.parseColor&&(e.nodes.parseColor=t.parseColor),null!=t.inheritColor&&(e.edges.inheritColor=t.inheritColor));var C=g.edges,I=Fh(C).call(C,(function(g){var t={from:g.source,id:g.id,to:g.target};return null!=g.attributes&&(t.attributes=g.attributes),null!=g.label&&(t.label=g.label),null!=g.attributes&&null!=g.attributes.title&&(t.title=g.attributes.title),"Directed"===g.type&&(t.arrows="to"),g.color&&!1===e.edges.inheritColor&&(t.color=g.color),t}));return{nodes:Fh(A=g.nodes).call(A,(function(g){var t={id:g.id,fixed:e.nodes.fixed&&null!=g.x&&null!=g.y};return null!=g.attributes&&(t.attributes=g.attributes),null!=g.label&&(t.label=g.label),null!=g.size&&(t.size=g.size),null!=g.attributes&&null!=g.attributes.title&&(t.title=g.attributes.title),null!=g.title&&(t.title=g.title),null!=g.x&&(t.x=g.x),null!=g.y&&(t.y=g.y),null!=g.color&&(!0===e.nodes.parseColor?t.color=g.color:t.color={background:g.color,border:g.color,highlight:{background:g.color,border:g.color},hover:{background:g.color,border:g.color}}),t})),edges:I}}var oy=Object.freeze({__proto__:null,parseGephi:iy}),ny=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});var ry=function(){function g(){cn(this,g),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return kd(g,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var g=this.image.width,t=this.image.height;this.width=g,this.height=t;var A=Math.floor(t/2),e=Math.floor(t/4),C=Math.floor(t/8),I=Math.floor(t/16),i=Math.floor(g/2),o=Math.floor(g/4),n=Math.floor(g/8),r=Math.floor(g/16);this.canvas.width=3*o,this.canvas.height=A,this.coordinates=[[0,0,i,A],[i,0,o,e],[i,e,n,C],[5*n,e,r,I]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var g=this.canvas.getContext("2d"),t=this.coordinates[0];g.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var A=1;A2){t*=.5;for(var i=0;t>2&&i=this.NUM_ITERATIONS&&(i=this.NUM_ITERATIONS-1);var o=this.coordinates[i];g.drawImage(this.canvas,o[0],o[1],o[2],o[3],A,e,C,I)}else g.drawImage(this.image,A,e,C,I)}}]),g}(),sy=function(){function g(t){cn(this,g),this.images={},this.imageBroken={},this.callback=t}return kd(g,[{key:"_tryloadBrokenUrl",value:function(g,t,A){void 0!==g&&void 0!==A&&(void 0!==t?(A.image.onerror=function(){console.error("Could not load brokenImage:",t)},A.image.src=t):console.warn("No broken url image defined"))}},{key:"_redrawWithImage",value:function(g){this.callback&&this.callback(g)}},{key:"load",value:function(g,t){var A=this,e=this.images[g];if(e)return e;var C=new ry;return this.images[g]=C,C.image.onload=function(){A._fixImageCoordinates(C.image),C.init(),A._redrawWithImage(C)},C.image.onerror=function(){console.error("Could not load image:",g),A._tryloadBrokenUrl(g,t,C)},C.image.src=g,C}},{key:"_fixImageCoordinates",value:function(g){0===g.width&&(document.body.appendChild(g),g.width=g.offsetWidth,g.height=g.offsetHeight,document.body.removeChild(g))}}]),g}(),ay={exports:{}},dy=I((function(){if("function"==typeof ArrayBuffer){var g=new ArrayBuffer(8);Object.isExtensible(g)&&Object.defineProperty(g,"a",{value:8})}})),hy=I,ly=gg,cy=y,uy=dy,py=Object.isExtensible,fy=hy((function(){py(1)}))||uy?function(g){return!!ly(g)&&((!uy||"ArrayBuffer"!==cy(g))&&(!py||py(g)))}:py,vy=!I((function(){return Object.isExtensible(Object.preventExtensions({}))})),yy=TA,my=u,by=UA,wy=gg,ky=qg,xy=Jt.f,Ey=gr,Oy=er,Ty=fy,Dy=vy,Ny=!1,Ry=et("meta"),Py=0,My=function(g){xy(g,Ry,{value:{objectID:"O"+Py++,weakData:{}}})},By=ay.exports={enable:function(){By.enable=function(){},Ny=!0;var g=Ey.f,t=my([].splice),A={};A[Ry]=1,g(A).length&&(Ey.f=function(A){for(var e=g(A),C=0,I=e.length;CI;I++)if((o=p(g[I]))&&Vy(Ky,o))return o;return new _y(!1)}e=Yy(g,C)}for(n=d?g.next:e.next;!(r=Zy(n,e)).done;){try{o=p(r.value)}catch(g){Qy(e,"throw",g)}if("object"==typeof o&&o&&Vy(Ky,o))return o}return new _y(!1)},Xy=og,Jy=TypeError,qy=function(g,t){if(Xy(t,g))return g;throw new Jy("Incorrect invocation")},$y=TA,gm=C,tm=zy,Am=I,em=uA,Cm=Hy,Im=qy,im=O,om=gg,nm=Q,rm=_I,sm=Jt.f,am=Sr.forEach,dm=D,hm=GC.set,lm=GC.getterFor,cm=function(g,t,A){var e,C=-1!==g.indexOf("Map"),I=-1!==g.indexOf("Weak"),i=C?"set":"add",o=gm[g],n=o&&o.prototype,r={};if(dm&&im(o)&&(I||n.forEach&&!Am((function(){(new o).entries().next()})))){var s=(e=t((function(t,A){hm(Im(t,s),{type:g,collection:new o}),nm(A)||Cm(A,t[i],{that:t,AS_ENTRIES:C})}))).prototype,a=lm(g);am(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(g){var t="add"===g||"set"===g;!(g in n)||I&&"clear"===g||em(s,g,(function(A,e){var C=a(this).collection;if(!t&&I&&!om(A))return"get"===g&&void 0;var i=C[g](0===A?0:A,e);return t?this:i}))})),I||sm(s,"size",{configurable:!0,get:function(){return a(this).collection.size}})}else e=A.getConstructor(t,g,C,i),tm.enable();return rm(e,g,!1,!0),r[g]=e,$y({global:!0,forced:!0},r),I||A.setStrong(e,g,C),e},um=TI,pm=function(g,t,A){for(var e in t)A&&A.unsafe&&g[e]?g[e]=t[e]:um(g,e,t[e],A);return g},fm=ig,vm=ur,ym=D,mm=dt("species"),bm=function(g){var t=fm(g);ym&&t&&!t[mm]&&vm(t,mm,{configurable:!0,get:function(){return this}})},wm=pI,km=ur,xm=pm,Em=Xt,Om=qy,Tm=Q,Dm=Hy,Nm=Ei,Rm=Oi,Pm=bm,Mm=D,Bm=zy.fastKey,zm=GC.set,Sm=GC.getterFor,Zm={getConstructor:function(g,t,A,e){var C=g((function(g,C){Om(g,I),zm(g,{type:t,index:wm(null),first:void 0,last:void 0,size:0}),Mm||(g.size=0),Tm(C)||Dm(C,g[e],{that:g,AS_ENTRIES:A})})),I=C.prototype,i=Sm(t),o=function(g,t,A){var e,C,I=i(g),o=n(g,t);return o?o.value=A:(I.last=o={index:C=Bm(t,!0),key:t,value:A,previous:e=I.last,next:void 0,removed:!1},I.first||(I.first=o),e&&(e.next=o),Mm?I.size++:g.size++,"F"!==C&&(I.index[C]=o)),g},n=function(g,t){var A,e=i(g),C=Bm(t);if("F"!==C)return e.index[C];for(A=e.first;A;A=A.next)if(A.key===t)return A};return xm(I,{clear:function(){for(var g=i(this),t=g.index,A=g.first;A;)A.removed=!0,A.previous&&(A.previous=A.previous.next=void 0),delete t[A.index],A=A.next;g.first=g.last=void 0,Mm?g.size=0:this.size=0},delete:function(g){var t=this,A=i(t),e=n(t,g);if(e){var C=e.next,I=e.previous;delete A.index[e.index],e.removed=!0,I&&(I.next=C),C&&(C.previous=I),A.first===e&&(A.first=C),A.last===e&&(A.last=I),Mm?A.size--:t.size--}return!!e},forEach:function(g){for(var t,A=i(this),e=Em(g,arguments.length>1?arguments[1]:void 0);t=t?t.next:A.first;)for(e(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(g){return!!n(this,g)}}),xm(I,A?{get:function(g){var t=n(this,g);return t&&t.value},set:function(g,t){return o(this,0===g?0:g,t)}}:{add:function(g){return o(this,g=0===g?0:g,g)}}),Mm&&km(I,"size",{configurable:!0,get:function(){return i(this).size}}),C},setStrong:function(g,t,A){var e=t+" Iterator",C=Sm(t),I=Sm(e);Nm(g,t,(function(g,t){zm(this,{type:e,target:g,state:C(g),kind:t,last:void 0})}),(function(){for(var g=I(this),t=g.kind,A=g.last;A&&A.removed;)A=A.previous;return g.target&&(g.last=A=A?A.next:g.state.first)?Rm("keys"===t?A.key:"values"===t?A.value:[A.key,A.value],!1):(g.target=void 0,Rm(void 0,!0))}),A?"entries":"values",!A,!0),Pm(t)}};cm("Map",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Zm);var Fm=A(tg.Map),Gm=function(){function g(){cn(this,g),this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},fe(this.options,this.defaultOptions)}return kd(g,[{key:"setOptions",value:function(g){var t=["useDefaultGroups"];if(void 0!==g)for(var A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&-1===Xc(t).call(t,A)){var e=g[A];this.add(A,e)}}},{key:"clear",value:function(){this._groups=new Fm,this._groupNames=[]}},{key:"get",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],A=this._groups.get(g);if(void 0===A&&t)if(!1===this.options.useDefaultGroups&&this._groupNames.length>0){var e=this._groupIndex%this._groupNames.length;++this._groupIndex,(A={}).color=this._groups.get(this._groupNames[e]),this._groups.set(g,A)}else{var C=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,(A={}).color=this._defaultGroups[C],this._groups.set(g,A)}return A}},{key:"add",value:function(g,t){return this._groups.has(g)||this._groupNames.push(g),this._groups.set(g,t),t}}]),g}();TA({target:"Number",stat:!0},{isNaN:function(g){return g!=g}});var jm=A(tg.Number.isNaN),Lm=C.isFinite,Vm=Number.isFinite||function(g){return"number"==typeof g&&Lm(g)};TA({target:"Number",stat:!0},{isFinite:Vm});var Ym=A(tg.Number.isFinite),Wm=Sr.some;TA({target:"Array",proto:!0,forced:!_h("some")},{some:function(g){return Wm(this,g,arguments.length>1?arguments[1]:void 0)}});var Qm=Me("Array").some,Um=og,_m=Qm,Km=Array.prototype,Hm=function(g){var t=g.some;return g===Km||Um(Km,g)&&t===Km.some?_m:t},Xm=A(Hm);function Jm(g){if(void 0===g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}var qm=qc,$m=A(qm);TA({target:"Object",stat:!0},{setPrototypeOf:ri});var gb=tg.Object.setPrototypeOf,tb=A(gb),Ab=A(Ge);function eb(g,t){var A;return eb=tb?Ab(A=tb).call(A):function(g,t){return g.__proto__=t,g},eb(g,t)}function Cb(g,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");g.prototype=$m(t&&t.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),kn(g,"prototype",{writable:!1}),t&&eb(g,t)}function Ib(g,t){if(t&&("object"===yd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Jm(g)}var ib=rc,ob=A(ib);function nb(g){var t;return nb=tb?Ab(t=ob).call(t):function(g){return g.__proto__||ob(g)},nb(g)}function rb(g,t,A){return(t=bd(t))in g?kn(g,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):g[t]=A,g}var sb={exports:{}},ab={exports:{}};!function(g){var t=cd,A=fd;function e(C){return g.exports=e="function"==typeof t&&"symbol"==typeof A?function(g){return typeof g}:function(g){return g&&"function"==typeof t&&g.constructor===t&&g!==t.prototype?"symbol":typeof g},g.exports.__esModule=!0,g.exports.default=g.exports,e(C)}g.exports=e,g.exports.__esModule=!0,g.exports.default=g.exports}(ab);var db=ab.exports,hb=el,lb=qg,cb=Dh,ub=T,pb=Jt,fb=gg,vb=uA,yb=Error,mb=u("".replace),bb=String(new yb("zxcasd").stack),wb=/\n\s*at [^:]*:[^\n]*/,kb=wb.test(bb),xb=G,Eb=!I((function(){var g=new Error("a");return!("stack"in g)||(Object.defineProperty(g,"stack",xb(1,7)),7!==g.stack)})),Ob=uA,Tb=function(g,t){if(kb&&"string"==typeof g&&!yb.prepareStackTrace)for(;t--;)g=mb(g,wb,"");return g},Db=Eb,Nb=Error.captureStackTrace,Rb=sC,Pb=TA,Mb=og,Bb=EI,zb=ri,Sb=function(g,t,A){for(var e=cb(t),C=pb.f,I=ub.f,i=0;i2&&jb(A,arguments[2]);var C=[];return Vb(g,Ub,{that:C}),Fb(A,"errors",C),A};zb?zb(_b,Qb):Sb(_b,Qb,{name:!0});var Kb=_b.prototype=Zb(Qb.prototype,{constructor:Gb(1,_b),message:Gb(1,""),name:Gb(1,"AggregateError")});Pb({global:!0,constructor:!0,arity:2},{AggregateError:_b});var Hb,Xb,Jb,qb,$b="process"===y(C.process),gw=ro,tw=Og,Aw=TypeError,ew=function(g){if(gw(g))return g;throw new Aw(tw(g)+" is not a constructor")},Cw=AA,Iw=ew,iw=Q,ow=dt("species"),nw=function(g,t){var A,e=Cw(g).constructor;return void 0===e||iw(A=Cw(e)[ow])?t:Iw(A)},rw=/(?:ipad|iphone|ipod).*applewebkit/i.test(ng),sw=C,aw=a,dw=Xt,hw=O,lw=qg,cw=I,uw=gI,pw=ve,fw=Et,vw=iu,yw=rw,mw=$b,bw=sw.setImmediate,ww=sw.clearImmediate,kw=sw.process,xw=sw.Dispatch,Ew=sw.Function,Ow=sw.MessageChannel,Tw=sw.String,Dw=0,Nw={},Rw="onreadystatechange";cw((function(){Hb=sw.location}));var Pw=function(g){if(lw(Nw,g)){var t=Nw[g];delete Nw[g],t()}},Mw=function(g){return function(){Pw(g)}},Bw=function(g){Pw(g.data)},zw=function(g){sw.postMessage(Tw(g),Hb.protocol+"//"+Hb.host)};bw&&ww||(bw=function(g){vw(arguments.length,1);var t=hw(g)?g:Ew(g),A=pw(arguments,1);return Nw[++Dw]=function(){aw(t,void 0,A)},Xb(Dw),Dw},ww=function(g){delete Nw[g]},mw?Xb=function(g){kw.nextTick(Mw(g))}:xw&&xw.now?Xb=function(g){xw.now(Mw(g))}:Ow&&!yw?(qb=(Jb=new Ow).port2,Jb.port1.onmessage=Bw,Xb=dw(qb.postMessage,qb)):sw.addEventListener&&hw(sw.postMessage)&&!sw.importScripts&&Hb&&"file:"!==Hb.protocol&&!cw(zw)?(Xb=zw,sw.addEventListener("message",Bw,!1)):Xb=Rw in fw("script")?function(g){uw.appendChild(fw("script"))[Rw]=function(){uw.removeChild(this),Pw(g)}}:function(g){setTimeout(Mw(g),0)});var Sw={set:bw,clear:ww},Zw=function(){this.head=null,this.tail=null};Zw.prototype={add:function(g){var t={item:g,next:null},A=this.tail;A?A.next=t:this.head=t,this.tail=t},get:function(){var g=this.head;if(g)return null===(this.head=g.next)&&(this.tail=null),g.item}};var Fw,Gw,jw,Lw,Vw,Yw=Zw,Ww=/ipad|iphone|ipod/i.test(ng)&&"undefined"!=typeof Pebble,Qw=/web0s(?!.*chrome)/i.test(ng),Uw=C,_w=Xt,Kw=T.f,Hw=Sw.set,Xw=Yw,Jw=rw,qw=Ww,$w=Qw,gk=$b,tk=Uw.MutationObserver||Uw.WebKitMutationObserver,Ak=Uw.document,ek=Uw.process,Ck=Uw.Promise,Ik=Kw(Uw,"queueMicrotask"),ik=Ik&&Ik.value;if(!ik){var ok=new Xw,nk=function(){var g,t;for(gk&&(g=ek.domain)&&g.exit();t=ok.get();)try{t()}catch(g){throw ok.head&&Fw(),g}g&&g.enter()};Jw||gk||$w||!tk||!Ak?!qw&&Ck&&Ck.resolve?((Lw=Ck.resolve(void 0)).constructor=Ck,Vw=_w(Lw.then,Lw),Fw=function(){Vw(nk)}):gk?Fw=function(){ek.nextTick(nk)}:(Hw=_w(Hw,Uw),Fw=function(){Hw(nk)}):(Gw=!0,jw=Ak.createTextNode(""),new tk(nk).observe(jw,{characterData:!0}),Fw=function(){jw.data=Gw=!Gw}),ik=function(g){ok.head||Fw(),ok.add(g)}}var rk=ik,sk=function(g){try{return{error:!1,value:g()}}catch(g){return{error:!0,value:g}}},ak=C.Promise,dk="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,hk=!dk&&!$b&&"object"==typeof window&&"object"==typeof document,lk=C,ck=ak,uk=O,pk=Ut,fk=Hi,vk=dt,yk=hk,mk=dk,bk=cg,wk=ck&&ck.prototype,kk=vk("species"),xk=!1,Ek=uk(lk.PromiseRejectionEvent),Ok=pk("Promise",(function(){var g=fk(ck),t=g!==String(ck);if(!t&&66===bk)return!0;if(!wk.catch||!wk.finally)return!0;if(!bk||bk<51||!/native code/.test(g)){var A=new ck((function(g){g(1)})),e=function(g){g((function(){}),(function(){}))};if((A.constructor={})[kk]=e,!(xk=A.then((function(){}))instanceof e))return!0}return!t&&(yk||mk)&&!Ek})),Tk={CONSTRUCTOR:Ok,REJECTION_EVENT:Ek,SUBCLASSING:xk},Dk={},Nk=Rg,Rk=TypeError,Pk=function(g){var t,A;this.promise=new g((function(g,e){if(void 0!==t||void 0!==A)throw new Rk("Bad Promise constructor");t=g,A=e})),this.resolve=Nk(t),this.reject=Nk(A)};Dk.f=function(g){return new Pk(g)};var Mk,Bk,zk=TA,Sk=$b,Zk=C,Fk=P,Gk=TI,jk=_I,Lk=bm,Vk=Rg,Yk=O,Wk=gg,Qk=qy,Uk=nw,_k=Sw.set,Kk=rk,Hk=function(g,t){try{1===arguments.length?console.error(g):console.error(g,t)}catch(g){}},Xk=sk,Jk=Yw,qk=GC,$k=ak,gx=Tk,tx=Dk,Ax="Promise",ex=gx.CONSTRUCTOR,Cx=gx.REJECTION_EVENT,Ix=qk.getterFor(Ax),ix=qk.set,ox=$k&&$k.prototype,nx=$k,rx=ox,sx=Zk.TypeError,ax=Zk.document,dx=Zk.process,hx=tx.f,lx=hx,cx=!!(ax&&ax.createEvent&&Zk.dispatchEvent),ux="unhandledrejection",px=function(g){var t;return!(!Wk(g)||!Yk(t=g.then))&&t},fx=function(g,t){var A,e,C,I=t.value,i=1===t.state,o=i?g.ok:g.fail,n=g.resolve,r=g.reject,s=g.domain;try{o?(i||(2===t.rejection&&wx(t),t.rejection=1),!0===o?A=I:(s&&s.enter(),A=o(I),s&&(s.exit(),C=!0)),A===g.promise?r(new sx("Promise-chain cycle")):(e=px(A))?Fk(e,A,n,r):n(A)):r(I)}catch(g){s&&!C&&s.exit(),r(g)}},vx=function(g,t){g.notified||(g.notified=!0,Kk((function(){for(var A,e=g.reactions;A=e.get();)fx(A,g);g.notified=!1,t&&!g.rejection&&mx(g)})))},yx=function(g,t,A){var e,C;cx?((e=ax.createEvent("Event")).promise=t,e.reason=A,e.initEvent(g,!1,!0),Zk.dispatchEvent(e)):e={promise:t,reason:A},!Cx&&(C=Zk["on"+g])?C(e):g===ux&&Hk("Unhandled promise rejection",A)},mx=function(g){Fk(_k,Zk,(function(){var t,A=g.facade,e=g.value;if(bx(g)&&(t=Xk((function(){Sk?dx.emit("unhandledRejection",e,A):yx(ux,A,e)})),g.rejection=Sk||bx(g)?2:1,t.error))throw t.value}))},bx=function(g){return 1!==g.rejection&&!g.parent},wx=function(g){Fk(_k,Zk,(function(){var t=g.facade;Sk?dx.emit("rejectionHandled",t):yx("rejectionhandled",t,g.value)}))},kx=function(g,t,A){return function(e){g(t,e,A)}},xx=function(g,t,A){g.done||(g.done=!0,A&&(g=A),g.value=t,g.state=2,vx(g,!0))},Ex=function(g,t,A){if(!g.done){g.done=!0,A&&(g=A);try{if(g.facade===t)throw new sx("Promise can't be resolved itself");var e=px(t);e?Kk((function(){var A={done:!1};try{Fk(e,t,kx(Ex,A,g),kx(xx,A,g))}catch(t){xx(A,t,g)}})):(g.value=t,g.state=1,vx(g,!1))}catch(t){xx({done:!1},t,g)}}};ex&&(rx=(nx=function(g){Qk(this,rx),Vk(g),Fk(Mk,this);var t=Ix(this);try{g(kx(Ex,t),kx(xx,t))}catch(g){xx(t,g)}}).prototype,(Mk=function(g){ix(this,{type:Ax,done:!1,notified:!1,parent:!1,reactions:new Jk,rejection:!1,state:0,value:void 0})}).prototype=Gk(rx,"then",(function(g,t){var A=Ix(this),e=hx(Uk(this,nx));return A.parent=!0,e.ok=!Yk(g)||g,e.fail=Yk(t)&&t,e.domain=Sk?dx.domain:void 0,0===A.state?A.reactions.add(e):Kk((function(){fx(e,A)})),e.promise})),Bk=function(){var g=new Mk,t=Ix(g);this.promise=g,this.resolve=kx(Ex,t),this.reject=kx(xx,t)},tx.f=hx=function(g){return g===nx||undefined===g?new Bk(g):lx(g)}),zk({global:!0,constructor:!0,wrap:!0,forced:ex},{Promise:nx}),jk(nx,Ax,!1,!0),Lk(Ax);var Ox=ak,Tx=Tk.CONSTRUCTOR||!Yo((function(g){Ox.all(g).then(void 0,(function(){}))})),Dx=P,Nx=Rg,Rx=Dk,Px=sk,Mx=Hy;TA({target:"Promise",stat:!0,forced:Tx},{all:function(g){var t=this,A=Rx.f(t),e=A.resolve,C=A.reject,I=Px((function(){var A=Nx(t.resolve),I=[],i=0,o=1;Mx(g,(function(g){var n=i++,r=!1;o++,Dx(A,t,g).then((function(g){r||(r=!0,I[n]=g,--o||e(I))}),C)})),--o||e(I)}));return I.error&&C(I.value),A.promise}});var Bx=TA,zx=Tk.CONSTRUCTOR;ak&&ak.prototype,Bx({target:"Promise",proto:!0,forced:zx,real:!0},{catch:function(g){return this.then(void 0,g)}});var Sx=P,Zx=Rg,Fx=Dk,Gx=sk,jx=Hy;TA({target:"Promise",stat:!0,forced:Tx},{race:function(g){var t=this,A=Fx.f(t),e=A.reject,C=Gx((function(){var C=Zx(t.resolve);jx(g,(function(g){Sx(C,t,g).then(A.resolve,e)}))}));return C.error&&e(C.value),A.promise}});var Lx=P,Vx=Dk;TA({target:"Promise",stat:!0,forced:Tk.CONSTRUCTOR},{reject:function(g){var t=Vx.f(this);return Lx(t.reject,void 0,g),t.promise}});var Yx=AA,Wx=gg,Qx=Dk,Ux=function(g,t){if(Yx(g),Wx(t)&&t.constructor===g)return t;var A=Qx.f(g);return(0,A.resolve)(t),A.promise},_x=TA,Kx=ak,Hx=Tk.CONSTRUCTOR,Xx=Ux,Jx=ig("Promise"),qx=!Hx;_x({target:"Promise",stat:!0,forced:true},{resolve:function(g){return Xx(qx&&this===Jx?Kx:this,g)}});var $x=P,gE=Rg,tE=Dk,AE=sk,eE=Hy;TA({target:"Promise",stat:!0,forced:Tx},{allSettled:function(g){var t=this,A=tE.f(t),e=A.resolve,C=A.reject,I=AE((function(){var A=gE(t.resolve),C=[],I=0,i=1;eE(g,(function(g){var o=I++,n=!1;i++,$x(A,t,g).then((function(g){n||(n=!0,C[o]={status:"fulfilled",value:g},--i||e(C))}),(function(g){n||(n=!0,C[o]={status:"rejected",reason:g},--i||e(C))}))})),--i||e(C)}));return I.error&&C(I.value),A.promise}});var CE=P,IE=Rg,iE=ig,oE=Dk,nE=sk,rE=Hy,sE="No one promise resolved";TA({target:"Promise",stat:!0,forced:Tx},{any:function(g){var t=this,A=iE("AggregateError"),e=oE.f(t),C=e.resolve,I=e.reject,i=nE((function(){var e=IE(t.resolve),i=[],o=0,n=1,r=!1;rE(g,(function(g){var s=o++,a=!1;n++,CE(e,t,g).then((function(g){a||r||(r=!0,C(g))}),(function(g){a||r||(a=!0,i[s]=g,--n||I(new A(i,sE)))}))})),--n||I(new A(i,sE))}));return i.error&&I(i.value),e.promise}});var aE=TA,dE=ak,hE=I,lE=ig,cE=O,uE=nw,pE=Ux,fE=dE&&dE.prototype;aE({target:"Promise",proto:!0,real:!0,forced:!!dE&&hE((function(){fE.finally.call({then:function(){}},(function(){}))}))},{finally:function(g){var t=uE(this,lE("Promise")),A=cE(g);return this.then(A?function(A){return pE(t,g()).then((function(){return A}))}:g,A?function(A){return pE(t,g()).then((function(){throw A}))}:g)}});var vE=tg.Promise,yE=Dk;TA({target:"Promise",stat:!0},{withResolvers:function(){var g=yE.f(this);return{promise:g.promise,resolve:g.resolve,reject:g.reject}}});var mE=vE,bE=Dk,wE=sk;TA({target:"Promise",stat:!0,forced:!0},{try:function(g){var t=bE.f(this),A=wE(g);return(A.error?t.reject:t.resolve)(A.value),t.promise}});var kE=mE,xE=ll;!function(g){var t=db.default,A=wn,e=cd,C=qm,I=ib,i=hb,o=Ld,n=gb,r=kE,s=xE,a=rh;function d(){g.exports=d=function(){return l},g.exports.__esModule=!0,g.exports.default=g.exports;var h,l={},c=Object.prototype,u=c.hasOwnProperty,p=A||function(g,t,A){g[t]=A.value},f="function"==typeof e?e:{},v=f.iterator||"@@iterator",y=f.asyncIterator||"@@asyncIterator",m=f.toStringTag||"@@toStringTag";function b(g,t,e){return A(g,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),g[t]}try{b({},"")}catch(h){b=function(g,t,A){return g[t]=A}}function w(g,t,A,e){var I=t&&t.prototype instanceof N?t:N,i=C(I.prototype),o=new V(e||[]);return p(i,"_invoke",{value:F(g,A,o)}),i}function k(g,t,A){try{return{type:"normal",arg:g.call(t,A)}}catch(g){return{type:"throw",arg:g}}}l.wrap=w;var x="suspendedStart",E="suspendedYield",O="executing",T="completed",D={};function N(){}function R(){}function P(){}var M={};b(M,v,(function(){return this}));var B=I&&I(I(Y([])));B&&B!==c&&u.call(B,v)&&(M=B);var z=P.prototype=N.prototype=C(M);function S(g){var t;i(t=["next","throw","return"]).call(t,(function(t){b(g,t,(function(g){return this._invoke(t,g)}))}))}function Z(g,A){function e(C,I,i,o){var n=k(g[C],g,I);if("throw"!==n.type){var r=n.arg,s=r.value;return s&&"object"==t(s)&&u.call(s,"__await")?A.resolve(s.__await).then((function(g){e("next",g,i,o)}),(function(g){e("throw",g,i,o)})):A.resolve(s).then((function(g){r.value=g,i(r)}),(function(g){return e("throw",g,i,o)}))}o(n.arg)}var C;p(this,"_invoke",{value:function(g,t){function I(){return new A((function(A,C){e(g,t,A,C)}))}return C=C?C.then(I,I):I()}})}function F(g,t,A){var e=x;return function(C,I){if(e===O)throw new Error("Generator is already running");if(e===T){if("throw"===C)throw I;return{value:h,done:!0}}for(A.method=C,A.arg=I;;){var i=A.delegate;if(i){var o=G(i,A);if(o){if(o===D)continue;return o}}if("next"===A.method)A.sent=A._sent=A.arg;else if("throw"===A.method){if(e===x)throw e=T,A.arg;A.dispatchException(A.arg)}else"return"===A.method&&A.abrupt("return",A.arg);e=O;var n=k(g,t,A);if("normal"===n.type){if(e=A.done?T:E,n.arg===D)continue;return{value:n.arg,done:A.done}}"throw"===n.type&&(e=T,A.method="throw",A.arg=n.arg)}}}function G(g,t){var A=t.method,e=g.iterator[A];if(e===h)return t.delegate=null,"throw"===A&&g.iterator.return&&(t.method="return",t.arg=h,G(g,t),"throw"===t.method)||"return"!==A&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+A+"' method")),D;var C=k(e,g.iterator,t.arg);if("throw"===C.type)return t.method="throw",t.arg=C.arg,t.delegate=null,D;var I=C.arg;return I?I.done?(t[g.resultName]=I.value,t.next=g.nextLoc,"return"!==t.method&&(t.method="next",t.arg=h),t.delegate=null,D):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,D)}function j(g){var t,A={tryLoc:g[0]};1 in g&&(A.catchLoc=g[1]),2 in g&&(A.finallyLoc=g[2],A.afterLoc=g[3]),o(t=this.tryEntries).call(t,A)}function L(g){var t=g.completion||{};t.type="normal",delete t.arg,g.completion=t}function V(g){this.tryEntries=[{tryLoc:"root"}],i(g).call(g,j,this),this.reset(!0)}function Y(g){if(g||""===g){var A=g[v];if(A)return A.call(g);if("function"==typeof g.next)return g;if(!isNaN(g.length)){var e=-1,C=function t(){for(;++e=0;--e){var C=this.tryEntries[e],I=C.completion;if("root"===C.tryLoc)return A("end");if(C.tryLoc<=this.prev){var i=u.call(C,"catchLoc"),o=u.call(C,"finallyLoc");if(i&&o){if(this.prev=0;--A){var e=this.tryEntries[A];if(e.tryLoc<=this.prev&&u.call(e,"finallyLoc")&&this.prev=0;--t){var A=this.tryEntries[t];if(A.finallyLoc===g)return this.complete(A.completion,A.afterLoc),L(A),D}},catch:function(g){for(var t=this.tryEntries.length-1;t>=0;--t){var A=this.tryEntries[t];if(A.tryLoc===g){var e=A.completion;if("throw"===e.type){var C=e.arg;L(A)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(g,t,A){return this.delegate={iterator:Y(g),resultName:t,nextLoc:A},"next"===this.method&&(this.arg=h),D}},l}g.exports=d,g.exports.__esModule=!0,g.exports.default=g.exports}(sb);var EE=(0,sb.exports)(),OE=EE;try{regeneratorRuntime=EE}catch(g){"object"==typeof globalThis?globalThis.regeneratorRuntime=EE:Function("r","regeneratorRuntime = r")(EE)}var TE=A(OE),DE=Rg,NE=Hg,RE=W,PE=jA,ME=TypeError,BE=function(g){return function(t,A,e,C){DE(A);var I=NE(t),i=RE(I),o=PE(I),n=g?o-1:0,r=g?-1:1;if(e<2)for(;;){if(n in i){C=i[n],n+=r;break}if(n+=r,g?n<0:o<=n)throw new ME("Reduce of empty array with no initial value")}for(;g?n>=0:o>n;n+=r)n in i&&(C=A(C,i[n],n,I));return C}},zE={left:BE(!1),right:BE(!0)}.left;TA({target:"Array",proto:!0,forced:!$b&&cg>79&&cg<83||!_h("reduce")},{reduce:function(g){var t=arguments.length;return zE(this,g,t,t>1?arguments[1]:void 0)}});var SE=Me("Array").reduce,ZE=og,FE=SE,GE=Array.prototype,jE=function(g){var t=g.reduce;return g===GE||ZE(GE,g)&&t===GE.reduce?FE:t},LE=A(jE),VE=En,YE=jA,WE=Tn,QE=Xt,UE=function(g,t,A,e,C,I,i,o){for(var n,r,s=C,a=0,d=!!i&&QE(i,o);a0&&VE(n)?(r=YE(n),s=UE(g,t,n,r,s,I-1)-1):(WE(s+1),g[s]=n),s++),a++;return s},_E=UE,KE=Rg,HE=Hg,XE=jA,JE=zn;TA({target:"Array",proto:!0},{flatMap:function(g){var t,A=HE(this),e=XE(A);return KE(g),(t=JE(A,0)).length=_E(t,A,A,e,0,1,g,arguments.length>1?arguments[1]:void 0),t}});var qE=Me("Array").flatMap,$E=og,gO=qE,tO=Array.prototype,AO=function(g){var t=g.flatMap;return g===tO||$E(tO,g)&&t===tO.flatMap?gO:t},eO=A(AO);cm("Set",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Zm);var CO=A(tg.Set),IO=A(pd),iO=A(Oo),oO=rr,nO=Math.floor,rO=function(g,t){var A=g.length,e=nO(A/2);return A<8?sO(g,t):aO(g,rO(oO(g,0,e),t),rO(oO(g,e),t),t)},sO=function(g,t){for(var A,e,C=g.length,I=1;I0;)g[e]=g[--e];e!==I++&&(g[e]=A)}return g},aO=function(g,t,A,e){for(var C=t.length,I=A.length,i=0,o=0;i3)){if(DO)return!0;if(RO)return RO<603;var g,t,A,e,C="";for(g=65;g<76;g++){switch(t=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:A=3;break;case 68:case 71:A=4;break;default:A=2}for(e=0;e<47;e++)PO.push({k:t+e,v:A})}for(PO.sort((function(g,t){return t.v-g.v})),e=0;ekO(A)?1:-1}}(g)),A=bO(C),e=0;eo;)void 0!==(A=C(e,t=I[o++]))&&KT(i,t,A);return i}});var HT=A(tg.Object.getOwnPropertyDescriptors),XT={exports:{}},JT=TA,qT=D,$T=UC.f;JT({target:"Object",stat:!0,forced:Object.defineProperties!==$T,sham:!qT},{defineProperties:$T});var gD=tg.Object,tD=XT.exports=function(g,t){return gD.defineProperties(g,t)};gD.defineProperties.sham&&(tD.sham=!0);var AD=A(XT.exports);let eD;const CD=new Uint8Array(16);function ID(){if(!eD&&(eD="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!eD))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eD(CD)}const iD=[];for(let g=0;g<256;++g)iD.push((g+256).toString(16).slice(1));var oD,nD={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function rD(g,t,A){if(nD.randomUUID&&!t&&!g)return nD.randomUUID();const e=(g=g||{}).random||(g.rng||ID)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,t){A=A||0;for(let g=0;g<16;++g)t[A+g]=e[g];return t}return function(g,t=0){return iD[g[t+0]]+iD[g[t+1]]+iD[g[t+2]]+iD[g[t+3]]+"-"+iD[g[t+4]]+iD[g[t+5]]+"-"+iD[g[t+6]]+iD[g[t+7]]+"-"+iD[g[t+8]]+iD[g[t+9]]+"-"+iD[g[t+10]]+iD[g[t+11]]+iD[g[t+12]]+iD[g[t+13]]+iD[g[t+14]]+iD[g[t+15]]}(e)}function sD(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function aD(g){for(var t=1;t=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function lD(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);Athis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=wu((function(){g.flush()}),this.delay))}},{key:"flush",value:function(){var g,t;Cl(g=Zl(t=this._queue).call(t,0)).call(g,(function(g){g.fn.apply(g.context||g.fn,g.args||[])}))}}],[{key:"extend",value:function(t,A){var e=new g(A);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){e.flush()};var C=[{name:"flush",original:void 0}];if(A&&A.replace)for(var I=0;IC&&(C=n,e=o)}return e}},{key:"min",value:function(g){var t=iO(this._pairs),A=t.next();if(A.done)return null;for(var e=A.value[1],C=g(A.value[1],A.value[0]);!(A=t.next()).done;){var I=lh(A.value,2),i=I[0],o=I[1],n=g(o,i);n1?A-1:0),C=1;CC?1:eC)&&(e=i,C=o)}}catch(g){I.e(g)}finally{I.f()}return e||null}},{key:"min",value:function(g){var t,A,e=null,C=null,I=hD(nT(t=this._data).call(t));try{for(I.s();!(A=I.n()).done;){var i=A.value,o=i[g];"number"==typeof o&&(null==C||ot.x&&g.topt.y}function QD(g){return"string"==typeof g&&""!==g}function UD(g,t,A,e){var C=e.x,I=e.y;if("function"==typeof e.distanceToBorder){var i=e.distanceToBorder(g,t),o=Math.sin(t)*i,n=Math.cos(t)*i;n===i?(C+=i,I=e.y):o===i?(C=e.x,I-=i):(C+=n,I-=o)}else e.shape.width>e.shape.height?(C=e.x+.5*e.shape.width,I=e.y-A):(C=e.x+A,I=e.y-.5*e.shape.height);return{x:C,y:I}}var _D=function(){function g(t){cn(this,g),this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}return kd(g,[{key:"_add",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[g]&&(this.lines[g]={width:0,height:0,blocks:[]});var e=t;void 0!==t&&""!==t||(e=" ");var C=this.measureText(e,A),I=fe({},nT(C));I.text=t,I.width=C.width,I.mod=A,void 0!==t&&""!==t||(I.width=0),this.lines[g].blocks.push(I),this.lines[g].width+=I.width}},{key:"curWidth",value:function(){var g=this.lines[this.current];return void 0===g?0:g.width}},{key:"append",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,t)}},{key:"newLine",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,t),this.current++}},{key:"determineLineHeights",value:function(){for(var g=0;gg&&(g=e.width),t+=e.height}this.width=g,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var g=[],t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},HD=function(){function g(t){cn(this,g),this.text=t,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return kd(g,[{key:"mod",value:function(){return 0===this.modStack.length?"normal":this.modStack[0]}},{key:"modName",value:function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(g){" "===g&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=g&&(this.buffer+=g)}},{key:"parseWS",value:function(g){return!!/[ \t]/.test(g)&&(this.mono?this.add(g):this.spacing=!0,!0)}},{key:"setTag",value:function(g){this.emitBlock(),this[g]=!0,this.modStack.unshift(g)}},{key:"unsetTag",value:function(g){this.emitBlock(),this[g]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(g,t){return!(this.mono||this[g]||!this.match(t))&&(this.setTag(g),!0)}},{key:"match",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],A=lh(this.prepareRegExp(g),2),e=A[0],C=A[1],I=e.test(this.text.substr(this.position,C));return I&&t&&(this.position+=C-1),I}},{key:"parseEndTag",value:function(g,t,A){var e=this.mod()===g;return!(!(e="mono"===g?e&&this.mono:e&&!this.mono)||!this.match(t))&&(void 0!==A?(this.position===this.text.length-1||this.match(A,!1))&&this.unsetTag(g):this.unsetTag(g),!0)}},{key:"replace",value:function(g,t){return!!this.match(g)&&(this.add(t),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(g){var t,A;if(g instanceof RegExp)A=g,t=1;else{var e=KD[g];A=void 0!==e?e:new RegExp(g),t=g.length}return[A,t]}}]),g}(),XD=function(){function g(t,A,e,C){var I=this;cn(this,g),this.ctx=t,this.parent=A,this.selected=e,this.hover=C;this.lines=new _D((function(g,A){if(void 0===g)return 0;var i=I.parent.getFormattingValues(t,e,C,A),o=0;""!==g&&(o=I.ctx.measureText(g).width);return{width:o,values:i}}))}return kd(g,[{key:"process",value:function(g){if(!QD(g))return this.lines.finalize();var t=this.parent.fontOptions;g=(g=g.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");var A=String(g).split("\n"),e=A.length;if(t.multi)for(var C=0;C0)for(var i=0;i0)for(var d=0;d")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||A(e)||t.add(e),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(g){for(var t=this,A=new HD(g),e=!0,C=function(g){return!!/\\/.test(g)&&(A.positionthis.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(g){for(var t="",A=0;A1&&void 0!==arguments[1]?arguments[1]:"normal",A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t);for(var e=(g=(g=g.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");e.length>0;){var C=this.getLongestFit(e);if(0===C){var I=e[0],i=this.getLongestFitWord(I);this.lines.newLine(wh(I).call(I,0,i),t),e[0]=wh(I).call(I,i)}else{var o=C;" "===e[C-1]?C--:" "===e[o]&&o++;var n=wh(e).call(e,0,C).join("");C==e.length&&A?this.lines.append(n,t):this.lines.newLine(n,t),e=wh(e).call(e,o)}}}}]),g}(),JD=["bold","ital","boldital","mono"],qD=function(){function g(t,A){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];cn(this,g),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(A),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=e}return kd(g,[{key:"setOptions",value:function(g){if(this.elementOptions=g,this.initFontOptions(g.font),QD(g.label)?this.labelDirty=!0:g.label=void 0,void 0!==g.font&&null!==g.font)if("string"==typeof g.font)this.baseSize=this.fontOptions.size;else if("object"===yd(g.font)){var t=g.font.size;void 0!==t&&(this.baseSize=t)}}},{key:"initFontOptions",value:function(t){var A=this;tv(JD,(function(g){A.fontOptions[g]={}})),g.parseFontString(this.fontOptions,t)?this.fontOptions.vadjust=0:tv(t,(function(g,t){null!=g&&"object"!==yd(g)&&(A.fontOptions[t]=g)}))}},{key:"constrain",value:function(g){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},A=lv(g,"widthConstraint");if("number"==typeof A)t.maxWdt=Number(A),t.minWdt=Number(A);else if("object"===yd(A)){var e=lv(g,["widthConstraint","maximum"]);"number"==typeof e&&(t.maxWdt=Number(e));var C=lv(g,["widthConstraint","minimum"]);"number"==typeof C&&(t.minWdt=Number(C))}var I=lv(g,"heightConstraint");if("number"==typeof I)t.minHgt=Number(I);else if("object"===yd(I)){var i=lv(g,["heightConstraint","minimum"]);"number"==typeof i&&(t.minHgt=Number(i));var o=lv(g,["heightConstraint","valign"]);"string"==typeof o&&("top"!==o&&"bottom"!==o||(t.valign=o))}return t}},{key:"update",value:function(g,t){this.setOptions(g,!0),this.propagateFonts(t),qf(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=YD("label",t)}},{key:"adjustSizes",value:function(g){var t=g?g.right+g.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var A=g?g.top+g.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=A)}},{key:"addFontOptionsToPile",value:function(g,t){for(var A=0;A5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var i=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&i=this.elementOptions.scaling.label.maxVisible&&(i=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(g,e,C,t,A,I),this._drawBackground(g),this._drawText(g,t,this.size.yLine,I,i))}}},{key:"_drawBackground",value:function(g){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){g.fillStyle=this.fontOptions.background;var t=this.getSize();g.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0,I=lh(this._setAlignment(g,t,A,e),2);t=I[0],A=I[1],g.textAlign="left",t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(A-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(A+=(this.size.height-this.size.labelHeight)/2));for(var i=0;i0&&(g.lineWidth=s.strokeWidth,g.strokeStyle=h,g.lineJoin="round"),g.fillStyle=d,s.strokeWidth>0&&g.strokeText(s.text,t+n,A+s.vadjust),g.fillText(s.text,t+n,A+s.vadjust),n+=s.width}A+=o.height}}}},{key:"_setAlignment",value:function(g,t,A,e){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){t=0,A=0;"top"===this.fontOptions.align?(g.textBaseline="alphabetic",A-=4):"bottom"===this.fontOptions.align?(g.textBaseline="hanging",A+=4):g.textBaseline="middle"}else g.textBaseline=e;return[t,A]}},{key:"_getColor",value:function(g,t,A){var e=g||"#000000",C=A||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var I=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));e=ev(e,I),C=ev(C,I)}return[e,C]}},{key:"getTextSize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(g,t,A),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var g=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){var A=.5*-this.size.width;switch(this.fontOptions.align){case"middle":g=A,t=.5*-this.size.height;break;case"top":g=A,t=-(this.size.height+2);break;case"bottom":g=A,t=2}}return{left:g,top:t,width:this.size.width,height:this.size.height}}},{key:"calculateLabelSize",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,C=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,I=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(g,t,A),this.size.left=e-.5*this.size.width,this.size.top=C-.5*this.size.height,this.size.yLine=C+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===I&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(g,t,A,e){var C=function(g,t,A){return"normal"===t?"mod"===A?"":g[A]:void 0!==g[t][A]?g[t][A]:g[A]},I={color:C(this.fontOptions,e,"color"),size:C(this.fontOptions,e,"size"),face:C(this.fontOptions,e,"face"),mod:C(this.fontOptions,e,"mod"),vadjust:C(this.fontOptions,e,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||A)&&("normal"===e&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?I.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(I,this.elementOptions.id,t,A));var i="";return void 0!==I.mod&&""!==I.mod&&(i+=I.mod+" "),i+=I.size+"px "+I.face,g.font=i.replace(/"/g,""),I.font=g.font,I.height=I.size,I}},{key:"differentState",value:function(g,t){return g!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(g,t,A,e){return new XD(g,this,t,A).process(e)}},{key:"_processLabel",value:function(g,t,A){if(!1!==this.labelDirty||this.differentState(t,A)){var e=this._processLabelText(g,t,A,this.elementOptions.label);this.fontOptions.minWdt>0&&e.width0&&e.height0&&(this.enableBorderDashes(g,t),g.stroke(),this.disableBorderDashes(g,t)),g.restore()}},{key:"performFill",value:function(g,t){g.save(),g.fillStyle=t.color,this.enableShadow(g,t),Bu(g).call(g),this.disableShadow(g,t),g.restore(),this.performStroke(g,t)}},{key:"_addBoundingBoxMargin",value:function(g){this.boundingBox.left-=g,this.boundingBox.top-=g,this.boundingBox.bottom+=g,this.boundingBox.right+=g}},{key:"_updateBoundingBox",value:function(g,t,A,e,C){void 0!==A&&this.resize(A,e,C),this.left=g-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(g,t,A,e,C){this._updateBoundingBox(g,t,A,e,C)}},{key:"getDimensionsFromLabel",value:function(g,t,A){this.textSize=this.labelModule.getTextSize(g,t,A);var e=this.textSize.width,C=this.textSize.height;return 0===e&&(e=14,C=14),{width:e,height:C}}}]),g}();function gN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var tN=function(g){Cb(A,g);var t=gN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A);this.width=e.width+this.margin.right+this.margin.left,this.height=e.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this.initContextForDraw(g,I),Ve(g,this.left,this.top,this.width,this.height,I.borderRadius),this.performFill(g,I),this.updateBoundingBox(t,A,g,e,C),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,e,C)}},{key:"updateBoundingBox",value:function(g,t,A,e,C){this._updateBoundingBox(g,t,A,e,C);var I=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(I)}},{key:"distanceToBorder",value:function(g,t){g&&this.resize(g);var A=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+A}}]),A}($D);function AN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var eN=function(g){Cb(A,g);var t=AN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C)).labelOffset=0,I.selected=!1,I}return kd(A,[{key:"setOptions",value:function(g,t,A){this.options=g,void 0===t&&void 0===A||this.setImages(t,A)}},{key:"setImages",value:function(g,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=g):(this.imageObj=g,this.imageObjAlt=t)}},{key:"switchImages",value:function(g){var t=g&&!this.selected||!g&&this.selected;if(this.selected=g,void 0!==this.imageObjAlt&&t){var A=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=A}}},{key:"_getImagePadding",value:function(){var g={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var t=this.options.imagePadding;"object"==yd(t)?(g.top=t.top,g.right=t.right,g.bottom=t.bottom,g.left=t.left):(g.top=t,g.right=t,g.bottom=t,g.left=t)}return g}},{key:"_resizeImage",value:function(){var g,t;if(!1===this.options.shapeProperties.useImageSize){var A=1,e=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?A=this.imageObj.width/this.imageObj.height:e=this.imageObj.height/this.imageObj.width),g=2*this.options.size*A,t=2*this.options.size*e}else{var C=this._getImagePadding();g=this.imageObj.width+C.left+C.right,t=this.imageObj.height+C.top+C.bottom}this.width=g,this.height=t,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(g,t,A,e){this.initContextForDraw(g,e),Le(g,t,A,e.size),this.performFill(g,e)}},{key:"_drawImageAtPosition",value:function(g,t){if(0!=this.imageObj.width){g.globalAlpha=void 0!==t.opacity?t.opacity:1,this.enableShadow(g,t);var A=1;!0===this.options.shapeProperties.interpolation&&(A=this.imageObj.width/this.width/this.body.view.scale);var e=this._getImagePadding(),C=this.left+e.left,I=this.top+e.top,i=this.width-e.left-e.right,o=this.height-e.top-e.bottom;this.imageObj.drawImageAtPosition(g,A,C,I,i,o),this.disableShadow(g,t)}}},{key:"_drawImageLabel",value:function(g,t,A,e,C){var I=0;if(void 0!==this.height){I=.5*this.height;var i=this.labelModule.getTextSize(g,e,C);i.lineCount>=1&&(I+=i.height/2)}var o=A+I;this.options.label&&(this.labelOffset=I),this.labelModule.draw(g,t,o,e,C,"hanging")}}]),A}($D);function CN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var IN=function(g){Cb(A,g);var t=CN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A),C=Math.max(e.width+this.margin.right+this.margin.left,e.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this._drawRawCircle(g,t,A,I),this.updateBoundingBox(t,A),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,A,e,C)}},{key:"updateBoundingBox",value:function(g,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(g){return g&&this.resize(g),.5*this.width}}]),A}(eN);function iN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var oN=function(g){Cb(A,g);var t=iN(A);function A(g,e,C,I,i){var o;return cn(this,A),(o=t.call(this,g,e,C)).setImages(I,i),o}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var e=2*this.options.size;return this.width=e,this.height=e,void(this.radius=.5*this.width)}this.needsRefresh(t,A)&&this._resizeImage()}},{key:"draw",value:function(g,t,A,e,C,I){this.switchImages(e),this.resize();var i=t,o=A;"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=t,this.top=A,i+=this.width/2,o+=this.height/2):(this.left=t-this.width/2,this.top=A-this.height/2),this._drawRawCircle(g,i,o,I),g.save(),g.clip(),this._drawImageAtPosition(g,I),g.restore(),this._drawImageLabel(g,i,o,e,C),this.updateBoundingBox(t,A)}},{key:"updateBoundingBox",value:function(g,t){"top-left"===this.options.shapeProperties.coordinateOrigin?(this.boundingBox.top=t,this.boundingBox.left=g,this.boundingBox.right=g+2*this.options.size,this.boundingBox.bottom=t+2*this.options.size):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(g){return g&&this.resize(g),.5*this.width}}]),A}(eN);function nN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var rN=function(g){Cb(A,g);var t=nN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,A)){var C,I;this.labelModule.getTextSize(g,t,A);var i=2*e.size;this.width=null!==(C=this.customSizeWidth)&&void 0!==C?C:i,this.height=null!==(I=this.customSizeHeight)&&void 0!==I?I:i,this.radius=.5*this.width}}},{key:"_drawShape",value:function(g,t,A,e,C,I,i,o){var n,r=this;return this.resize(g,I,i,o),this.left=e-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,o),(n=t,Object.prototype.hasOwnProperty.call(Ue,n)?Ue[n]:function(g){for(var t=arguments.length,A=new Array(t>1?t-1:0),e=1;e0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),A}($D);function sN(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function aN(g){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A);this.height=2*e.height,this.width=e.width+e.height,this.radius=.5*this.width}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-.5*this.width,this.top=A-.5*this.height,this.initContextForDraw(g,I),Ye(g,this.left,this.top,this.width,this.height),this.performFill(g,I),this.updateBoundingBox(t,A,g,e,C),this.labelModule.draw(g,t,A,e,C)}},{key:"distanceToBorder",value:function(g,t){g&&this.resize(g);var A=.5*this.width,e=.5*this.height,C=Math.sin(t)*A,I=Math.cos(t)*e;return A*e/Math.sqrt(C*C+I*I)}}]),A}($D);function bN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var wN=function(g){Cb(A,g);var t=bN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g,t,A){this.needsRefresh(t,A)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(g,t,A,e,C,I){var i=this;return this.resize(g,e,C),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=A-this.height/2,this._icon(g,t,A,e,C,I),{drawExternalLabel:function(){if(void 0!==i.options.label){i.labelModule.draw(g,i.left+i.iconSize.width/2+i.margin.left,A+i.height/2+5,e)}i.updateBoundingBox(t,A)}}}},{key:"updateBoundingBox",value:function(g,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=g-.5*this.options.icon.size,this.boundingBox.right=g+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(g,t,A,e,C,I){var i=Number(this.options.icon.size);void 0!==this.options.icon.code?(g.font=[null!=this.options.icon.weight?this.options.icon.weight:e?"bold":"",(null!=this.options.icon.weight&&e?5:0)+i+"px",this.options.icon.face].join(" "),g.fillStyle=this.options.icon.color||"black",g.textAlign="center",g.textBaseline="middle",this.enableShadow(g,I),g.fillText(this.options.icon.code,t,A),this.disableShadow(g,I)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}($D);function kN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var xN=function(g){Cb(A,g);var t=kN(A);function A(g,e,C,I,i){var o;return cn(this,A),(o=t.call(this,g,e,C)).setImages(I,i),o}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var e=2*this.options.size;return this.width=e,void(this.height=e)}this.needsRefresh(t,A)&&this._resizeImage()}},{key:"draw",value:function(g,t,A,e,C,I){g.save(),this.switchImages(e),this.resize();var i=t,o=A;if("top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=t,this.top=A,i+=this.width/2,o+=this.height/2):(this.left=t-this.width/2,this.top=A-this.height/2),!0===this.options.shapeProperties.useBorderWithImage){var n=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,s=(e?r:n)/this.body.view.scale;g.lineWidth=Math.min(this.width,s),g.beginPath();var a=e?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,d=e?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;void 0!==I.opacity&&(a=ev(a,I.opacity),d=ev(d,I.opacity)),g.strokeStyle=a,g.fillStyle=d,g.rect(this.left-.5*g.lineWidth,this.top-.5*g.lineWidth,this.width+g.lineWidth,this.height+g.lineWidth),Bu(g).call(g),this.performStroke(g,I),g.closePath()}this._drawImageAtPosition(g,I),this._drawImageLabel(g,i,o,e,C),this.updateBoundingBox(t,A),g.restore()}},{key:"updateBoundingBox",value:function(g,t){this.resize(),"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=g,this.top=t):(this.left=g-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(eN);function EN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var ON=function(g){Cb(A,g);var t=EN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"square",2,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function TN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var DN=function(g){Cb(A,g);var t=TN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"hexagon",4,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function NN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var RN=function(g){Cb(A,g);var t=NN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"star",4,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function PN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var MN=function(g){Cb(A,g);var t=PN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g,t,A){this.needsRefresh(t,A)&&(this.textSize=this.labelModule.getTextSize(g,t,A),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this.enableShadow(g,I),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,e,C),this.disableShadow(g,I),this.updateBoundingBox(t,A,g,e,C)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}($D);function BN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var zN=function(g){Cb(A,g);var t=BN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"triangle",3,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function SN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var ZN=function(g){Cb(A,g);var t=SN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"triangleDown",3,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function FN(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function GN(g){for(var t=1;tg.left&&this.shape.topg.top}},{key:"isBoundingBoxOverlappingWith",value:function(g){return this.shape.boundingBox.leftg.left&&this.shape.boundingBox.topg.top}}],[{key:"checkOpacity",value:function(g){return 0<=g&&g<=1}},{key:"checkCoordinateOrigin",value:function(g){return void 0===g||"center"===g||"top-left"===g}},{key:"updateGroupOptions",value:function(t,A,e){var C;if(void 0!==e){var I=t.group;if(void 0!==A&&void 0!==A.group&&I!==A.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof I||"string"==typeof I&&""!=I){var i=e.get(I);void 0!==i.opacity&&void 0===A.opacity&&(g.checkOpacity(i.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+i.opacity),i.opacity=void 0));var o=pc(C=VD(A)).call(C,(function(g){return null!=A[g]}));o.push("font"),Jf(o,t,i),t.color=Iv(t.color)}}}},{key:"parseOptions",value:function(t,A){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],C=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},I=arguments.length>4?arguments[4]:void 0;if(Jf(["color","fixed","shadow"],t,A,e),g.checkMass(A),void 0!==t.opacity&&(g.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),void 0!==A.opacity&&(g.checkOpacity(A.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+A.opacity),A.opacity=void 0)),A.shapeProperties&&!g.checkCoordinateOrigin(A.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+A.shapeProperties.coordinateOrigin),dv(t,A,"shadow",C),void 0!==A.color&&null!==A.color){var i=Iv(A.color);Hf(t.color,i)}else!0===e&&null===A.color&&(t.color=av(C.color));void 0!==A.fixed&&null!==A.fixed&&("boolean"==typeof A.fixed?(t.fixed.x=A.fixed,t.fixed.y=A.fixed):(void 0!==A.fixed.x&&"boolean"==typeof A.fixed.x&&(t.fixed.x=A.fixed.x),void 0!==A.fixed.y&&"boolean"==typeof A.fixed.y&&(t.fixed.y=A.fixed.y))),!0===e&&null===A.font&&(t.font=av(C.font)),g.updateGroupOptions(t,A,I),void 0!==A.scaling&&dv(t.scaling,A.scaling,"label",C.scaling)}},{key:"checkMass",value:function(g,t){if(void 0!==g.mass&&g.mass<=0){var A="";void 0!==t&&(A=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+A+", setting mass to 1.",Tv),g.mass=1}}}]),g}();function LN(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return VN(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return VN(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function VN(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity):this.options.opacity=g.opacity),void 0!==g.shape)for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(void 0!==g.font||void 0!==g.widthConstraint||void 0!==g.heightConstraint)for(var A=0,e=Lh(this.body.nodes);A1&&void 0!==arguments[1]&&arguments[1],A=this.body.data.nodes;if(kD("id",g))this.body.data.nodes=g;else if(Rh(g))this.body.data.nodes=new mD,this.body.data.nodes.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new mD}if(A&&tv(this.nodesListeners,(function(g,t){A.off(t,g)})),this.body.nodes={},this.body.data.nodes){var e=this;tv(this.nodesListeners,(function(g,t){e.body.data.nodes.on(t,g)}));var C=this.body.data.nodes.getIds();this.add(C,!0)}!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(g){for(var t,A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=[],C=0;C1&&void 0!==arguments[1]?arguments[1]:jN)(g,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];tv(this.body.nodes,(function(A,e){var C=g.body.data.nodes.get(e);void 0!==C&&(!0===t&&A.setOptions({x:null,y:null}),A.setOptions({fixed:!1}),A.setOptions(C))}))}},{key:"getPositions",value:function(g){var t={};if(void 0!==g){if(!0===Rh(g)){for(var A=0;A0?(e=A/o)*e:A;return o===1/0?1/0:o*eR(C)}});var CR=A(tg.Math.hypot);function IR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var iR=function(){function g(){cn(this,g)}return kd(g,null,[{key:"transform",value:function(g,t){Rh(g)||(g=[g]);for(var A=t.point.x,e=t.point.y,C=t.angle,I=t.length,i=0;i4&&void 0!==arguments[4]?arguments[4]:this.getViaNode();g.strokeStyle=this.getColor(g,t),g.lineWidth=t.width,!1!==t.dashes?this._drawDashedLine(g,t,C):this._drawLine(g,t,C)}},{key:"_drawLine",value:function(g,t,A,e,C){if(this.from!=this.to)this._line(g,t,A,e,C);else{var I=lh(this._getCircleData(g),3),i=I[0],o=I[1],n=I[2];this._circle(g,t,i,o,n)}}},{key:"_drawDashedLine",value:function(g,t,A,e,C){g.lineCap="round";var I=Rh(t.dashes)?t.dashes:[5,5];if(void 0!==g.setLineDash){if(g.save(),g.setLineDash(I),g.lineDashOffset=0,this.from!=this.to)this._line(g,t,A);else{var i=lh(this._getCircleData(g),3),o=i[0],n=i[1],r=i[2];this._circle(g,t,o,n,r)}g.setLineDash([0]),g.lineDashOffset=0,g.restore()}else{if(this.from!=this.to)Qe(g,this.from.x,this.from.y,this.to.x,this.to.y,I);else{var s=lh(this._getCircleData(g),3),a=s[0],d=s[1],h=s[2];this._circle(g,t,a,d,h)}this.enableShadow(g,t),g.stroke(),this.disableShadow(g,t)}}},{key:"findBorderPosition",value:function(g,t,A){return this.from!=this.to?this._findBorderPosition(g,t,A):this._findBorderPositionCircle(g,t,A)}},{key:"findBorderPositions",value:function(g){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,g),to:this._findBorderPosition(this.to,g)};var t,A=lh(wh(t=this._getCircleData(g)).call(t,0,2),2),e=A[0],C=A[1];return{from:this._findBorderPositionCircle(this.from,g,{x:e,y:C,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,g,{x:e,y:C,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(g){var t=this.options.selfReference.size;void 0!==g&&void 0===this.from.shape.width&&this.from.shape.resize(g);var A=UD(g,this.options.selfReference.angle,t,this.from);return[A.x,A.y,t]}},{key:"_pointOnCircle",value:function(g,t,A,e){var C=2*e*Math.PI;return{x:g+A*Math.cos(C),y:t-A*Math.sin(C)}}},{key:"_findBorderPositionCircle",value:function(g,t,A){var e,C=A.x,I=A.y,i=A.low,o=A.high,n=A.direction,r=this.options.selfReference.size,s=.5*(i+o),a=0;!0===this.options.arrowStrikethrough&&(-1===n?a=this.options.endPointOffset.from:1===n&&(a=this.options.endPointOffset.to));var d=0;do{s=.5*(i+o),e=this._pointOnCircle(C,I,r,s);var h=Math.atan2(g.y-e.y,g.x-e.x),l=g.distanceToBorder(t,h)+a-Math.sqrt(Math.pow(e.x-g.x,2)+Math.pow(e.y-g.y,2));if(Math.abs(l)<.05)break;l>0?n>0?i=s:o=s:n>0?o=s:i=s,++d}while(i<=o&&d<10);return mR(mR({},e),{},{t:s})}},{key:"getLineWidth",value:function(g,t){return!0===g?Math.max(this.selectionWidth,.3/this._body.view.scale):!0===t?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(g,t){if(!1!==t.inheritsColor){if("both"===t.inheritsColor&&this.from.id!==this.to.id){var A=g.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),e=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(e=ev(this.from.options.color.border,t.opacity),C=ev(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?C=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(e=this.from.options.color.border),A.addColorStop(0,e),A.addColorStop(1,C),A}return"to"===t.inheritsColor?ev(this.to.options.color.border,t.opacity):ev(this.from.options.color.border,t.opacity)}return ev(t.color,t.opacity)}},{key:"_circle",value:function(g,t,A,e,C){this.enableShadow(g,t);var I=0,i=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){var o=this.options.selfReference.angle,n=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,g,{x:A,y:e,low:o,high:n,direction:-1}),s=this._findBorderPositionCircle(this.from,g,{x:A,y:e,low:o,high:n,direction:1});I=Math.atan2(r.y-e,r.x-A),i=Math.atan2(s.y-e,s.x-A)}g.beginPath(),g.arc(A,e,C,I,i,!1),g.stroke(),this.disableShadow(g,t)}},{key:"getDistanceToEdge",value:function(g,t,A,e,C,I){if(this.from!=this.to)return this._getDistanceToEdge(g,t,A,e,C,I);var i=lh(this._getCircleData(void 0),3),o=i[0],n=i[1],r=i[2],s=o-C,a=n-I;return Math.abs(Math.sqrt(s*s+a*a)-r)}},{key:"_getDistanceToLine",value:function(g,t,A,e,C,I){var i=A-g,o=e-t,n=((C-g)*i+(I-t)*o)/(i*i+o*o);n>1?n=1:n<0&&(n=0);var r=g+n*i-C,s=t+n*o-I;return Math.sqrt(r*r+s*s)}},{key:"getArrowData",value:function(g,t,A,e,C,I){var i,o,n,r,s,a,d,h=I.width;"from"===t?(n=this.from,r=this.to,s=I.fromArrowScale<0,a=Math.abs(I.fromArrowScale),d=I.fromArrowType):"to"===t?(n=this.to,r=this.from,s=I.toArrowScale<0,a=Math.abs(I.toArrowScale),d=I.toArrowType):(n=this.to,r=this.from,s=I.middleArrowScale<0,a=Math.abs(I.middleArrowScale),d=I.middleArrowType);var l=15*a+3*h;if(n!=r){var c=l/CR(n.x-r.x,n.y-r.y);if("middle"!==t)if(!0===this.options.smooth.enabled){var u=this._findBorderPosition(n,g,{via:A}),p=this.getPoint(u.t+c*("from"===t?1:-1),A);i=Math.atan2(u.y-p.y,u.x-p.x),o=u}else i=Math.atan2(n.y-r.y,n.x-r.x),o=this._findBorderPosition(n,g);else{var f=(s?-c:c)/2,v=this.getPoint(.5+f,A),y=this.getPoint(.5-f,A);i=Math.atan2(v.y-y.y,v.x-y.x),o=this.getPoint(.5,A)}}else{var m=lh(this._getCircleData(g),3),b=m[0],w=m[1],k=m[2];if("from"===t){var x=this.options.selfReference.angle,E=this.options.selfReference.angle+Math.PI,O=this._findBorderPositionCircle(this.from,g,{x:b,y:w,low:x,high:E,direction:-1});i=-2*O.t*Math.PI+1.5*Math.PI+.1*Math.PI,o=O}else if("to"===t){var T=this.options.selfReference.angle,D=this.options.selfReference.angle+Math.PI,N=this._findBorderPositionCircle(this.from,g,{x:b,y:w,low:T,high:D,direction:1});i=-2*N.t*Math.PI+1.5*Math.PI-1.1*Math.PI,o=N}else{var R=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(b,w,k,R),i=-2*R*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:o,core:{x:o.x-.9*l*Math.cos(i),y:o.y-.9*l*Math.sin(i)},angle:i,length:l,type:d}}},{key:"drawArrowHead",value:function(g,t,A,e,C){g.strokeStyle=this.getColor(g,t),g.fillStyle=g.strokeStyle,g.lineWidth=t.width,vR.draw(g,C)&&(this.enableShadow(g,t),Bu(g).call(g),this.disableShadow(g,t))}},{key:"enableShadow",value:function(g,t){!0===t.shadow&&(g.shadowColor=t.shadowColor,g.shadowBlur=t.shadowSize,g.shadowOffsetX=t.shadowX,g.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(g,t){!0===t.shadow&&(g.shadowColor="rgba(0,0,0,0)",g.shadowBlur=0,g.shadowOffsetX=0,g.shadowOffsetY=0)}},{key:"drawBackground",value:function(g,t){if(!1!==t.background){var A={strokeStyle:g.strokeStyle,lineWidth:g.lineWidth,dashes:g.dashes};g.strokeStyle=t.backgroundColor,g.lineWidth=t.backgroundSize,this.setStrokeDashed(g,t.backgroundDashes),g.stroke(),g.strokeStyle=A.strokeStyle,g.lineWidth=A.lineWidth,g.dashes=A.dashes,this.setStrokeDashed(g,t.dashes)}}},{key:"setStrokeDashed",value:function(g,t){if(!1!==t)if(void 0!==g.setLineDash){var A=Rh(t)?t:[5,5];g.setLineDash(A)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==g.setLineDash?g.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),g}();function wR(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function kR(g){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),I=!1,i=1,o=0,n=this.to,r=this.options.endPointOffset?this.options.endPointOffset.to:0;g.id===this.from.id&&(n=this.from,I=!0,r=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(r=0);var s=0;do{e=.5*(o+i),A=this.getPoint(e,C);var a=Math.atan2(n.y-A.y,n.x-A.x),d=n.distanceToBorder(t,a)+r-Math.sqrt(Math.pow(A.x-n.x,2)+Math.pow(A.y-n.y,2));if(Math.abs(d)<.2)break;d<0?!1===I?o=e:i=e:!1===I?i=e:o=e,++s}while(o<=i&&s<10);return kR(kR({},A),{},{t:e})}},{key:"_getDistanceToBezierEdge",value:function(g,t,A,e,C,I,i){var o,n,r,s,a,d=1e9,h=g,l=t;for(n=1;n<10;n++)r=.1*n,s=Math.pow(1-r,2)*g+2*r*(1-r)*i.x+Math.pow(r,2)*A,a=Math.pow(1-r,2)*t+2*r*(1-r)*i.y+Math.pow(r,2)*e,n>0&&(d=(o=this._getDistanceToLine(h,l,s,a,C,I))1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){var A=lh(this._getCircleData(),3),e=A[0],C=A[1],I=A[2],i=2*Math.PI*(1-g);return{x:e+I*Math.sin(i),y:C+I-I*(1-Math.cos(i))}}return{x:Math.pow(1-g,2)*this.fromPoint.x+2*g*(1-g)*t.x+Math.pow(g,2)*this.toPoint.x,y:Math.pow(1-g,2)*this.fromPoint.y+2*g*(1-g)*t.y+Math.pow(g,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(g,t){return this._findBorderPositionBezier(g,t,this.via)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){return this._getDistanceToBezierEdge(g,t,A,e,C,I,this.via)}}]),A}(ER);function DR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var NR=function(g){Cb(A,g);var t=DR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_line",value:function(g,t,A){this._bezierCurve(g,t,A)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var g,t,A=this.options.smooth.roundness,e=this.options.smooth.type,C=Math.abs(this.from.x-this.to.x),I=Math.abs(this.from.y-this.to.y);if("discrete"===e||"diagonalCross"===e){var i,o;i=o=C<=I?A*I:A*C,this.from.x>this.to.x&&(i=-i),this.from.y>=this.to.y&&(o=-o);var n=this.from.x+i,r=this.from.y+o;return"discrete"===e&&(C<=I?n=Cthis.to.x&&(g=-g),this.from.y>=this.to.y&&(t=-t);var y=this.from.x+g,m=this.from.y+t;return C<=I?y=this.from.x<=this.to.x?this.to.xy?this.to.x:y:m=this.from.y>=this.to.y?this.to.y>m?this.to.y:m:this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(g,t,A.via)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){var i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(g,t,A,e,C,I,i)}},{key:"getPoint",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),A=g;return{x:Math.pow(1-A,2)*this.fromPoint.x+2*A*(1-A)*t.x+Math.pow(A,2)*this.toPoint.x,y:Math.pow(1-A,2)*this.fromPoint.y+2*A*(1-A)*t.y+Math.pow(A,2)*this.toPoint.y}}}]),A}(ER);function RR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var PR=function(g){Cb(A,g);var t=RR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_getDistanceToBezierEdge2",value:function(g,t,A,e,C,I,i,o){for(var n=1e9,r=g,s=t,a=[0,0,0,0],d=1;d<10;d++){var h=.1*d;a[0]=Math.pow(1-h,3),a[1]=3*h*Math.pow(1-h,2),a[2]=3*Math.pow(h,2)*(1-h),a[3]=Math.pow(h,3);var l=a[0]*g+a[1]*i.x+a[2]*o.x+a[3]*A,c=a[0]*t+a[1]*i.y+a[2]*o.y+a[3]*e;if(d>0){var u=this._getDistanceToLine(r,s,l,c,C,I);n=uMath.abs(I)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(t=this.from.y,e=this.to.y,g=this.from.x-i*C,A=this.to.x+i*C):(t=this.from.y-i*I,e=this.to.y+i*I,g=this.from.x,A=this.to.x),[{x:g,y:t},{x:A,y:e}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(g,t){return this._findBorderPositionBezier(g,t)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){var i=lh(arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),2),o=i[0],n=i[1];return this._getDistanceToBezierEdge2(g,t,A,e,C,I,o,n)}},{key:"getPoint",value:function(g){var t=lh(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),2),A=t[0],e=t[1],C=g,I=[Math.pow(1-C,3),3*C*Math.pow(1-C,2),3*Math.pow(C,2)*(1-C),Math.pow(C,3)];return{x:I[0]*this.fromPoint.x+I[1]*A.x+I[2]*e.x+I[3]*this.toPoint.x,y:I[0]*this.fromPoint.y+I[1]*A.y+I[2]*e.y+I[3]*this.toPoint.y}}}]),A}(PR);function zR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var SR=function(g){Cb(A,g);var t=zR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_line",value:function(g,t){g.beginPath(),g.moveTo(this.fromPoint.x,this.fromPoint.y),g.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(g,t),g.stroke(),this.disableShadow(g,t)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(g){return{x:(1-g)*this.fromPoint.x+g*this.toPoint.x,y:(1-g)*this.fromPoint.y+g*this.toPoint.y}}},{key:"_findBorderPosition",value:function(g,t){var A=this.to,e=this.from;g.id===this.from.id&&(A=this.from,e=this.to);var C=Math.atan2(A.y-e.y,A.x-e.x),I=A.x-e.x,i=A.y-e.y,o=Math.sqrt(I*I+i*i),n=(o-g.distanceToBorder(t,C))/o;return{x:(1-n)*e.x+n*A.x,y:(1-n)*e.y+n*A.y,t:0}}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){return this._getDistanceToLine(g,t,A,e,C,I)}}]),A}(bR),ZR=function(){function g(t,A,e,C,I){if(cn(this,g),void 0===A)throw new Error("No body provided");this.options=av(C),this.globalOptions=C,this.defaultOptions=I,this.body=A,this.imagelist=e,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new qD(this.body,this.options,!0),this.setOptions(t)}return kd(g,[{key:"setOptions",value:function(t){if(t){var A=void 0!==t.physics&&this.options.physics!==t.physics||void 0!==t.hidden&&(this.options.hidden||!1)!==(t.hidden||!1)||void 0!==t.from&&this.options.from!==t.from||void 0!==t.to&&this.options.to!==t.to;g.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),void 0!==t.value&&(t.value=SD(t.value));var e=[t,this.options,this.defaultOptions];return this.chooser=YD("edge",e),this.updateLabelModule(t),A=this.updateEdgeType()||A,this._setInteractionWidths(),this.connect(),A}}},{key:"getFormattingValues",value:function(){var g=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,t=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,A=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,e=this.options.color.inherit,C={toArrow:g,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:A,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:e?void 0:this.options.color.color,inheritsColor:e,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(!0===this.chooser){if(this.selected){var I=this.options.selectionWidth;"function"==typeof I?C.width=I(C.width):"number"==typeof I&&(C.width+=I),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.highlight,C.shadow=this.options.shadow.enabled}else if(this.hover){var i=this.options.hoverWidth;"function"==typeof i?C.width=i(C.width):"number"==typeof i&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.hover,C.shadow=this.options.shadow.enabled}}else"function"==typeof this.chooser&&(this.chooser(C,this.options.id,this.selected,this.hover),void 0!==C.color&&(C.inheritsColor=!1),!1===C.shadow&&(C.shadowColor===this.options.shadow.color&&C.shadowSize===this.options.shadow.size&&C.shadowX===this.options.shadow.x&&C.shadowY===this.options.shadow.y||(C.shadow=!0)));else C.shadow=this.options.shadow.enabled,C.width=Math.max(C.width,.3/this.body.view.scale);return C}},{key:"updateLabelModule",value:function(g){var t=[g,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var g=this.options.smooth,t=!1,A=!0;return void 0!==this.edgeType&&((this.edgeType instanceof TR&&!0===g.enabled&&"dynamic"===g.type||this.edgeType instanceof BR&&!0===g.enabled&&"cubicBezier"===g.type||this.edgeType instanceof NR&&!0===g.enabled&&"dynamic"!==g.type&&"cubicBezier"!==g.type||this.edgeType instanceof SR&&!1===g.type.enabled)&&(A=!1),!0===A&&(t=this.cleanup())),!0===A?!0===g.enabled?"dynamic"===g.type?(t=!0,this.edgeType=new TR(this.options,this.body,this.labelModule)):"cubicBezier"===g.type?this.edgeType=new BR(this.options,this.body,this.labelModule):this.edgeType=new NR(this.options,this.body,this.labelModule):this.edgeType=new SR(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(g,t,A){if(void 0!==this.options.value){var e=this.options.scaling.customScalingFunction(g,t,A,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var I=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+e*I}this.options.width=this.options.scaling.min+e*C}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(g){var t=this.getFormattingValues();if(!t.hidden){var A=this.edgeType.getViaNode();this.edgeType.drawLine(g,t,this.selected,this.hover,A),this.drawLabel(g,A)}}},{key:"drawArrows",value:function(g){var t=this.getFormattingValues();if(!t.hidden){var A=this.edgeType.getViaNode(),e={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(e.from=this.edgeType.getArrowData(g,"from",A,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.fromPoint=e.from.core),t.fromArrowSrc&&(e.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(e.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(e.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(e.to=this.edgeType.getArrowData(g,"to",A,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.toPoint=e.to.core),t.toArrowSrc&&(e.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(e.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(e.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(e.middle=this.edgeType.getArrowData(g,"middle",A,this.selected,this.hover,t),t.middleArrowSrc&&(e.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(e.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(e.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.from),t.middleArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.middle),t.toArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.to)}}},{key:"drawLabel",value:function(g,t){if(void 0!==this.options.label){var A,e=this.from,C=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(g,this.selected,this.hover),e.id!=C.id){this.labelModule.pointToSelf=!1,A=this.edgeType.getPoint(.5,t),g.save();var I=this._getRotation(g);0!=I.angle&&(g.translate(I.x,I.y),g.rotate(I.angle)),this.labelModule.draw(g,A.x,A.y,this.selected,this.hover),g.restore()}else{this.labelModule.pointToSelf=!0;var i=UD(g,this.options.selfReference.angle,this.options.selfReference.size,e);A=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(g,A.x,A.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(g){var t=[];if(this.labelModule.visible()){var A=this._getRotation();WD(this.labelModule.getSize(),g,A)&&t.push({edgeId:this.id,labelId:0})}var e={left:g.x,top:g.y};return this.isOverlappingWith(e)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(g){if(this.connected){var t=this.from.x,A=this.from.y,e=this.to.x,C=this.to.y,I=g.left,i=g.top;return this.edgeType.getDistanceToEdge(t,A,e,C,I,i)<10}return!1}},{key:"_getRotation",value:function(g){var t=this.edgeType.getViaNode(),A=this.edgeType.getPoint(.5,t);void 0!==g&&this.labelModule.calculateLabelSize(g,this.selected,this.hover,A.x,A.y);var e={x:A.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return e;if("horizontal"===this.options.font.align)return e;var C=this.from.y-this.to.y,I=this.from.x-this.to.x,i=Math.atan2(C,I);return(i<-1&&I<0||i>0&&I<0)&&(i+=Math.PI),e.angle=i,e}},{key:"_pointOnCircle",value:function(g,t,A,e){return{x:g+A*Math.cos(e),y:t-A*Math.sin(e)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}],[{key:"parseOptions",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},C=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Xf(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],g,t,A),void 0!==t.endPointOffset&&void 0!==t.endPointOffset.from&&(Ym(t.endPointOffset.from)?g.endPointOffset.from=t.endPointOffset.from:(g.endPointOffset.from=void 0!==e.endPointOffset.from?e.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),void 0!==t.endPointOffset&&void 0!==t.endPointOffset.to&&(Ym(t.endPointOffset.to)?g.endPointOffset.to=t.endPointOffset.to:(g.endPointOffset.to=void 0!==e.endPointOffset.to?e.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),QD(t.label)?g.label=t.label:QD(g.label)||(g.label=void 0),dv(g,t,"smooth",e),dv(g,t,"shadow",e),dv(g,t,"background",e),void 0!==t.dashes&&null!==t.dashes?g.dashes=t.dashes:!0===A&&null===t.dashes&&(g.dashes=$c(e.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(g.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(g.scaling.max=t.scaling.max),dv(g.scaling,t.scaling,"label",e.scaling)):!0===A&&null===t.scaling&&(g.scaling=$c(e.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var I=t.arrows.toLowerCase();g.arrows.to.enabled=-1!=Xc(I).call(I,"to"),g.arrows.middle.enabled=-1!=Xc(I).call(I,"middle"),g.arrows.from.enabled=-1!=Xc(I).call(I,"from")}else{if("object"!==yd(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+eu(t.arrows));dv(g.arrows,t.arrows,"to",e.arrows),dv(g.arrows,t.arrows,"middle",e.arrows),dv(g.arrows,t.arrows,"from",e.arrows)}else!0===A&&null===t.arrows&&(g.arrows=$c(e.arrows));if(void 0!==t.color&&null!==t.color){var i=Uf(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,o=g.color;if(C)qf(o,e.color,!1,A);else for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&delete o[n];if(Uf(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,void 0===i.opacity&&(o.opacity=1);else{var r=!1;void 0!==i.color&&(o.color=i.color,r=!0),void 0!==i.highlight&&(o.highlight=i.highlight,r=!0),void 0!==i.hover&&(o.hover=i.hover,r=!0),void 0!==i.inherit&&(o.inherit=i.inherit),void 0!==i.opacity&&(o.opacity=Math.min(1,Math.max(0,i.opacity))),!0===r?o.inherit=!1:void 0===o.inherit&&(o.inherit="from")}}else!0===A&&null===t.color&&(g.color=av(e.color));!0===A&&null===t.font&&(g.font=av(e.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),g.selfReference.size=t.selfReferenceSize)}}]),g}(),FR=function(){function g(t,A,e){var C,I=this;cn(this,g),this.body=t,this.images=A,this.groups=e,this.body.functions.createEdge=je(C=this.create).call(C,this),this.edgesListeners={add:function(g,t){I.add(t.items)},update:function(g,t){I.update(t.items)},remove:function(g,t){I.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(g,t,A,e){if(t===g)return.5;var C=1/(t-g);return Math.max(0,(e-g)*C)}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},qf(this.options,this.defaultOptions),this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g,t,A=this;this.body.emitter.on("_forceDisableDynamicCurves",(function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===g&&(g="continuous");var e=!1;for(var C in A.body.edges)if(Object.prototype.hasOwnProperty.call(A.body.edges,C)){var I=A.body.edges[C],i=A.body.data.edges.get(C);if(null!=i){var o=i.smooth;void 0!==o&&!0===o.enabled&&"dynamic"===o.type&&(void 0===g?I.setOptions({smooth:!1}):I.setOptions({smooth:{type:g}}),e=!0)}}!0===t&&!0===e&&A.body.emitter.emit("_dataChanged")})),this.body.emitter.on("_dataUpdated",(function(){A.reconnectEdges()})),this.body.emitter.on("refreshEdges",je(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",je(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",(function(){tv(A.edgesListeners,(function(g,t){A.body.data.edges&&A.body.data.edges.off(t,g)})),delete A.body.functions.createEdge,delete A.edgesListeners.add,delete A.edgesListeners.update,delete A.edgesListeners.remove,delete A.edgesListeners}))}},{key:"setOptions",value:function(g){if(void 0!==g){ZR.parseOptions(this.options,g,!0,this.defaultOptions,!0);var t=!1;if(void 0!==g.smooth)for(var A in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,A)&&(t=this.body.edges[A].updateEdgeType()||t);if(void 0!==g.font)for(var e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&this.body.edges[e].updateLabelModule();void 0===g.hidden&&void 0===g.physics&&!0!==t||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(g){var t=this,A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=this.body.data.edges;if(kD("id",g))this.body.data.edges=g;else if(Rh(g))this.body.data.edges=new mD,this.body.data.edges.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.edges=new mD}if(e&&tv(this.edgesListeners,(function(g,t){e.off(t,g)})),this.body.edges={},this.body.data.edges){tv(this.edgesListeners,(function(g,A){t.body.data.edges.on(A,g)}));var C=this.body.data.edges.getIds();this.add(C,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===A&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(g){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=this.body.edges,e=this.body.data.edges,C=0;C1&&void 0!==arguments[1])||arguments[1];if(0!==g.length){var A=this.body.edges;tv(g,(function(g){var t=A[g];void 0!==t&&t.remove()})),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var g=this;tv(this.body.edges,(function(t,A){var e=g.body.data.edges.get(A);void 0!==e&&t.setOptions(e)}))}},{key:"create",value:function(g){return new ZR(g,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var g,t=this.body.nodes,A=this.body.edges;for(g in t)Object.prototype.hasOwnProperty.call(t,g)&&(t[g].edges=[]);for(g in A)if(Object.prototype.hasOwnProperty.call(A,g)){var e=A[g];e.from=null,e.to=null,e.connect()}}},{key:"getConnectedNodes",value:function(g){var t=[];if(void 0!==this.body.edges[g]){var A=this.body.edges[g];void 0!==A.fromId&&t.push(A.fromId),void 0!==A.toId&&t.push(A.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var g=this,t=[];tv(this.body.edges,(function(A,e){var C=g.body.nodes[A.toId],I=g.body.nodes[A.fromId];void 0!==C&&!0===C.isCluster||void 0!==I&&!0===I.isCluster||void 0!==C&&void 0!==I||t.push(e)})),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var g=this.body.data.edges;if(null!=g){var t=this.body.edges,A=[];Cl(g).call(g,(function(g,e){void 0===t[e]&&A.push(e)})),this.add(A,!0)}}}]),g}(),GR=function(){function g(t,A,e){cn(this,g),this.body=t,this.physicsBody=A,this.barnesHutTree,this.setOptions(e),this._rng=Ff("BARNES HUT SOLVER")}return kd(g,[{key:"setOptions",value:function(g){this.options=g,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var g,t=this.body.nodes,A=this.physicsBody.physicsNodeIndices,e=A.length,C=this._formBarnesHutTree(t,A);this.barnesHutTree=C;for(var I=0;I0&&this._getForceContributions(C.root,g)}}},{key:"_getForceContributions",value:function(g,t){this._getForceContribution(g.children.NW,t),this._getForceContribution(g.children.NE,t),this._getForceContribution(g.children.SW,t),this._getForceContribution(g.children.SE,t)}},{key:"_getForceContribution",value:function(g,t){if(g.childrenCount>0){var A=g.centerOfMass.x-t.x,e=g.centerOfMass.y-t.y,C=Math.sqrt(A*A+e*e);C*g.calcSize>this.thetaInversed?this._calculateForces(C,A,e,t,g):4===g.childrenCount?this._getForceContributions(g,t):g.children.data.id!=t.id&&this._calculateForces(C,A,e,t,g)}}},{key:"_calculateForces",value:function(g,t,A,e,C){0===g&&(t=g=.1),this.overlapAvoidanceFactor<1&&e.shape.radius&&(g=Math.max(.1+this.overlapAvoidanceFactor*e.shape.radius,g-e.shape.radius));var I=this.options.gravitationalConstant*C.mass*e.options.mass/Math.pow(g,3),i=t*I,o=A*I;this.physicsBody.forces[e.id].x+=i,this.physicsBody.forces[e.id].y+=o}},{key:"_formBarnesHutTree",value:function(g,t){for(var A,e=t.length,C=g[t[0]].x,I=g[t[0]].y,i=g[t[0]].x,o=g[t[0]].y,n=1;n0&&(si&&(i=s),ao&&(o=a))}var d=Math.abs(i-C)-Math.abs(o-I);d>0?(I-=.5*d,o+=.5*d):(C+=.5*d,i-=.5*d);var h=Math.max(1e-5,Math.abs(i-C)),l=.5*h,c=.5*(C+i),u=.5*(I+o),p={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:c-l,maxX:c+l,minY:u-l,maxY:u+l},size:h,calcSize:1/h,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(p.root);for(var f=0;f0&&this._placeInTree(p.root,A);return p}},{key:"_updateBranchMass",value:function(g,t){var A=g.centerOfMass,e=g.mass+t.options.mass,C=1/e;A.x=A.x*g.mass+t.x*t.options.mass,A.x*=C,A.y=A.y*g.mass+t.y*t.options.mass,A.y*=C,g.mass=e;var I=Math.max(Math.max(t.height,t.radius),t.width);g.maxWidth=g.maxWidtht.x?C.maxY>t.y?"NW":"SW":C.maxY>t.y?"NE":"SE",this._placeInRegion(g,t,e)}},{key:"_placeInRegion",value:function(g,t,A){var e=g.children[A];switch(e.childrenCount){case 0:e.children.data=t,e.childrenCount=1,this._updateBranchMass(e,t);break;case 1:e.children.data.x===t.x&&e.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(e),this._placeInTree(e,t));break;case 4:this._placeInTree(e,t)}}},{key:"_splitBranch",value:function(g){var t=null;1===g.childrenCount&&(t=g.children.data,g.mass=0,g.centerOfMass.x=0,g.centerOfMass.y=0),g.childrenCount=4,g.children.data=null,this._insertRegion(g,"NW"),this._insertRegion(g,"NE"),this._insertRegion(g,"SW"),this._insertRegion(g,"SE"),null!=t&&this._placeInTree(g,t)}},{key:"_insertRegion",value:function(g,t){var A,e,C,I,i=.5*g.size;switch(t){case"NW":A=g.range.minX,e=g.range.minX+i,C=g.range.minY,I=g.range.minY+i;break;case"NE":A=g.range.minX+i,e=g.range.maxX,C=g.range.minY,I=g.range.minY+i;break;case"SW":A=g.range.minX,e=g.range.minX+i,C=g.range.minY+i,I=g.range.maxY;break;case"SE":A=g.range.minX+i,e=g.range.maxX,C=g.range.minY+i,I=g.range.maxY}g.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:A,maxX:e,minY:C,maxY:I},size:.5*g.size,calcSize:2*g.calcSize,children:{data:null},maxWidth:0,level:g.level+1,childrenCount:0}}},{key:"_debug",value:function(g,t){void 0!==this.barnesHutTree&&(g.lineWidth=1,this._drawBranch(this.barnesHutTree.root,g,t))}},{key:"_drawBranch",value:function(g,t,A){void 0===A&&(A="#FF0000"),4===g.childrenCount&&(this._drawBranch(g.children.NW,t),this._drawBranch(g.children.NE,t),this._drawBranch(g.children.SE,t),this._drawBranch(g.children.SW,t)),t.strokeStyle=A,t.beginPath(),t.moveTo(g.range.minX,g.range.minY),t.lineTo(g.range.maxX,g.range.minY),t.stroke(),t.beginPath(),t.moveTo(g.range.maxX,g.range.minY),t.lineTo(g.range.maxX,g.range.maxY),t.stroke(),t.beginPath(),t.moveTo(g.range.maxX,g.range.maxY),t.lineTo(g.range.minX,g.range.maxY),t.stroke(),t.beginPath(),t.moveTo(g.range.minX,g.range.maxY),t.lineTo(g.range.minX,g.range.minY),t.stroke()}}]),g}(),jR=function(){function g(t,A,e){cn(this,g),this._rng=Ff("REPULSION SOLVER"),this.body=t,this.physicsBody=A,this.setOptions(e)}return kd(g,[{key:"setOptions",value:function(g){this.options=g}},{key:"solve",value:function(){for(var g,t,A,e,C,I,i,o,n=this.body.nodes,r=this.physicsBody.physicsNodeIndices,s=this.physicsBody.forces,a=this.options.nodeDistance,d=-2/3/a,h=0;h0){var I=C.edges.length+1,i=this.options.centralGravity*I*C.options.mass;e[C.id].x=t*i,e[C.id].y=A*i}}}]),A}(WR),HR=function(){function g(t){cn(this,g),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},fe(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g=this;this.body.emitter.on("initPhysics",(function(){g.initPhysics()})),this.body.emitter.on("_layoutFailed",(function(){g.layoutFailed=!0})),this.body.emitter.on("resetPhysics",(function(){g.stopSimulation(),g.ready=!1})),this.body.emitter.on("disablePhysics",(function(){g.physicsEnabled=!1,g.stopSimulation()})),this.body.emitter.on("restorePhysics",(function(){g.setOptions(g.options),!0===g.ready&&g.startSimulation()})),this.body.emitter.on("startSimulation",(function(){!0===g.ready&&g.startSimulation()})),this.body.emitter.on("stopSimulation",(function(){g.stopSimulation()})),this.body.emitter.on("destroy",(function(){g.stopSimulation(!1),g.body.emitter.off()})),this.body.emitter.on("_dataChanged",(function(){g.updatePhysicsData()}))}},{key:"setOptions",value:function(g){if(void 0!==g)if(!1===g)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(!0===g)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Jf(["stabilization"],this.options,g),dv(this.options,g,"stabilization"),void 0===g.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());var t=this.options.wind;t&&(("number"!=typeof t.x||jm(t.x))&&(t.x=0),("number"!=typeof t.y||jm(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var g;"forceAtlas2Based"===this.options.solver?(g=this.options.forceAtlas2Based,this.nodesSolver=new UR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new KR(this.body,this.physicsBody,g)):"repulsion"===this.options.solver?(g=this.options.repulsion,this.nodesSolver=new jR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)):"hierarchicalRepulsion"===this.options.solver?(g=this.options.hierarchicalRepulsion,this.nodesSolver=new LR(this.body,this.physicsBody,g),this.edgesSolver=new YR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)):(g=this.options.barnesHut,this.nodesSolver=new GR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)),this.modelOptions=g}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){var g;!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=je(g=this.simulationStep).call(g,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var g=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===g&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===g&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var g=Qh();this.physicsTick(),(Qh()-g<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&wu((function(){g.body.emitter.emit("stabilized",{iterations:t}),g.startedStabilization=!1,g.stabilizationIterations=0}),0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var g=this.physicsBody.physicsNodeIndices,t=0,A=0,e=0;ee&&(g=g>0?e:-e),g}},{key:"_performStep",value:function(g){var t=this.body.nodes[g],A=this.physicsBody.forces[g];this.options.wind&&(A.x+=this.options.wind.x,A.y+=this.options.wind.y);var e=this.physicsBody.velocities[g];return this.previousStates[g]={x:t.x,y:t.y,vx:e.x,vy:e.y},!1===t.options.fixed.x?(e.x=this.calculateComponentVelocity(e.x,A.x,t.options.mass),t.x+=e.x*this.timestep):(A.x=0,e.x=0),!1===t.options.fixed.y?(e.y=this.calculateComponentVelocity(e.y,A.y,t.options.mass),t.y+=e.y*this.timestep):(A.y=0,e.y=0),Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}},{key:"_freezeNodes",value:function(){var g=this.body.nodes;for(var t in g)if(Object.prototype.hasOwnProperty.call(g,t)&&g[t].x&&g[t].y){var A=g[t].options.fixed;this.freezeCache[t]={x:A.x,y:A.y},A.x=!0,A.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var g=this.body.nodes;for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&void 0!==this.freezeCache[t]&&(g[t].options.fixed.x=this.freezeCache[t].x,g[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof t&&(t=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,wu((function(){return g._stabilizationBatch()}),0)):this.ready=!0}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var g=this,t=function(){return!1===g.stabilized&&g.stabilizationIterations1&&void 0!==arguments[1]?arguments[1]:[],e=1e9,C=-1e9,I=1e9,i=-1e9;if(A.length>0)for(var o=0;o(t=g[A[o]]).shape.boundingBox.left&&(I=t.shape.boundingBox.left),it.shape.boundingBox.top&&(e=t.shape.boundingBox.top),C1&&void 0!==arguments[1]?arguments[1]:[],e=1e9,C=-1e9,I=1e9,i=-1e9;if(A.length>0)for(var o=0;o(t=g[A[o]]).x&&(I=t.x),it.y&&(e=t.y),C=g&&A.push(C.id)}for(var I=0;I0&&void 0!==arguments[0]?arguments[0]:{},A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var e={},C={};tv(this.body.nodes,(function(A,I){A.options&&!0===t.joinCondition(A.options)&&(e[I]=A,tv(A.edges,(function(t){void 0===g.clusteredEdges[t.id]&&(C[t.id]=t)})))})),this._cluster(e,C,t,A)}},{key:"clusterByEdgeCount",value:function(g,t){var A=this,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=this._checkOptions(t);for(var C,I,i,o=[],n={},r=function(){var e={},r={},a=A.body.nodeIndices[s],d=A.body.nodes[a];if(void 0===n[a]){i=0,I=[];for(var h=0;h0&&Lh(r).length>0&&!0===c){var f=function(){for(var g=0;g1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,g,t)}},{key:"clusterBridges",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,g,t)}},{key:"clusterByConnection",value:function(g,t){var A,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[g])throw new Error("The nodeId given to clusterByConnection does not exist!");var C=this.body.nodes[g];void 0===(t=this._checkOptions(t,C)).clusterNodeProperties.x&&(t.clusterNodeProperties.x=C.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=C.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=C.options.fixed.x,t.clusterNodeProperties.fixed.y=C.options.fixed.y);var I={},i={},o=C.id,n=XR.cloneOptions(C);I[o]=C;for(var r=0;r-1&&(i[p.id]=p)}this._cluster(I,i,t,e)}},{key:"_createClusterEdges",value:function(g,t,A,e){for(var C,I,i,o,n,r,s=Lh(g),a=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:{};return void 0===g.clusterEdgeProperties&&(g.clusterEdgeProperties={}),void 0===g.clusterNodeProperties&&(g.clusterNodeProperties={}),g}},{key:"_cluster",value:function(g,t,A){var e=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],C=[];for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&void 0!==this.clusteredNodes[I]&&C.push(I);for(var i=0;iC?t.x:C,I=t.yi?t.y:i;return{x:.5*(e+C),y:.5*(I+i)}}},{key:"openCluster",value:function(g,t){var A=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No clusterNodeId supplied to openCluster.");var e=this.body.nodes[g];if(void 0===e)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==e.isCluster||void 0===e.containedNodes||void 0===e.containedEdges)throw new Error("The node:"+g+" is not a valid cluster.");var C=this.findNode(g),I=Xc(C).call(C,g)-1;if(I>=0){var i=C[I];return this.body.nodes[i]._openChildCluster(g),delete this.body.nodes[g],void(!0===A&&this.body.emitter.emit("_dataChanged"))}var o=e.containedNodes,n=e.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},s={x:e.x,y:e.y};for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)){var d=this.body.nodes[a];r[a]={x:d.x,y:d.y}}var h=t.releaseFunction(s,r);for(var l in o)if(Object.prototype.hasOwnProperty.call(o,l)){var c=this.body.nodes[l];void 0!==h[l]&&(c.x=void 0===h[l].x?e.x:h[l].x,c.y=void 0===h[l].y?e.y:h[l].y)}}else tv(o,(function(g){!1===g.options.fixed.x&&(g.x=e.x),!1===g.options.fixed.y&&(g.y=e.y)}));for(var u in o)if(Object.prototype.hasOwnProperty.call(o,u)){var p=this.body.nodes[u];p.vx=e.vx,p.vy=e.vy,p.setOptions({physics:!0}),delete this.clusteredNodes[u]}for(var f=[],v=0;v0&&C<100;){var I=t.pop();if(void 0!==I){var i=this.body.edges[I];if(void 0!==i){C++;var o=i.clusteringEdgeReplacingIds;if(void 0===o)e.push(I);else for(var n=0;ne&&(e=I.edges.length),g+=I.edges.length,t+=Math.pow(I.edges.length,2),A+=1}g/=A;var i=(t/=A)-Math.pow(g,2),o=Math.sqrt(i),n=Math.floor(g+2*o);return n>e&&(n=e),n}},{key:"_createClusteredEdge",value:function(g,t,A,e,C){var I=XR.cloneOptions(A,"edge");qf(I,e),I.from=g,I.to=t,I.id="clusterEdge:"+rD(),void 0!==C&&qf(I,C);var i=this.body.functions.createEdge(I);return i.clusteringEdgeReplacingIds=[A.id],i.connect(),this.body.edges[i.id]=i,i}},{key:"_clusterEdges",value:function(g,t,A,e){if(t instanceof ZR){var C=t,I={};I[C.id]=C,t=I}if(g instanceof jN){var i=g,o={};o[i.id]=i,g=o}if(null==A)throw new Error("_clusterEdges: parameter clusterNode required");for(var n in void 0===e&&(e=A.clusterEdgeProperties),this._createClusterEdges(g,t,A,e),t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==this.body.edges[n]){var r=this.body.edges[n];this._backupEdgeOptions(r),r.setOptions({physics:!1})}for(var s in g)Object.prototype.hasOwnProperty.call(g,s)&&(this.clusteredNodes[s]={clusterId:A.id,node:this.body.nodes[s]},this.body.nodes[s].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(g){if(void 0!==g){var t=this.clusteredNodes[g];if(void 0!==t){var A=t.clusterId;if(void 0!==A)return this.body.nodes[A]}}}},{key:"_filter",value:function(g,t){var A=[];return tv(g,(function(g){t(g)&&A.push(g)})),A}},{key:"_updateState",value:function(){var g,t=this,A=[],e={},C=function(g){tv(t.body.nodes,(function(t){!0===t.isCluster&&g(t)}))};for(g in this.clusteredNodes){if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,g))void 0===this.body.nodes[g]&&A.push(g)}C((function(g){for(var t=0;t0}g.endPointsValid()&&C||(e[A]=A)})),C((function(g){tv(e,(function(A){delete g.containedEdges[A],tv(g.edges,(function(C,I){C.id!==A?C.clusteringEdgeReplacingIds=t._filter(C.clusteringEdgeReplacingIds,(function(g){return!e[g]})):g.edges[I]=null})),g.edges=t._filter(g.edges,(function(g){return null!==g}))}))})),tv(e,(function(g){delete t.clusteredEdges[g]})),tv(e,(function(g){delete t.body.edges[g]})),tv(Lh(this.body.edges),(function(g){var A=t.body.edges[g],e=t._isClusteredNode(A.fromId)||t._isClusteredNode(A.toId);if(e!==t._isClusteredEdge(A.id))if(e){var C=t._getClusterNodeForNode(A.fromId);void 0!==C&&t._clusterEdges(t.body.nodes[A.fromId],A,C);var I=t._getClusterNodeForNode(A.toId);void 0!==I&&t._clusterEdges(t.body.nodes[A.toId],A,I)}else delete t._clusterEdges[g],t._restoreEdge(A)}));for(var i=!1,o=!0,n=function(){var g=[];C((function(t){var A=Lh(t.containedNodes).length,e=!0===t.options.allowSingleNodeCluster;(e&&A<1||!e&&A<2)&&g.push(t.id)}));for(var A=0;A0,i=i||o};o;)n();i&&this._updateState()}},{key:"_isClusteredNode",value:function(g){return void 0!==this.clusteredNodes[g]}},{key:"_isClusteredEdge",value:function(g){return void 0!==this.clusteredEdges[g]}}]),g}();var gP=function(){function g(t,A){var e;cn(this,g),void 0!==window&&(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===e?function(g){g()}:e,this.body=t,this.canvas=A,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},fe(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g,t=this;this.body.emitter.on("dragStart",(function(){t.dragging=!0})),this.body.emitter.on("dragEnd",(function(){t.dragging=!1})),this.body.emitter.on("zoom",(function(){t.zooming=!0,window.clearTimeout(t.zoomTimeoutId),t.zoomTimeoutId=wu((function(){var g;t.zooming=!1,je(g=t._requestRedraw).call(g,t)()}),250)})),this.body.emitter.on("_resizeNodes",(function(){t._resizeNodes()})),this.body.emitter.on("_redraw",(function(){!1===t.renderingActive&&t._redraw()})),this.body.emitter.on("_blockRedraw",(function(){t.allowRedraw=!1})),this.body.emitter.on("_allowRedraw",(function(){t.allowRedraw=!0,t.redrawRequested=!1})),this.body.emitter.on("_requestRedraw",je(g=this._requestRedraw).call(g,this)),this.body.emitter.on("_startRendering",(function(){t.renderRequests+=1,t.renderingActive=!0,t._startRendering()})),this.body.emitter.on("_stopRendering",(function(){t.renderRequests-=1,t.renderingActive=t.renderRequests>0,t.renderTimer=void 0})),this.body.emitter.on("destroy",(function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,!0===t.requiresTimeout?clearTimeout(t.renderTimer):window.cancelAnimationFrame(t.renderTimer),t.body.emitter.off()}))}},{key:"setOptions",value:function(g){if(void 0!==g){Xf(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,g)}}},{key:"_requestNextFrame",value:function(g,t){if("undefined"!=typeof window){var A,e=window;return!0===this.requiresTimeout?A=wu(g,t):e.requestAnimationFrame&&(A=e.requestAnimationFrame(g)),A}}},{key:"_startRendering",value:function(){var g;!0===this.renderingActive&&(void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(je(g=this._renderStep).call(g,this),this.simulationInterval)))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var g=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame((function(){g._redraw(!1)}),0))}},{key:"_redraw",value:function(){var g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t={drawExternalLabels:null};0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();var A=this.canvas.getContext(),e=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(A.clearRect(0,0,e,C),0===this.canvas.frame.clientWidth)return;if(A.save(),A.translate(this.body.view.translation.x,this.body.view.translation.y),A.scale(this.body.view.scale,this.body.view.scale),A.beginPath(),this.body.emitter.emit("beforeDrawing",A),A.closePath(),!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(A),!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag){var I=this._drawNodes(A,g).drawExternalLabels;t.drawExternalLabels=I}!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawArrows(A),null!=t.drawExternalLabels&&t.drawExternalLabels(),!1===g&&this._drawSelectionBox(A),A.beginPath(),this.body.emitter.emit("afterDrawing",A),A.closePath(),A.restore(),!0===g&&A.clearRect(0,0,e,C)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var g=this.canvas.getContext();g.save(),g.translate(this.body.view.translation.x,this.body.view.translation.y),g.scale(this.body.view.scale,this.body.view.scale);var t,A=this.body.nodes;for(var e in A)Object.prototype.hasOwnProperty.call(A,e)&&((t=A[e]).resize(g),t.updateBoundingBox(g,t.selected));g.restore()}},{key:"_drawNodes",value:function(g){for(var t,A,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],C=this.body.nodes,I=this.body.nodeIndices,i=[],o=[],n=this.canvas.DOMtoCanvas({x:-20,y:-20}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),s={top:n.y,left:n.x,bottom:r.y,right:r.x},a=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/g,this.cameraState.previousHeight=this.frame.canvas.height/g,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/g,y:.5*this.frame.canvas.height/g}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var g=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,A=this.cameraState.scale;1!=g&&1!=t?A=.5*this.cameraState.scale*(g+t):1!=g?A=this.cameraState.scale*g:1!=t&&(A=this.cameraState.scale*t),this.body.view.scale=A;var e=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:e.x-this.cameraState.position.x,y:e.y-this.cameraState.position.y};this.body.view.translation.x+=C.x*this.body.view.scale,this.body.view.translation.y+=C.y*this.body.view.scale}}},{key:"_prepareValue",value:function(g){if("number"==typeof g)return g+"px";if("string"==typeof g){if(-1!==Xc(g).call(g,"%")||-1!==Xc(g).call(g,"px"))return g;if(-1===Xc(g).call(g,"%"))return g+"px"}throw new Error("Could not use the value supplied for width or height:"+g)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{var g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(g)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var g=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Ev(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Ev.DIRECTION_ALL}),AP(this.hammer,(function(t){g.body.eventListeners.onTouch(t)})),this.hammer.on("tap",(function(t){g.body.eventListeners.onTap(t)})),this.hammer.on("doubletap",(function(t){g.body.eventListeners.onDoubleTap(t)})),this.hammer.on("press",(function(t){g.body.eventListeners.onHold(t)})),this.hammer.on("panstart",(function(t){g.body.eventListeners.onDragStart(t)})),this.hammer.on("panmove",(function(t){g.body.eventListeners.onDrag(t)})),this.hammer.on("panend",(function(t){g.body.eventListeners.onDragEnd(t)})),this.hammer.on("pinch",(function(t){g.body.eventListeners.onPinch(t)})),this.frame.canvas.addEventListener("wheel",(function(t){g.body.eventListeners.onMouseWheel(t)})),this.frame.canvas.addEventListener("mousemove",(function(t){g.body.eventListeners.onMouseMove(t)})),this.frame.canvas.addEventListener("contextmenu",(function(t){g.body.eventListeners.onContext(t)})),this.hammerFrame=new Ev(this.frame),eP(this.hammerFrame,(function(t){g.body.eventListeners.onRelease(t)}))}},{key:"setSize",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;g=this._prepareValue(g),t=this._prepareValue(t);var A=!1,e=this.frame.canvas.width,C=this.frame.canvas.height,I=this.pixelRatio;if(this._setPixelRatio(),g!=this.options.width||t!=this.options.height||this.frame.style.width!=g||this.frame.style.height!=t)this._getCameraState(I),this.frame.style.width=g,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=g,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},A=!0;else{var i=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),o=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===i&&this.frame.canvas.height===o||this._getCameraState(I),this.frame.canvas.width!==i&&(this.frame.canvas.width=i,A=!0),this.frame.canvas.height!==o&&(this.frame.canvas.height=o,A=!0)}return!0===A&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(e/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,A}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");var t=1;return"undefined"!=typeof window&&(t=window.devicePixelRatio||1),t/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(g){return(g-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(g){return g*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(g){return(g-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(g){return g*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(g){return{x:this._XconvertCanvasToDOM(g.x),y:this._YconvertCanvasToDOM(g.y)}}},{key:"DOMtoCanvas",value:function(g){return{x:this._XconvertDOMtoCanvas(g.x),y:this._YconvertDOMtoCanvas(g.y)}}}]),g}();var IP=function(){function g(t,A){var e,C,I=this;cn(this,g),this.body=t,this.canvas=A,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",je(e=this.fit).call(e,this)),this.body.emitter.on("animationFinished",(function(){I.body.emitter.emit("_stopRendering")})),this.body.emitter.on("unlockNode",je(C=this.releaseNode).call(C,this))}return kd(g,[{key:"setOptions",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=g}},{key:"fit",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g=function(g,t){var A=fe({nodes:t,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},null!=g?g:{});if(!Rh(A.nodes))throw new TypeError("Nodes has to be an array of ids.");if(0===A.nodes.length&&(A.nodes=t),!("number"==typeof A.minZoomLevel&&A.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!("number"==typeof A.maxZoomLevel&&A.minZoomLevel<=A.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return A}(g,this.body.nodeIndices);var A,e,C=this.canvas.frame.canvas.clientWidth,I=this.canvas.frame.canvas.clientHeight;if(0===C||0===I)e=1,A=XR.getRange(this.body.nodes,g.nodes);else if(!0===t){var i=0;for(var o in this.body.nodes){if(Object.prototype.hasOwnProperty.call(this.body.nodes,o))!0===this.body.nodes[o].predefinedPosition&&(i+=1)}if(i>.5*this.body.nodeIndices.length)return void this.fit(g,!1);A=XR.getRange(this.body.nodes,g.nodes),e=12.662/(this.body.nodeIndices.length+7.4147)+.0964822,e*=Math.min(C/600,I/600)}else{this.body.emitter.emit("_resizeNodes"),A=XR.getRange(this.body.nodes,g.nodes);var n=C/(1.1*Math.abs(A.maxX-A.minX)),r=I/(1.1*Math.abs(A.maxY-A.minY));e=n<=r?n:r}e>g.maxZoomLevel?e=g.maxZoomLevel:e1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[g]){var A={x:this.body.nodes[g].x,y:this.body.nodes[g].y};t.position=A,t.lockedOnNode=g,this.moveTo(t)}else console.error("Node: "+g+" cannot be found.")}},{key:"moveTo",value:function(g){if(void 0!==g){if(null!=g.offset){if(null!=g.offset.x){if(g.offset.x=+g.offset.x,!Ym(g.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else g.offset.x=0;if(null!=g.offset.y){if(g.offset.y=+g.offset.y,!Ym(g.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else g.offset.x=0}else g.offset={x:0,y:0};if(null!=g.position){if(null!=g.position.x){if(g.position.x=+g.position.x,!Ym(g.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else g.position.x=0;if(null!=g.position.y){if(g.position.y=+g.position.y,!Ym(g.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else g.position.x=0}else g.position=this.getViewPosition();if(null!=g.scale){if(g.scale=+g.scale,!(g.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else g.scale=this.body.view.scale;void 0===g.animation&&(g.animation={duration:0}),!1===g.animation&&(g.animation={duration:0}),!0===g.animation&&(g.animation={}),void 0===g.animation.duration&&(g.animation.duration=1e3),void 0===g.animation.easingFunction&&(g.animation.easingFunction="easeInOutQuad"),this.animateView(g)}else g={}}},{key:"animateView",value:function(g){if(void 0!==g){this.animationEasingFunction=g.animation.easingFunction,this.releaseNode(),!0===g.locked&&(this.lockedOnNodeId=g.lockedOnNode,this.lockedOnNodeOffset=g.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=g.scale,this.body.view.scale=this.targetScale;var t,A,e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),C=e.x-g.position.x,I=e.y-g.position.y;if(this.targetTranslation={x:this.sourceTranslation.x+C*this.targetScale+g.offset.x,y:this.sourceTranslation.y+I*this.targetScale+g.offset.y},0===g.animation.duration)if(null!=this.lockedOnNodeId)this.viewFunction=je(t=this._lockedRedraw).call(t,this),this.body.emitter.on("initRedraw",this.viewFunction);else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else this.animationSpeed=1/(60*g.animation.duration*.001)||1/60,this.animationEasingFunction=g.animation.easingFunction,this.viewFunction=je(A=this._transitionRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}},{key:"_lockedRedraw",value:function(){var g=this.body.nodes[this.lockedOnNodeId].x,t=this.body.nodes[this.lockedOnNodeId].y,A=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),e=A.x-g,C=A.y-t,I=this.body.view.translation,i={x:I.x+e*this.body.view.scale+this.lockedOnNodeOffset.x,y:I.y+C*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===g?1:this.easingTime;var t=hv[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){var A;if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId)this.viewFunction=je(A=this._lockedRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction);this.body.emitter.emit("animationFinished")}}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),g}();function iP(g){var t,A=g&&g.preventDefault||!1,e=g&&g.container||window,C={},I={keydown:{},keyup:{}},i={};for(t=97;t<=122;t++)i[String.fromCharCode(t)]={code:t-97+65,shift:!1};for(t=65;t<=90;t++)i[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;t<=9;t++)i[""+t]={code:48+t,shift:!1};for(t=1;t<=12;t++)i["F"+t]={code:111+t,shift:!1};for(t=0;t<=9;t++)i["num"+t]={code:96+t,shift:!1};i["num*"]={code:106,shift:!1},i["num+"]={code:107,shift:!1},i["num-"]={code:109,shift:!1},i["num/"]={code:111,shift:!1},i["num."]={code:110,shift:!1},i.left={code:37,shift:!1},i.up={code:38,shift:!1},i.right={code:39,shift:!1},i.down={code:40,shift:!1},i.space={code:32,shift:!1},i.enter={code:13,shift:!1},i.shift={code:16,shift:void 0},i.esc={code:27,shift:!1},i.backspace={code:8,shift:!1},i.tab={code:9,shift:!1},i.ctrl={code:17,shift:!1},i.alt={code:18,shift:!1},i.delete={code:46,shift:!1},i.pageup={code:33,shift:!1},i.pagedown={code:34,shift:!1},i["="]={code:187,shift:!1},i["-"]={code:189,shift:!1},i["]"]={code:221,shift:!1},i["["]={code:219,shift:!1};var o=function(g){r(g,"keydown")},n=function(g){r(g,"keyup")},r=function(g,t){if(void 0!==I[t][g.keyCode]){for(var e=I[t][g.keyCode],C=0;C700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var g in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,g)&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var g=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),A=this.body.view.translation,e=t/g,C=(1-e)*this.canvas.canvasViewCenter.x+A.x*e,I=(1-e)*this.canvas.canvasViewCenter.y+A.y*e;this.body.view.scale=t,this.body.view.translation={x:C,y:I},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var g=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),A=this.body.view.translation,e=t/g,C=(1-e)*this.canvas.canvasViewCenter.x+A.x*e,I=(1-e)*this.canvas.canvasViewCenter.y+A.y*e;this.body.view.scale=t,this.body.view.translation={x:C,y:I},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var g,t,A,e,C,I,i,o,n,r,s,a,d,h,l,c,u,p,f,v,y,m,b,w,k=this;(void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=iP({container:window,preventDefault:!0}):this.keycharm=iP({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(je(g=this.keycharm).call(g,"up",(function(){k.bindToRedraw("_moveUp")}),"keydown"),je(t=this.keycharm).call(t,"down",(function(){k.bindToRedraw("_moveDown")}),"keydown"),je(A=this.keycharm).call(A,"left",(function(){k.bindToRedraw("_moveLeft")}),"keydown"),je(e=this.keycharm).call(e,"right",(function(){k.bindToRedraw("_moveRight")}),"keydown"),je(C=this.keycharm).call(C,"=",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(I=this.keycharm).call(I,"num+",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(i=this.keycharm).call(i,"num-",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(o=this.keycharm).call(o,"-",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(n=this.keycharm).call(n,"[",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(r=this.keycharm).call(r,"]",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(s=this.keycharm).call(s,"pageup",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(a=this.keycharm).call(a,"pagedown",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(d=this.keycharm).call(d,"up",(function(){k.unbindFromRedraw("_moveUp")}),"keyup"),je(h=this.keycharm).call(h,"down",(function(){k.unbindFromRedraw("_moveDown")}),"keyup"),je(l=this.keycharm).call(l,"left",(function(){k.unbindFromRedraw("_moveLeft")}),"keyup"),je(c=this.keycharm).call(c,"right",(function(){k.unbindFromRedraw("_moveRight")}),"keyup"),je(u=this.keycharm).call(u,"=",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(p=this.keycharm).call(p,"num+",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(f=this.keycharm).call(f,"num-",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(v=this.keycharm).call(v,"-",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(y=this.keycharm).call(y,"[",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(m=this.keycharm).call(m,"]",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(b=this.keycharm).call(b,"pageup",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(w=this.keycharm).call(w,"pagedown",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup")))}}]),g}();function nP(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return rP(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rP(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function rP(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A50&&(this.drag.pointer=this.getPointer(g.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(g){var t=this.getPointer(g.center),A=this.selectionHandler.options.multiselect&&(g.changedPointers[0].ctrlKey||g.changedPointers[0].metaKey);this.checkSelectionChanges(t,A),this.selectionHandler.commitAndEmit(t,g),this.selectionHandler.generateClickEvent("click",g,t)}},{key:"onDoubleTap",value:function(g){var t=this.getPointer(g.center);this.selectionHandler.generateClickEvent("doubleClick",g,t)}},{key:"onHold",value:function(g){var t=this.getPointer(g.center),A=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,A),this.selectionHandler.commitAndEmit(t,g),this.selectionHandler.generateClickEvent("click",g,t),this.selectionHandler.generateClickEvent("hold",g,t)}},{key:"onRelease",value:function(g){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(g.center);this.selectionHandler.generateClickEvent("release",g,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(g){var t=this.getPointer({x:g.clientX,y:g.clientY});this.selectionHandler.generateClickEvent("oncontext",g,t)}},{key:"checkSelectionChanges",value:function(g){!0===(arguments.length>1&&void 0!==arguments[1]&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(g):this.selectionHandler.selectOnPoint(g)}},{key:"_determineDifference",value:function(g,t){var A=function(g,t){for(var A=[],e=0;e=C.minX&&A.x<=C.maxX&&A.y>=C.minY&&A.y<=C.maxY}));Cl(I).call(I,(function(g){return t.selectionHandler.selectObject(t.body.nodes[g])}));var i=this.getPointer(g.center);this.selectionHandler.commitAndEmit(i,g),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var o=this.drag.selection;o&&o.length?(Cl(o).call(o,(function(g){g.node.options.fixed.x=g.xFixed,g.node.options.fixed.y=g.yFixed})),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}},{key:"onPinch",value:function(g){var t=this.getPointer(g.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var A=this.pinch.scale*g.scale;this.zoom(A,t)}},{key:"zoom",value:function(g,t){if(!0===this.options.zoomView){var A=this.body.view.scale;g<1e-5&&(g=1e-5),g>10&&(g=10);var e=void 0;void 0!==this.drag&&!0===this.drag.dragging&&(e=this.canvas.DOMtoCanvas(this.drag.pointer));var C=this.body.view.translation,I=g/A,i=(1-I)*t.x+C.x*I,o=(1-I)*t.y+C.y*I;if(this.body.view.scale=g,this.body.view.translation={x:i,y:o},null!=e){var n=this.canvas.canvasToDOM(e);this.drag.pointer.x=n.x,this.drag.pointer.y=n.y}this.body.emitter.emit("_requestRedraw"),A0&&(this.popupObj=r[s[s.length-1]],I=!0)}if(void 0===this.popupObj&&!1===I){for(var d,h=this.body.edgeIndices,l=this.body.edges,c=[],u=0;u0&&(this.popupObj=l[c[c.length-1]],i="edge")}void 0!==this.popupObj?this.popupObj.id!==C&&(void 0===this.popup&&(this.popup=new Ov(this.canvas.frame)),this.popup.popupTargetType=i,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(g.x+3,g.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(g){var t=this.selectionHandler._pointerToPositionObject(g),A=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&!0===(A=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t))){var e=this.selectionHandler.getNodeAt(g);A=void 0!==e&&e.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(g)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(A=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));!1===A&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),g}(),aP=u,dP=pm,hP=zy.getWeakData,lP=qy,cP=AA,uP=Q,pP=gg,fP=Hy,vP=qg,yP=GC.set,mP=GC.getterFor,bP=Sr.find,wP=Sr.findIndex,kP=aP([].splice),xP=0,EP=function(g){return g.frozen||(g.frozen=new OP)},OP=function(){this.entries=[]},TP=function(g,t){return bP(g.entries,(function(g){return g[0]===t}))};OP.prototype={get:function(g){var t=TP(this,g);if(t)return t[1]},has:function(g){return!!TP(this,g)},set:function(g,t){var A=TP(this,g);A?A[1]=t:this.entries.push([g,t])},delete:function(g){var t=wP(this.entries,(function(t){return t[0]===g}));return~t&&kP(this.entries,t,1),!!~t}};var DP,NP={getConstructor:function(g,t,A,e){var C=g((function(g,C){lP(g,I),yP(g,{type:t,id:xP++,frozen:void 0}),uP(C)||fP(C,g[e],{that:g,AS_ENTRIES:A})})),I=C.prototype,i=mP(t),o=function(g,t,A){var e=i(g),C=hP(cP(t),!0);return!0===C?EP(e).set(t,A):C[e.id]=A,g};return dP(I,{delete:function(g){var t=i(this);if(!pP(g))return!1;var A=hP(g);return!0===A?EP(t).delete(g):A&&vP(A,t.id)&&delete A[t.id]},has:function(g){var t=i(this);if(!pP(g))return!1;var A=hP(g);return!0===A?EP(t).has(g):A&&vP(A,t.id)}}),dP(I,A?{get:function(g){var t=i(this);if(pP(g)){var A=hP(g);return!0===A?EP(t).get(g):A?A[t.id]:void 0}},set:function(g,t){return o(this,g,t)}}:{add:function(g){return o(this,g,!0)}}),C}},RP=vy,PP=C,MP=u,BP=pm,zP=zy,SP=cm,ZP=NP,FP=gg,GP=GC.enforce,jP=I,LP=bC,VP=Object,YP=Array.isArray,WP=VP.isExtensible,QP=VP.isFrozen,UP=VP.isSealed,_P=VP.freeze,KP=VP.seal,HP={},XP={},JP=!PP.ActiveXObject&&"ActiveXObject"in PP,qP=function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}},$P=SP("WeakMap",qP,ZP),gM=$P.prototype,tM=MP(gM.set);if(LP)if(JP){DP=ZP.getConstructor(qP,"WeakMap",!0),zP.enable();var AM=MP(gM.delete),eM=MP(gM.has),CM=MP(gM.get);BP(gM,{delete:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),AM(this,g)||t.frozen.delete(g)}return AM(this,g)},has:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),eM(this,g)||t.frozen.has(g)}return eM(this,g)},get:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),eM(this,g)?CM(this,g):t.frozen.get(g)}return CM(this,g)},set:function(g,t){if(FP(g)&&!WP(g)){var A=GP(this);A.frozen||(A.frozen=new DP),eM(this,g)?tM(this,g,t):A.frozen.set(g,t)}else tM(this,g,t);return this}})}else RP&&jP((function(){var g=_P([]);return tM(new $P,g,1),!QP(g)}))&&BP(gM,{set:function(g,t){var A;return YP(g)&&(QP(g)?A=HP:UP(g)&&(A=XP)),tM(this,g,t),A===HP&&_P(g),A===XP&&KP(g),this}});var IM,iM,oM,nM,rM,sM=A(tg.WeakMap);function aM(g,t,A,e){if("a"===A&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?g!==t||!e:!t.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===A?e:"a"===A?e.call(g):e?e.value:t.get(g)}function dM(g,t,A,e,C){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!C)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?g!==t||!C:!t.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?C.call(g,A):C?C.value=A:t.set(g,A),A}function hM(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return lM(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return lM(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function lM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&void 0!==arguments[0]?arguments[0]:function(){};cn(this,g),oM.set(this,new uM),nM.set(this,new uM),rM.set(this,void 0),dM(this,rM,t,"f")}return kd(g,[{key:"sizeNodes",get:function(){return aM(this,oM,"f").size}},{key:"sizeEdges",get:function(){return aM(this,nM,"f").size}},{key:"getNodes",value:function(){return aM(this,oM,"f").getSelection()}},{key:"getEdges",value:function(){return aM(this,nM,"f").getSelection()}},{key:"addNodes",value:function(){var g;(g=aM(this,oM,"f")).add.apply(g,arguments)}},{key:"addEdges",value:function(){var g;(g=aM(this,nM,"f")).add.apply(g,arguments)}},{key:"deleteNodes",value:function(g){aM(this,oM,"f").delete(g)}},{key:"deleteEdges",value:function(g){aM(this,nM,"f").delete(g)}},{key:"clear",value:function(){aM(this,oM,"f").clear(),aM(this,nM,"f").clear()}},{key:"commit",value:function(){for(var g,t,A={nodes:aM(this,oM,"f").commit(),edges:aM(this,nM,"f").commit()},e=arguments.length,C=new Array(e),I=0;I=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function vM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A4&&void 0!==arguments[4]&&arguments[4],I=this._initBaseEvent(t,A);if(!0===C)I.nodes=[],I.edges=[];else{var i=this.getSelection();I.nodes=i.nodes,I.edges=i.edges}void 0!==e&&(I.previousSelection=e),"click"==g&&(I.items=this.getClickedItems(A)),void 0!==t.controlEdge&&(I.controlEdge=t.controlEdge),this.body.emitter.emit(g,I)}},{key:"selectObject",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;if(void 0!==g){if(g instanceof jN){var A;if(!0===t)(A=this._selectionAccumulator).addEdges.apply(A,ch(g.edges));this._selectionAccumulator.addNodes(g)}else this._selectionAccumulator.addEdges(g);return!0}return!1}},{key:"deselectObject",value:function(g){!0===g.isSelected()&&(g.selected=!1,this._removeFromSelection(g))}},{key:"_getAllNodesOverlappingWith",value:function(g){for(var t=[],A=this.body.nodes,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this._pointerToPositionObject(g),e=this._getAllNodesOverlappingWith(A);return e.length>0?!0===t?this.body.nodes[e[e.length-1]]:e[e.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(g,t){for(var A=this.body.edges,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this.canvas.DOMtoCanvas(g),e=10,C=null,I=this.body.edges,i=0;i0&&(this.generateClickEvent("deselectEdge",t,g,C),A=!0),e.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,g,C),A=!0),e.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,g),A=!0),e.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,g),A=!0),!0===A&&this.generateClickEvent("select",t,g)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var g;return Fh(g=this._selectionAccumulator.getNodes()).call(g,(function(g){return g.id}))}},{key:"getSelectedEdgeIds",value:function(){var g;return Fh(g=this._selectionAccumulator.getEdges()).call(g,(function(g){return g.id}))}},{key:"setSelection",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!g||!g.nodes&&!g.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),g.nodes){var A,e=fM(g.nodes);try{for(e.s();!(A=e.n()).done;){var C=A.value,I=this.body.nodes[C];if(!I)throw new RangeError('Node with id "'+C+'" not found');this.selectObject(I,t.highlightEdges)}}catch(g){e.e(g)}finally{e.f()}}if(g.edges){var i,o=fM(g.edges);try{for(o.s();!(i=o.n()).done;){var n=i.value,r=this.body.edges[n];if(!r)throw new RangeError('Edge with id "'+n+'" not found');this.selectObject(r)}}catch(g){o.e(g)}finally{o.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({nodes:g},{highlightEdges:t})}},{key:"selectEdges",value:function(g){if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({edges:g})}},{key:"updateSelection",value:function(){for(var g in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,g.id)||this._selectionAccumulator.deleteNodes(g);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:"getClickedItems",value:function(g){for(var t=this.canvas.DOMtoCanvas(g),A=[],e=this.body.nodeIndices,C=this.body.nodes,I=e.length-1;I>=0;I--){var i=C[e[I]].getItemsOnPoint(t);A.push.apply(A,i)}for(var o=this.body.edgeIndices,n=this.body.edges,r=o.length-1;r>=0;r--){var s=n[o[r]].getItemsOnPoint(t);A.push.apply(A,s)}return A}}]),g}();function mM(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var bM=function(){function g(){cn(this,g)}return kd(g,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(g){return this.fake_use(g),this.abstract()}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(g,t,A),this.abstract()}},{key:"getTreeSize",value:function(g){return this.fake_use(g),this.abstract()}},{key:"sort",value:function(g){this.fake_use(g),this.abstract()}},{key:"fix",value:function(g,t){this.fake_use(g,t),this.abstract()}},{key:"shift",value:function(g,t){this.fake_use(g,t),this.abstract()}}]),g}(),wM=function(g){Cb(A,g);var t=mM(A);function A(g){var e;return cn(this,A),(e=t.call(this)).layout=g,e}return kd(A,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(g){return g.x}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.x=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_x,max:t.max_x}}},{key:"sort",value:function(g){WO(g).call(g,(function(g,t){return g.x-t.x}))}},{key:"fix",value:function(g,t){g.y=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.y=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].x+=t}}]),A}(bM),kM=function(g){Cb(A,g);var t=mM(A);function A(g){var e;return cn(this,A),(e=t.call(this)).layout=g,e}return kd(A,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(g){return g.y}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.y=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_y,max:t.max_y}}},{key:"sort",value:function(g){WO(g).call(g,(function(g,t){return g.y-t.y}))}},{key:"fix",value:function(g,t){g.x=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.x=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].y+=t}}]),A}(bM),xM=Sr.every;TA({target:"Array",proto:!0,forced:!_h("every")},{every:function(g){return xM(this,g,arguments.length>1?arguments[1]:void 0)}});var EM=Me("Array").every,OM=og,TM=EM,DM=Array.prototype,NM=function(g){var t=g.every;return g===DM||OM(DM,g)&&t===DM.every?TM:t},RM=A(NM);function PM(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return MM(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MM(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function MM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A=t[e])&&(t[e]=t[A]+1)})),t}function zM(g,t,A,e){var C,I,i=$c(null),o=LE(C=ch(nT(e).call(e))).call(C,(function(g,t){return g+1+t.edges.length}),0),n=A+"Id",r="to"===A?1:-1,s=PM(e);try{var a,d=function(){var C=lh(I.value,2),s=C[0],a=C[1];if(!e.has(s)||!g(a))return 0;i[s]=0;for(var d,h,l=[a],c=0,u=function(){var g,C;if(!e.has(s))return 0;var I=i[d.id]+r;if(Cl(g=pc(C=d.edges).call(C,(function(g){return g.connected&&g.to!==g.from&&g[A]!==d&&e.has(g.toId)&&e.has(g.fromId)}))).call(g,(function(g){var e=g[n],C=i[e];(null==C||t(I,C))&&(i[e]=I,l.push(g[A]))})),c>o)return{v:{v:BM(e,i)}};++c};d=l.pop();)if(0!==(h=u())&&h)return h.v};for(s.s();!(I=s.n()).done;)if(0!==(a=d())&&a)return a.v}catch(g){s.e(g)}finally{s.f()}return i}var SM=function(){function g(){cn(this,g),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return kd(g,[{key:"addRelation",value:function(g,t){void 0===this.childrenReference[g]&&(this.childrenReference[g]=[]),this.childrenReference[g].push(t),void 0===this.parentReference[t]&&(this.parentReference[t]=[]),this.parentReference[t].push(g)}},{key:"checkIfTree",value:function(){for(var g in this.parentReference)if(this.parentReference[g].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(g,t){void 0!==t&&void 0===this.trees[g.id]&&(this.trees[g.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(g){void 0===this.levels[g]&&(this.levels[g]=0)}},{key:"getMaxLevel",value:function(g){var t=this,A={};return function g(e){if(void 0!==A[e])return A[e];var C=t.levels[e];if(t.childrenReference[e]){var I=t.childrenReference[e];if(I.length>0)for(var i=0;i0&&(A.levelSeparation*=-1):A.levelSeparation<0&&(A.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===e)return this.body.emitter.emit("refresh"),qf(t,this.optionsBackup)}return t}},{key:"_resetRNG",value:function(g){this.initialRandomSeed=g,this._rng=Ff(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(g){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;void 0===g.physics||!0===g.physics?(g.physics={enabled:void 0===t.enabled||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=void 0===t.enabled||t.enabled,t.solver=t.solver||"barnesHut"):"object"===yd(g.physics)?(t.enabled=void 0===g.physics.enabled||g.physics.enabled,t.solver=g.physics.solver||"barnesHut",g.physics.solver="hierarchicalRepulsion"):!1!==g.physics&&(t.solver="barnesHut",g.physics={solver:"hierarchicalRepulsion"});var A=this.direction.curveType();if(void 0===g.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges={smooth:!1};else if(void 0===g.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges.smooth=!1;else if("boolean"==typeof g.edges.smooth)this.optionsBackup.edges={smooth:g.edges.smooth},g.edges.smooth={enabled:g.edges.smooth,type:A};else{var e=g.edges.smooth;void 0!==e.type&&"dynamic"!==e.type&&(A=e.type),this.optionsBackup.edges={smooth:{enabled:void 0===e.enabled||e.enabled,type:void 0===e.type?"dynamic":e.type,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}},g.edges.smooth={enabled:void 0===e.enabled||e.enabled,type:A,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",A)}return g}},{key:"positionInitially",value:function(g){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);for(var t=g.length+50,A=0;AC){for(var i=g.length;g.length>C&&e<=10;){e+=1;var o=g.length;if(e%3==0?this.body.modules.clustering.clusterBridges(I):this.body.modules.clustering.clusterOutliers(I),o==g.length&&e%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*i)})}e>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(g,this.body.edgeIndices,!0),this._shiftToCenter();for(var n=0;n0){var g,t,A=!1,e=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new SM,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(void 0!==(g=this.body.nodes[t]).options.level?(A=!0,this.hierarchical.levels[t]=g.options.level):e=!0);if(!0===e&&!0===A)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(!0===e){var C=this.options.hierarchical.sortMethod;"hubsize"===C?this._determineLevelsByHubsize():"directed"===C?this._determineLevelsDirected():"custom"===C&&this._determineLevelsCustomCallback()}for(var I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&this.hierarchical.ensureLevel(I);var i=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(i),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var g=this,t=!1,A={},e=function(t,A){var e=g.hierarchical.trees;for(var C in e)Object.prototype.hasOwnProperty.call(e,C)&&e[C]===t&&g.direction.shift(C,A)},C=function(){for(var t=[],A=0;A0)for(var I=0;I1&&void 0!==arguments[1]?arguments[1]:1e9,e=1e9,C=1e9,I=1e9,i=-1e9;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var n=g.body.nodes[o],r=g.hierarchical.levels[n.id],s=g.direction.getPosition(n),a=lh(g._getSpaceAroundNode(n,t),2),d=a[0],h=a[1];e=Math.min(d,e),C=Math.min(h,C),r<=A&&(I=Math.min(s,I),i=Math.max(s,i))}return[I,i,e,C]},o=function(t,A,e){for(var C=g.hierarchical,I=0;I1)for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],o=g.direction.getPosition(A),n=g.direction.getPosition(e),r=Math.abs(n-o),s=g.options.hierarchical.nodeSpacing;if(r>s){var a={},d={};I(A,a),I(e,d);var h=function(t,A){var e=g.hierarchical.getMaxLevel(t.id),C=g.hierarchical.getMaxLevel(A.id);return Math.min(e,C)}(A,e),l=i(a,h),c=i(d,h),u=l[1],p=c[0],f=c[2];if(Math.abs(u-p)>s){var v=u-p+s;v<-f+s&&(v=-f+s),v<0&&(g._shiftBlock(e.id,v),t=!0,!0===C&&g._centerParent(e))}}},r=function(e,C){for(var o=C.id,n=C.edges,r=g.hierarchical.levels[C.id],s=g.options.hierarchical.levelSeparation*g.options.hierarchical.levelSeparation,a={},d=[],h=0;h0?h=Math.min(d,a-g.options.hierarchical.nodeSpacing):d<0&&(h=-Math.min(-d,s-g.options.hierarchical.nodeSpacing)),0!=h&&(g._shiftBlock(C.id,h),t=!0)}(v),function(A){var e=g.direction.getPosition(C),I=lh(g._getSpaceAroundNode(C),2),i=I[0],o=I[1],n=A-e,r=e;n>0?r=Math.min(e+(o-g.options.hierarchical.nodeSpacing),A):n<0&&(r=Math.max(e-(i-g.options.hierarchical.nodeSpacing),A)),r!==e&&(g.direction.setPosition(C,r),t=!0)}(v=f(e,n))};!0===this.options.hierarchical.blockShifting&&(function(A){var e=g.hierarchical.getLevels();e=cl(e).call(e);for(var C=0;C0&&Math.abs(a)0&&(n=this.direction.getPosition(e[I-1])+o),this.direction.setPosition(i,n,t),this._validatePositionAndContinue(i,t,n),C++}}}}},{key:"_placeBranchNodes",value:function(g,t){var A,e=this.hierarchical.childrenReference[g];if(void 0!==e){for(var C=[],I=0;It&&void 0===this.positionedNodes[o.id]))return;var r=this.options.hierarchical.nodeSpacing,s=void 0;s=0===i?this.direction.getPosition(this.body.nodes[g]):this.direction.getPosition(C[i-1])+r,this.direction.setPosition(o,s,n),this._validatePositionAndContinue(o,n,s)}var a=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[g],a,t)}}},{key:"_validatePositionAndContinue",value:function(g,t,A){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[t]){var e=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(A-eg}),"from",g)}(A),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var g=this;this._crawlNetwork((function(t,A){g.hierarchical.levels[A.id]>g.hierarchical.levels[t.id]&&g.hierarchical.addRelation(t.id,A.id)})),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},A=arguments.length>1?arguments[1]:void 0,e={},C=function A(C,I){if(void 0===e[C.id]){var i;g.hierarchical.setTreeIndex(C,I),e[C.id]=!0;for(var o=g._getActiveEdges(C),n=0;n=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function GM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&!1!==this.options.deleteNode||0===A&&!1!==this.options.deleteEdge)&&(!0===i&&this._createSeperator(4),this._createDeleteButton(I)),this._bindElementEvents(this.closeDiv,je(g=this.toggleEditMode).call(g,this)),this._temporaryBindEvent("select",je(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var g;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var t,A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,je(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",je(g=this._performAddNode).call(g,this))}},{key:"editNode",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==t.isCluster){var A=qf({},t.options,!1);if(A.x=t.x,A.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(A,(function(t){null!=t&&"editNode"===g.inMode&&g.body.data.nodes.getDataSet().update(t),g.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var g,t,A,e,C;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var I,i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,je(I=this.toggleEditMode).call(I,this))}this._temporaryBindUI("onTouch",je(g=this._handleConnect).call(g,this)),this._temporaryBindUI("onDragEnd",je(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",je(A=this._dragControlNode).call(A,this)),this._temporaryBindUI("onRelease",je(e=this._finishConnect).call(e,this)),this._temporaryBindUI("onDragStart",je(C=this._dragStartEdge).call(C,this)),this._temporaryBindUI("onHold",(function(){}))}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"!==yd(this.options.editEdge)||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var g,t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,je(g=this.toggleEditMode).call(g,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var A,e,C,I,i=this.body.edges[this.edgeBeingEditedId],o=this._getNewTargetNode(i.from.x,i.from.y),n=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(o.id),this.temporaryIds.nodes.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this._temporaryBindUI("onTouch",je(A=this._controlNodeTouch).call(A,this)),this._temporaryBindUI("onTap",(function(){})),this._temporaryBindUI("onHold",(function(){})),this._temporaryBindUI("onDragStart",je(e=this._controlNodeDragStart).call(e,this)),this._temporaryBindUI("onDrag",je(C=this._controlNodeDrag).call(C,this)),this._temporaryBindUI("onDragEnd",je(I=this._controlNodeDragEnd).call(I,this)),this._temporaryBindUI("onMouseMove",(function(){})),this._temporaryBindEvent("beforeDrawing",(function(g){var t=i.edgeType.findBorderPositions(g);!1===o.selected&&(o.x=t.from.x,o.y=t.from.y),!1===n.selected&&(n.x=t.to.x,n.y=t.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{var r=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(r.from.id,r.to.id)}}},{key:"deleteSelected",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodeIds(),A=this.selectionHandler.getSelectedEdgeIds(),e=void 0;if(t.length>0){for(var C=0;C0&&"function"==typeof this.options.deleteEdge&&(e=this.options.deleteEdge);if("function"==typeof e){var I={nodes:t,edges:A};if(2!==e.length)throw new Error("The function for delete does not support two arguments (data, callback)");e(I,(function(t){null!=t&&"delete"===g.inMode?(g.body.data.edges.getDataSet().remove(t.edges),g.body.data.nodes.getDataSet().remove(t.nodes),g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar()):(g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(A),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){var g,t;(void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv)&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",null!==(g=null===(t=this.options.locales[this.options.locale])||void 0===t?void 0:t.close)&&void 0!==g?g:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(g,t){var A=qf({},this.options.controlNodeStyle);A.id="targetNode"+rD(),A.hidden=!1,A.physics=!1,A.x=g,A.y=t;var e=this.body.functions.createNode(A);return e.shape.boundingBox={left:g,right:g,top:t,bottom:t},e}},{key:"_createEditButton",value:function(){var g;this._clean(),this.manipulationDOM={},Qf(this.editModeDiv);var t=this.options.locales[this.options.locale],A=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(A),this._bindElementEvents(A,je(g=this.toggleEditMode).call(g,this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(Qf(this.editModeDiv),Qf(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var g,t,A=FM(Zl(g=this._domEventListenerCleanupQueue).call(g,0));try{for(A.s();!(t=A.n()).done;){(0,t.value)()}}catch(g){A.e(g)}finally{A.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Qf(this.manipulationDiv),Qf(this.editModeDiv),Qf(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+g]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+g].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+g])}},{key:"_createAddNodeButton",value:function(g){var t,A=this._createButton("addNode","vis-add",g.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.addNodeMode).call(t,this))}},{key:"_createAddEdgeButton",value:function(g){var t,A=this._createButton("addEdge","vis-connect",g.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.addEdgeMode).call(t,this))}},{key:"_createEditNodeButton",value:function(g){var t,A=this._createButton("editNode","vis-edit",g.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.editNode).call(t,this))}},{key:"_createEditEdgeButton",value:function(g){var t,A=this._createButton("editEdge","vis-edit",g.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.editEdgeMode).call(t,this))}},{key:"_createDeleteButton",value:function(g){var t,A;A=this.options.rtl?"vis-delete-rtl":"vis-delete";var e=this._createButton("delete",A,g.del||this.options.locales.en.del);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,je(t=this.deleteSelected).call(t,this))}},{key:"_createBackButton",value:function(g){var t,A=this._createButton("back","vis-back",g.back||this.options.locales.en.back);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.showManipulatorToolbar).call(t,this))}},{key:"_createButton",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[g+"Div"]=document.createElement("button"),this.manipulationDOM[g+"Div"].className="vis-button "+t,this.manipulationDOM[g+"Label"]=document.createElement("div"),this.manipulationDOM[g+"Label"].className=e,this.manipulationDOM[g+"Label"].innerText=A,this.manipulationDOM[g+"Div"].appendChild(this.manipulationDOM[g+"Label"]),this.manipulationDOM[g+"Div"]}},{key:"_createDescription",value:function(g){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=g,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(g,t){this.temporaryEventFunctions.push({event:g,boundFunction:t}),this.body.emitter.on(g,t)}},{key:"_temporaryBindUI",value:function(g,t){if(void 0===this.body.eventListeners[g])throw new Error("This UI function does not exist. Typo? You tried: "+g+" possible are: "+eu(Lh(this.body.eventListeners)));this.temporaryUIFunctions[g]=this.body.eventListeners[g],this.body.eventListeners[g]=t}},{key:"_unbindTemporaryUIs",value:function(){for(var g in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,g)&&(this.body.eventListeners[g]=this.temporaryUIFunctions[g],delete this.temporaryUIFunctions[g]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var g=0;g=0;i--)if(C[i]!==this.selectedControlNode.id){I=this.body.nodes[C[i]];break}if(void 0!==I&&void 0!==this.selectedControlNode)if(!0===I.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===o.id?this._performEditEdge(I.id,e.to.id):this._performEditEdge(e.from.id,I.id)}else e.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(g){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=fe({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,A=this.selectionHandler.getNodeAt(t);if(void 0!==A)if(!0===A.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var e=this._getNewTargetNode(A.x,A.y);this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id);var C=this.body.functions.createEdge({id:"connectionEdge"+rD(),from:A.id,to:e.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(e.id),this.temporaryIds.edges.push(C.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===Xc(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}if(g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",g,t),void 0!==this.temporaryIds.nodes[0]){var n=this.body.nodes[this.temporaryIds.nodes[0]];n.x=this.canvas._XconvertDOMtoCanvas(t.x),n.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(g)}},{key:"_finishConnect",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===Xc(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}this._cleanupTemporaryNodesAndEdges(),void 0!==I&&(!0===I.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[e]&&void 0!==this.body.nodes[I.id]&&this._performAddEdge(e,I.id)),g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",g,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(g){var t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",g,t,void 0,!0)}},{key:"_performAddNode",value:function(g){var t=this,A={id:rD(),x:g.pointer.canvas.x,y:g.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(A,(function(g){null!=g&&"addNode"===t.inMode&&t.body.data.nodes.getDataSet().add(g),t.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(A),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(g,t){var A=this,e={from:g,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(e,(function(g){null!=g&&"addEdge"===A.inMode&&(A.body.data.edges.getDataSet().add(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(g,t){var A=this,e={id:this.edgeBeingEditedId,from:g,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},C=this.options.editEdge;if("object"===yd(C)&&(C=C.editWithoutDrag),"function"==typeof C){if(2!==C.length)throw new Error("The function for edit does not support two arguments (data, callback)");C(e,(function(g){null==g||"editEdge"!==A.inMode?(A.body.edges[e.id].updateEdgeType(),A.body.emitter.emit("_redraw"),A.showManipulatorToolbar()):(A.body.data.edges.getDataSet().update(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),g}(),LM="string",VM="boolean",YM="number",WM="array",QM="object",UM=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],_M={borderWidth:{number:YM},borderWidthSelected:{number:YM,undefined:"undefined"},brokenImage:{string:LM,undefined:"undefined"},chosen:{label:{boolean:VM,function:"function"},node:{boolean:VM,function:"function"},__type__:{object:QM,boolean:VM}},color:{border:{string:LM},background:{string:LM},highlight:{border:{string:LM},background:{string:LM},__type__:{object:QM,string:LM}},hover:{border:{string:LM},background:{string:LM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},opacity:{number:YM,undefined:"undefined"},fixed:{x:{boolean:VM},y:{boolean:VM},__type__:{object:QM,boolean:VM}},font:{align:{string:LM},color:{string:LM},size:{number:YM},face:{string:LM},background:{string:LM},strokeWidth:{number:YM},strokeColor:{string:LM},vadjust:{number:YM},multi:{boolean:VM,string:LM},bold:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},boldital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},ital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},mono:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},group:{string:LM,number:YM,undefined:"undefined"},heightConstraint:{minimum:{number:YM},valign:{string:LM},__type__:{object:QM,boolean:VM,number:YM}},hidden:{boolean:VM},icon:{face:{string:LM},code:{string:LM},size:{number:YM},color:{string:LM},weight:{string:LM,number:YM},__type__:{object:QM}},id:{string:LM,number:YM},image:{selected:{string:LM,undefined:"undefined"},unselected:{string:LM,undefined:"undefined"},__type__:{object:QM,string:LM}},imagePadding:{top:{number:YM},right:{number:YM},bottom:{number:YM},left:{number:YM},__type__:{object:QM,number:YM}},label:{string:LM,undefined:"undefined"},labelHighlightBold:{boolean:VM},level:{number:YM,undefined:"undefined"},margin:{top:{number:YM},right:{number:YM},bottom:{number:YM},left:{number:YM},__type__:{object:QM,number:YM}},mass:{number:YM},physics:{boolean:VM},scaling:{min:{number:YM},max:{number:YM},label:{enabled:{boolean:VM},min:{number:YM},max:{number:YM},maxVisible:{number:YM},drawThreshold:{number:YM},__type__:{object:QM,boolean:VM}},customScalingFunction:{function:"function"},__type__:{object:QM}},shadow:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},x:{number:YM},y:{number:YM},__type__:{object:QM,boolean:VM}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:VM,array:WM},borderRadius:{number:YM},interpolation:{boolean:VM},useImageSize:{boolean:VM},useBorderWithImage:{boolean:VM},coordinateOrigin:{string:["center","top-left"]},__type__:{object:QM}},size:{number:YM},title:{string:LM,dom:"dom",undefined:"undefined"},value:{number:YM,undefined:"undefined"},widthConstraint:{minimum:{number:YM},maximum:{number:YM},__type__:{object:QM,boolean:VM,number:YM}},x:{number:YM},y:{number:YM},__type__:{object:QM}},KM={configure:{enabled:{boolean:VM},filter:{boolean:VM,string:LM,array:WM,function:"function"},container:{dom:"dom"},showButton:{boolean:VM},__type__:{object:QM,boolean:VM,string:LM,array:WM,function:"function"}},edges:{arrows:{to:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageHeight:{number:YM},imageWidth:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},middle:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageWidth:{number:YM},imageHeight:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},from:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageWidth:{number:YM},imageHeight:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},__type__:{string:["from","to","middle"],object:QM}},endPointOffset:{from:{number:YM},to:{number:YM},__type__:{object:QM,number:YM}},arrowStrikethrough:{boolean:VM},background:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},dashes:{boolean:VM,array:WM},__type__:{object:QM,boolean:VM}},chosen:{label:{boolean:VM,function:"function"},edge:{boolean:VM,function:"function"},__type__:{object:QM,boolean:VM}},color:{color:{string:LM},highlight:{string:LM},hover:{string:LM},inherit:{string:["from","to","both"],boolean:VM},opacity:{number:YM},__type__:{object:QM,string:LM}},dashes:{boolean:VM,array:WM},font:{color:{string:LM},size:{number:YM},face:{string:LM},background:{string:LM},strokeWidth:{number:YM},strokeColor:{string:LM},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:YM},multi:{boolean:VM,string:LM},bold:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},boldital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},ital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},mono:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},hidden:{boolean:VM},hoverWidth:{function:"function",number:YM},label:{string:LM,undefined:"undefined"},labelHighlightBold:{boolean:VM},length:{number:YM,undefined:"undefined"},physics:{boolean:VM},scaling:{min:{number:YM},max:{number:YM},label:{enabled:{boolean:VM},min:{number:YM},max:{number:YM},maxVisible:{number:YM},drawThreshold:{number:YM},__type__:{object:QM,boolean:VM}},customScalingFunction:{function:"function"},__type__:{object:QM}},selectionWidth:{function:"function",number:YM},selfReferenceSize:{number:YM},selfReference:{size:{number:YM},angle:{number:YM},renderBehindTheNode:{boolean:VM},__type__:{object:QM}},shadow:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},x:{number:YM},y:{number:YM},__type__:{object:QM,boolean:VM}},smooth:{enabled:{boolean:VM},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:YM},forceDirection:{string:["horizontal","vertical","none"],boolean:VM},__type__:{object:QM,boolean:VM}},title:{string:LM,undefined:"undefined"},width:{number:YM},widthConstraint:{maximum:{number:YM},__type__:{object:QM,boolean:VM,number:YM}},value:{number:YM,undefined:"undefined"},__type__:{object:QM}},groups:{useDefaultGroups:{boolean:VM},__any__:_M,__type__:{object:QM}},interaction:{dragNodes:{boolean:VM},dragView:{boolean:VM},hideEdgesOnDrag:{boolean:VM},hideEdgesOnZoom:{boolean:VM},hideNodesOnDrag:{boolean:VM},hover:{boolean:VM},keyboard:{enabled:{boolean:VM},speed:{x:{number:YM},y:{number:YM},zoom:{number:YM},__type__:{object:QM}},bindToWindow:{boolean:VM},autoFocus:{boolean:VM},__type__:{object:QM,boolean:VM}},multiselect:{boolean:VM},navigationButtons:{boolean:VM},selectable:{boolean:VM},selectConnectedEdges:{boolean:VM},hoverConnectedEdges:{boolean:VM},tooltipDelay:{number:YM},zoomView:{boolean:VM},zoomSpeed:{number:YM},__type__:{object:QM}},layout:{randomSeed:{undefined:"undefined",number:YM,string:LM},improvedLayout:{boolean:VM},clusterThreshold:{number:YM},hierarchical:{enabled:{boolean:VM},levelSeparation:{number:YM},nodeSpacing:{number:YM},treeSpacing:{number:YM},blockShifting:{boolean:VM},edgeMinimization:{boolean:VM},parentCentralization:{boolean:VM},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:QM,boolean:VM}},__type__:{object:QM}},manipulation:{enabled:{boolean:VM},initiallyActive:{boolean:VM},addNode:{boolean:VM,function:"function"},addEdge:{boolean:VM,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:QM,boolean:VM,function:"function"}},deleteNode:{boolean:VM,function:"function"},deleteEdge:{boolean:VM,function:"function"},controlNodeStyle:_M,__type__:{object:QM,boolean:VM}},nodes:_M,physics:{enabled:{boolean:VM},barnesHut:{theta:{number:YM},gravitationalConstant:{number:YM},centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},forceAtlas2Based:{theta:{number:YM},gravitationalConstant:{number:YM},centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},repulsion:{centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},nodeDistance:{number:YM},damping:{number:YM},__type__:{object:QM}},hierarchicalRepulsion:{centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},nodeDistance:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},maxVelocity:{number:YM},minVelocity:{number:YM},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:VM},iterations:{number:YM},updateInterval:{number:YM},onlyDynamicEdges:{boolean:VM},fit:{boolean:VM},__type__:{object:QM,boolean:VM}},timestep:{number:YM},adaptiveTimestep:{boolean:VM},wind:{x:{number:YM},y:{number:YM},__type__:{object:QM}},__type__:{object:QM,boolean:VM}},autoResize:{boolean:VM},clickToUse:{boolean:VM},locale:{string:LM},locales:{__any__:{any:"any"},__type__:{object:QM}},height:{string:LM},width:{string:LM},__type__:{object:QM}},HM={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},XM=function(g,t,A){var e;return!(!Ic(g).call(g,"physics")||!Ic(e=HM.physics.solver).call(e,t)||A.physics.solver===t||"wind"===t)},JM=Object.freeze({__proto__:null,allOptions:KM,configuratorHideOption:XM,configureOptions:HM}),qM=function(){function g(){cn(this,g)}return kd(g,[{key:"getDistances",value:function(g,t,A){for(var e={},C=g.edges,I=0;I2&&void 0!==arguments[2]&&arguments[2],e=this.distanceSolver.getDistances(this.body,g,t);this._createL_matrix(e),this._createK_matrix(e),this._createE_matrix();for(var C=0,I=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),i=1e9,o=0,n=0,r=0,s=0,a=0;i>.01&&C1&&a<5;){a+=1,this._moveNode(o,n,r);var h=lh(this._getEnergy(o),3);s=h[0],n=h[1],r=h[2]}}}},{key:"_getHighestEnergyNode",value:function(g){for(var t=this.body.nodeIndices,A=this.body.nodes,e=0,C=t[0],I=0,i=0,o=0;o-1}var wp=function(){function g(g,t){this.manager=g,this.set(t)}var t=g.prototype;return t.set=function(g){g===Ku&&(g=this.compute()),_u&&this.manager.element.style&&gp[g]&&(this.manager.element.style[Uu]=g),this.actions=g.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var g=[];return yp(this.manager.recognizers,(function(t){mp(t.options.enable,[t])&&(g=g.concat(t.getTouchAction()))})),function(g){if(bp(g,Ju))return Ju;var t=bp(g,qu),A=bp(g,$u);return t&&A?Ju:t||A?t?qu:$u:bp(g,Xu)?Xu:Hu}(g.join(" "))},t.preventDefaults=function(g){var t=g.srcEvent,A=g.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var e=this.actions,C=bp(e,Ju)&&!gp[Ju],I=bp(e,$u)&&!gp[$u],i=bp(e,qu)&&!gp[qu];if(C){var o=1===g.pointers.length,n=g.distance<2,r=g.deltaTime<250;if(o&&n&&r)return}if(!i||!I)return C||I&&A&cp||i&&A&up?this.preventSrc(t):void 0}},t.preventSrc=function(g){this.manager.session.prevented=!0,g.preventDefault()},g}();function kp(g,t){for(;g;){if(g===t)return!0;g=g.parentNode}return!1}function xp(g){var t=g.length;if(1===t)return{x:Vu(g[0].clientX),y:Vu(g[0].clientY)};for(var A=0,e=0,C=0;C=Yu(t)?g<0?ap:dp:t<0?hp:lp}function Np(g,t,A){return{x:t/g||0,y:A/g||0}}function Rp(g,t){var A=g.session,e=t.pointers,C=e.length;A.firstInput||(A.firstInput=Ep(t)),C>1&&!A.firstMultiple?A.firstMultiple=Ep(t):1===C&&(A.firstMultiple=!1);var I=A.firstInput,i=A.firstMultiple,o=i?i.center:I.center,n=t.center=xp(e);t.timeStamp=Wu(),t.deltaTime=t.timeStamp-I.timeStamp,t.angle=Tp(o,n),t.distance=Op(o,n),function(g,t){var A=t.center,e=g.offsetDelta||{},C=g.prevDelta||{},I=g.prevInput||{};t.eventType!==op&&I.eventType!==np||(C=g.prevDelta={x:I.deltaX||0,y:I.deltaY||0},e=g.offsetDelta={x:A.x,y:A.y}),t.deltaX=C.x+(A.x-e.x),t.deltaY=C.y+(A.y-e.y)}(A,t),t.offsetDirection=Dp(t.deltaX,t.deltaY);var r,s,a=Np(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=a.x,t.overallVelocityY=a.y,t.overallVelocity=Yu(a.x)>Yu(a.y)?a.x:a.y,t.scale=i?(r=i.pointers,Op((s=e)[0],s[1],vp)/Op(r[0],r[1],vp)):1,t.rotation=i?function(g,t){return Tp(t[1],t[0],vp)+Tp(g[1],g[0],vp)}(i.pointers,e):0,t.maxPointers=A.prevInput?t.pointers.length>A.prevInput.maxPointers?t.pointers.length:A.prevInput.maxPointers:t.pointers.length,function(g,t){var A,e,C,I,i=g.lastInterval||t,o=t.timeStamp-i.timeStamp;if(t.eventType!==rp&&(o>ip||void 0===i.velocity)){var n=t.deltaX-i.deltaX,r=t.deltaY-i.deltaY,s=Np(o,n,r);e=s.x,C=s.y,A=Yu(s.x)>Yu(s.y)?s.x:s.y,I=Dp(n,r),g.lastInterval=t}else A=i.velocity,e=i.velocityX,C=i.velocityY,I=i.direction;t.velocity=A,t.velocityX=e,t.velocityY=C,t.direction=I}(A,t);var d,h=g.element,l=t.srcEvent;kp(d=l.composedPath?l.composedPath()[0]:l.path?l.path[0]:l.target,h)&&(h=d),t.target=h}function Pp(g,t,A){var e=A.pointers.length,C=A.changedPointers.length,I=t&op&&e-C==0,i=t&(np|rp)&&e-C==0;A.isFirst=!!I,A.isFinal=!!i,I&&(g.session={}),A.eventType=t,Rp(g,A),g.emit("hammer.input",A),g.recognize(A),g.session.prevInput=A}function Mp(g){return g.trim().split(/\s+/g)}function Bp(g,t,A){yp(Mp(t),(function(t){g.addEventListener(t,A,!1)}))}function zp(g,t,A){yp(Mp(t),(function(t){g.removeEventListener(t,A,!1)}))}function Sp(g){var t=g.ownerDocument||g;return t.defaultView||t.parentWindow||window}var Zp=function(){function g(g,t){var A=this;this.manager=g,this.callback=t,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(t){mp(g.options.enable,[g])&&A.handler(t)},this.init()}var t=g.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Bp(this.element,this.evEl,this.domHandler),this.evTarget&&Bp(this.target,this.evTarget,this.domHandler),this.evWin&&Bp(Sp(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&zp(this.element,this.evEl,this.domHandler),this.evTarget&&zp(this.target,this.evTarget,this.domHandler),this.evWin&&zp(Sp(this.element),this.evWin,this.domHandler)},g}();function Fp(g,t,A){if(g.indexOf&&!A)return g.indexOf(t);for(var e=0;eA[t]})):e.sort()),e}var Up={touchstart:op,touchmove:2,touchend:np,touchcancel:rp},_p=function(g){function t(){var A;return t.prototype.evTarget="touchstart touchmove touchend touchcancel",(A=g.apply(this,arguments)||this).targetIds={},A}return Su(t,g),t.prototype.handler=function(g){var t=Up[g.type],A=Kp.call(this,g,t);A&&this.callback(this.manager,t,{pointers:A[0],changedPointers:A[1],pointerType:Cp,srcEvent:g})},t}(Zp);function Kp(g,t){var A,e,C=Wp(g.touches),I=this.targetIds;if(t&(2|op)&&1===C.length)return I[C[0].identifier]=!0,[C,C];var i=Wp(g.changedTouches),o=[],n=this.target;if(e=C.filter((function(g){return kp(g.target,n)})),t===op)for(A=0;A-1&&e.splice(g,1)}),Jp)}}function $p(g,t){g&op?(this.primaryTouch=t.changedPointers[0].identifier,qp.call(this,t)):g&(np|rp)&&qp.call(this,t)}function gf(g){for(var t=g.srcEvent.clientX,A=g.srcEvent.clientY,e=0;e-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(g){return!!this.simultaneous[g.id]},t.emit=function(g){var t=this,A=this.state;function e(A){t.manager.emit(A,g)}A<8&&e(t.options.event+of(A)),e(t.options.event),g.additionalEvent&&e(g.additionalEvent),A>=8&&e(t.options.event+of(A))},t.tryEmit=function(g){if(this.canEmit())return this.emit(g);this.state=ef},t.canEmit=function(){for(var g=0;gt.threshold&&C&t.direction},A.attrTest=function(g){return sf.prototype.attrTest.call(this,g)&&(2&this.state||!(2&this.state)&&this.directionTest(g))},A.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var A=af(t.direction);A&&(t.additionalEvent=this.options.event+A),g.prototype.emit.call(this,t)},t}(sf),hf=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"swipe",threshold:10,velocity:.3,direction:cp|up,pointers:1},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return df.prototype.getTouchAction.call(this)},A.attrTest=function(t){var A,e=this.options.direction;return e&(cp|up)?A=t.overallVelocity:e&cp?A=t.overallVelocityX:e&up&&(A=t.overallVelocityY),g.prototype.attrTest.call(this,t)&&e&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Yu(A)>this.options.velocity&&t.eventType&np},A.emit=function(g){var t=af(g.offsetDirection);t&&this.manager.emit(this.options.event+t,g),this.manager.emit(this.options.event,g)},t}(sf),lf=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"pinch",threshold:0,pointers:2},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Ju]},A.attrTest=function(t){return g.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},A.emit=function(t){if(1!==t.scale){var A=t.scale<1?"in":"out";t.additionalEvent=this.options.event+A}g.prototype.emit.call(this,t)},t}(sf),cf=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"rotate",threshold:0,pointers:2},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Ju]},A.attrTest=function(t){return g.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)},t}(sf),uf=function(g){function t(t){var A;return void 0===t&&(t={}),(A=g.call(this,zu({event:"press",pointers:1,time:251,threshold:9},t))||this)._timer=null,A._input=null,A}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Hu]},A.process=function(g){var t=this,A=this.options,e=g.pointers.length===A.pointers,C=g.distanceA.time;if(this._input=g,!C||!e||g.eventType&(np|rp)&&!I)this.reset();else if(g.eventType&op)this.reset(),this._timer=setTimeout((function(){t.state=8,t.tryEmit()}),A.time);else if(g.eventType&np)return 8;return ef},A.reset=function(){clearTimeout(this._timer)},A.emit=function(g){8===this.state&&(g&&g.eventType&np?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=Wu(),this.manager.emit(this.options.event,this._input)))},t}(nf),pf={domEvents:!1,touchAction:Ku,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ff=[[cf,{enable:!1}],[lf,{enable:!1},["rotate"]],[hf,{direction:cp}],[df,{direction:cp},["swipe"]],[rf],[rf,{event:"doubletap",taps:2},["tap"]],[uf]];function vf(g,t){var A,e=g.element;e.style&&(yp(g.options.cssProps,(function(C,I){A=Qu(e.style,I),t?(g.oldCssProps[A]=e.style[A],e.style[A]=C):e.style[A]=g.oldCssProps[A]||""})),t||(g.oldCssProps={}))}var yf=function(){function g(g,t){var A,e=this;this.options=Gu({},pf,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=new((A=this).options.inputClass||(Ap?Yp:ep?_p:tp?tf:Xp))(A,Pp),this.touchAction=new wp(this,this.options.touchAction),vf(this,!0),yp(this.options.recognizers,(function(g){var t=e.add(new g[0](g[1]));g[2]&&t.recognizeWith(g[2]),g[3]&&t.requireFailure(g[3])}),this)}var t=g.prototype;return t.set=function(g){return Gu(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},t.stop=function(g){this.session.stopped=g?2:1},t.recognize=function(g){var t=this.session;if(!t.stopped){var A;this.touchAction.preventDefaults(g);var e=this.recognizers,C=t.curRecognizer;(!C||C&&8&C.state)&&(t.curRecognizer=null,C=null);for(var I=0;I\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",C=window.console&&(window.console.warn||window.console.log);return C&&C.call(window.console,e,A),g.apply(this,arguments)}}var xf=kf((function(g,t,A){for(var e=Object.keys(t),C=0;C=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function Pf(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A2)return zf.apply(void 0,bh(e=[Bf(t[0],t[1])]).call(e,ch(wh(t).call(t,2))));var C=t[0],I=t[1];if(C instanceof Date&&I instanceof Date)return C.setTime(I.getTime()),C;var i,o=Rf(Nh(I));try{for(o.s();!(i=o.n()).done;){var n=i.value;Object.prototype.propertyIsEnumerable.call(I,n)&&(I[n]===Mf?delete C[n]:null===C[n]||null===I[n]||"object"!==yd(C[n])||"object"!==yd(I[n])||Rh(C[n])||Rh(I[n])?C[n]=Sf(I[n]):C[n]=zf(C[n],I[n]))}}catch(g){o.e(g)}finally{o.f()}return C}function Sf(g){return Rh(g)?Fh(g).call(g,(function(g){return Sf(g)})):"object"===yd(g)&&null!==g?g instanceof Date?new Date(g.getTime()):zf({},g):g}function Zf(g){for(var t=0,A=Lh(g);t>>0,g=(C*=g)>>>0,g+=4294967296*(C-=g)}return 2.3283064365386963e-10*(g>>>0)}}(),t=g(" "),A=g(" "),e=g(" "),C=0;C2&&void 0!==arguments[2]&&arguments[2];for(var e in g)if(void 0!==t[e])if(null===t[e]||"object"!==yd(t[e]))Kf(g,t,e,A);else{var C=g[e],I=t[e];_f(C)&&_f(I)&&Hf(C,I,A)}}function Xf(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rh(A))throw new TypeError("Arrays are not supported by deepExtend");for(var C=0;C3&&void 0!==arguments[3]&&arguments[3];if(Rh(A))throw new TypeError("Arrays are not supported by deepExtend");for(var C in A)if(Object.prototype.hasOwnProperty.call(A,C)&&!Ic(g).call(g,C))if(A[C]&&A[C].constructor===Object)void 0===t[C]&&(t[C]={}),t[C].constructor===Object?qf(t[C],A[C]):Kf(t,A,C,e);else if(Rh(A[C])){t[C]=[];for(var I=0;I2&&void 0!==arguments[2]&&arguments[2],e=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var C in t)if(Object.prototype.hasOwnProperty.call(t,C)||!0===A)if("object"===yd(t[C])&&null!==t[C]&&sc(t[C])===Object.prototype)void 0===g[C]?g[C]=qf({},t[C],A):"object"===yd(g[C])&&null!==g[C]&&sc(g[C])===Object.prototype?qf(g[C],t[C],A):Kf(g,t,C,e);else if(Rh(t[C])){var I;g[C]=wh(I=t[C]).call(I)}else Kf(g,t,C,e);return g}function $f(g,t){var A;return bh(A=[]).call(A,ch(g),[t])}function gv(g){return g.getBoundingClientRect().top}function tv(g,t){if(Rh(g))for(var A=g.length,e=0;e3&&void 0!==arguments[3]?arguments[3]:{},C=function(g){return null!=g},I=function(g){return null!==g&&"object"===yd(g)};if(!I(g))throw new Error("Parameter mergeTarget must be an object");if(!I(t))throw new Error("Parameter options must be an object");if(!C(A))throw new Error("Parameter option must have a value");if(!I(e))throw new Error("Parameter globalOptions must be an object");var i=t[A],o=I(e)&&!function(g){for(var t in g)if(Object.prototype.hasOwnProperty.call(g,t))return!1;return!0}(e)?e[A]:void 0,n=o?o.enabled:void 0;if(void 0!==i){if("boolean"==typeof i)return I(g[A])||(g[A]={}),void(g[A].enabled=i);if(null===i&&!I(g[A])){if(!C(o))return;g[A]=$c(o)}if(I(i)){var r=!0;void 0!==i.enabled?r=i.enabled:void 0!==n&&(r=o.enabled),function(g,t,A){I(g[A])||(g[A]={});var e=t[A],C=g[A];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(C[i]=e[i])}(g,t,A),g[A].enabled=r}}}var hv={linear:function(g){return g},easeInQuad:function(g){return g*g},easeOutQuad:function(g){return g*(2-g)},easeInOutQuad:function(g){return g<.5?2*g*g:(4-2*g)*g-1},easeInCubic:function(g){return g*g*g},easeOutCubic:function(g){return--g*g*g+1},easeInOutCubic:function(g){return g<.5?4*g*g*g:(g-1)*(2*g-2)*(2*g-2)+1},easeInQuart:function(g){return g*g*g*g},easeOutQuart:function(g){return 1- --g*g*g*g},easeInOutQuart:function(g){return g<.5?8*g*g*g*g:1-8*--g*g*g*g},easeInQuint:function(g){return g*g*g*g*g},easeOutQuint:function(g){return 1+--g*g*g*g*g},easeInOutQuint:function(g){return g<.5?16*g*g*g*g*g:1+16*--g*g*g*g*g}};function lv(g,t){var A;Rh(t)||(t=[t]);var e,C=Rf(g);try{for(C.s();!(e=C.n()).done;){var I=e.value;if(I){A=I[t[0]];for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:1;cn(this,g),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return kd(g,[{key:"insertTo",value:function(g){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=g,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=g}},{key:"setCloseCallback",value:function(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=g}},{key:"_isColorString",value:function(g){if("string"==typeof g)return cv[g]}},{key:"setColor",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==g){var A,e=this._isColorString(g);if(void 0!==e&&(g=e),!0===Uf(g)){if(!0===sv(g)){var C=g.substr(4).substr(0,g.length-5).split(",");A={r:C[0],g:C[1],b:C[2],a:1}}else if(!0===function(g){return Wf.test(g)}(g)){var I=g.substr(5).substr(0,g.length-6).split(",");A={r:I[0],g:I[1],b:I[2],a:I[3]}}else if(!0===rv(g)){var i=Av(g);A={r:i.r,g:i.g,b:i.b,a:1}}}else if(g instanceof Object&&void 0!==g.r&&void 0!==g.g&&void 0!==g.b){var o=void 0!==g.a?g.a:"1.0";A={r:g.r,g:g.g,b:g.b,a:o}}if(void 0===A)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+eu(g));this._setColor(A,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var g=this;!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=fe({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",wu((function(){void 0!==g.closeCallback&&(g.closeCallback(),g.closeCallback=void 0)}),0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(g){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=fe({},g)),this.color=g;var t=iv(g.r,g.g,g.b),A=2*Math.PI,e=this.r*t.s,C=this.centerCoordinates.x+e*Math.sin(A*t.h),I=this.centerCoordinates.y+e*Math.cos(A*t.h);this.colorPickerSelector.style.left=C-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=I-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(g)}},{key:"_setOpacity",value:function(g){this.color.a=g/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(g){var t=iv(this.color.r,this.color.g,this.color.b);t.v=g/100;var A=ov(t.h,t.s,t.v);A.a=this.color.a,this.color=A,this._updatePicker()}},{key:"_updatePicker",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=iv(g.r,g.g,g.b),A=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(A.webkitBackingStorePixelRatio||A.mozBackingStorePixelRatio||A.msBackingStorePixelRatio||A.oBackingStorePixelRatio||A.backingStorePixelRatio||1)),A.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;A.clearRect(0,0,e,C),A.putImageData(this.hueCircle,0,0),A.fillStyle="rgba(0,0,0,"+(1-t.v)+")",A.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Bu(A).call(A),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*g.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var g,t,A,e;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var C=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var I=document.createElement("DIV");I.style.color="red",I.style.fontWeight="bold",I.style.padding="10px",I.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(I)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(g){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(g){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var i=this;this.opacityRange.onchange=function(){i._setOpacity(this.value)},this.opacityRange.oninput=function(){i._setOpacity(this.value)},this.brightnessRange.onchange=function(){i._setBrightness(this.value)},this.brightnessRange.oninput=function(){i._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=je(g=this._hide).call(g,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=je(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=je(A=this._save).call(A,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=je(e=this._loadLast).call(e,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var g=this;this.drag={},this.pinch={},this.hammer=new Gf(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(function(t){t.isFirst&&g._moveSelector(t)})),this.hammer.on("tap",(function(t){g._moveSelector(t)})),this.hammer.on("panstart",(function(t){g._moveSelector(t)})),this.hammer.on("panmove",(function(t){g._moveSelector(t)})),this.hammer.on("panend",(function(t){g._moveSelector(t)}))}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var g=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)),g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t,A,e,C,I=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;g.clearRect(0,0,I,i),this.centerCoordinates={x:.5*I,y:.5*i},this.r=.49*I;var o,n=2*Math.PI/360,r=1/this.r;for(e=0;e<360;e++)for(C=0;C3&&void 0!==arguments[3]?arguments[3]:1,I=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1};cn(this,g),this.parent=t,this.changedOptions=[],this.container=A,this.allowCreation=!1,this.hideOption=I,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},fe(this.options,this.defaultOptions),this.configureOptions=e,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new uv(C),this.wrapper=void 0}return kd(g,[{key:"setOptions",value:function(g){if(void 0!==g){this.popupHistory={},this._removePopup();var t=!0;if("string"==typeof g)this.options.filter=g;else if(Rh(g))this.options.filter=g.join();else if("object"===yd(g)){if(null==g)throw new TypeError("options cannot be null");void 0!==g.container&&(this.options.container=g.container),void 0!==pc(g)&&(this.options.filter=pc(g)),void 0!==g.showButton&&(this.options.showButton=g.showButton),void 0!==g.enabled&&(t=g.enabled)}else"boolean"==typeof g?(this.options.filter=!0,t=g):"function"==typeof g&&(this.options.filter=g,t=!0);!1===pc(this.options)&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(g){this.moduleOptions=g,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var g=pc(this.options),t=0,A=!1;for(var e in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,e)&&(this.allowCreation=!1,A=!1,"function"==typeof g?A=(A=g(e,[]))||this._handleObject(this.configureOptions[e],[e],!0):!0!==g&&-1===Xc(g).call(g,e)||(A=!0),!1!==A&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(e),this._handleObject(this.configureOptions[e],[e])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var g=0;g1?A-1:0),C=1;C2&&void 0!==arguments[2]&&arguments[2],e=document.createElement("div");if(e.className="vis-configuration vis-config-label vis-config-s"+t.length,!0===A){for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(pv("i","b",g))}else e.innerText=g+":";return e}},{key:"_makeDropdown",value:function(g,t,A){var e=document.createElement("select");e.className="vis-configuration vis-config-select";var C=0;void 0!==t&&-1!==Xc(g).call(g,t)&&(C=Xc(g).call(g,t));for(var I=0;II&&1!==I&&(o.max=Math.ceil(t*s),r=o.max,n="range increased"),o.value=t}else o.value=e;var a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=o.value;var d=this;o.onchange=function(){a.value=this.value,d._update(Number(this.value),A)},o.oninput=function(){a.value=this.value};var h=this._makeLabel(A[A.length-1],A),l=this._makeItem(A,h,o,a);""!==n&&this.popupHistory[l]!==r&&(this.popupHistory[l]=r,this._setupPopup(n,l))}},{key:"_makeButton",value:function(){var g=this;if(!0===this.options.showButton){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=function(){g._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{key:"_setupPopup",value:function(g,t){var A=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e=!1,C=pc(this.options),I=!1;for(var i in g)if(Object.prototype.hasOwnProperty.call(g,i)){e=!0;var o=g[i],n=$f(t,i);if("function"==typeof C&&!1===(e=C(i,t))&&!Rh(o)&&"string"!=typeof o&&"boolean"!=typeof o&&o instanceof Object&&(this.allowCreation=!1,e=this._handleObject(o,n,!0),this.allowCreation=!1===A),!1!==e){I=!0;var r=this._getValue(n);if(Rh(o))this._handleArray(o,r,n);else if("string"==typeof o)this._makeTextInput(o,r,n);else if("boolean"==typeof o)this._makeCheckbox(o,r,n);else if(o instanceof Object){if(!this.hideOption(t,i,this.moduleOptions))if(void 0!==o.enabled){var s=$f(n,"enabled"),a=this._getValue(s);if(!0===a){var d=this._makeLabel(i,n,!0);this._makeItem(n,d),I=this._handleObject(o,n)||I}else this._makeCheckbox(o,a,n)}else{var h=this._makeLabel(i,n,!0);this._makeItem(n,h),I=this._handleObject(o,n)||I}}else console.error("dont know how to handle",o,i,n)}}return I}},{key:"_handleArray",value:function(g,t,A){"string"==typeof g[0]&&"color"===g[0]?(this._makeColorField(g,t,A),g[1]!==t&&this.changedOptions.push({path:A,value:t})):"string"==typeof g[0]?(this._makeDropdown(g,t,A),g[0]!==t&&this.changedOptions.push({path:A,value:t})):"number"==typeof g[0]&&(this._makeRange(g,t,A),g[0]!==t&&this.changedOptions.push({path:A,value:Number(t)}))}},{key:"_update",value:function(g,t){var A=this._constructOptions(g,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",A),this.initialized=!0,this.parent.setOptions(A)}},{key:"_constructOptions",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=A;g="false"!==(g="true"===g||g)&&g;for(var C=0;CC-this.padding&&(o=!0),I=o?this.x-A:this.x,i=n?this.y-t:this.y}else(i=this.y-t)+t+this.padding>e&&(i=e-t-this.padding),iC&&(I=C-A-this.padding),Ii.distance?" in "+g.printLocation(I.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+g.printLocation(i.path,i.closestMatch,""):I.distance<=8?'. Did you mean "'+I.closestMatch+'"?'+g.printLocation(I.path,t):". Did you mean one of these: "+g.print(Lh(A))+g.printLocation(e,t),console.error('%cUnknown option detected: "'+t+'"'+C,bv),mv=!0}},{key:"findInOptions",value:function(t,A,e){var C,I=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=1e9,o="",n=[],r=t.toLowerCase(),s=void 0;for(var a in A){var d=void 0;if(void 0!==A[a].__type__&&!0===I){var h=g.findInOptions(t,A[a],$f(e,a));i>h.distance&&(o=h.closestMatch,n=h.path,i=h.distance,s=h.indexMatch)}else{var l;-1!==Xc(l=a.toLowerCase()).call(l,r)&&(s=a),i>(d=g.levenshteinDistance(t,a))&&(o=a,n=wh(C=e).call(C),i=d)}}return{closestMatch:o,path:n,distance:i,indexMatch:s}}},{key:"printLocation",value:function(g,t){for(var A="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n",e=0;e":!0,"--":!0},zv="",Sv=0,Zv="",Fv="",Gv=Mv.NULL;function jv(){Sv++,Zv=zv.charAt(Sv)}function Lv(){return zv.charAt(Sv+1)}function Vv(g){var t=g.charCodeAt(0);return t<47?35===t||46===t:t<59?t>47:t<91?t>64:t<96?95===t:t<123&&t>96}function Yv(g,t){if(g||(g={}),t)for(var A in t)t.hasOwnProperty(A)&&(g[A]=t[A]);return g}function Wv(g,t,A){for(var e=t.split("."),C=g;e.length;){var I=e.shift();e.length?(C[I]||(C[I]={}),C=C[I]):C[I]=A}}function Qv(g,t){for(var A,e,C=null,I=[g],i=g;i.parent;)I.push(i.parent),i=i.parent;if(i.nodes)for(A=0,e=i.nodes.length;A=0;A--){var o,n=I[A];n.nodes||(n.nodes=[]),-1===Xc(o=n.nodes).call(o,C)&&n.nodes.push(C)}t.attr&&(C.attr=Yv(C.attr,t.attr))}function Uv(g,t){if(g.edges||(g.edges=[]),g.edges.push(t),g.edge){var A=Yv({},g.edge);t.attr=Yv(A,t.attr)}}function _v(g,t,A,e,C){var I={from:t,to:A,type:e};return g.edge&&(I.attr=Yv({},g.edge)),I.attr=Yv(I.attr||{},C),null!=C&&C.hasOwnProperty("arrows")&&null!=C.arrows&&(I.arrows={to:{enabled:!0,type:C.arrows.type}},C.arrows=null),I}function Kv(){for(Gv=Mv.NULL,Fv="";" "===Zv||"\t"===Zv||"\n"===Zv||"\r"===Zv;)jv();do{var g=!1;if("#"===Zv){for(var t=Sv-1;" "===zv.charAt(t)||"\t"===zv.charAt(t);)t--;if("\n"===zv.charAt(t)||""===zv.charAt(t)){for(;""!=Zv&&"\n"!=Zv;)jv();g=!0}}if("/"===Zv&&"/"===Lv()){for(;""!=Zv&&"\n"!=Zv;)jv();g=!0}if("/"===Zv&&"*"===Lv()){for(;""!=Zv;){if("*"===Zv&&"/"===Lv()){jv(),jv();break}jv()}g=!0}for(;" "===Zv||"\t"===Zv||"\n"===Zv||"\r"===Zv;)jv()}while(g);if(""!==Zv){var A=Zv+Lv();if(Bv[A])return Gv=Mv.DELIMITER,Fv=A,jv(),void jv();if(Bv[Zv])return Gv=Mv.DELIMITER,Fv=Zv,void jv();if(Vv(Zv)||"-"===Zv){for(Fv+=Zv,jv();Vv(Zv);)Fv+=Zv,jv();return"false"===Fv?Fv=!1:"true"===Fv?Fv=!0:isNaN(Number(Fv))||(Fv=Number(Fv)),void(Gv=Mv.IDENTIFIER)}if('"'===Zv){for(jv();""!=Zv&&('"'!=Zv||'"'===Zv&&'"'===Lv());)'"'===Zv?(Fv+=Zv,jv()):"\\"===Zv&&"n"===Lv()?(Fv+="\n",jv()):Fv+=Zv,jv();if('"'!=Zv)throw gy('End of string " expected');return jv(),void(Gv=Mv.IDENTIFIER)}for(Gv=Mv.UNKNOWN;""!=Zv;)Fv+=Zv,jv();throw new SyntaxError('Syntax error in part "'+ty(Fv,30)+'"')}Gv=Mv.DELIMITER}function Hv(g){for(;""!==Fv&&"}"!=Fv;)Xv(g),";"===Fv&&Kv()}function Xv(g){var t=Jv(g);if(t)qv(g,t);else{var A=function(g){if("node"===Fv)return Kv(),g.node=$v(),"node";if("edge"===Fv)return Kv(),g.edge=$v(),"edge";if("graph"===Fv)return Kv(),g.graph=$v(),"graph";return null}(g);if(!A){if(Gv!=Mv.IDENTIFIER)throw gy("Identifier expected");var e=Fv;if(Kv(),"="===Fv){if(Kv(),Gv!=Mv.IDENTIFIER)throw gy("Identifier expected");g[e]=Fv,Kv()}else!function(g,t){var A={id:t},e=$v();e&&(A.attr=e);Qv(g,A),qv(g,t)}(g,e)}}}function Jv(g){var t=null;if("subgraph"===Fv&&((t={}).type="subgraph",Kv(),Gv===Mv.IDENTIFIER&&(t.id=Fv,Kv())),"{"===Fv){if(Kv(),t||(t={}),t.parent=g,t.node=g.node,t.edge=g.edge,t.graph=g.graph,Hv(t),"}"!=Fv)throw gy("Angle bracket } expected");Kv(),delete t.node,delete t.edge,delete t.graph,delete t.parent,g.subgraphs||(g.subgraphs=[]),g.subgraphs.push(t)}return t}function qv(g,t){for(;"->"===Fv||"--"===Fv;){var A,e=Fv;Kv();var C=Jv(g);if(C)A=C;else{if(Gv!=Mv.IDENTIFIER)throw gy("Identifier or subgraph expected");Qv(g,{id:A=Fv}),Kv()}Uv(g,_v(g,t,A,e,$v())),t=A}}function $v(){for(var g,t,A=null,e={dashed:!0,solid:!1,dotted:[1,5]},C={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},I=new Array,i=new Array;"["===Fv;){for(Kv(),A={};""!==Fv&&"]"!=Fv;){if(Gv!=Mv.IDENTIFIER)throw gy("Attribute name expected");var o=Fv;if(Kv(),"="!=Fv)throw gy("Equal sign = expected");if(Kv(),Gv!=Mv.IDENTIFIER)throw gy("Attribute value expected");var n=Fv;"style"===o&&(n=e[n]),"arrowhead"===o&&(o="arrows",n={to:{enabled:!0,type:C[n]}}),"arrowtail"===o&&(o="arrows",n={from:{enabled:!0,type:C[n]}}),I.push({attr:A,name:o,value:n}),i.push(o),Kv(),","==Fv&&Kv()}if("]"!=Fv)throw gy("Bracket ] expected");Kv()}if(Ic(i).call(i,"dir")){var r={arrows:{}};for(g=0;g"===g.type&&(t.arrows="to"),t};Cl(C=A.edges).call(C,(function(g){var t,A,C,i,o,n,r;(t=g.from instanceof Object?g.from.nodes:{id:g.from},A=g.to instanceof Object?g.to.nodes:{id:g.to},g.from instanceof Object&&g.from.edges)&&Cl(C=g.from.edges).call(C,(function(g){var t=I(g);e.edges.push(t)}));(o=A,n=function(t,A){var C=_v(e,t.id,A.id,g.type,g.attr),i=I(C);e.edges.push(i)},Rh(i=t)?Cl(i).call(i,(function(g){Rh(o)?Cl(o).call(o,(function(t){n(g,t)})):n(g,o)})):Rh(o)?Cl(o).call(o,(function(g){n(i,g)})):n(i,o),g.to instanceof Object&&g.to.edges)&&Cl(r=g.to.edges).call(r,(function(g){var t=I(g);e.edges.push(t)}))}))}return A.attr&&(e.options=A.attr),e}var Iy=Object.freeze({__proto__:null,DOTToGraph:Cy,parseDOT:Nv});function iy(g,t){var A,e={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=t&&(null!=t.fixed&&(e.nodes.fixed=t.fixed),null!=t.parseColor&&(e.nodes.parseColor=t.parseColor),null!=t.inheritColor&&(e.edges.inheritColor=t.inheritColor));var C=g.edges,I=Fh(C).call(C,(function(g){var t={from:g.source,id:g.id,to:g.target};return null!=g.attributes&&(t.attributes=g.attributes),null!=g.label&&(t.label=g.label),null!=g.attributes&&null!=g.attributes.title&&(t.title=g.attributes.title),"Directed"===g.type&&(t.arrows="to"),g.color&&!1===e.edges.inheritColor&&(t.color=g.color),t}));return{nodes:Fh(A=g.nodes).call(A,(function(g){var t={id:g.id,fixed:e.nodes.fixed&&null!=g.x&&null!=g.y};return null!=g.attributes&&(t.attributes=g.attributes),null!=g.label&&(t.label=g.label),null!=g.size&&(t.size=g.size),null!=g.attributes&&null!=g.attributes.title&&(t.title=g.attributes.title),null!=g.title&&(t.title=g.title),null!=g.x&&(t.x=g.x),null!=g.y&&(t.y=g.y),null!=g.color&&(!0===e.nodes.parseColor?t.color=g.color:t.color={background:g.color,border:g.color,highlight:{background:g.color,border:g.color},hover:{background:g.color,border:g.color}}),t})),edges:I}}var oy=Object.freeze({__proto__:null,parseGephi:iy}),ny=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});var ry=function(){function g(){cn(this,g),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return kd(g,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var g=this.image.width,t=this.image.height;this.width=g,this.height=t;var A=Math.floor(t/2),e=Math.floor(t/4),C=Math.floor(t/8),I=Math.floor(t/16),i=Math.floor(g/2),o=Math.floor(g/4),n=Math.floor(g/8),r=Math.floor(g/16);this.canvas.width=3*o,this.canvas.height=A,this.coordinates=[[0,0,i,A],[i,0,o,e],[i,e,n,C],[5*n,e,r,I]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var g=this.canvas.getContext("2d"),t=this.coordinates[0];g.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var A=1;A2){t*=.5;for(var i=0;t>2&&i=this.NUM_ITERATIONS&&(i=this.NUM_ITERATIONS-1);var o=this.coordinates[i];g.drawImage(this.canvas,o[0],o[1],o[2],o[3],A,e,C,I)}else g.drawImage(this.image,A,e,C,I)}}]),g}(),sy=function(){function g(t){cn(this,g),this.images={},this.imageBroken={},this.callback=t}return kd(g,[{key:"_tryloadBrokenUrl",value:function(g,t,A){void 0!==g&&void 0!==A&&(void 0!==t?(A.image.onerror=function(){console.error("Could not load brokenImage:",t)},A.image.src=t):console.warn("No broken url image defined"))}},{key:"_redrawWithImage",value:function(g){this.callback&&this.callback(g)}},{key:"load",value:function(g,t){var A=this,e=this.images[g];if(e)return e;var C=new ry;return this.images[g]=C,C.image.onload=function(){A._fixImageCoordinates(C.image),C.init(),A._redrawWithImage(C)},C.image.onerror=function(){console.error("Could not load image:",g),A._tryloadBrokenUrl(g,t,C)},C.image.src=g,C}},{key:"_fixImageCoordinates",value:function(g){0===g.width&&(document.body.appendChild(g),g.width=g.offsetWidth,g.height=g.offsetHeight,document.body.removeChild(g))}}]),g}(),ay={exports:{}},dy=I((function(){if("function"==typeof ArrayBuffer){var g=new ArrayBuffer(8);Object.isExtensible(g)&&Object.defineProperty(g,"a",{value:8})}})),hy=I,ly=gg,cy=y,uy=dy,py=Object.isExtensible,fy=hy((function(){py(1)}))||uy?function(g){return!!ly(g)&&((!uy||"ArrayBuffer"!==cy(g))&&(!py||py(g)))}:py,vy=!I((function(){return Object.isExtensible(Object.preventExtensions({}))})),yy=TA,my=u,by=UA,wy=gg,ky=qg,xy=Jt.f,Ey=gr,Oy=er,Ty=fy,Dy=vy,Ny=!1,Ry=et("meta"),Py=0,My=function(g){xy(g,Ry,{value:{objectID:"O"+Py++,weakData:{}}})},By=ay.exports={enable:function(){By.enable=function(){},Ny=!0;var g=Ey.f,t=my([].splice),A={};A[Ry]=1,g(A).length&&(Ey.f=function(A){for(var e=g(A),C=0,I=e.length;CI;I++)if((o=p(g[I]))&&Vy(Ky,o))return o;return new _y(!1)}e=Yy(g,C)}for(n=d?g.next:e.next;!(r=Zy(n,e)).done;){try{o=p(r.value)}catch(g){Qy(e,"throw",g)}if("object"==typeof o&&o&&Vy(Ky,o))return o}return new _y(!1)},Xy=og,Jy=TypeError,qy=function(g,t){if(Xy(t,g))return g;throw new Jy("Incorrect invocation")},$y=TA,gm=C,tm=zy,Am=I,em=uA,Cm=Hy,Im=qy,im=O,om=gg,nm=Q,rm=_I,sm=Jt.f,am=Sr.forEach,dm=D,hm=GC.set,lm=GC.getterFor,cm=function(g,t,A){var e,C=-1!==g.indexOf("Map"),I=-1!==g.indexOf("Weak"),i=C?"set":"add",o=gm[g],n=o&&o.prototype,r={};if(dm&&im(o)&&(I||n.forEach&&!Am((function(){(new o).entries().next()})))){var s=(e=t((function(t,A){hm(Im(t,s),{type:g,collection:new o}),nm(A)||Cm(A,t[i],{that:t,AS_ENTRIES:C})}))).prototype,a=lm(g);am(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(g){var t="add"===g||"set"===g;!(g in n)||I&&"clear"===g||em(s,g,(function(A,e){var C=a(this).collection;if(!t&&I&&!om(A))return"get"===g&&void 0;var i=C[g](0===A?0:A,e);return t?this:i}))})),I||sm(s,"size",{configurable:!0,get:function(){return a(this).collection.size}})}else e=A.getConstructor(t,g,C,i),tm.enable();return rm(e,g,!1,!0),r[g]=e,$y({global:!0,forced:!0},r),I||A.setStrong(e,g,C),e},um=TI,pm=function(g,t,A){for(var e in t)A&&A.unsafe&&g[e]?g[e]=t[e]:um(g,e,t[e],A);return g},fm=ig,vm=ur,ym=D,mm=dt("species"),bm=function(g){var t=fm(g);ym&&t&&!t[mm]&&vm(t,mm,{configurable:!0,get:function(){return this}})},wm=pI,km=ur,xm=pm,Em=Xt,Om=qy,Tm=Q,Dm=Hy,Nm=Ei,Rm=Oi,Pm=bm,Mm=D,Bm=zy.fastKey,zm=GC.set,Sm=GC.getterFor,Zm={getConstructor:function(g,t,A,e){var C=g((function(g,C){Om(g,I),zm(g,{type:t,index:wm(null),first:void 0,last:void 0,size:0}),Mm||(g.size=0),Tm(C)||Dm(C,g[e],{that:g,AS_ENTRIES:A})})),I=C.prototype,i=Sm(t),o=function(g,t,A){var e,C,I=i(g),o=n(g,t);return o?o.value=A:(I.last=o={index:C=Bm(t,!0),key:t,value:A,previous:e=I.last,next:void 0,removed:!1},I.first||(I.first=o),e&&(e.next=o),Mm?I.size++:g.size++,"F"!==C&&(I.index[C]=o)),g},n=function(g,t){var A,e=i(g),C=Bm(t);if("F"!==C)return e.index[C];for(A=e.first;A;A=A.next)if(A.key===t)return A};return xm(I,{clear:function(){for(var g=i(this),t=g.index,A=g.first;A;)A.removed=!0,A.previous&&(A.previous=A.previous.next=void 0),delete t[A.index],A=A.next;g.first=g.last=void 0,Mm?g.size=0:this.size=0},delete:function(g){var t=this,A=i(t),e=n(t,g);if(e){var C=e.next,I=e.previous;delete A.index[e.index],e.removed=!0,I&&(I.next=C),C&&(C.previous=I),A.first===e&&(A.first=C),A.last===e&&(A.last=I),Mm?A.size--:t.size--}return!!e},forEach:function(g){for(var t,A=i(this),e=Em(g,arguments.length>1?arguments[1]:void 0);t=t?t.next:A.first;)for(e(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(g){return!!n(this,g)}}),xm(I,A?{get:function(g){var t=n(this,g);return t&&t.value},set:function(g,t){return o(this,0===g?0:g,t)}}:{add:function(g){return o(this,g=0===g?0:g,g)}}),Mm&&km(I,"size",{configurable:!0,get:function(){return i(this).size}}),C},setStrong:function(g,t,A){var e=t+" Iterator",C=Sm(t),I=Sm(e);Nm(g,t,(function(g,t){zm(this,{type:e,target:g,state:C(g),kind:t,last:void 0})}),(function(){for(var g=I(this),t=g.kind,A=g.last;A&&A.removed;)A=A.previous;return g.target&&(g.last=A=A?A.next:g.state.first)?Rm("keys"===t?A.key:"values"===t?A.value:[A.key,A.value],!1):(g.target=void 0,Rm(void 0,!0))}),A?"entries":"values",!A,!0),Pm(t)}};cm("Map",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Zm);var Fm=A(tg.Map),Gm=function(){function g(){cn(this,g),this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},fe(this.options,this.defaultOptions)}return kd(g,[{key:"setOptions",value:function(g){var t=["useDefaultGroups"];if(void 0!==g)for(var A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&-1===Xc(t).call(t,A)){var e=g[A];this.add(A,e)}}},{key:"clear",value:function(){this._groups=new Fm,this._groupNames=[]}},{key:"get",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],A=this._groups.get(g);if(void 0===A&&t)if(!1===this.options.useDefaultGroups&&this._groupNames.length>0){var e=this._groupIndex%this._groupNames.length;++this._groupIndex,(A={}).color=this._groups.get(this._groupNames[e]),this._groups.set(g,A)}else{var C=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,(A={}).color=this._defaultGroups[C],this._groups.set(g,A)}return A}},{key:"add",value:function(g,t){return this._groups.has(g)||this._groupNames.push(g),this._groups.set(g,t),t}}]),g}();TA({target:"Number",stat:!0},{isNaN:function(g){return g!=g}});var jm=A(tg.Number.isNaN),Lm=C.isFinite,Vm=Number.isFinite||function(g){return"number"==typeof g&&Lm(g)};TA({target:"Number",stat:!0},{isFinite:Vm});var Ym=A(tg.Number.isFinite),Wm=Sr.some;TA({target:"Array",proto:!0,forced:!_h("some")},{some:function(g){return Wm(this,g,arguments.length>1?arguments[1]:void 0)}});var Qm=Me("Array").some,Um=og,_m=Qm,Km=Array.prototype,Hm=function(g){var t=g.some;return g===Km||Um(Km,g)&&t===Km.some?_m:t},Xm=A(Hm);function Jm(g){if(void 0===g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}var qm=qc,$m=A(qm);TA({target:"Object",stat:!0},{setPrototypeOf:ri});var gb=tg.Object.setPrototypeOf,tb=A(gb),Ab=A(Ge);function eb(g,t){var A;return eb=tb?Ab(A=tb).call(A):function(g,t){return g.__proto__=t,g},eb(g,t)}function Cb(g,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");g.prototype=$m(t&&t.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),kn(g,"prototype",{writable:!1}),t&&eb(g,t)}function Ib(g,t){if(t&&("object"===yd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Jm(g)}var ib=rc,ob=A(ib);function nb(g){var t;return nb=tb?Ab(t=ob).call(t):function(g){return g.__proto__||ob(g)},nb(g)}function rb(g,t,A){return(t=bd(t))in g?kn(g,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):g[t]=A,g}var sb={exports:{}},ab={exports:{}};!function(g){var t=cd,A=fd;function e(C){return g.exports=e="function"==typeof t&&"symbol"==typeof A?function(g){return typeof g}:function(g){return g&&"function"==typeof t&&g.constructor===t&&g!==t.prototype?"symbol":typeof g},g.exports.__esModule=!0,g.exports.default=g.exports,e(C)}g.exports=e,g.exports.__esModule=!0,g.exports.default=g.exports}(ab);var db=ab.exports,hb=el,lb=qg,cb=Dh,ub=T,pb=Jt,fb=gg,vb=uA,yb=Error,mb=u("".replace),bb=String(new yb("zxcasd").stack),wb=/\n\s*at [^:]*:[^\n]*/,kb=wb.test(bb),xb=G,Eb=!I((function(){var g=new Error("a");return!("stack"in g)||(Object.defineProperty(g,"stack",xb(1,7)),7!==g.stack)})),Ob=uA,Tb=function(g,t){if(kb&&"string"==typeof g&&!yb.prepareStackTrace)for(;t--;)g=mb(g,wb,"");return g},Db=Eb,Nb=Error.captureStackTrace,Rb=sC,Pb=TA,Mb=og,Bb=EI,zb=ri,Sb=function(g,t,A){for(var e=cb(t),C=pb.f,I=ub.f,i=0;i2&&jb(A,arguments[2]);var C=[];return Vb(g,Ub,{that:C}),Fb(A,"errors",C),A};zb?zb(_b,Qb):Sb(_b,Qb,{name:!0});var Kb=_b.prototype=Zb(Qb.prototype,{constructor:Gb(1,_b),message:Gb(1,""),name:Gb(1,"AggregateError")});Pb({global:!0,constructor:!0,arity:2},{AggregateError:_b});var Hb,Xb,Jb,qb,$b="process"===y(C.process),gw=ro,tw=Og,Aw=TypeError,ew=function(g){if(gw(g))return g;throw new Aw(tw(g)+" is not a constructor")},Cw=AA,Iw=ew,iw=Q,ow=dt("species"),nw=function(g,t){var A,e=Cw(g).constructor;return void 0===e||iw(A=Cw(e)[ow])?t:Iw(A)},rw=/(?:ipad|iphone|ipod).*applewebkit/i.test(ng),sw=C,aw=a,dw=Xt,hw=O,lw=qg,cw=I,uw=gI,pw=ve,fw=Et,vw=iu,yw=rw,mw=$b,bw=sw.setImmediate,ww=sw.clearImmediate,kw=sw.process,xw=sw.Dispatch,Ew=sw.Function,Ow=sw.MessageChannel,Tw=sw.String,Dw=0,Nw={},Rw="onreadystatechange";cw((function(){Hb=sw.location}));var Pw=function(g){if(lw(Nw,g)){var t=Nw[g];delete Nw[g],t()}},Mw=function(g){return function(){Pw(g)}},Bw=function(g){Pw(g.data)},zw=function(g){sw.postMessage(Tw(g),Hb.protocol+"//"+Hb.host)};bw&&ww||(bw=function(g){vw(arguments.length,1);var t=hw(g)?g:Ew(g),A=pw(arguments,1);return Nw[++Dw]=function(){aw(t,void 0,A)},Xb(Dw),Dw},ww=function(g){delete Nw[g]},mw?Xb=function(g){kw.nextTick(Mw(g))}:xw&&xw.now?Xb=function(g){xw.now(Mw(g))}:Ow&&!yw?(qb=(Jb=new Ow).port2,Jb.port1.onmessage=Bw,Xb=dw(qb.postMessage,qb)):sw.addEventListener&&hw(sw.postMessage)&&!sw.importScripts&&Hb&&"file:"!==Hb.protocol&&!cw(zw)?(Xb=zw,sw.addEventListener("message",Bw,!1)):Xb=Rw in fw("script")?function(g){uw.appendChild(fw("script"))[Rw]=function(){uw.removeChild(this),Pw(g)}}:function(g){setTimeout(Mw(g),0)});var Sw={set:bw,clear:ww},Zw=function(){this.head=null,this.tail=null};Zw.prototype={add:function(g){var t={item:g,next:null},A=this.tail;A?A.next=t:this.head=t,this.tail=t},get:function(){var g=this.head;if(g)return null===(this.head=g.next)&&(this.tail=null),g.item}};var Fw,Gw,jw,Lw,Vw,Yw=Zw,Ww=/ipad|iphone|ipod/i.test(ng)&&"undefined"!=typeof Pebble,Qw=/web0s(?!.*chrome)/i.test(ng),Uw=C,_w=Xt,Kw=T.f,Hw=Sw.set,Xw=Yw,Jw=rw,qw=Ww,$w=Qw,gk=$b,tk=Uw.MutationObserver||Uw.WebKitMutationObserver,Ak=Uw.document,ek=Uw.process,Ck=Uw.Promise,Ik=Kw(Uw,"queueMicrotask"),ik=Ik&&Ik.value;if(!ik){var ok=new Xw,nk=function(){var g,t;for(gk&&(g=ek.domain)&&g.exit();t=ok.get();)try{t()}catch(g){throw (ok.head&&Fw(), g)}g&&g.enter()};Jw||gk||$w||!tk||!Ak?!qw&&Ck&&Ck.resolve?((Lw=Ck.resolve(void 0)).constructor=Ck,Vw=_w(Lw.then,Lw),Fw=function(){Vw(nk)}):gk?Fw=function(){ek.nextTick(nk)}:(Hw=_w(Hw,Uw),Fw=function(){Hw(nk)}):(Gw=!0,jw=Ak.createTextNode(""),new tk(nk).observe(jw,{characterData:!0}),Fw=function(){jw.data=Gw=!Gw}),ik=function(g){ok.head||Fw(),ok.add(g)}}var rk=ik,sk=function(g){try{return{error:!1,value:g()}}catch(g){return{error:!0,value:g}}},ak=C.Promise,dk="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,hk=!dk&&!$b&&"object"==typeof window&&"object"==typeof document,lk=C,ck=ak,uk=O,pk=Ut,fk=Hi,vk=dt,yk=hk,mk=dk,bk=cg,wk=ck&&ck.prototype,kk=vk("species"),xk=!1,Ek=uk(lk.PromiseRejectionEvent),Ok=pk("Promise",(function(){var g=fk(ck),t=g!==String(ck);if(!t&&66===bk)return!0;if(!wk.catch||!wk.finally)return!0;if(!bk||bk<51||!/native code/.test(g)){var A=new ck((function(g){g(1)})),e=function(g){g((function(){}),(function(){}))};if((A.constructor={})[kk]=e,!(xk=A.then((function(){}))instanceof e))return!0}return!t&&(yk||mk)&&!Ek})),Tk={CONSTRUCTOR:Ok,REJECTION_EVENT:Ek,SUBCLASSING:xk},Dk={},Nk=Rg,Rk=TypeError,Pk=function(g){var t,A;this.promise=new g((function(g,e){if(void 0!==t||void 0!==A)throw new Rk("Bad Promise constructor");t=g,A=e})),this.resolve=Nk(t),this.reject=Nk(A)};Dk.f=function(g){return new Pk(g)};var Mk,Bk,zk=TA,Sk=$b,Zk=C,Fk=P,Gk=TI,jk=_I,Lk=bm,Vk=Rg,Yk=O,Wk=gg,Qk=qy,Uk=nw,_k=Sw.set,Kk=rk,Hk=function(g,t){try{1===arguments.length?console.error(g):console.error(g,t)}catch(g){}},Xk=sk,Jk=Yw,qk=GC,$k=ak,gx=Tk,tx=Dk,Ax="Promise",ex=gx.CONSTRUCTOR,Cx=gx.REJECTION_EVENT,Ix=qk.getterFor(Ax),ix=qk.set,ox=$k&&$k.prototype,nx=$k,rx=ox,sx=Zk.TypeError,ax=Zk.document,dx=Zk.process,hx=tx.f,lx=hx,cx=!!(ax&&ax.createEvent&&Zk.dispatchEvent),ux="unhandledrejection",px=function(g){var t;return!(!Wk(g)||!Yk(t=g.then))&&t},fx=function(g,t){var A,e,C,I=t.value,i=1===t.state,o=i?g.ok:g.fail,n=g.resolve,r=g.reject,s=g.domain;try{o?(i||(2===t.rejection&&wx(t),t.rejection=1),!0===o?A=I:(s&&s.enter(),A=o(I),s&&(s.exit(),C=!0)),A===g.promise?r(new sx("Promise-chain cycle")):(e=px(A))?Fk(e,A,n,r):n(A)):r(I)}catch(g){s&&!C&&s.exit(),r(g)}},vx=function(g,t){g.notified||(g.notified=!0,Kk((function(){for(var A,e=g.reactions;A=e.get();)fx(A,g);g.notified=!1,t&&!g.rejection&&mx(g)})))},yx=function(g,t,A){var e,C;cx?((e=ax.createEvent("Event")).promise=t,e.reason=A,e.initEvent(g,!1,!0),Zk.dispatchEvent(e)):e={promise:t,reason:A},!Cx&&(C=Zk["on"+g])?C(e):g===ux&&Hk("Unhandled promise rejection",A)},mx=function(g){Fk(_k,Zk,(function(){var t,A=g.facade,e=g.value;if(bx(g)&&(t=Xk((function(){Sk?dx.emit("unhandledRejection",e,A):yx(ux,A,e)})),g.rejection=Sk||bx(g)?2:1,t.error))throw t.value}))},bx=function(g){return 1!==g.rejection&&!g.parent},wx=function(g){Fk(_k,Zk,(function(){var t=g.facade;Sk?dx.emit("rejectionHandled",t):yx("rejectionhandled",t,g.value)}))},kx=function(g,t,A){return function(e){g(t,e,A)}},xx=function(g,t,A){g.done||(g.done=!0,A&&(g=A),g.value=t,g.state=2,vx(g,!0))},Ex=function(g,t,A){if(!g.done){g.done=!0,A&&(g=A);try{if(g.facade===t)throw new sx("Promise can't be resolved itself");var e=px(t);e?Kk((function(){var A={done:!1};try{Fk(e,t,kx(Ex,A,g),kx(xx,A,g))}catch(t){xx(A,t,g)}})):(g.value=t,g.state=1,vx(g,!1))}catch(t){xx({done:!1},t,g)}}};ex&&(rx=(nx=function(g){Qk(this,rx),Vk(g),Fk(Mk,this);var t=Ix(this);try{g(kx(Ex,t),kx(xx,t))}catch(g){xx(t,g)}}).prototype,(Mk=function(g){ix(this,{type:Ax,done:!1,notified:!1,parent:!1,reactions:new Jk,rejection:!1,state:0,value:void 0})}).prototype=Gk(rx,"then",(function(g,t){var A=Ix(this),e=hx(Uk(this,nx));return A.parent=!0,e.ok=!Yk(g)||g,e.fail=Yk(t)&&t,e.domain=Sk?dx.domain:void 0,0===A.state?A.reactions.add(e):Kk((function(){fx(e,A)})),e.promise})),Bk=function(){var g=new Mk,t=Ix(g);this.promise=g,this.resolve=kx(Ex,t),this.reject=kx(xx,t)},tx.f=hx=function(g){return g===nx||undefined===g?new Bk(g):lx(g)}),zk({global:!0,constructor:!0,wrap:!0,forced:ex},{Promise:nx}),jk(nx,Ax,!1,!0),Lk(Ax);var Ox=ak,Tx=Tk.CONSTRUCTOR||!Yo((function(g){Ox.all(g).then(void 0,(function(){}))})),Dx=P,Nx=Rg,Rx=Dk,Px=sk,Mx=Hy;TA({target:"Promise",stat:!0,forced:Tx},{all:function(g){var t=this,A=Rx.f(t),e=A.resolve,C=A.reject,I=Px((function(){var A=Nx(t.resolve),I=[],i=0,o=1;Mx(g,(function(g){var n=i++,r=!1;o++,Dx(A,t,g).then((function(g){r||(r=!0,I[n]=g,--o||e(I))}),C)})),--o||e(I)}));return I.error&&C(I.value),A.promise}});var Bx=TA,zx=Tk.CONSTRUCTOR;ak&&ak.prototype,Bx({target:"Promise",proto:!0,forced:zx,real:!0},{catch:function(g){return this.then(void 0,g)}});var Sx=P,Zx=Rg,Fx=Dk,Gx=sk,jx=Hy;TA({target:"Promise",stat:!0,forced:Tx},{race:function(g){var t=this,A=Fx.f(t),e=A.reject,C=Gx((function(){var C=Zx(t.resolve);jx(g,(function(g){Sx(C,t,g).then(A.resolve,e)}))}));return C.error&&e(C.value),A.promise}});var Lx=P,Vx=Dk;TA({target:"Promise",stat:!0,forced:Tk.CONSTRUCTOR},{reject:function(g){var t=Vx.f(this);return Lx(t.reject,void 0,g),t.promise}});var Yx=AA,Wx=gg,Qx=Dk,Ux=function(g,t){if(Yx(g),Wx(t)&&t.constructor===g)return t;var A=Qx.f(g);return(0,A.resolve)(t),A.promise},_x=TA,Kx=ak,Hx=Tk.CONSTRUCTOR,Xx=Ux,Jx=ig("Promise"),qx=!Hx;_x({target:"Promise",stat:!0,forced:true},{resolve:function(g){return Xx(qx&&this===Jx?Kx:this,g)}});var $x=P,gE=Rg,tE=Dk,AE=sk,eE=Hy;TA({target:"Promise",stat:!0,forced:Tx},{allSettled:function(g){var t=this,A=tE.f(t),e=A.resolve,C=A.reject,I=AE((function(){var A=gE(t.resolve),C=[],I=0,i=1;eE(g,(function(g){var o=I++,n=!1;i++,$x(A,t,g).then((function(g){n||(n=!0,C[o]={status:"fulfilled",value:g},--i||e(C))}),(function(g){n||(n=!0,C[o]={status:"rejected",reason:g},--i||e(C))}))})),--i||e(C)}));return I.error&&C(I.value),A.promise}});var CE=P,IE=Rg,iE=ig,oE=Dk,nE=sk,rE=Hy,sE="No one promise resolved";TA({target:"Promise",stat:!0,forced:Tx},{any:function(g){var t=this,A=iE("AggregateError"),e=oE.f(t),C=e.resolve,I=e.reject,i=nE((function(){var e=IE(t.resolve),i=[],o=0,n=1,r=!1;rE(g,(function(g){var s=o++,a=!1;n++,CE(e,t,g).then((function(g){a||r||(r=!0,C(g))}),(function(g){a||r||(a=!0,i[s]=g,--n||I(new A(i,sE)))}))})),--n||I(new A(i,sE))}));return i.error&&I(i.value),e.promise}});var aE=TA,dE=ak,hE=I,lE=ig,cE=O,uE=nw,pE=Ux,fE=dE&&dE.prototype;aE({target:"Promise",proto:!0,real:!0,forced:!!dE&&hE((function(){fE.finally.call({then:function(){}},(function(){}))}))},{finally:function(g){var t=uE(this,lE("Promise")),A=cE(g);return this.then(A?function(A){return pE(t,g()).then((function(){return A}))}:g,A?function(A){return pE(t,g()).then((function(){throw A}))}:g)}});var vE=tg.Promise,yE=Dk;TA({target:"Promise",stat:!0},{withResolvers:function(){var g=yE.f(this);return{promise:g.promise,resolve:g.resolve,reject:g.reject}}});var mE=vE,bE=Dk,wE=sk;TA({target:"Promise",stat:!0,forced:!0},{try:function(g){var t=bE.f(this),A=wE(g);return(A.error?t.reject:t.resolve)(A.value),t.promise}});var kE=mE,xE=ll;!function(g){var t=db.default,A=wn,e=cd,C=qm,I=ib,i=hb,o=Ld,n=gb,r=kE,s=xE,a=rh;function d(){g.exports=d=function(){return l},g.exports.__esModule=!0,g.exports.default=g.exports;var h,l={},c=Object.prototype,u=c.hasOwnProperty,p=A||function(g,t,A){g[t]=A.value},f="function"==typeof e?e:{},v=f.iterator||"@@iterator",y=f.asyncIterator||"@@asyncIterator",m=f.toStringTag||"@@toStringTag";function b(g,t,e){return A(g,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),g[t]}try{b({},"")}catch(h){b=function(g,t,A){return g[t]=A}}function w(g,t,A,e){var I=t&&t.prototype instanceof N?t:N,i=C(I.prototype),o=new V(e||[]);return p(i,"_invoke",{value:F(g,A,o)}),i}function k(g,t,A){try{return{type:"normal",arg:g.call(t,A)}}catch(g){return{type:"throw",arg:g}}}l.wrap=w;var x="suspendedStart",E="suspendedYield",O="executing",T="completed",D={};function N(){}function R(){}function P(){}var M={};b(M,v,(function(){return this}));var B=I&&I(I(Y([])));B&&B!==c&&u.call(B,v)&&(M=B);var z=P.prototype=N.prototype=C(M);function S(g){var t;i(t=["next","throw","return"]).call(t,(function(t){b(g,t,(function(g){return this._invoke(t,g)}))}))}function Z(g,A){function e(C,I,i,o){var n=k(g[C],g,I);if("throw"!==n.type){var r=n.arg,s=r.value;return s&&"object"==t(s)&&u.call(s,"__await")?A.resolve(s.__await).then((function(g){e("next",g,i,o)}),(function(g){e("throw",g,i,o)})):A.resolve(s).then((function(g){r.value=g,i(r)}),(function(g){return e("throw",g,i,o)}))}o(n.arg)}var C;p(this,"_invoke",{value:function(g,t){function I(){return new A((function(A,C){e(g,t,A,C)}))}return C=C?C.then(I,I):I()}})}function F(g,t,A){var e=x;return function(C,I){if(e===O)throw new Error("Generator is already running");if(e===T){if("throw"===C)throw I;return{value:h,done:!0}}for(A.method=C,A.arg=I;;){var i=A.delegate;if(i){var o=G(i,A);if(o){if(o===D)continue;return o}}if("next"===A.method)A.sent=A._sent=A.arg;else if("throw"===A.method){if(e===x)throw (e=T, A.arg);A.dispatchException(A.arg)}else"return"===A.method&&A.abrupt("return",A.arg);e=O;var n=k(g,t,A);if("normal"===n.type){if(e=A.done?T:E,n.arg===D)continue;return{value:n.arg,done:A.done}}"throw"===n.type&&(e=T,A.method="throw",A.arg=n.arg)}};}function G(g,t){var A=t.method,e=g.iterator[A];if(e===h)return t.delegate=null,"throw"===A&&g.iterator.return&&(t.method="return",t.arg=h,G(g,t),"throw"===t.method)||"return"!==A&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+A+"' method")),D;var C=k(e,g.iterator,t.arg);if("throw"===C.type)return t.method="throw",t.arg=C.arg,t.delegate=null,D;var I=C.arg;return I?I.done?(t[g.resultName]=I.value,t.next=g.nextLoc,"return"!==t.method&&(t.method="next",t.arg=h),t.delegate=null,D):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,D)}function j(g){var t,A={tryLoc:g[0]};1 in g&&(A.catchLoc=g[1]),2 in g&&(A.finallyLoc=g[2],A.afterLoc=g[3]),o(t=this.tryEntries).call(t,A)}function L(g){var t=g.completion||{};t.type="normal",delete t.arg,g.completion=t}function V(g){this.tryEntries=[{tryLoc:"root"}],i(g).call(g,j,this),this.reset(!0)}function Y(g){if(g||""===g){var A=g[v];if(A)return A.call(g);if("function"==typeof g.next)return g;if(!isNaN(g.length)){var e=-1,C=function t(){for(;++e=0;--e){var C=this.tryEntries[e],I=C.completion;if("root"===C.tryLoc)return A("end");if(C.tryLoc<=this.prev){var i=u.call(C,"catchLoc"),o=u.call(C,"finallyLoc");if(i&&o){if(this.prev=0;--A){var e=this.tryEntries[A];if(e.tryLoc<=this.prev&&u.call(e,"finallyLoc")&&this.prev=0;--t){var A=this.tryEntries[t];if(A.finallyLoc===g)return this.complete(A.completion,A.afterLoc),L(A),D}},catch:function(g){for(var t=this.tryEntries.length-1;t>=0;--t){var A=this.tryEntries[t];if(A.tryLoc===g){var e=A.completion;if("throw"===e.type){var C=e.arg;L(A)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(g,t,A){return this.delegate={iterator:Y(g),resultName:t,nextLoc:A},"next"===this.method&&(this.arg=h),D}},l}g.exports=d,g.exports.__esModule=!0,g.exports.default=g.exports}(sb);var EE=(0,sb.exports)(),OE=EE;try{regeneratorRuntime=EE}catch(g){"object"==typeof globalThis?globalThis.regeneratorRuntime=EE:Function("r","regeneratorRuntime = r")(EE)}var TE=A(OE),DE=Rg,NE=Hg,RE=W,PE=jA,ME=TypeError,BE=function(g){return function(t,A,e,C){DE(A);var I=NE(t),i=RE(I),o=PE(I),n=g?o-1:0,r=g?-1:1;if(e<2)for(;;){if(n in i){C=i[n],n+=r;break}if(n+=r,g?n<0:o<=n)throw new ME("Reduce of empty array with no initial value")}for(;g?n>=0:o>n;n+=r)n in i&&(C=A(C,i[n],n,I));return C}},zE={left:BE(!1),right:BE(!0)}.left;TA({target:"Array",proto:!0,forced:!$b&&cg>79&&cg<83||!_h("reduce")},{reduce:function(g){var t=arguments.length;return zE(this,g,t,t>1?arguments[1]:void 0)}});var SE=Me("Array").reduce,ZE=og,FE=SE,GE=Array.prototype,jE=function(g){var t=g.reduce;return g===GE||ZE(GE,g)&&t===GE.reduce?FE:t},LE=A(jE),VE=En,YE=jA,WE=Tn,QE=Xt,UE=function(g,t,A,e,C,I,i,o){for(var n,r,s=C,a=0,d=!!i&&QE(i,o);a0&&VE(n)?(r=YE(n),s=UE(g,t,n,r,s,I-1)-1):(WE(s+1),g[s]=n),s++),a++;return s},_E=UE,KE=Rg,HE=Hg,XE=jA,JE=zn;TA({target:"Array",proto:!0},{flatMap:function(g){var t,A=HE(this),e=XE(A);return KE(g),(t=JE(A,0)).length=_E(t,A,A,e,0,1,g,arguments.length>1?arguments[1]:void 0),t}});var qE=Me("Array").flatMap,$E=og,gO=qE,tO=Array.prototype,AO=function(g){var t=g.flatMap;return g===tO||$E(tO,g)&&t===tO.flatMap?gO:t},eO=A(AO);cm("Set",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Zm);var CO=A(tg.Set),IO=A(pd),iO=A(Oo),oO=rr,nO=Math.floor,rO=function(g,t){var A=g.length,e=nO(A/2);return A<8?sO(g,t):aO(g,rO(oO(g,0,e),t),rO(oO(g,e),t),t)},sO=function(g,t){for(var A,e,C=g.length,I=1;I0;)g[e]=g[--e];e!==I++&&(g[e]=A)}return g},aO=function(g,t,A,e){for(var C=t.length,I=A.length,i=0,o=0;i3)){if(DO)return!0;if(RO)return RO<603;var g,t,A,e,C="";for(g=65;g<76;g++){switch(t=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:A=3;break;case 68:case 71:A=4;break;default:A=2}for(e=0;e<47;e++)PO.push({k:t+e,v:A})}for(PO.sort((function(g,t){return t.v-g.v})),e=0;ekO(A)?1:-1}}(g)),A=bO(C),e=0;eo;)void 0!==(A=C(e,t=I[o++]))&&KT(i,t,A);return i}});var HT=A(tg.Object.getOwnPropertyDescriptors),XT={exports:{}},JT=TA,qT=D,$T=UC.f;JT({target:"Object",stat:!0,forced:Object.defineProperties!==$T,sham:!qT},{defineProperties:$T});var gD=tg.Object,tD=XT.exports=function(g,t){return gD.defineProperties(g,t)};gD.defineProperties.sham&&(tD.sham=!0);var AD=A(XT.exports);let eD;const CD=new Uint8Array(16);function ID(){if(!eD&&(eD="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!eD))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eD(CD)}const iD=[];for(let g=0;g<256;++g)iD.push((g+256).toString(16).slice(1));var oD,nD={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function rD(g,t,A){if(nD.randomUUID&&!t&&!g)return nD.randomUUID();const e=(g=g||{}).random||(g.rng||ID)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,t){A=A||0;for(let g=0;g<16;++g)t[A+g]=e[g];return t}return function(g,t=0){return iD[g[t+0]]+iD[g[t+1]]+iD[g[t+2]]+iD[g[t+3]]+"-"+iD[g[t+4]]+iD[g[t+5]]+"-"+iD[g[t+6]]+iD[g[t+7]]+"-"+iD[g[t+8]]+iD[g[t+9]]+"-"+iD[g[t+10]]+iD[g[t+11]]+iD[g[t+12]]+iD[g[t+13]]+iD[g[t+14]]+iD[g[t+15]]}(e)}function sD(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function aD(g){for(var t=1;t=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function lD(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);Athis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=wu((function(){g.flush()}),this.delay))}},{key:"flush",value:function(){var g,t;Cl(g=Zl(t=this._queue).call(t,0)).call(g,(function(g){g.fn.apply(g.context||g.fn,g.args||[])}))}}],[{key:"extend",value:function(t,A){var e=new g(A);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){e.flush()};var C=[{name:"flush",original:void 0}];if(A&&A.replace)for(var I=0;IC&&(C=n,e=o)}return e}},{key:"min",value:function(g){var t=iO(this._pairs),A=t.next();if(A.done)return null;for(var e=A.value[1],C=g(A.value[1],A.value[0]);!(A=t.next()).done;){var I=lh(A.value,2),i=I[0],o=I[1],n=g(o,i);n1?A-1:0),C=1;CC?1:eC)&&(e=i,C=o)}}catch(g){I.e(g)}finally{I.f()}return e||null}},{key:"min",value:function(g){var t,A,e=null,C=null,I=hD(nT(t=this._data).call(t));try{for(I.s();!(A=I.n()).done;){var i=A.value,o=i[g];"number"==typeof o&&(null==C||ot.x&&g.topt.y}function QD(g){return"string"==typeof g&&""!==g}function UD(g,t,A,e){var C=e.x,I=e.y;if("function"==typeof e.distanceToBorder){var i=e.distanceToBorder(g,t),o=Math.sin(t)*i,n=Math.cos(t)*i;n===i?(C+=i,I=e.y):o===i?(C=e.x,I-=i):(C+=n,I-=o)}else e.shape.width>e.shape.height?(C=e.x+.5*e.shape.width,I=e.y-A):(C=e.x+A,I=e.y-.5*e.shape.height);return{x:C,y:I}}var _D=function(){function g(t){cn(this,g),this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}return kd(g,[{key:"_add",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[g]&&(this.lines[g]={width:0,height:0,blocks:[]});var e=t;void 0!==t&&""!==t||(e=" ");var C=this.measureText(e,A),I=fe({},nT(C));I.text=t,I.width=C.width,I.mod=A,void 0!==t&&""!==t||(I.width=0),this.lines[g].blocks.push(I),this.lines[g].width+=I.width}},{key:"curWidth",value:function(){var g=this.lines[this.current];return void 0===g?0:g.width}},{key:"append",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,t)}},{key:"newLine",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,t),this.current++}},{key:"determineLineHeights",value:function(){for(var g=0;gg&&(g=e.width),t+=e.height}this.width=g,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var g=[],t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},HD=function(){function g(t){cn(this,g),this.text=t,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return kd(g,[{key:"mod",value:function(){return 0===this.modStack.length?"normal":this.modStack[0]}},{key:"modName",value:function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(g){" "===g&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=g&&(this.buffer+=g)}},{key:"parseWS",value:function(g){return!!/[ \t]/.test(g)&&(this.mono?this.add(g):this.spacing=!0,!0)}},{key:"setTag",value:function(g){this.emitBlock(),this[g]=!0,this.modStack.unshift(g)}},{key:"unsetTag",value:function(g){this.emitBlock(),this[g]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(g,t){return!(this.mono||this[g]||!this.match(t))&&(this.setTag(g),!0)}},{key:"match",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],A=lh(this.prepareRegExp(g),2),e=A[0],C=A[1],I=e.test(this.text.substr(this.position,C));return I&&t&&(this.position+=C-1),I}},{key:"parseEndTag",value:function(g,t,A){var e=this.mod()===g;return!(!(e="mono"===g?e&&this.mono:e&&!this.mono)||!this.match(t))&&(void 0!==A?(this.position===this.text.length-1||this.match(A,!1))&&this.unsetTag(g):this.unsetTag(g),!0)}},{key:"replace",value:function(g,t){return!!this.match(g)&&(this.add(t),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(g){var t,A;if(g instanceof RegExp)A=g,t=1;else{var e=KD[g];A=void 0!==e?e:new RegExp(g),t=g.length}return[A,t]}}]),g}(),XD=function(){function g(t,A,e,C){var I=this;cn(this,g),this.ctx=t,this.parent=A,this.selected=e,this.hover=C;this.lines=new _D((function(g,A){if(void 0===g)return 0;var i=I.parent.getFormattingValues(t,e,C,A),o=0;""!==g&&(o=I.ctx.measureText(g).width);return{width:o,values:i}}))}return kd(g,[{key:"process",value:function(g){if(!QD(g))return this.lines.finalize();var t=this.parent.fontOptions;g=(g=g.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");var A=String(g).split("\n"),e=A.length;if(t.multi)for(var C=0;C0)for(var i=0;i0)for(var d=0;d")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||A(e)||t.add(e),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(g){for(var t=this,A=new HD(g),e=!0,C=function(g){return!!/\\/.test(g)&&(A.positionthis.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(g){for(var t="",A=0;A1&&void 0!==arguments[1]?arguments[1]:"normal",A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t);for(var e=(g=(g=g.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");e.length>0;){var C=this.getLongestFit(e);if(0===C){var I=e[0],i=this.getLongestFitWord(I);this.lines.newLine(wh(I).call(I,0,i),t),e[0]=wh(I).call(I,i)}else{var o=C;" "===e[C-1]?C--:" "===e[o]&&o++;var n=wh(e).call(e,0,C).join("");C==e.length&&A?this.lines.append(n,t):this.lines.newLine(n,t),e=wh(e).call(e,o)}}}}]),g}(),JD=["bold","ital","boldital","mono"],qD=function(){function g(t,A){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];cn(this,g),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(A),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=e}return kd(g,[{key:"setOptions",value:function(g){if(this.elementOptions=g,this.initFontOptions(g.font),QD(g.label)?this.labelDirty=!0:g.label=void 0,void 0!==g.font&&null!==g.font)if("string"==typeof g.font)this.baseSize=this.fontOptions.size;else if("object"===yd(g.font)){var t=g.font.size;void 0!==t&&(this.baseSize=t)}}},{key:"initFontOptions",value:function(t){var A=this;tv(JD,(function(g){A.fontOptions[g]={}})),g.parseFontString(this.fontOptions,t)?this.fontOptions.vadjust=0:tv(t,(function(g,t){null!=g&&"object"!==yd(g)&&(A.fontOptions[t]=g)}))}},{key:"constrain",value:function(g){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},A=lv(g,"widthConstraint");if("number"==typeof A)t.maxWdt=Number(A),t.minWdt=Number(A);else if("object"===yd(A)){var e=lv(g,["widthConstraint","maximum"]);"number"==typeof e&&(t.maxWdt=Number(e));var C=lv(g,["widthConstraint","minimum"]);"number"==typeof C&&(t.minWdt=Number(C))}var I=lv(g,"heightConstraint");if("number"==typeof I)t.minHgt=Number(I);else if("object"===yd(I)){var i=lv(g,["heightConstraint","minimum"]);"number"==typeof i&&(t.minHgt=Number(i));var o=lv(g,["heightConstraint","valign"]);"string"==typeof o&&("top"!==o&&"bottom"!==o||(t.valign=o))}return t}},{key:"update",value:function(g,t){this.setOptions(g,!0),this.propagateFonts(t),qf(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=YD("label",t)}},{key:"adjustSizes",value:function(g){var t=g?g.right+g.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var A=g?g.top+g.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=A)}},{key:"addFontOptionsToPile",value:function(g,t){for(var A=0;A5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var i=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&i=this.elementOptions.scaling.label.maxVisible&&(i=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(g,e,C,t,A,I),this._drawBackground(g),this._drawText(g,t,this.size.yLine,I,i))}}},{key:"_drawBackground",value:function(g){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){g.fillStyle=this.fontOptions.background;var t=this.getSize();g.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0,I=lh(this._setAlignment(g,t,A,e),2);t=I[0],A=I[1],g.textAlign="left",t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(A-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(A+=(this.size.height-this.size.labelHeight)/2));for(var i=0;i0&&(g.lineWidth=s.strokeWidth,g.strokeStyle=h,g.lineJoin="round"),g.fillStyle=d,s.strokeWidth>0&&g.strokeText(s.text,t+n,A+s.vadjust),g.fillText(s.text,t+n,A+s.vadjust),n+=s.width}A+=o.height}}}},{key:"_setAlignment",value:function(g,t,A,e){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){t=0,A=0;"top"===this.fontOptions.align?(g.textBaseline="alphabetic",A-=4):"bottom"===this.fontOptions.align?(g.textBaseline="hanging",A+=4):g.textBaseline="middle"}else g.textBaseline=e;return[t,A]}},{key:"_getColor",value:function(g,t,A){var e=g||"#000000",C=A||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var I=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));e=ev(e,I),C=ev(C,I)}return[e,C]}},{key:"getTextSize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(g,t,A),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var g=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){var A=.5*-this.size.width;switch(this.fontOptions.align){case"middle":g=A,t=.5*-this.size.height;break;case"top":g=A,t=-(this.size.height+2);break;case"bottom":g=A,t=2}}return{left:g,top:t,width:this.size.width,height:this.size.height}}},{key:"calculateLabelSize",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,C=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,I=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(g,t,A),this.size.left=e-.5*this.size.width,this.size.top=C-.5*this.size.height,this.size.yLine=C+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===I&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(g,t,A,e){var C=function(g,t,A){return"normal"===t?"mod"===A?"":g[A]:void 0!==g[t][A]?g[t][A]:g[A]},I={color:C(this.fontOptions,e,"color"),size:C(this.fontOptions,e,"size"),face:C(this.fontOptions,e,"face"),mod:C(this.fontOptions,e,"mod"),vadjust:C(this.fontOptions,e,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||A)&&("normal"===e&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?I.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(I,this.elementOptions.id,t,A));var i="";return void 0!==I.mod&&""!==I.mod&&(i+=I.mod+" "),i+=I.size+"px "+I.face,g.font=i.replace(/"/g,""),I.font=g.font,I.height=I.size,I}},{key:"differentState",value:function(g,t){return g!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(g,t,A,e){return new XD(g,this,t,A).process(e)}},{key:"_processLabel",value:function(g,t,A){if(!1!==this.labelDirty||this.differentState(t,A)){var e=this._processLabelText(g,t,A,this.elementOptions.label);this.fontOptions.minWdt>0&&e.width0&&e.height0&&(this.enableBorderDashes(g,t),g.stroke(),this.disableBorderDashes(g,t)),g.restore()}},{key:"performFill",value:function(g,t){g.save(),g.fillStyle=t.color,this.enableShadow(g,t),Bu(g).call(g),this.disableShadow(g,t),g.restore(),this.performStroke(g,t)}},{key:"_addBoundingBoxMargin",value:function(g){this.boundingBox.left-=g,this.boundingBox.top-=g,this.boundingBox.bottom+=g,this.boundingBox.right+=g}},{key:"_updateBoundingBox",value:function(g,t,A,e,C){void 0!==A&&this.resize(A,e,C),this.left=g-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(g,t,A,e,C){this._updateBoundingBox(g,t,A,e,C)}},{key:"getDimensionsFromLabel",value:function(g,t,A){this.textSize=this.labelModule.getTextSize(g,t,A);var e=this.textSize.width,C=this.textSize.height;return 0===e&&(e=14,C=14),{width:e,height:C}}}]),g}();function gN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var tN=function(g){Cb(A,g);var t=gN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A);this.width=e.width+this.margin.right+this.margin.left,this.height=e.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this.initContextForDraw(g,I),Ve(g,this.left,this.top,this.width,this.height,I.borderRadius),this.performFill(g,I),this.updateBoundingBox(t,A,g,e,C),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,e,C)}},{key:"updateBoundingBox",value:function(g,t,A,e,C){this._updateBoundingBox(g,t,A,e,C);var I=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(I)}},{key:"distanceToBorder",value:function(g,t){g&&this.resize(g);var A=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+A}}]),A}($D);function AN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var eN=function(g){Cb(A,g);var t=AN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C)).labelOffset=0,I.selected=!1,I}return kd(A,[{key:"setOptions",value:function(g,t,A){this.options=g,void 0===t&&void 0===A||this.setImages(t,A)}},{key:"setImages",value:function(g,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=g):(this.imageObj=g,this.imageObjAlt=t)}},{key:"switchImages",value:function(g){var t=g&&!this.selected||!g&&this.selected;if(this.selected=g,void 0!==this.imageObjAlt&&t){var A=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=A}}},{key:"_getImagePadding",value:function(){var g={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var t=this.options.imagePadding;"object"==yd(t)?(g.top=t.top,g.right=t.right,g.bottom=t.bottom,g.left=t.left):(g.top=t,g.right=t,g.bottom=t,g.left=t)}return g}},{key:"_resizeImage",value:function(){var g,t;if(!1===this.options.shapeProperties.useImageSize){var A=1,e=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?A=this.imageObj.width/this.imageObj.height:e=this.imageObj.height/this.imageObj.width),g=2*this.options.size*A,t=2*this.options.size*e}else{var C=this._getImagePadding();g=this.imageObj.width+C.left+C.right,t=this.imageObj.height+C.top+C.bottom}this.width=g,this.height=t,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(g,t,A,e){this.initContextForDraw(g,e),Le(g,t,A,e.size),this.performFill(g,e)}},{key:"_drawImageAtPosition",value:function(g,t){if(0!=this.imageObj.width){g.globalAlpha=void 0!==t.opacity?t.opacity:1,this.enableShadow(g,t);var A=1;!0===this.options.shapeProperties.interpolation&&(A=this.imageObj.width/this.width/this.body.view.scale);var e=this._getImagePadding(),C=this.left+e.left,I=this.top+e.top,i=this.width-e.left-e.right,o=this.height-e.top-e.bottom;this.imageObj.drawImageAtPosition(g,A,C,I,i,o),this.disableShadow(g,t)}}},{key:"_drawImageLabel",value:function(g,t,A,e,C){var I=0;if(void 0!==this.height){I=.5*this.height;var i=this.labelModule.getTextSize(g,e,C);i.lineCount>=1&&(I+=i.height/2)}var o=A+I;this.options.label&&(this.labelOffset=I),this.labelModule.draw(g,t,o,e,C,"hanging")}}]),A}($D);function CN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var IN=function(g){Cb(A,g);var t=CN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A),C=Math.max(e.width+this.margin.right+this.margin.left,e.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this._drawRawCircle(g,t,A,I),this.updateBoundingBox(t,A),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,A,e,C)}},{key:"updateBoundingBox",value:function(g,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(g){return g&&this.resize(g),.5*this.width}}]),A}(eN);function iN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var oN=function(g){Cb(A,g);var t=iN(A);function A(g,e,C,I,i){var o;return cn(this,A),(o=t.call(this,g,e,C)).setImages(I,i),o}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var e=2*this.options.size;return this.width=e,this.height=e,void(this.radius=.5*this.width)}this.needsRefresh(t,A)&&this._resizeImage()}},{key:"draw",value:function(g,t,A,e,C,I){this.switchImages(e),this.resize();var i=t,o=A;"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=t,this.top=A,i+=this.width/2,o+=this.height/2):(this.left=t-this.width/2,this.top=A-this.height/2),this._drawRawCircle(g,i,o,I),g.save(),g.clip(),this._drawImageAtPosition(g,I),g.restore(),this._drawImageLabel(g,i,o,e,C),this.updateBoundingBox(t,A)}},{key:"updateBoundingBox",value:function(g,t){"top-left"===this.options.shapeProperties.coordinateOrigin?(this.boundingBox.top=t,this.boundingBox.left=g,this.boundingBox.right=g+2*this.options.size,this.boundingBox.bottom=t+2*this.options.size):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(g){return g&&this.resize(g),.5*this.width}}]),A}(eN);function nN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var rN=function(g){Cb(A,g);var t=nN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,A)){var C,I;this.labelModule.getTextSize(g,t,A);var i=2*e.size;this.width=null!==(C=this.customSizeWidth)&&void 0!==C?C:i,this.height=null!==(I=this.customSizeHeight)&&void 0!==I?I:i,this.radius=.5*this.width}}},{key:"_drawShape",value:function(g,t,A,e,C,I,i,o){var n,r=this;return this.resize(g,I,i,o),this.left=e-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,o),(n=t,Object.prototype.hasOwnProperty.call(Ue,n)?Ue[n]:function(g){for(var t=arguments.length,A=new Array(t>1?t-1:0),e=1;e0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),A}($D);function sN(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function aN(g){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A);this.height=2*e.height,this.width=e.width+e.height,this.radius=.5*this.width}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-.5*this.width,this.top=A-.5*this.height,this.initContextForDraw(g,I),Ye(g,this.left,this.top,this.width,this.height),this.performFill(g,I),this.updateBoundingBox(t,A,g,e,C),this.labelModule.draw(g,t,A,e,C)}},{key:"distanceToBorder",value:function(g,t){g&&this.resize(g);var A=.5*this.width,e=.5*this.height,C=Math.sin(t)*A,I=Math.cos(t)*e;return A*e/Math.sqrt(C*C+I*I)}}]),A}($D);function bN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var wN=function(g){Cb(A,g);var t=bN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g,t,A){this.needsRefresh(t,A)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(g,t,A,e,C,I){var i=this;return this.resize(g,e,C),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=A-this.height/2,this._icon(g,t,A,e,C,I),{drawExternalLabel:function(){if(void 0!==i.options.label){i.labelModule.draw(g,i.left+i.iconSize.width/2+i.margin.left,A+i.height/2+5,e)}i.updateBoundingBox(t,A)}}}},{key:"updateBoundingBox",value:function(g,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=g-.5*this.options.icon.size,this.boundingBox.right=g+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(g,t,A,e,C,I){var i=Number(this.options.icon.size);void 0!==this.options.icon.code?(g.font=[null!=this.options.icon.weight?this.options.icon.weight:e?"bold":"",(null!=this.options.icon.weight&&e?5:0)+i+"px",this.options.icon.face].join(" "),g.fillStyle=this.options.icon.color||"black",g.textAlign="center",g.textBaseline="middle",this.enableShadow(g,I),g.fillText(this.options.icon.code,t,A),this.disableShadow(g,I)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}($D);function kN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var xN=function(g){Cb(A,g);var t=kN(A);function A(g,e,C,I,i){var o;return cn(this,A),(o=t.call(this,g,e,C)).setImages(I,i),o}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var e=2*this.options.size;return this.width=e,void(this.height=e)}this.needsRefresh(t,A)&&this._resizeImage()}},{key:"draw",value:function(g,t,A,e,C,I){g.save(),this.switchImages(e),this.resize();var i=t,o=A;if("top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=t,this.top=A,i+=this.width/2,o+=this.height/2):(this.left=t-this.width/2,this.top=A-this.height/2),!0===this.options.shapeProperties.useBorderWithImage){var n=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,s=(e?r:n)/this.body.view.scale;g.lineWidth=Math.min(this.width,s),g.beginPath();var a=e?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,d=e?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;void 0!==I.opacity&&(a=ev(a,I.opacity),d=ev(d,I.opacity)),g.strokeStyle=a,g.fillStyle=d,g.rect(this.left-.5*g.lineWidth,this.top-.5*g.lineWidth,this.width+g.lineWidth,this.height+g.lineWidth),Bu(g).call(g),this.performStroke(g,I),g.closePath()}this._drawImageAtPosition(g,I),this._drawImageLabel(g,i,o,e,C),this.updateBoundingBox(t,A),g.restore()}},{key:"updateBoundingBox",value:function(g,t){this.resize(),"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=g,this.top=t):(this.left=g-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(eN);function EN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var ON=function(g){Cb(A,g);var t=EN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"square",2,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function TN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var DN=function(g){Cb(A,g);var t=TN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"hexagon",4,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function NN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var RN=function(g){Cb(A,g);var t=NN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"star",4,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function PN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var MN=function(g){Cb(A,g);var t=PN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g,t,A){this.needsRefresh(t,A)&&(this.textSize=this.labelModule.getTextSize(g,t,A),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this.enableShadow(g,I),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,e,C),this.disableShadow(g,I),this.updateBoundingBox(t,A,g,e,C)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}($D);function BN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var zN=function(g){Cb(A,g);var t=BN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"triangle",3,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function SN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var ZN=function(g){Cb(A,g);var t=SN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"triangleDown",3,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function FN(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function GN(g){for(var t=1;tg.left&&this.shape.topg.top}},{key:"isBoundingBoxOverlappingWith",value:function(g){return this.shape.boundingBox.leftg.left&&this.shape.boundingBox.topg.top}}],[{key:"checkOpacity",value:function(g){return 0<=g&&g<=1}},{key:"checkCoordinateOrigin",value:function(g){return void 0===g||"center"===g||"top-left"===g}},{key:"updateGroupOptions",value:function(t,A,e){var C;if(void 0!==e){var I=t.group;if(void 0!==A&&void 0!==A.group&&I!==A.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof I||"string"==typeof I&&""!=I){var i=e.get(I);void 0!==i.opacity&&void 0===A.opacity&&(g.checkOpacity(i.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+i.opacity),i.opacity=void 0));var o=pc(C=VD(A)).call(C,(function(g){return null!=A[g]}));o.push("font"),Jf(o,t,i),t.color=Iv(t.color)}}}},{key:"parseOptions",value:function(t,A){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],C=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},I=arguments.length>4?arguments[4]:void 0;if(Jf(["color","fixed","shadow"],t,A,e),g.checkMass(A),void 0!==t.opacity&&(g.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),void 0!==A.opacity&&(g.checkOpacity(A.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+A.opacity),A.opacity=void 0)),A.shapeProperties&&!g.checkCoordinateOrigin(A.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+A.shapeProperties.coordinateOrigin),dv(t,A,"shadow",C),void 0!==A.color&&null!==A.color){var i=Iv(A.color);Hf(t.color,i)}else!0===e&&null===A.color&&(t.color=av(C.color));void 0!==A.fixed&&null!==A.fixed&&("boolean"==typeof A.fixed?(t.fixed.x=A.fixed,t.fixed.y=A.fixed):(void 0!==A.fixed.x&&"boolean"==typeof A.fixed.x&&(t.fixed.x=A.fixed.x),void 0!==A.fixed.y&&"boolean"==typeof A.fixed.y&&(t.fixed.y=A.fixed.y))),!0===e&&null===A.font&&(t.font=av(C.font)),g.updateGroupOptions(t,A,I),void 0!==A.scaling&&dv(t.scaling,A.scaling,"label",C.scaling)}},{key:"checkMass",value:function(g,t){if(void 0!==g.mass&&g.mass<=0){var A="";void 0!==t&&(A=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+A+", setting mass to 1.",Tv),g.mass=1}}}]),g}();function LN(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return VN(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return VN(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function VN(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity):this.options.opacity=g.opacity),void 0!==g.shape)for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(void 0!==g.font||void 0!==g.widthConstraint||void 0!==g.heightConstraint)for(var A=0,e=Lh(this.body.nodes);A1&&void 0!==arguments[1]&&arguments[1],A=this.body.data.nodes;if(kD("id",g))this.body.data.nodes=g;else if(Rh(g))this.body.data.nodes=new mD,this.body.data.nodes.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new mD}if(A&&tv(this.nodesListeners,(function(g,t){A.off(t,g)})),this.body.nodes={},this.body.data.nodes){var e=this;tv(this.nodesListeners,(function(g,t){e.body.data.nodes.on(t,g)}));var C=this.body.data.nodes.getIds();this.add(C,!0)}!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(g){for(var t,A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=[],C=0;C1&&void 0!==arguments[1]?arguments[1]:jN)(g,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];tv(this.body.nodes,(function(A,e){var C=g.body.data.nodes.get(e);void 0!==C&&(!0===t&&A.setOptions({x:null,y:null}),A.setOptions({fixed:!1}),A.setOptions(C))}))}},{key:"getPositions",value:function(g){var t={};if(void 0!==g){if(!0===Rh(g)){for(var A=0;A0?(e=A/o)*e:A;return o===1/0?1/0:o*eR(C)}});var CR=A(tg.Math.hypot);function IR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var iR=function(){function g(){cn(this,g)}return kd(g,null,[{key:"transform",value:function(g,t){Rh(g)||(g=[g]);for(var A=t.point.x,e=t.point.y,C=t.angle,I=t.length,i=0;i4&&void 0!==arguments[4]?arguments[4]:this.getViaNode();g.strokeStyle=this.getColor(g,t),g.lineWidth=t.width,!1!==t.dashes?this._drawDashedLine(g,t,C):this._drawLine(g,t,C)}},{key:"_drawLine",value:function(g,t,A,e,C){if(this.from!=this.to)this._line(g,t,A,e,C);else{var I=lh(this._getCircleData(g),3),i=I[0],o=I[1],n=I[2];this._circle(g,t,i,o,n)}}},{key:"_drawDashedLine",value:function(g,t,A,e,C){g.lineCap="round";var I=Rh(t.dashes)?t.dashes:[5,5];if(void 0!==g.setLineDash){if(g.save(),g.setLineDash(I),g.lineDashOffset=0,this.from!=this.to)this._line(g,t,A);else{var i=lh(this._getCircleData(g),3),o=i[0],n=i[1],r=i[2];this._circle(g,t,o,n,r)}g.setLineDash([0]),g.lineDashOffset=0,g.restore()}else{if(this.from!=this.to)Qe(g,this.from.x,this.from.y,this.to.x,this.to.y,I);else{var s=lh(this._getCircleData(g),3),a=s[0],d=s[1],h=s[2];this._circle(g,t,a,d,h)}this.enableShadow(g,t),g.stroke(),this.disableShadow(g,t)}}},{key:"findBorderPosition",value:function(g,t,A){return this.from!=this.to?this._findBorderPosition(g,t,A):this._findBorderPositionCircle(g,t,A)}},{key:"findBorderPositions",value:function(g){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,g),to:this._findBorderPosition(this.to,g)};var t,A=lh(wh(t=this._getCircleData(g)).call(t,0,2),2),e=A[0],C=A[1];return{from:this._findBorderPositionCircle(this.from,g,{x:e,y:C,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,g,{x:e,y:C,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(g){var t=this.options.selfReference.size;void 0!==g&&void 0===this.from.shape.width&&this.from.shape.resize(g);var A=UD(g,this.options.selfReference.angle,t,this.from);return[A.x,A.y,t]}},{key:"_pointOnCircle",value:function(g,t,A,e){var C=2*e*Math.PI;return{x:g+A*Math.cos(C),y:t-A*Math.sin(C)}}},{key:"_findBorderPositionCircle",value:function(g,t,A){var e,C=A.x,I=A.y,i=A.low,o=A.high,n=A.direction,r=this.options.selfReference.size,s=.5*(i+o),a=0;!0===this.options.arrowStrikethrough&&(-1===n?a=this.options.endPointOffset.from:1===n&&(a=this.options.endPointOffset.to));var d=0;do{s=.5*(i+o),e=this._pointOnCircle(C,I,r,s);var h=Math.atan2(g.y-e.y,g.x-e.x),l=g.distanceToBorder(t,h)+a-Math.sqrt(Math.pow(e.x-g.x,2)+Math.pow(e.y-g.y,2));if(Math.abs(l)<.05)break;l>0?n>0?i=s:o=s:n>0?o=s:i=s,++d}while(i<=o&&d<10);return mR(mR({},e),{},{t:s})}},{key:"getLineWidth",value:function(g,t){return!0===g?Math.max(this.selectionWidth,.3/this._body.view.scale):!0===t?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(g,t){if(!1!==t.inheritsColor){if("both"===t.inheritsColor&&this.from.id!==this.to.id){var A=g.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),e=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(e=ev(this.from.options.color.border,t.opacity),C=ev(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?C=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(e=this.from.options.color.border),A.addColorStop(0,e),A.addColorStop(1,C),A}return"to"===t.inheritsColor?ev(this.to.options.color.border,t.opacity):ev(this.from.options.color.border,t.opacity)}return ev(t.color,t.opacity)}},{key:"_circle",value:function(g,t,A,e,C){this.enableShadow(g,t);var I=0,i=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){var o=this.options.selfReference.angle,n=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,g,{x:A,y:e,low:o,high:n,direction:-1}),s=this._findBorderPositionCircle(this.from,g,{x:A,y:e,low:o,high:n,direction:1});I=Math.atan2(r.y-e,r.x-A),i=Math.atan2(s.y-e,s.x-A)}g.beginPath(),g.arc(A,e,C,I,i,!1),g.stroke(),this.disableShadow(g,t)}},{key:"getDistanceToEdge",value:function(g,t,A,e,C,I){if(this.from!=this.to)return this._getDistanceToEdge(g,t,A,e,C,I);var i=lh(this._getCircleData(void 0),3),o=i[0],n=i[1],r=i[2],s=o-C,a=n-I;return Math.abs(Math.sqrt(s*s+a*a)-r)}},{key:"_getDistanceToLine",value:function(g,t,A,e,C,I){var i=A-g,o=e-t,n=((C-g)*i+(I-t)*o)/(i*i+o*o);n>1?n=1:n<0&&(n=0);var r=g+n*i-C,s=t+n*o-I;return Math.sqrt(r*r+s*s)}},{key:"getArrowData",value:function(g,t,A,e,C,I){var i,o,n,r,s,a,d,h=I.width;"from"===t?(n=this.from,r=this.to,s=I.fromArrowScale<0,a=Math.abs(I.fromArrowScale),d=I.fromArrowType):"to"===t?(n=this.to,r=this.from,s=I.toArrowScale<0,a=Math.abs(I.toArrowScale),d=I.toArrowType):(n=this.to,r=this.from,s=I.middleArrowScale<0,a=Math.abs(I.middleArrowScale),d=I.middleArrowType);var l=15*a+3*h;if(n!=r){var c=l/CR(n.x-r.x,n.y-r.y);if("middle"!==t)if(!0===this.options.smooth.enabled){var u=this._findBorderPosition(n,g,{via:A}),p=this.getPoint(u.t+c*("from"===t?1:-1),A);i=Math.atan2(u.y-p.y,u.x-p.x),o=u}else i=Math.atan2(n.y-r.y,n.x-r.x),o=this._findBorderPosition(n,g);else{var f=(s?-c:c)/2,v=this.getPoint(.5+f,A),y=this.getPoint(.5-f,A);i=Math.atan2(v.y-y.y,v.x-y.x),o=this.getPoint(.5,A)}}else{var m=lh(this._getCircleData(g),3),b=m[0],w=m[1],k=m[2];if("from"===t){var x=this.options.selfReference.angle,E=this.options.selfReference.angle+Math.PI,O=this._findBorderPositionCircle(this.from,g,{x:b,y:w,low:x,high:E,direction:-1});i=-2*O.t*Math.PI+1.5*Math.PI+.1*Math.PI,o=O}else if("to"===t){var T=this.options.selfReference.angle,D=this.options.selfReference.angle+Math.PI,N=this._findBorderPositionCircle(this.from,g,{x:b,y:w,low:T,high:D,direction:1});i=-2*N.t*Math.PI+1.5*Math.PI-1.1*Math.PI,o=N}else{var R=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(b,w,k,R),i=-2*R*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:o,core:{x:o.x-.9*l*Math.cos(i),y:o.y-.9*l*Math.sin(i)},angle:i,length:l,type:d}}},{key:"drawArrowHead",value:function(g,t,A,e,C){g.strokeStyle=this.getColor(g,t),g.fillStyle=g.strokeStyle,g.lineWidth=t.width,vR.draw(g,C)&&(this.enableShadow(g,t),Bu(g).call(g),this.disableShadow(g,t))}},{key:"enableShadow",value:function(g,t){!0===t.shadow&&(g.shadowColor=t.shadowColor,g.shadowBlur=t.shadowSize,g.shadowOffsetX=t.shadowX,g.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(g,t){!0===t.shadow&&(g.shadowColor="rgba(0,0,0,0)",g.shadowBlur=0,g.shadowOffsetX=0,g.shadowOffsetY=0)}},{key:"drawBackground",value:function(g,t){if(!1!==t.background){var A={strokeStyle:g.strokeStyle,lineWidth:g.lineWidth,dashes:g.dashes};g.strokeStyle=t.backgroundColor,g.lineWidth=t.backgroundSize,this.setStrokeDashed(g,t.backgroundDashes),g.stroke(),g.strokeStyle=A.strokeStyle,g.lineWidth=A.lineWidth,g.dashes=A.dashes,this.setStrokeDashed(g,t.dashes)}}},{key:"setStrokeDashed",value:function(g,t){if(!1!==t)if(void 0!==g.setLineDash){var A=Rh(t)?t:[5,5];g.setLineDash(A)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==g.setLineDash?g.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),g}();function wR(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=pc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function kR(g){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),I=!1,i=1,o=0,n=this.to,r=this.options.endPointOffset?this.options.endPointOffset.to:0;g.id===this.from.id&&(n=this.from,I=!0,r=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(r=0);var s=0;do{e=.5*(o+i),A=this.getPoint(e,C);var a=Math.atan2(n.y-A.y,n.x-A.x),d=n.distanceToBorder(t,a)+r-Math.sqrt(Math.pow(A.x-n.x,2)+Math.pow(A.y-n.y,2));if(Math.abs(d)<.2)break;d<0?!1===I?o=e:i=e:!1===I?i=e:o=e,++s}while(o<=i&&s<10);return kR(kR({},A),{},{t:e})}},{key:"_getDistanceToBezierEdge",value:function(g,t,A,e,C,I,i){var o,n,r,s,a,d=1e9,h=g,l=t;for(n=1;n<10;n++)r=.1*n,s=Math.pow(1-r,2)*g+2*r*(1-r)*i.x+Math.pow(r,2)*A,a=Math.pow(1-r,2)*t+2*r*(1-r)*i.y+Math.pow(r,2)*e,n>0&&(d=(o=this._getDistanceToLine(h,l,s,a,C,I))1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){var A=lh(this._getCircleData(),3),e=A[0],C=A[1],I=A[2],i=2*Math.PI*(1-g);return{x:e+I*Math.sin(i),y:C+I-I*(1-Math.cos(i))}}return{x:Math.pow(1-g,2)*this.fromPoint.x+2*g*(1-g)*t.x+Math.pow(g,2)*this.toPoint.x,y:Math.pow(1-g,2)*this.fromPoint.y+2*g*(1-g)*t.y+Math.pow(g,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(g,t){return this._findBorderPositionBezier(g,t,this.via)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){return this._getDistanceToBezierEdge(g,t,A,e,C,I,this.via)}}]),A}(ER);function DR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var NR=function(g){Cb(A,g);var t=DR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_line",value:function(g,t,A){this._bezierCurve(g,t,A)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var g,t,A=this.options.smooth.roundness,e=this.options.smooth.type,C=Math.abs(this.from.x-this.to.x),I=Math.abs(this.from.y-this.to.y);if("discrete"===e||"diagonalCross"===e){var i,o;i=o=C<=I?A*I:A*C,this.from.x>this.to.x&&(i=-i),this.from.y>=this.to.y&&(o=-o);var n=this.from.x+i,r=this.from.y+o;return"discrete"===e&&(C<=I?n=Cthis.to.x&&(g=-g),this.from.y>=this.to.y&&(t=-t);var y=this.from.x+g,m=this.from.y+t;return C<=I?y=this.from.x<=this.to.x?this.to.xy?this.to.x:y:m=this.from.y>=this.to.y?this.to.y>m?this.to.y:m:this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(g,t,A.via)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){var i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(g,t,A,e,C,I,i)}},{key:"getPoint",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),A=g;return{x:Math.pow(1-A,2)*this.fromPoint.x+2*A*(1-A)*t.x+Math.pow(A,2)*this.toPoint.x,y:Math.pow(1-A,2)*this.fromPoint.y+2*A*(1-A)*t.y+Math.pow(A,2)*this.toPoint.y}}}]),A}(ER);function RR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var PR=function(g){Cb(A,g);var t=RR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_getDistanceToBezierEdge2",value:function(g,t,A,e,C,I,i,o){for(var n=1e9,r=g,s=t,a=[0,0,0,0],d=1;d<10;d++){var h=.1*d;a[0]=Math.pow(1-h,3),a[1]=3*h*Math.pow(1-h,2),a[2]=3*Math.pow(h,2)*(1-h),a[3]=Math.pow(h,3);var l=a[0]*g+a[1]*i.x+a[2]*o.x+a[3]*A,c=a[0]*t+a[1]*i.y+a[2]*o.y+a[3]*e;if(d>0){var u=this._getDistanceToLine(r,s,l,c,C,I);n=uMath.abs(I)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(t=this.from.y,e=this.to.y,g=this.from.x-i*C,A=this.to.x+i*C):(t=this.from.y-i*I,e=this.to.y+i*I,g=this.from.x,A=this.to.x),[{x:g,y:t},{x:A,y:e}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(g,t){return this._findBorderPositionBezier(g,t)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){var i=lh(arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),2),o=i[0],n=i[1];return this._getDistanceToBezierEdge2(g,t,A,e,C,I,o,n)}},{key:"getPoint",value:function(g){var t=lh(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),2),A=t[0],e=t[1],C=g,I=[Math.pow(1-C,3),3*C*Math.pow(1-C,2),3*Math.pow(C,2)*(1-C),Math.pow(C,3)];return{x:I[0]*this.fromPoint.x+I[1]*A.x+I[2]*e.x+I[3]*this.toPoint.x,y:I[0]*this.fromPoint.y+I[1]*A.y+I[2]*e.y+I[3]*this.toPoint.y}}}]),A}(PR);function zR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var SR=function(g){Cb(A,g);var t=zR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_line",value:function(g,t){g.beginPath(),g.moveTo(this.fromPoint.x,this.fromPoint.y),g.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(g,t),g.stroke(),this.disableShadow(g,t)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(g){return{x:(1-g)*this.fromPoint.x+g*this.toPoint.x,y:(1-g)*this.fromPoint.y+g*this.toPoint.y}}},{key:"_findBorderPosition",value:function(g,t){var A=this.to,e=this.from;g.id===this.from.id&&(A=this.from,e=this.to);var C=Math.atan2(A.y-e.y,A.x-e.x),I=A.x-e.x,i=A.y-e.y,o=Math.sqrt(I*I+i*i),n=(o-g.distanceToBorder(t,C))/o;return{x:(1-n)*e.x+n*A.x,y:(1-n)*e.y+n*A.y,t:0}}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){return this._getDistanceToLine(g,t,A,e,C,I)}}]),A}(bR),ZR=function(){function g(t,A,e,C,I){if(cn(this,g),void 0===A)throw new Error("No body provided");this.options=av(C),this.globalOptions=C,this.defaultOptions=I,this.body=A,this.imagelist=e,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new qD(this.body,this.options,!0),this.setOptions(t)}return kd(g,[{key:"setOptions",value:function(t){if(t){var A=void 0!==t.physics&&this.options.physics!==t.physics||void 0!==t.hidden&&(this.options.hidden||!1)!==(t.hidden||!1)||void 0!==t.from&&this.options.from!==t.from||void 0!==t.to&&this.options.to!==t.to;g.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),void 0!==t.value&&(t.value=SD(t.value));var e=[t,this.options,this.defaultOptions];return this.chooser=YD("edge",e),this.updateLabelModule(t),A=this.updateEdgeType()||A,this._setInteractionWidths(),this.connect(),A}}},{key:"getFormattingValues",value:function(){var g=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,t=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,A=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,e=this.options.color.inherit,C={toArrow:g,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:A,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:e?void 0:this.options.color.color,inheritsColor:e,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(!0===this.chooser){if(this.selected){var I=this.options.selectionWidth;"function"==typeof I?C.width=I(C.width):"number"==typeof I&&(C.width+=I),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.highlight,C.shadow=this.options.shadow.enabled}else if(this.hover){var i=this.options.hoverWidth;"function"==typeof i?C.width=i(C.width):"number"==typeof i&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.hover,C.shadow=this.options.shadow.enabled}}else"function"==typeof this.chooser&&(this.chooser(C,this.options.id,this.selected,this.hover),void 0!==C.color&&(C.inheritsColor=!1),!1===C.shadow&&(C.shadowColor===this.options.shadow.color&&C.shadowSize===this.options.shadow.size&&C.shadowX===this.options.shadow.x&&C.shadowY===this.options.shadow.y||(C.shadow=!0)));else C.shadow=this.options.shadow.enabled,C.width=Math.max(C.width,.3/this.body.view.scale);return C}},{key:"updateLabelModule",value:function(g){var t=[g,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var g=this.options.smooth,t=!1,A=!0;return void 0!==this.edgeType&&((this.edgeType instanceof TR&&!0===g.enabled&&"dynamic"===g.type||this.edgeType instanceof BR&&!0===g.enabled&&"cubicBezier"===g.type||this.edgeType instanceof NR&&!0===g.enabled&&"dynamic"!==g.type&&"cubicBezier"!==g.type||this.edgeType instanceof SR&&!1===g.type.enabled)&&(A=!1),!0===A&&(t=this.cleanup())),!0===A?!0===g.enabled?"dynamic"===g.type?(t=!0,this.edgeType=new TR(this.options,this.body,this.labelModule)):"cubicBezier"===g.type?this.edgeType=new BR(this.options,this.body,this.labelModule):this.edgeType=new NR(this.options,this.body,this.labelModule):this.edgeType=new SR(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(g,t,A){if(void 0!==this.options.value){var e=this.options.scaling.customScalingFunction(g,t,A,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var I=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+e*I}this.options.width=this.options.scaling.min+e*C}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(g){var t=this.getFormattingValues();if(!t.hidden){var A=this.edgeType.getViaNode();this.edgeType.drawLine(g,t,this.selected,this.hover,A),this.drawLabel(g,A)}}},{key:"drawArrows",value:function(g){var t=this.getFormattingValues();if(!t.hidden){var A=this.edgeType.getViaNode(),e={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(e.from=this.edgeType.getArrowData(g,"from",A,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.fromPoint=e.from.core),t.fromArrowSrc&&(e.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(e.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(e.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(e.to=this.edgeType.getArrowData(g,"to",A,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.toPoint=e.to.core),t.toArrowSrc&&(e.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(e.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(e.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(e.middle=this.edgeType.getArrowData(g,"middle",A,this.selected,this.hover,t),t.middleArrowSrc&&(e.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(e.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(e.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.from),t.middleArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.middle),t.toArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.to)}}},{key:"drawLabel",value:function(g,t){if(void 0!==this.options.label){var A,e=this.from,C=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(g,this.selected,this.hover),e.id!=C.id){this.labelModule.pointToSelf=!1,A=this.edgeType.getPoint(.5,t),g.save();var I=this._getRotation(g);0!=I.angle&&(g.translate(I.x,I.y),g.rotate(I.angle)),this.labelModule.draw(g,A.x,A.y,this.selected,this.hover),g.restore()}else{this.labelModule.pointToSelf=!0;var i=UD(g,this.options.selfReference.angle,this.options.selfReference.size,e);A=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(g,A.x,A.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(g){var t=[];if(this.labelModule.visible()){var A=this._getRotation();WD(this.labelModule.getSize(),g,A)&&t.push({edgeId:this.id,labelId:0})}var e={left:g.x,top:g.y};return this.isOverlappingWith(e)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(g){if(this.connected){var t=this.from.x,A=this.from.y,e=this.to.x,C=this.to.y,I=g.left,i=g.top;return this.edgeType.getDistanceToEdge(t,A,e,C,I,i)<10}return!1}},{key:"_getRotation",value:function(g){var t=this.edgeType.getViaNode(),A=this.edgeType.getPoint(.5,t);void 0!==g&&this.labelModule.calculateLabelSize(g,this.selected,this.hover,A.x,A.y);var e={x:A.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return e;if("horizontal"===this.options.font.align)return e;var C=this.from.y-this.to.y,I=this.from.x-this.to.x,i=Math.atan2(C,I);return(i<-1&&I<0||i>0&&I<0)&&(i+=Math.PI),e.angle=i,e}},{key:"_pointOnCircle",value:function(g,t,A,e){return{x:g+A*Math.cos(e),y:t-A*Math.sin(e)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}],[{key:"parseOptions",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},C=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Xf(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],g,t,A),void 0!==t.endPointOffset&&void 0!==t.endPointOffset.from&&(Ym(t.endPointOffset.from)?g.endPointOffset.from=t.endPointOffset.from:(g.endPointOffset.from=void 0!==e.endPointOffset.from?e.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),void 0!==t.endPointOffset&&void 0!==t.endPointOffset.to&&(Ym(t.endPointOffset.to)?g.endPointOffset.to=t.endPointOffset.to:(g.endPointOffset.to=void 0!==e.endPointOffset.to?e.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),QD(t.label)?g.label=t.label:QD(g.label)||(g.label=void 0),dv(g,t,"smooth",e),dv(g,t,"shadow",e),dv(g,t,"background",e),void 0!==t.dashes&&null!==t.dashes?g.dashes=t.dashes:!0===A&&null===t.dashes&&(g.dashes=$c(e.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(g.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(g.scaling.max=t.scaling.max),dv(g.scaling,t.scaling,"label",e.scaling)):!0===A&&null===t.scaling&&(g.scaling=$c(e.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var I=t.arrows.toLowerCase();g.arrows.to.enabled=-1!=Xc(I).call(I,"to"),g.arrows.middle.enabled=-1!=Xc(I).call(I,"middle"),g.arrows.from.enabled=-1!=Xc(I).call(I,"from")}else{if("object"!==yd(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+eu(t.arrows));dv(g.arrows,t.arrows,"to",e.arrows),dv(g.arrows,t.arrows,"middle",e.arrows),dv(g.arrows,t.arrows,"from",e.arrows)}else!0===A&&null===t.arrows&&(g.arrows=$c(e.arrows));if(void 0!==t.color&&null!==t.color){var i=Uf(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,o=g.color;if(C)qf(o,e.color,!1,A);else for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&delete o[n];if(Uf(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,void 0===i.opacity&&(o.opacity=1);else{var r=!1;void 0!==i.color&&(o.color=i.color,r=!0),void 0!==i.highlight&&(o.highlight=i.highlight,r=!0),void 0!==i.hover&&(o.hover=i.hover,r=!0),void 0!==i.inherit&&(o.inherit=i.inherit),void 0!==i.opacity&&(o.opacity=Math.min(1,Math.max(0,i.opacity))),!0===r?o.inherit=!1:void 0===o.inherit&&(o.inherit="from")}}else!0===A&&null===t.color&&(g.color=av(e.color));!0===A&&null===t.font&&(g.font=av(e.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),g.selfReference.size=t.selfReferenceSize)}}]),g}(),FR=function(){function g(t,A,e){var C,I=this;cn(this,g),this.body=t,this.images=A,this.groups=e,this.body.functions.createEdge=je(C=this.create).call(C,this),this.edgesListeners={add:function(g,t){I.add(t.items)},update:function(g,t){I.update(t.items)},remove:function(g,t){I.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(g,t,A,e){if(t===g)return.5;var C=1/(t-g);return Math.max(0,(e-g)*C)}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},qf(this.options,this.defaultOptions),this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g,t,A=this;this.body.emitter.on("_forceDisableDynamicCurves",(function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===g&&(g="continuous");var e=!1;for(var C in A.body.edges)if(Object.prototype.hasOwnProperty.call(A.body.edges,C)){var I=A.body.edges[C],i=A.body.data.edges.get(C);if(null!=i){var o=i.smooth;void 0!==o&&!0===o.enabled&&"dynamic"===o.type&&(void 0===g?I.setOptions({smooth:!1}):I.setOptions({smooth:{type:g}}),e=!0)}}!0===t&&!0===e&&A.body.emitter.emit("_dataChanged")})),this.body.emitter.on("_dataUpdated",(function(){A.reconnectEdges()})),this.body.emitter.on("refreshEdges",je(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",je(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",(function(){tv(A.edgesListeners,(function(g,t){A.body.data.edges&&A.body.data.edges.off(t,g)})),delete A.body.functions.createEdge,delete A.edgesListeners.add,delete A.edgesListeners.update,delete A.edgesListeners.remove,delete A.edgesListeners}))}},{key:"setOptions",value:function(g){if(void 0!==g){ZR.parseOptions(this.options,g,!0,this.defaultOptions,!0);var t=!1;if(void 0!==g.smooth)for(var A in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,A)&&(t=this.body.edges[A].updateEdgeType()||t);if(void 0!==g.font)for(var e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&this.body.edges[e].updateLabelModule();void 0===g.hidden&&void 0===g.physics&&!0!==t||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(g){var t=this,A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=this.body.data.edges;if(kD("id",g))this.body.data.edges=g;else if(Rh(g))this.body.data.edges=new mD,this.body.data.edges.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.edges=new mD}if(e&&tv(this.edgesListeners,(function(g,t){e.off(t,g)})),this.body.edges={},this.body.data.edges){tv(this.edgesListeners,(function(g,A){t.body.data.edges.on(A,g)}));var C=this.body.data.edges.getIds();this.add(C,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===A&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(g){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=this.body.edges,e=this.body.data.edges,C=0;C1&&void 0!==arguments[1])||arguments[1];if(0!==g.length){var A=this.body.edges;tv(g,(function(g){var t=A[g];void 0!==t&&t.remove()})),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var g=this;tv(this.body.edges,(function(t,A){var e=g.body.data.edges.get(A);void 0!==e&&t.setOptions(e)}))}},{key:"create",value:function(g){return new ZR(g,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var g,t=this.body.nodes,A=this.body.edges;for(g in t)Object.prototype.hasOwnProperty.call(t,g)&&(t[g].edges=[]);for(g in A)if(Object.prototype.hasOwnProperty.call(A,g)){var e=A[g];e.from=null,e.to=null,e.connect()}}},{key:"getConnectedNodes",value:function(g){var t=[];if(void 0!==this.body.edges[g]){var A=this.body.edges[g];void 0!==A.fromId&&t.push(A.fromId),void 0!==A.toId&&t.push(A.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var g=this,t=[];tv(this.body.edges,(function(A,e){var C=g.body.nodes[A.toId],I=g.body.nodes[A.fromId];void 0!==C&&!0===C.isCluster||void 0!==I&&!0===I.isCluster||void 0!==C&&void 0!==I||t.push(e)})),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var g=this.body.data.edges;if(null!=g){var t=this.body.edges,A=[];Cl(g).call(g,(function(g,e){void 0===t[e]&&A.push(e)})),this.add(A,!0)}}}]),g}(),GR=function(){function g(t,A,e){cn(this,g),this.body=t,this.physicsBody=A,this.barnesHutTree,this.setOptions(e),this._rng=Ff("BARNES HUT SOLVER")}return kd(g,[{key:"setOptions",value:function(g){this.options=g,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var g,t=this.body.nodes,A=this.physicsBody.physicsNodeIndices,e=A.length,C=this._formBarnesHutTree(t,A);this.barnesHutTree=C;for(var I=0;I0&&this._getForceContributions(C.root,g)}}},{key:"_getForceContributions",value:function(g,t){this._getForceContribution(g.children.NW,t),this._getForceContribution(g.children.NE,t),this._getForceContribution(g.children.SW,t),this._getForceContribution(g.children.SE,t)}},{key:"_getForceContribution",value:function(g,t){if(g.childrenCount>0){var A=g.centerOfMass.x-t.x,e=g.centerOfMass.y-t.y,C=Math.sqrt(A*A+e*e);C*g.calcSize>this.thetaInversed?this._calculateForces(C,A,e,t,g):4===g.childrenCount?this._getForceContributions(g,t):g.children.data.id!=t.id&&this._calculateForces(C,A,e,t,g)}}},{key:"_calculateForces",value:function(g,t,A,e,C){0===g&&(t=g=.1),this.overlapAvoidanceFactor<1&&e.shape.radius&&(g=Math.max(.1+this.overlapAvoidanceFactor*e.shape.radius,g-e.shape.radius));var I=this.options.gravitationalConstant*C.mass*e.options.mass/Math.pow(g,3),i=t*I,o=A*I;this.physicsBody.forces[e.id].x+=i,this.physicsBody.forces[e.id].y+=o}},{key:"_formBarnesHutTree",value:function(g,t){for(var A,e=t.length,C=g[t[0]].x,I=g[t[0]].y,i=g[t[0]].x,o=g[t[0]].y,n=1;n0&&(si&&(i=s),ao&&(o=a))}var d=Math.abs(i-C)-Math.abs(o-I);d>0?(I-=.5*d,o+=.5*d):(C+=.5*d,i-=.5*d);var h=Math.max(1e-5,Math.abs(i-C)),l=.5*h,c=.5*(C+i),u=.5*(I+o),p={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:c-l,maxX:c+l,minY:u-l,maxY:u+l},size:h,calcSize:1/h,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(p.root);for(var f=0;f0&&this._placeInTree(p.root,A);return p}},{key:"_updateBranchMass",value:function(g,t){var A=g.centerOfMass,e=g.mass+t.options.mass,C=1/e;A.x=A.x*g.mass+t.x*t.options.mass,A.x*=C,A.y=A.y*g.mass+t.y*t.options.mass,A.y*=C,g.mass=e;var I=Math.max(Math.max(t.height,t.radius),t.width);g.maxWidth=g.maxWidtht.x?C.maxY>t.y?"NW":"SW":C.maxY>t.y?"NE":"SE",this._placeInRegion(g,t,e)}},{key:"_placeInRegion",value:function(g,t,A){var e=g.children[A];switch(e.childrenCount){case 0:e.children.data=t,e.childrenCount=1,this._updateBranchMass(e,t);break;case 1:e.children.data.x===t.x&&e.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(e),this._placeInTree(e,t));break;case 4:this._placeInTree(e,t)}}},{key:"_splitBranch",value:function(g){var t=null;1===g.childrenCount&&(t=g.children.data,g.mass=0,g.centerOfMass.x=0,g.centerOfMass.y=0),g.childrenCount=4,g.children.data=null,this._insertRegion(g,"NW"),this._insertRegion(g,"NE"),this._insertRegion(g,"SW"),this._insertRegion(g,"SE"),null!=t&&this._placeInTree(g,t)}},{key:"_insertRegion",value:function(g,t){var A,e,C,I,i=.5*g.size;switch(t){case"NW":A=g.range.minX,e=g.range.minX+i,C=g.range.minY,I=g.range.minY+i;break;case"NE":A=g.range.minX+i,e=g.range.maxX,C=g.range.minY,I=g.range.minY+i;break;case"SW":A=g.range.minX,e=g.range.minX+i,C=g.range.minY+i,I=g.range.maxY;break;case"SE":A=g.range.minX+i,e=g.range.maxX,C=g.range.minY+i,I=g.range.maxY}g.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:A,maxX:e,minY:C,maxY:I},size:.5*g.size,calcSize:2*g.calcSize,children:{data:null},maxWidth:0,level:g.level+1,childrenCount:0}}},{key:"_debug",value:function(g,t){void 0!==this.barnesHutTree&&(g.lineWidth=1,this._drawBranch(this.barnesHutTree.root,g,t))}},{key:"_drawBranch",value:function(g,t,A){void 0===A&&(A="#FF0000"),4===g.childrenCount&&(this._drawBranch(g.children.NW,t),this._drawBranch(g.children.NE,t),this._drawBranch(g.children.SE,t),this._drawBranch(g.children.SW,t)),t.strokeStyle=A,t.beginPath(),t.moveTo(g.range.minX,g.range.minY),t.lineTo(g.range.maxX,g.range.minY),t.stroke(),t.beginPath(),t.moveTo(g.range.maxX,g.range.minY),t.lineTo(g.range.maxX,g.range.maxY),t.stroke(),t.beginPath(),t.moveTo(g.range.maxX,g.range.maxY),t.lineTo(g.range.minX,g.range.maxY),t.stroke(),t.beginPath(),t.moveTo(g.range.minX,g.range.maxY),t.lineTo(g.range.minX,g.range.minY),t.stroke()}}]),g}(),jR=function(){function g(t,A,e){cn(this,g),this._rng=Ff("REPULSION SOLVER"),this.body=t,this.physicsBody=A,this.setOptions(e)}return kd(g,[{key:"setOptions",value:function(g){this.options=g}},{key:"solve",value:function(){for(var g,t,A,e,C,I,i,o,n=this.body.nodes,r=this.physicsBody.physicsNodeIndices,s=this.physicsBody.forces,a=this.options.nodeDistance,d=-2/3/a,h=0;h0){var I=C.edges.length+1,i=this.options.centralGravity*I*C.options.mass;e[C.id].x=t*i,e[C.id].y=A*i}}}]),A}(WR),HR=function(){function g(t){cn(this,g),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},fe(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g=this;this.body.emitter.on("initPhysics",(function(){g.initPhysics()})),this.body.emitter.on("_layoutFailed",(function(){g.layoutFailed=!0})),this.body.emitter.on("resetPhysics",(function(){g.stopSimulation(),g.ready=!1})),this.body.emitter.on("disablePhysics",(function(){g.physicsEnabled=!1,g.stopSimulation()})),this.body.emitter.on("restorePhysics",(function(){g.setOptions(g.options),!0===g.ready&&g.startSimulation()})),this.body.emitter.on("startSimulation",(function(){!0===g.ready&&g.startSimulation()})),this.body.emitter.on("stopSimulation",(function(){g.stopSimulation()})),this.body.emitter.on("destroy",(function(){g.stopSimulation(!1),g.body.emitter.off()})),this.body.emitter.on("_dataChanged",(function(){g.updatePhysicsData()}))}},{key:"setOptions",value:function(g){if(void 0!==g)if(!1===g)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(!0===g)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Jf(["stabilization"],this.options,g),dv(this.options,g,"stabilization"),void 0===g.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());var t=this.options.wind;t&&(("number"!=typeof t.x||jm(t.x))&&(t.x=0),("number"!=typeof t.y||jm(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var g;"forceAtlas2Based"===this.options.solver?(g=this.options.forceAtlas2Based,this.nodesSolver=new UR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new KR(this.body,this.physicsBody,g)):"repulsion"===this.options.solver?(g=this.options.repulsion,this.nodesSolver=new jR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)):"hierarchicalRepulsion"===this.options.solver?(g=this.options.hierarchicalRepulsion,this.nodesSolver=new LR(this.body,this.physicsBody,g),this.edgesSolver=new YR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)):(g=this.options.barnesHut,this.nodesSolver=new GR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)),this.modelOptions=g}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){var g;!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=je(g=this.simulationStep).call(g,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var g=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===g&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===g&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var g=Qh();this.physicsTick(),(Qh()-g<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&wu((function(){g.body.emitter.emit("stabilized",{iterations:t}),g.startedStabilization=!1,g.stabilizationIterations=0}),0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var g=this.physicsBody.physicsNodeIndices,t=0,A=0,e=0;ee&&(g=g>0?e:-e),g}},{key:"_performStep",value:function(g){var t=this.body.nodes[g],A=this.physicsBody.forces[g];this.options.wind&&(A.x+=this.options.wind.x,A.y+=this.options.wind.y);var e=this.physicsBody.velocities[g];return this.previousStates[g]={x:t.x,y:t.y,vx:e.x,vy:e.y},!1===t.options.fixed.x?(e.x=this.calculateComponentVelocity(e.x,A.x,t.options.mass),t.x+=e.x*this.timestep):(A.x=0,e.x=0),!1===t.options.fixed.y?(e.y=this.calculateComponentVelocity(e.y,A.y,t.options.mass),t.y+=e.y*this.timestep):(A.y=0,e.y=0),Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}},{key:"_freezeNodes",value:function(){var g=this.body.nodes;for(var t in g)if(Object.prototype.hasOwnProperty.call(g,t)&&g[t].x&&g[t].y){var A=g[t].options.fixed;this.freezeCache[t]={x:A.x,y:A.y},A.x=!0,A.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var g=this.body.nodes;for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&void 0!==this.freezeCache[t]&&(g[t].options.fixed.x=this.freezeCache[t].x,g[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof t&&(t=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,wu((function(){return g._stabilizationBatch()}),0)):this.ready=!0}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var g=this,t=function(){return!1===g.stabilized&&g.stabilizationIterations1&&void 0!==arguments[1]?arguments[1]:[],e=1e9,C=-1e9,I=1e9,i=-1e9;if(A.length>0)for(var o=0;o(t=g[A[o]]).shape.boundingBox.left&&(I=t.shape.boundingBox.left),it.shape.boundingBox.top&&(e=t.shape.boundingBox.top),C1&&void 0!==arguments[1]?arguments[1]:[],e=1e9,C=-1e9,I=1e9,i=-1e9;if(A.length>0)for(var o=0;o(t=g[A[o]]).x&&(I=t.x),it.y&&(e=t.y),C=g&&A.push(C.id)}for(var I=0;I0&&void 0!==arguments[0]?arguments[0]:{},A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var e={},C={};tv(this.body.nodes,(function(A,I){A.options&&!0===t.joinCondition(A.options)&&(e[I]=A,tv(A.edges,(function(t){void 0===g.clusteredEdges[t.id]&&(C[t.id]=t)})))})),this._cluster(e,C,t,A)}},{key:"clusterByEdgeCount",value:function(g,t){var A=this,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=this._checkOptions(t);for(var C,I,i,o=[],n={},r=function(){var e={},r={},a=A.body.nodeIndices[s],d=A.body.nodes[a];if(void 0===n[a]){i=0,I=[];for(var h=0;h0&&Lh(r).length>0&&!0===c){var f=function(){for(var g=0;g1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,g,t)}},{key:"clusterBridges",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,g,t)}},{key:"clusterByConnection",value:function(g,t){var A,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[g])throw new Error("The nodeId given to clusterByConnection does not exist!");var C=this.body.nodes[g];void 0===(t=this._checkOptions(t,C)).clusterNodeProperties.x&&(t.clusterNodeProperties.x=C.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=C.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=C.options.fixed.x,t.clusterNodeProperties.fixed.y=C.options.fixed.y);var I={},i={},o=C.id,n=XR.cloneOptions(C);I[o]=C;for(var r=0;r-1&&(i[p.id]=p)}this._cluster(I,i,t,e)}},{key:"_createClusterEdges",value:function(g,t,A,e){for(var C,I,i,o,n,r,s=Lh(g),a=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:{};return void 0===g.clusterEdgeProperties&&(g.clusterEdgeProperties={}),void 0===g.clusterNodeProperties&&(g.clusterNodeProperties={}),g}},{key:"_cluster",value:function(g,t,A){var e=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],C=[];for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&void 0!==this.clusteredNodes[I]&&C.push(I);for(var i=0;iC?t.x:C,I=t.yi?t.y:i;return{x:.5*(e+C),y:.5*(I+i)}}},{key:"openCluster",value:function(g,t){var A=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No clusterNodeId supplied to openCluster.");var e=this.body.nodes[g];if(void 0===e)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==e.isCluster||void 0===e.containedNodes||void 0===e.containedEdges)throw new Error("The node:"+g+" is not a valid cluster.");var C=this.findNode(g),I=Xc(C).call(C,g)-1;if(I>=0){var i=C[I];return this.body.nodes[i]._openChildCluster(g),delete this.body.nodes[g],void(!0===A&&this.body.emitter.emit("_dataChanged"))}var o=e.containedNodes,n=e.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},s={x:e.x,y:e.y};for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)){var d=this.body.nodes[a];r[a]={x:d.x,y:d.y}}var h=t.releaseFunction(s,r);for(var l in o)if(Object.prototype.hasOwnProperty.call(o,l)){var c=this.body.nodes[l];void 0!==h[l]&&(c.x=void 0===h[l].x?e.x:h[l].x,c.y=void 0===h[l].y?e.y:h[l].y)}}else tv(o,(function(g){!1===g.options.fixed.x&&(g.x=e.x),!1===g.options.fixed.y&&(g.y=e.y)}));for(var u in o)if(Object.prototype.hasOwnProperty.call(o,u)){var p=this.body.nodes[u];p.vx=e.vx,p.vy=e.vy,p.setOptions({physics:!0}),delete this.clusteredNodes[u]}for(var f=[],v=0;v0&&C<100;){var I=t.pop();if(void 0!==I){var i=this.body.edges[I];if(void 0!==i){C++;var o=i.clusteringEdgeReplacingIds;if(void 0===o)e.push(I);else for(var n=0;ne&&(e=I.edges.length),g+=I.edges.length,t+=Math.pow(I.edges.length,2),A+=1}g/=A;var i=(t/=A)-Math.pow(g,2),o=Math.sqrt(i),n=Math.floor(g+2*o);return n>e&&(n=e),n}},{key:"_createClusteredEdge",value:function(g,t,A,e,C){var I=XR.cloneOptions(A,"edge");qf(I,e),I.from=g,I.to=t,I.id="clusterEdge:"+rD(),void 0!==C&&qf(I,C);var i=this.body.functions.createEdge(I);return i.clusteringEdgeReplacingIds=[A.id],i.connect(),this.body.edges[i.id]=i,i}},{key:"_clusterEdges",value:function(g,t,A,e){if(t instanceof ZR){var C=t,I={};I[C.id]=C,t=I}if(g instanceof jN){var i=g,o={};o[i.id]=i,g=o}if(null==A)throw new Error("_clusterEdges: parameter clusterNode required");for(var n in (void 0===e&&(e=A.clusterEdgeProperties), this._createClusterEdges(g,t,A,e), t))if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==this.body.edges[n]){var r=this.body.edges[n];this._backupEdgeOptions(r),r.setOptions({physics:!1})}for(var s in g)Object.prototype.hasOwnProperty.call(g,s)&&(this.clusteredNodes[s]={clusterId:A.id,node:this.body.nodes[s]},this.body.nodes[s].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(g){if(void 0!==g){var t=this.clusteredNodes[g];if(void 0!==t){var A=t.clusterId;if(void 0!==A)return this.body.nodes[A]}}}},{key:"_filter",value:function(g,t){var A=[];return tv(g,(function(g){t(g)&&A.push(g)})),A}},{key:"_updateState",value:function(){var g,t=this,A=[],e={},C=function(g){tv(t.body.nodes,(function(t){!0===t.isCluster&&g(t)}))};for(g in this.clusteredNodes){if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,g))void 0===this.body.nodes[g]&&A.push(g)}C((function(g){for(var t=0;t0}g.endPointsValid()&&C||(e[A]=A)})),C((function(g){tv(e,(function(A){delete g.containedEdges[A],tv(g.edges,(function(C,I){C.id!==A?C.clusteringEdgeReplacingIds=t._filter(C.clusteringEdgeReplacingIds,(function(g){return!e[g]})):g.edges[I]=null})),g.edges=t._filter(g.edges,(function(g){return null!==g}))}))})),tv(e,(function(g){delete t.clusteredEdges[g]})),tv(e,(function(g){delete t.body.edges[g]})),tv(Lh(this.body.edges),(function(g){var A=t.body.edges[g],e=t._isClusteredNode(A.fromId)||t._isClusteredNode(A.toId);if(e!==t._isClusteredEdge(A.id))if(e){var C=t._getClusterNodeForNode(A.fromId);void 0!==C&&t._clusterEdges(t.body.nodes[A.fromId],A,C);var I=t._getClusterNodeForNode(A.toId);void 0!==I&&t._clusterEdges(t.body.nodes[A.toId],A,I)}else delete t._clusterEdges[g],t._restoreEdge(A)}));for(var i=!1,o=!0,n=function(){var g=[];C((function(t){var A=Lh(t.containedNodes).length,e=!0===t.options.allowSingleNodeCluster;(e&&A<1||!e&&A<2)&&g.push(t.id)}));for(var A=0;A0,i=i||o};o;)n();i&&this._updateState()}},{key:"_isClusteredNode",value:function(g){return void 0!==this.clusteredNodes[g]}},{key:"_isClusteredEdge",value:function(g){return void 0!==this.clusteredEdges[g]}}]),g;}();var gP=function(){function g(t,A){var e;cn(this,g),void 0!==window&&(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===e?function(g){g()}:e,this.body=t,this.canvas=A,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},fe(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g,t=this;this.body.emitter.on("dragStart",(function(){t.dragging=!0})),this.body.emitter.on("dragEnd",(function(){t.dragging=!1})),this.body.emitter.on("zoom",(function(){t.zooming=!0,window.clearTimeout(t.zoomTimeoutId),t.zoomTimeoutId=wu((function(){var g;t.zooming=!1,je(g=t._requestRedraw).call(g,t)()}),250)})),this.body.emitter.on("_resizeNodes",(function(){t._resizeNodes()})),this.body.emitter.on("_redraw",(function(){!1===t.renderingActive&&t._redraw()})),this.body.emitter.on("_blockRedraw",(function(){t.allowRedraw=!1})),this.body.emitter.on("_allowRedraw",(function(){t.allowRedraw=!0,t.redrawRequested=!1})),this.body.emitter.on("_requestRedraw",je(g=this._requestRedraw).call(g,this)),this.body.emitter.on("_startRendering",(function(){t.renderRequests+=1,t.renderingActive=!0,t._startRendering()})),this.body.emitter.on("_stopRendering",(function(){t.renderRequests-=1,t.renderingActive=t.renderRequests>0,t.renderTimer=void 0})),this.body.emitter.on("destroy",(function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,!0===t.requiresTimeout?clearTimeout(t.renderTimer):window.cancelAnimationFrame(t.renderTimer),t.body.emitter.off()}))}},{key:"setOptions",value:function(g){if(void 0!==g){Xf(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,g)}}},{key:"_requestNextFrame",value:function(g,t){if("undefined"!=typeof window){var A,e=window;return!0===this.requiresTimeout?A=wu(g,t):e.requestAnimationFrame&&(A=e.requestAnimationFrame(g)),A}}},{key:"_startRendering",value:function(){var g;!0===this.renderingActive&&(void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(je(g=this._renderStep).call(g,this),this.simulationInterval)))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var g=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame((function(){g._redraw(!1)}),0))}},{key:"_redraw",value:function(){var g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t={drawExternalLabels:null};0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();var A=this.canvas.getContext(),e=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(A.clearRect(0,0,e,C),0===this.canvas.frame.clientWidth)return;if(A.save(),A.translate(this.body.view.translation.x,this.body.view.translation.y),A.scale(this.body.view.scale,this.body.view.scale),A.beginPath(),this.body.emitter.emit("beforeDrawing",A),A.closePath(),!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(A),!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag){var I=this._drawNodes(A,g).drawExternalLabels;t.drawExternalLabels=I}!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawArrows(A),null!=t.drawExternalLabels&&t.drawExternalLabels(),!1===g&&this._drawSelectionBox(A),A.beginPath(),this.body.emitter.emit("afterDrawing",A),A.closePath(),A.restore(),!0===g&&A.clearRect(0,0,e,C)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var g=this.canvas.getContext();g.save(),g.translate(this.body.view.translation.x,this.body.view.translation.y),g.scale(this.body.view.scale,this.body.view.scale);var t,A=this.body.nodes;for(var e in A)Object.prototype.hasOwnProperty.call(A,e)&&((t=A[e]).resize(g),t.updateBoundingBox(g,t.selected));g.restore()}},{key:"_drawNodes",value:function(g){for(var t,A,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],C=this.body.nodes,I=this.body.nodeIndices,i=[],o=[],n=this.canvas.DOMtoCanvas({x:-20,y:-20}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),s={top:n.y,left:n.x,bottom:r.y,right:r.x},a=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/g,this.cameraState.previousHeight=this.frame.canvas.height/g,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/g,y:.5*this.frame.canvas.height/g}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var g=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,A=this.cameraState.scale;1!=g&&1!=t?A=.5*this.cameraState.scale*(g+t):1!=g?A=this.cameraState.scale*g:1!=t&&(A=this.cameraState.scale*t),this.body.view.scale=A;var e=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:e.x-this.cameraState.position.x,y:e.y-this.cameraState.position.y};this.body.view.translation.x+=C.x*this.body.view.scale,this.body.view.translation.y+=C.y*this.body.view.scale}}},{key:"_prepareValue",value:function(g){if("number"==typeof g)return g+"px";if("string"==typeof g){if(-1!==Xc(g).call(g,"%")||-1!==Xc(g).call(g,"px"))return g;if(-1===Xc(g).call(g,"%"))return g+"px"}throw new Error("Could not use the value supplied for width or height:"+g)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{var g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(g)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var g=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Ev(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Ev.DIRECTION_ALL}),AP(this.hammer,(function(t){g.body.eventListeners.onTouch(t)})),this.hammer.on("tap",(function(t){g.body.eventListeners.onTap(t)})),this.hammer.on("doubletap",(function(t){g.body.eventListeners.onDoubleTap(t)})),this.hammer.on("press",(function(t){g.body.eventListeners.onHold(t)})),this.hammer.on("panstart",(function(t){g.body.eventListeners.onDragStart(t)})),this.hammer.on("panmove",(function(t){g.body.eventListeners.onDrag(t)})),this.hammer.on("panend",(function(t){g.body.eventListeners.onDragEnd(t)})),this.hammer.on("pinch",(function(t){g.body.eventListeners.onPinch(t)})),this.frame.canvas.addEventListener("wheel",(function(t){g.body.eventListeners.onMouseWheel(t)})),this.frame.canvas.addEventListener("mousemove",(function(t){g.body.eventListeners.onMouseMove(t)})),this.frame.canvas.addEventListener("contextmenu",(function(t){g.body.eventListeners.onContext(t)})),this.hammerFrame=new Ev(this.frame),eP(this.hammerFrame,(function(t){g.body.eventListeners.onRelease(t)}))}},{key:"setSize",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;g=this._prepareValue(g),t=this._prepareValue(t);var A=!1,e=this.frame.canvas.width,C=this.frame.canvas.height,I=this.pixelRatio;if(this._setPixelRatio(),g!=this.options.width||t!=this.options.height||this.frame.style.width!=g||this.frame.style.height!=t)this._getCameraState(I),this.frame.style.width=g,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=g,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},A=!0;else{var i=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),o=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===i&&this.frame.canvas.height===o||this._getCameraState(I),this.frame.canvas.width!==i&&(this.frame.canvas.width=i,A=!0),this.frame.canvas.height!==o&&(this.frame.canvas.height=o,A=!0)}return!0===A&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(e/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,A}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");var t=1;return"undefined"!=typeof window&&(t=window.devicePixelRatio||1),t/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(g){return(g-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(g){return g*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(g){return(g-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(g){return g*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(g){return{x:this._XconvertCanvasToDOM(g.x),y:this._YconvertCanvasToDOM(g.y)}}},{key:"DOMtoCanvas",value:function(g){return{x:this._XconvertDOMtoCanvas(g.x),y:this._YconvertDOMtoCanvas(g.y)}}}]),g}();var IP=function(){function g(t,A){var e,C,I=this;cn(this,g),this.body=t,this.canvas=A,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",je(e=this.fit).call(e,this)),this.body.emitter.on("animationFinished",(function(){I.body.emitter.emit("_stopRendering")})),this.body.emitter.on("unlockNode",je(C=this.releaseNode).call(C,this))}return kd(g,[{key:"setOptions",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=g}},{key:"fit",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g=function(g,t){var A=fe({nodes:t,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},null!=g?g:{});if(!Rh(A.nodes))throw new TypeError("Nodes has to be an array of ids.");if(0===A.nodes.length&&(A.nodes=t),!("number"==typeof A.minZoomLevel&&A.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!("number"==typeof A.maxZoomLevel&&A.minZoomLevel<=A.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return A}(g,this.body.nodeIndices);var A,e,C=this.canvas.frame.canvas.clientWidth,I=this.canvas.frame.canvas.clientHeight;if(0===C||0===I)e=1,A=XR.getRange(this.body.nodes,g.nodes);else if(!0===t){var i=0;for(var o in this.body.nodes){if(Object.prototype.hasOwnProperty.call(this.body.nodes,o))!0===this.body.nodes[o].predefinedPosition&&(i+=1)}if(i>.5*this.body.nodeIndices.length)return void this.fit(g,!1);A=XR.getRange(this.body.nodes,g.nodes),e=12.662/(this.body.nodeIndices.length+7.4147)+.0964822,e*=Math.min(C/600,I/600)}else{this.body.emitter.emit("_resizeNodes"),A=XR.getRange(this.body.nodes,g.nodes);var n=C/(1.1*Math.abs(A.maxX-A.minX)),r=I/(1.1*Math.abs(A.maxY-A.minY));e=n<=r?n:r}e>g.maxZoomLevel?e=g.maxZoomLevel:e1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[g]){var A={x:this.body.nodes[g].x,y:this.body.nodes[g].y};t.position=A,t.lockedOnNode=g,this.moveTo(t)}else console.error("Node: "+g+" cannot be found.")}},{key:"moveTo",value:function(g){if(void 0!==g){if(null!=g.offset){if(null!=g.offset.x){if(g.offset.x=+g.offset.x,!Ym(g.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else g.offset.x=0;if(null!=g.offset.y){if(g.offset.y=+g.offset.y,!Ym(g.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else g.offset.x=0}else g.offset={x:0,y:0};if(null!=g.position){if(null!=g.position.x){if(g.position.x=+g.position.x,!Ym(g.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else g.position.x=0;if(null!=g.position.y){if(g.position.y=+g.position.y,!Ym(g.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else g.position.x=0}else g.position=this.getViewPosition();if(null!=g.scale){if(g.scale=+g.scale,!(g.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else g.scale=this.body.view.scale;void 0===g.animation&&(g.animation={duration:0}),!1===g.animation&&(g.animation={duration:0}),!0===g.animation&&(g.animation={}),void 0===g.animation.duration&&(g.animation.duration=1e3),void 0===g.animation.easingFunction&&(g.animation.easingFunction="easeInOutQuad"),this.animateView(g)}else g={}}},{key:"animateView",value:function(g){if(void 0!==g){this.animationEasingFunction=g.animation.easingFunction,this.releaseNode(),!0===g.locked&&(this.lockedOnNodeId=g.lockedOnNode,this.lockedOnNodeOffset=g.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=g.scale,this.body.view.scale=this.targetScale;var t,A,e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),C=e.x-g.position.x,I=e.y-g.position.y;if(this.targetTranslation={x:this.sourceTranslation.x+C*this.targetScale+g.offset.x,y:this.sourceTranslation.y+I*this.targetScale+g.offset.y},0===g.animation.duration)if(null!=this.lockedOnNodeId)this.viewFunction=je(t=this._lockedRedraw).call(t,this),this.body.emitter.on("initRedraw",this.viewFunction);else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else this.animationSpeed=1/(60*g.animation.duration*.001)||1/60,this.animationEasingFunction=g.animation.easingFunction,this.viewFunction=je(A=this._transitionRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}},{key:"_lockedRedraw",value:function(){var g=this.body.nodes[this.lockedOnNodeId].x,t=this.body.nodes[this.lockedOnNodeId].y,A=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),e=A.x-g,C=A.y-t,I=this.body.view.translation,i={x:I.x+e*this.body.view.scale+this.lockedOnNodeOffset.x,y:I.y+C*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===g?1:this.easingTime;var t=hv[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){var A;if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId)this.viewFunction=je(A=this._lockedRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction);this.body.emitter.emit("animationFinished")}}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),g}();function iP(g){var t,A=g&&g.preventDefault||!1,e=g&&g.container||window,C={},I={keydown:{},keyup:{}},i={};for(t=97;t<=122;t++)i[String.fromCharCode(t)]={code:t-97+65,shift:!1};for(t=65;t<=90;t++)i[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;t<=9;t++)i[""+t]={code:48+t,shift:!1};for(t=1;t<=12;t++)i["F"+t]={code:111+t,shift:!1};for(t=0;t<=9;t++)i["num"+t]={code:96+t,shift:!1};i["num*"]={code:106,shift:!1},i["num+"]={code:107,shift:!1},i["num-"]={code:109,shift:!1},i["num/"]={code:111,shift:!1},i["num."]={code:110,shift:!1},i.left={code:37,shift:!1},i.up={code:38,shift:!1},i.right={code:39,shift:!1},i.down={code:40,shift:!1},i.space={code:32,shift:!1},i.enter={code:13,shift:!1},i.shift={code:16,shift:void 0},i.esc={code:27,shift:!1},i.backspace={code:8,shift:!1},i.tab={code:9,shift:!1},i.ctrl={code:17,shift:!1},i.alt={code:18,shift:!1},i.delete={code:46,shift:!1},i.pageup={code:33,shift:!1},i.pagedown={code:34,shift:!1},i["="]={code:187,shift:!1},i["-"]={code:189,shift:!1},i["]"]={code:221,shift:!1},i["["]={code:219,shift:!1};var o=function(g){r(g,"keydown")},n=function(g){r(g,"keyup")},r=function(g,t){if(void 0!==I[t][g.keyCode]){for(var e=I[t][g.keyCode],C=0;C700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var g in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,g)&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var g=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),A=this.body.view.translation,e=t/g,C=(1-e)*this.canvas.canvasViewCenter.x+A.x*e,I=(1-e)*this.canvas.canvasViewCenter.y+A.y*e;this.body.view.scale=t,this.body.view.translation={x:C,y:I},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var g=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),A=this.body.view.translation,e=t/g,C=(1-e)*this.canvas.canvasViewCenter.x+A.x*e,I=(1-e)*this.canvas.canvasViewCenter.y+A.y*e;this.body.view.scale=t,this.body.view.translation={x:C,y:I},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var g,t,A,e,C,I,i,o,n,r,s,a,d,h,l,c,u,p,f,v,y,m,b,w,k=this;(void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=iP({container:window,preventDefault:!0}):this.keycharm=iP({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(je(g=this.keycharm).call(g,"up",(function(){k.bindToRedraw("_moveUp")}),"keydown"),je(t=this.keycharm).call(t,"down",(function(){k.bindToRedraw("_moveDown")}),"keydown"),je(A=this.keycharm).call(A,"left",(function(){k.bindToRedraw("_moveLeft")}),"keydown"),je(e=this.keycharm).call(e,"right",(function(){k.bindToRedraw("_moveRight")}),"keydown"),je(C=this.keycharm).call(C,"=",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(I=this.keycharm).call(I,"num+",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(i=this.keycharm).call(i,"num-",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(o=this.keycharm).call(o,"-",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(n=this.keycharm).call(n,"[",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(r=this.keycharm).call(r,"]",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(s=this.keycharm).call(s,"pageup",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(a=this.keycharm).call(a,"pagedown",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(d=this.keycharm).call(d,"up",(function(){k.unbindFromRedraw("_moveUp")}),"keyup"),je(h=this.keycharm).call(h,"down",(function(){k.unbindFromRedraw("_moveDown")}),"keyup"),je(l=this.keycharm).call(l,"left",(function(){k.unbindFromRedraw("_moveLeft")}),"keyup"),je(c=this.keycharm).call(c,"right",(function(){k.unbindFromRedraw("_moveRight")}),"keyup"),je(u=this.keycharm).call(u,"=",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(p=this.keycharm).call(p,"num+",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(f=this.keycharm).call(f,"num-",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(v=this.keycharm).call(v,"-",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(y=this.keycharm).call(y,"[",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(m=this.keycharm).call(m,"]",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(b=this.keycharm).call(b,"pageup",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(w=this.keycharm).call(w,"pagedown",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup")))}}]),g}();function nP(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return rP(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rP(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function rP(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A50&&(this.drag.pointer=this.getPointer(g.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(g){var t=this.getPointer(g.center),A=this.selectionHandler.options.multiselect&&(g.changedPointers[0].ctrlKey||g.changedPointers[0].metaKey);this.checkSelectionChanges(t,A),this.selectionHandler.commitAndEmit(t,g),this.selectionHandler.generateClickEvent("click",g,t)}},{key:"onDoubleTap",value:function(g){var t=this.getPointer(g.center);this.selectionHandler.generateClickEvent("doubleClick",g,t)}},{key:"onHold",value:function(g){var t=this.getPointer(g.center),A=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,A),this.selectionHandler.commitAndEmit(t,g),this.selectionHandler.generateClickEvent("click",g,t),this.selectionHandler.generateClickEvent("hold",g,t)}},{key:"onRelease",value:function(g){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(g.center);this.selectionHandler.generateClickEvent("release",g,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(g){var t=this.getPointer({x:g.clientX,y:g.clientY});this.selectionHandler.generateClickEvent("oncontext",g,t)}},{key:"checkSelectionChanges",value:function(g){!0===(arguments.length>1&&void 0!==arguments[1]&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(g):this.selectionHandler.selectOnPoint(g)}},{key:"_determineDifference",value:function(g,t){var A=function(g,t){for(var A=[],e=0;e=C.minX&&A.x<=C.maxX&&A.y>=C.minY&&A.y<=C.maxY}));Cl(I).call(I,(function(g){return t.selectionHandler.selectObject(t.body.nodes[g])}));var i=this.getPointer(g.center);this.selectionHandler.commitAndEmit(i,g),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var o=this.drag.selection;o&&o.length?(Cl(o).call(o,(function(g){g.node.options.fixed.x=g.xFixed,g.node.options.fixed.y=g.yFixed})),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}},{key:"onPinch",value:function(g){var t=this.getPointer(g.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var A=this.pinch.scale*g.scale;this.zoom(A,t)}},{key:"zoom",value:function(g,t){if(!0===this.options.zoomView){var A=this.body.view.scale;g<1e-5&&(g=1e-5),g>10&&(g=10);var e=void 0;void 0!==this.drag&&!0===this.drag.dragging&&(e=this.canvas.DOMtoCanvas(this.drag.pointer));var C=this.body.view.translation,I=g/A,i=(1-I)*t.x+C.x*I,o=(1-I)*t.y+C.y*I;if(this.body.view.scale=g,this.body.view.translation={x:i,y:o},null!=e){var n=this.canvas.canvasToDOM(e);this.drag.pointer.x=n.x,this.drag.pointer.y=n.y}this.body.emitter.emit("_requestRedraw"),A0&&(this.popupObj=r[s[s.length-1]],I=!0)}if(void 0===this.popupObj&&!1===I){for(var d,h=this.body.edgeIndices,l=this.body.edges,c=[],u=0;u0&&(this.popupObj=l[c[c.length-1]],i="edge")}void 0!==this.popupObj?this.popupObj.id!==C&&(void 0===this.popup&&(this.popup=new Ov(this.canvas.frame)),this.popup.popupTargetType=i,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(g.x+3,g.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(g){var t=this.selectionHandler._pointerToPositionObject(g),A=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&!0===(A=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t))){var e=this.selectionHandler.getNodeAt(g);A=void 0!==e&&e.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(g)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(A=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));!1===A&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),g}(),aP=u,dP=pm,hP=zy.getWeakData,lP=qy,cP=AA,uP=Q,pP=gg,fP=Hy,vP=qg,yP=GC.set,mP=GC.getterFor,bP=Sr.find,wP=Sr.findIndex,kP=aP([].splice),xP=0,EP=function(g){return g.frozen||(g.frozen=new OP)},OP=function(){this.entries=[]},TP=function(g,t){return bP(g.entries,(function(g){return g[0]===t}))};OP.prototype={get:function(g){var t=TP(this,g);if(t)return t[1]},has:function(g){return!!TP(this,g)},set:function(g,t){var A=TP(this,g);A?A[1]=t:this.entries.push([g,t])},delete:function(g){var t=wP(this.entries,(function(t){return t[0]===g}));return~t&&kP(this.entries,t,1),!!~t}};var DP,NP={getConstructor:function(g,t,A,e){var C=g((function(g,C){lP(g,I),yP(g,{type:t,id:xP++,frozen:void 0}),uP(C)||fP(C,g[e],{that:g,AS_ENTRIES:A})})),I=C.prototype,i=mP(t),o=function(g,t,A){var e=i(g),C=hP(cP(t),!0);return!0===C?EP(e).set(t,A):C[e.id]=A,g};return dP(I,{delete:function(g){var t=i(this);if(!pP(g))return!1;var A=hP(g);return!0===A?EP(t).delete(g):A&&vP(A,t.id)&&delete A[t.id]},has:function(g){var t=i(this);if(!pP(g))return!1;var A=hP(g);return!0===A?EP(t).has(g):A&&vP(A,t.id)}}),dP(I,A?{get:function(g){var t=i(this);if(pP(g)){var A=hP(g);return!0===A?EP(t).get(g):A?A[t.id]:void 0}},set:function(g,t){return o(this,g,t)}}:{add:function(g){return o(this,g,!0)}}),C}},RP=vy,PP=C,MP=u,BP=pm,zP=zy,SP=cm,ZP=NP,FP=gg,GP=GC.enforce,jP=I,LP=bC,VP=Object,YP=Array.isArray,WP=VP.isExtensible,QP=VP.isFrozen,UP=VP.isSealed,_P=VP.freeze,KP=VP.seal,HP={},XP={},JP=!PP.ActiveXObject&&"ActiveXObject"in PP,qP=function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}},$P=SP("WeakMap",qP,ZP),gM=$P.prototype,tM=MP(gM.set);if(LP)if(JP){DP=ZP.getConstructor(qP,"WeakMap",!0),zP.enable();var AM=MP(gM.delete),eM=MP(gM.has),CM=MP(gM.get);BP(gM,{delete:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),AM(this,g)||t.frozen.delete(g)}return AM(this,g)},has:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),eM(this,g)||t.frozen.has(g)}return eM(this,g)},get:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),eM(this,g)?CM(this,g):t.frozen.get(g)}return CM(this,g)},set:function(g,t){if(FP(g)&&!WP(g)){var A=GP(this);A.frozen||(A.frozen=new DP),eM(this,g)?tM(this,g,t):A.frozen.set(g,t)}else tM(this,g,t);return this}})}else RP&&jP((function(){var g=_P([]);return tM(new $P,g,1),!QP(g)}))&&BP(gM,{set:function(g,t){var A;return YP(g)&&(QP(g)?A=HP:UP(g)&&(A=XP)),tM(this,g,t),A===HP&&_P(g),A===XP&&KP(g),this}});var IM,iM,oM,nM,rM,sM=A(tg.WeakMap);function aM(g,t,A,e){if("a"===A&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?g!==t||!e:!t.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===A?e:"a"===A?e.call(g):e?e.value:t.get(g)}function dM(g,t,A,e,C){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!C)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?g!==t||!C:!t.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?C.call(g,A):C?C.value=A:t.set(g,A),A}function hM(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return lM(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return lM(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function lM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&void 0!==arguments[0]?arguments[0]:function(){};cn(this,g),oM.set(this,new uM),nM.set(this,new uM),rM.set(this,void 0),dM(this,rM,t,"f")}return kd(g,[{key:"sizeNodes",get:function(){return aM(this,oM,"f").size}},{key:"sizeEdges",get:function(){return aM(this,nM,"f").size}},{key:"getNodes",value:function(){return aM(this,oM,"f").getSelection()}},{key:"getEdges",value:function(){return aM(this,nM,"f").getSelection()}},{key:"addNodes",value:function(){var g;(g=aM(this,oM,"f")).add.apply(g,arguments)}},{key:"addEdges",value:function(){var g;(g=aM(this,nM,"f")).add.apply(g,arguments)}},{key:"deleteNodes",value:function(g){aM(this,oM,"f").delete(g)}},{key:"deleteEdges",value:function(g){aM(this,nM,"f").delete(g)}},{key:"clear",value:function(){aM(this,oM,"f").clear(),aM(this,nM,"f").clear()}},{key:"commit",value:function(){for(var g,t,A={nodes:aM(this,oM,"f").commit(),edges:aM(this,nM,"f").commit()},e=arguments.length,C=new Array(e),I=0;I=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function vM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A4&&void 0!==arguments[4]&&arguments[4],I=this._initBaseEvent(t,A);if(!0===C)I.nodes=[],I.edges=[];else{var i=this.getSelection();I.nodes=i.nodes,I.edges=i.edges}void 0!==e&&(I.previousSelection=e),"click"==g&&(I.items=this.getClickedItems(A)),void 0!==t.controlEdge&&(I.controlEdge=t.controlEdge),this.body.emitter.emit(g,I)}},{key:"selectObject",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;if(void 0!==g){if(g instanceof jN){var A;if(!0===t)(A=this._selectionAccumulator).addEdges.apply(A,ch(g.edges));this._selectionAccumulator.addNodes(g)}else this._selectionAccumulator.addEdges(g);return!0}return!1}},{key:"deselectObject",value:function(g){!0===g.isSelected()&&(g.selected=!1,this._removeFromSelection(g))}},{key:"_getAllNodesOverlappingWith",value:function(g){for(var t=[],A=this.body.nodes,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this._pointerToPositionObject(g),e=this._getAllNodesOverlappingWith(A);return e.length>0?!0===t?this.body.nodes[e[e.length-1]]:e[e.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(g,t){for(var A=this.body.edges,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this.canvas.DOMtoCanvas(g),e=10,C=null,I=this.body.edges,i=0;i0&&(this.generateClickEvent("deselectEdge",t,g,C),A=!0),e.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,g,C),A=!0),e.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,g),A=!0),e.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,g),A=!0),!0===A&&this.generateClickEvent("select",t,g)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var g;return Fh(g=this._selectionAccumulator.getNodes()).call(g,(function(g){return g.id}))}},{key:"getSelectedEdgeIds",value:function(){var g;return Fh(g=this._selectionAccumulator.getEdges()).call(g,(function(g){return g.id}))}},{key:"setSelection",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!g||!g.nodes&&!g.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),g.nodes){var A,e=fM(g.nodes);try{for(e.s();!(A=e.n()).done;){var C=A.value,I=this.body.nodes[C];if(!I)throw new RangeError('Node with id "'+C+'" not found');this.selectObject(I,t.highlightEdges)}}catch(g){e.e(g)}finally{e.f()}}if(g.edges){var i,o=fM(g.edges);try{for(o.s();!(i=o.n()).done;){var n=i.value,r=this.body.edges[n];if(!r)throw new RangeError('Edge with id "'+n+'" not found');this.selectObject(r)}}catch(g){o.e(g)}finally{o.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({nodes:g},{highlightEdges:t})}},{key:"selectEdges",value:function(g){if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({edges:g})}},{key:"updateSelection",value:function(){for(var g in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,g.id)||this._selectionAccumulator.deleteNodes(g);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:"getClickedItems",value:function(g){for(var t=this.canvas.DOMtoCanvas(g),A=[],e=this.body.nodeIndices,C=this.body.nodes,I=e.length-1;I>=0;I--){var i=C[e[I]].getItemsOnPoint(t);A.push.apply(A,i)}for(var o=this.body.edgeIndices,n=this.body.edges,r=o.length-1;r>=0;r--){var s=n[o[r]].getItemsOnPoint(t);A.push.apply(A,s)}return A}}]),g}();function mM(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var bM=function(){function g(){cn(this,g)}return kd(g,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(g){return this.fake_use(g),this.abstract()}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(g,t,A),this.abstract()}},{key:"getTreeSize",value:function(g){return this.fake_use(g),this.abstract()}},{key:"sort",value:function(g){this.fake_use(g),this.abstract()}},{key:"fix",value:function(g,t){this.fake_use(g,t),this.abstract()}},{key:"shift",value:function(g,t){this.fake_use(g,t),this.abstract()}}]),g}(),wM=function(g){Cb(A,g);var t=mM(A);function A(g){var e;return cn(this,A),(e=t.call(this)).layout=g,e}return kd(A,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(g){return g.x}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.x=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_x,max:t.max_x}}},{key:"sort",value:function(g){WO(g).call(g,(function(g,t){return g.x-t.x}))}},{key:"fix",value:function(g,t){g.y=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.y=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].x+=t}}]),A}(bM),kM=function(g){Cb(A,g);var t=mM(A);function A(g){var e;return cn(this,A),(e=t.call(this)).layout=g,e}return kd(A,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(g){return g.y}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.y=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_y,max:t.max_y}}},{key:"sort",value:function(g){WO(g).call(g,(function(g,t){return g.y-t.y}))}},{key:"fix",value:function(g,t){g.x=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.x=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].y+=t}}]),A}(bM),xM=Sr.every;TA({target:"Array",proto:!0,forced:!_h("every")},{every:function(g){return xM(this,g,arguments.length>1?arguments[1]:void 0)}});var EM=Me("Array").every,OM=og,TM=EM,DM=Array.prototype,NM=function(g){var t=g.every;return g===DM||OM(DM,g)&&t===DM.every?TM:t},RM=A(NM);function PM(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return MM(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MM(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function MM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A=t[e])&&(t[e]=t[A]+1)})),t}function zM(g,t,A,e){var C,I,i=$c(null),o=LE(C=ch(nT(e).call(e))).call(C,(function(g,t){return g+1+t.edges.length}),0),n=A+"Id",r="to"===A?1:-1,s=PM(e);try{var a,d=function(){var C=lh(I.value,2),s=C[0],a=C[1];if(!e.has(s)||!g(a))return 0;i[s]=0;for(var d,h,l=[a],c=0,u=function(){var g,C;if(!e.has(s))return 0;var I=i[d.id]+r;if(Cl(g=pc(C=d.edges).call(C,(function(g){return g.connected&&g.to!==g.from&&g[A]!==d&&e.has(g.toId)&&e.has(g.fromId)}))).call(g,(function(g){var e=g[n],C=i[e];(null==C||t(I,C))&&(i[e]=I,l.push(g[A]))})),c>o)return{v:{v:BM(e,i)}};++c};d=l.pop();)if(0!==(h=u())&&h)return h.v};for(s.s();!(I=s.n()).done;)if(0!==(a=d())&&a)return a.v}catch(g){s.e(g)}finally{s.f()}return i}var SM=function(){function g(){cn(this,g),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return kd(g,[{key:"addRelation",value:function(g,t){void 0===this.childrenReference[g]&&(this.childrenReference[g]=[]),this.childrenReference[g].push(t),void 0===this.parentReference[t]&&(this.parentReference[t]=[]),this.parentReference[t].push(g)}},{key:"checkIfTree",value:function(){for(var g in this.parentReference)if(this.parentReference[g].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(g,t){void 0!==t&&void 0===this.trees[g.id]&&(this.trees[g.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(g){void 0===this.levels[g]&&(this.levels[g]=0)}},{key:"getMaxLevel",value:function(g){var t=this,A={};return function g(e){if(void 0!==A[e])return A[e];var C=t.levels[e];if(t.childrenReference[e]){var I=t.childrenReference[e];if(I.length>0)for(var i=0;i0&&(A.levelSeparation*=-1):A.levelSeparation<0&&(A.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===e)return this.body.emitter.emit("refresh"),qf(t,this.optionsBackup)}return t}},{key:"_resetRNG",value:function(g){this.initialRandomSeed=g,this._rng=Ff(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(g){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;void 0===g.physics||!0===g.physics?(g.physics={enabled:void 0===t.enabled||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=void 0===t.enabled||t.enabled,t.solver=t.solver||"barnesHut"):"object"===yd(g.physics)?(t.enabled=void 0===g.physics.enabled||g.physics.enabled,t.solver=g.physics.solver||"barnesHut",g.physics.solver="hierarchicalRepulsion"):!1!==g.physics&&(t.solver="barnesHut",g.physics={solver:"hierarchicalRepulsion"});var A=this.direction.curveType();if(void 0===g.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges={smooth:!1};else if(void 0===g.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges.smooth=!1;else if("boolean"==typeof g.edges.smooth)this.optionsBackup.edges={smooth:g.edges.smooth},g.edges.smooth={enabled:g.edges.smooth,type:A};else{var e=g.edges.smooth;void 0!==e.type&&"dynamic"!==e.type&&(A=e.type),this.optionsBackup.edges={smooth:{enabled:void 0===e.enabled||e.enabled,type:void 0===e.type?"dynamic":e.type,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}},g.edges.smooth={enabled:void 0===e.enabled||e.enabled,type:A,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",A)}return g}},{key:"positionInitially",value:function(g){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);for(var t=g.length+50,A=0;AC){for(var i=g.length;g.length>C&&e<=10;){e+=1;var o=g.length;if(e%3==0?this.body.modules.clustering.clusterBridges(I):this.body.modules.clustering.clusterOutliers(I),o==g.length&&e%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*i)})}e>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(g,this.body.edgeIndices,!0),this._shiftToCenter();for(var n=0;n0){var g,t,A=!1,e=!1;for(t in (this.lastNodeOnLevel={}, this.hierarchical=new SM, this.body.nodes))Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(void 0!==(g=this.body.nodes[t]).options.level?(A=!0,this.hierarchical.levels[t]=g.options.level):e=!0);if(!0===e&&!0===A)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(!0===e){var C=this.options.hierarchical.sortMethod;"hubsize"===C?this._determineLevelsByHubsize():"directed"===C?this._determineLevelsDirected():"custom"===C&&this._determineLevelsCustomCallback()}for(var I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&this.hierarchical.ensureLevel(I);var i=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(i),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var g=this,t=!1,A={},e=function(t,A){var e=g.hierarchical.trees;for(var C in e)Object.prototype.hasOwnProperty.call(e,C)&&e[C]===t&&g.direction.shift(C,A)},C=function(){for(var t=[],A=0;A0)for(var I=0;I1&&void 0!==arguments[1]?arguments[1]:1e9,e=1e9,C=1e9,I=1e9,i=-1e9;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var n=g.body.nodes[o],r=g.hierarchical.levels[n.id],s=g.direction.getPosition(n),a=lh(g._getSpaceAroundNode(n,t),2),d=a[0],h=a[1];e=Math.min(d,e),C=Math.min(h,C),r<=A&&(I=Math.min(s,I),i=Math.max(s,i))}return[I,i,e,C]},o=function(t,A,e){for(var C=g.hierarchical,I=0;I1)for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],o=g.direction.getPosition(A),n=g.direction.getPosition(e),r=Math.abs(n-o),s=g.options.hierarchical.nodeSpacing;if(r>s){var a={},d={};I(A,a),I(e,d);var h=function(t,A){var e=g.hierarchical.getMaxLevel(t.id),C=g.hierarchical.getMaxLevel(A.id);return Math.min(e,C)}(A,e),l=i(a,h),c=i(d,h),u=l[1],p=c[0],f=c[2];if(Math.abs(u-p)>s){var v=u-p+s;v<-f+s&&(v=-f+s),v<0&&(g._shiftBlock(e.id,v),t=!0,!0===C&&g._centerParent(e))}}},r=function(e,C){for(var o=C.id,n=C.edges,r=g.hierarchical.levels[C.id],s=g.options.hierarchical.levelSeparation*g.options.hierarchical.levelSeparation,a={},d=[],h=0;h0?h=Math.min(d,a-g.options.hierarchical.nodeSpacing):d<0&&(h=-Math.min(-d,s-g.options.hierarchical.nodeSpacing)),0!=h&&(g._shiftBlock(C.id,h),t=!0)}(v),function(A){var e=g.direction.getPosition(C),I=lh(g._getSpaceAroundNode(C),2),i=I[0],o=I[1],n=A-e,r=e;n>0?r=Math.min(e+(o-g.options.hierarchical.nodeSpacing),A):n<0&&(r=Math.max(e-(i-g.options.hierarchical.nodeSpacing),A)),r!==e&&(g.direction.setPosition(C,r),t=!0)}(v=f(e,n))};!0===this.options.hierarchical.blockShifting&&(function(A){var e=g.hierarchical.getLevels();e=cl(e).call(e);for(var C=0;C0&&Math.abs(a)0&&(n=this.direction.getPosition(e[I-1])+o),this.direction.setPosition(i,n,t),this._validatePositionAndContinue(i,t,n),C++}}}}},{key:"_placeBranchNodes",value:function(g,t){var A,e=this.hierarchical.childrenReference[g];if(void 0!==e){for(var C=[],I=0;It&&void 0===this.positionedNodes[o.id]))return;var r=this.options.hierarchical.nodeSpacing,s=void 0;s=0===i?this.direction.getPosition(this.body.nodes[g]):this.direction.getPosition(C[i-1])+r,this.direction.setPosition(o,s,n),this._validatePositionAndContinue(o,n,s)}var a=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[g],a,t)}}},{key:"_validatePositionAndContinue",value:function(g,t,A){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[t]){var e=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(A-eg}),"from",g)}(A),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var g=this;this._crawlNetwork((function(t,A){g.hierarchical.levels[A.id]>g.hierarchical.levels[t.id]&&g.hierarchical.addRelation(t.id,A.id)})),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},A=arguments.length>1?arguments[1]:void 0,e={},C=function A(C,I){if(void 0===e[C.id]){var i;g.hierarchical.setTreeIndex(C,I),e[C.id]=!0;for(var o=g._getActiveEdges(C),n=0;n=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function GM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&!1!==this.options.deleteNode||0===A&&!1!==this.options.deleteEdge)&&(!0===i&&this._createSeperator(4),this._createDeleteButton(I)),this._bindElementEvents(this.closeDiv,je(g=this.toggleEditMode).call(g,this)),this._temporaryBindEvent("select",je(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var g;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var t,A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,je(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",je(g=this._performAddNode).call(g,this))}},{key:"editNode",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==t.isCluster){var A=qf({},t.options,!1);if(A.x=t.x,A.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(A,(function(t){null!=t&&"editNode"===g.inMode&&g.body.data.nodes.getDataSet().update(t),g.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var g,t,A,e,C;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var I,i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,je(I=this.toggleEditMode).call(I,this))}this._temporaryBindUI("onTouch",je(g=this._handleConnect).call(g,this)),this._temporaryBindUI("onDragEnd",je(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",je(A=this._dragControlNode).call(A,this)),this._temporaryBindUI("onRelease",je(e=this._finishConnect).call(e,this)),this._temporaryBindUI("onDragStart",je(C=this._dragStartEdge).call(C,this)),this._temporaryBindUI("onHold",(function(){}))}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"!==yd(this.options.editEdge)||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var g,t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,je(g=this.toggleEditMode).call(g,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var A,e,C,I,i=this.body.edges[this.edgeBeingEditedId],o=this._getNewTargetNode(i.from.x,i.from.y),n=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(o.id),this.temporaryIds.nodes.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this._temporaryBindUI("onTouch",je(A=this._controlNodeTouch).call(A,this)),this._temporaryBindUI("onTap",(function(){})),this._temporaryBindUI("onHold",(function(){})),this._temporaryBindUI("onDragStart",je(e=this._controlNodeDragStart).call(e,this)),this._temporaryBindUI("onDrag",je(C=this._controlNodeDrag).call(C,this)),this._temporaryBindUI("onDragEnd",je(I=this._controlNodeDragEnd).call(I,this)),this._temporaryBindUI("onMouseMove",(function(){})),this._temporaryBindEvent("beforeDrawing",(function(g){var t=i.edgeType.findBorderPositions(g);!1===o.selected&&(o.x=t.from.x,o.y=t.from.y),!1===n.selected&&(n.x=t.to.x,n.y=t.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{var r=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(r.from.id,r.to.id)}}},{key:"deleteSelected",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodeIds(),A=this.selectionHandler.getSelectedEdgeIds(),e=void 0;if(t.length>0){for(var C=0;C0&&"function"==typeof this.options.deleteEdge&&(e=this.options.deleteEdge);if("function"==typeof e){var I={nodes:t,edges:A};if(2!==e.length)throw new Error("The function for delete does not support two arguments (data, callback)");e(I,(function(t){null!=t&&"delete"===g.inMode?(g.body.data.edges.getDataSet().remove(t.edges),g.body.data.nodes.getDataSet().remove(t.nodes),g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar()):(g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(A),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){var g,t;(void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv)&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",null!==(g=null===(t=this.options.locales[this.options.locale])||void 0===t?void 0:t.close)&&void 0!==g?g:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(g,t){var A=qf({},this.options.controlNodeStyle);A.id="targetNode"+rD(),A.hidden=!1,A.physics=!1,A.x=g,A.y=t;var e=this.body.functions.createNode(A);return e.shape.boundingBox={left:g,right:g,top:t,bottom:t},e}},{key:"_createEditButton",value:function(){var g;this._clean(),this.manipulationDOM={},Qf(this.editModeDiv);var t=this.options.locales[this.options.locale],A=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(A),this._bindElementEvents(A,je(g=this.toggleEditMode).call(g,this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(Qf(this.editModeDiv),Qf(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var g,t,A=FM(Zl(g=this._domEventListenerCleanupQueue).call(g,0));try{for(A.s();!(t=A.n()).done;){(0,t.value)()}}catch(g){A.e(g)}finally{A.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Qf(this.manipulationDiv),Qf(this.editModeDiv),Qf(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+g]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+g].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+g])}},{key:"_createAddNodeButton",value:function(g){var t,A=this._createButton("addNode","vis-add",g.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.addNodeMode).call(t,this))}},{key:"_createAddEdgeButton",value:function(g){var t,A=this._createButton("addEdge","vis-connect",g.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.addEdgeMode).call(t,this))}},{key:"_createEditNodeButton",value:function(g){var t,A=this._createButton("editNode","vis-edit",g.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.editNode).call(t,this))}},{key:"_createEditEdgeButton",value:function(g){var t,A=this._createButton("editEdge","vis-edit",g.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.editEdgeMode).call(t,this))}},{key:"_createDeleteButton",value:function(g){var t,A;A=this.options.rtl?"vis-delete-rtl":"vis-delete";var e=this._createButton("delete",A,g.del||this.options.locales.en.del);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,je(t=this.deleteSelected).call(t,this))}},{key:"_createBackButton",value:function(g){var t,A=this._createButton("back","vis-back",g.back||this.options.locales.en.back);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.showManipulatorToolbar).call(t,this))}},{key:"_createButton",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[g+"Div"]=document.createElement("button"),this.manipulationDOM[g+"Div"].className="vis-button "+t,this.manipulationDOM[g+"Label"]=document.createElement("div"),this.manipulationDOM[g+"Label"].className=e,this.manipulationDOM[g+"Label"].innerText=A,this.manipulationDOM[g+"Div"].appendChild(this.manipulationDOM[g+"Label"]),this.manipulationDOM[g+"Div"]}},{key:"_createDescription",value:function(g){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=g,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(g,t){this.temporaryEventFunctions.push({event:g,boundFunction:t}),this.body.emitter.on(g,t)}},{key:"_temporaryBindUI",value:function(g,t){if(void 0===this.body.eventListeners[g])throw new Error("This UI function does not exist. Typo? You tried: "+g+" possible are: "+eu(Lh(this.body.eventListeners)));this.temporaryUIFunctions[g]=this.body.eventListeners[g],this.body.eventListeners[g]=t}},{key:"_unbindTemporaryUIs",value:function(){for(var g in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,g)&&(this.body.eventListeners[g]=this.temporaryUIFunctions[g],delete this.temporaryUIFunctions[g]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var g=0;g=0;i--)if(C[i]!==this.selectedControlNode.id){I=this.body.nodes[C[i]];break}if(void 0!==I&&void 0!==this.selectedControlNode)if(!0===I.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===o.id?this._performEditEdge(I.id,e.to.id):this._performEditEdge(e.from.id,I.id)}else e.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(g){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=fe({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,A=this.selectionHandler.getNodeAt(t);if(void 0!==A)if(!0===A.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var e=this._getNewTargetNode(A.x,A.y);this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id);var C=this.body.functions.createEdge({id:"connectionEdge"+rD(),from:A.id,to:e.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(e.id),this.temporaryIds.edges.push(C.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===Xc(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}if(g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",g,t),void 0!==this.temporaryIds.nodes[0]){var n=this.body.nodes[this.temporaryIds.nodes[0]];n.x=this.canvas._XconvertDOMtoCanvas(t.x),n.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(g)}},{key:"_finishConnect",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===Xc(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}this._cleanupTemporaryNodesAndEdges(),void 0!==I&&(!0===I.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[e]&&void 0!==this.body.nodes[I.id]&&this._performAddEdge(e,I.id)),g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",g,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(g){var t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",g,t,void 0,!0)}},{key:"_performAddNode",value:function(g){var t=this,A={id:rD(),x:g.pointer.canvas.x,y:g.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw (this.showManipulatorToolbar(), new Error("The function for add does not support two arguments (data,callback)"));this.options.addNode(A,(function(g){null!=g&&"addNode"===t.inMode&&t.body.data.nodes.getDataSet().add(g),t.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(A),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(g,t){var A=this,e={from:g,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(e,(function(g){null!=g&&"addEdge"===A.inMode&&(A.body.data.edges.getDataSet().add(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(g,t){var A=this,e={id:this.edgeBeingEditedId,from:g,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},C=this.options.editEdge;if("object"===yd(C)&&(C=C.editWithoutDrag),"function"==typeof C){if(2!==C.length)throw new Error("The function for edit does not support two arguments (data, callback)");C(e,(function(g){null==g||"editEdge"!==A.inMode?(A.body.edges[e.id].updateEdgeType(),A.body.emitter.emit("_redraw"),A.showManipulatorToolbar()):(A.body.data.edges.getDataSet().update(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),g;}(),LM="string",VM="boolean",YM="number",WM="array",QM="object",UM=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],_M={borderWidth:{number:YM},borderWidthSelected:{number:YM,undefined:"undefined"},brokenImage:{string:LM,undefined:"undefined"},chosen:{label:{boolean:VM,function:"function"},node:{boolean:VM,function:"function"},__type__:{object:QM,boolean:VM}},color:{border:{string:LM},background:{string:LM},highlight:{border:{string:LM},background:{string:LM},__type__:{object:QM,string:LM}},hover:{border:{string:LM},background:{string:LM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},opacity:{number:YM,undefined:"undefined"},fixed:{x:{boolean:VM},y:{boolean:VM},__type__:{object:QM,boolean:VM}},font:{align:{string:LM},color:{string:LM},size:{number:YM},face:{string:LM},background:{string:LM},strokeWidth:{number:YM},strokeColor:{string:LM},vadjust:{number:YM},multi:{boolean:VM,string:LM},bold:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},boldital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},ital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},mono:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},group:{string:LM,number:YM,undefined:"undefined"},heightConstraint:{minimum:{number:YM},valign:{string:LM},__type__:{object:QM,boolean:VM,number:YM}},hidden:{boolean:VM},icon:{face:{string:LM},code:{string:LM},size:{number:YM},color:{string:LM},weight:{string:LM,number:YM},__type__:{object:QM}},id:{string:LM,number:YM},image:{selected:{string:LM,undefined:"undefined"},unselected:{string:LM,undefined:"undefined"},__type__:{object:QM,string:LM}},imagePadding:{top:{number:YM},right:{number:YM},bottom:{number:YM},left:{number:YM},__type__:{object:QM,number:YM}},label:{string:LM,undefined:"undefined"},labelHighlightBold:{boolean:VM},level:{number:YM,undefined:"undefined"},margin:{top:{number:YM},right:{number:YM},bottom:{number:YM},left:{number:YM},__type__:{object:QM,number:YM}},mass:{number:YM},physics:{boolean:VM},scaling:{min:{number:YM},max:{number:YM},label:{enabled:{boolean:VM},min:{number:YM},max:{number:YM},maxVisible:{number:YM},drawThreshold:{number:YM},__type__:{object:QM,boolean:VM}},customScalingFunction:{function:"function"},__type__:{object:QM}},shadow:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},x:{number:YM},y:{number:YM},__type__:{object:QM,boolean:VM}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:VM,array:WM},borderRadius:{number:YM},interpolation:{boolean:VM},useImageSize:{boolean:VM},useBorderWithImage:{boolean:VM},coordinateOrigin:{string:["center","top-left"]},__type__:{object:QM}},size:{number:YM},title:{string:LM,dom:"dom",undefined:"undefined"},value:{number:YM,undefined:"undefined"},widthConstraint:{minimum:{number:YM},maximum:{number:YM},__type__:{object:QM,boolean:VM,number:YM}},x:{number:YM},y:{number:YM},__type__:{object:QM}},KM={configure:{enabled:{boolean:VM},filter:{boolean:VM,string:LM,array:WM,function:"function"},container:{dom:"dom"},showButton:{boolean:VM},__type__:{object:QM,boolean:VM,string:LM,array:WM,function:"function"}},edges:{arrows:{to:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageHeight:{number:YM},imageWidth:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},middle:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageWidth:{number:YM},imageHeight:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},from:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageWidth:{number:YM},imageHeight:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},__type__:{string:["from","to","middle"],object:QM}},endPointOffset:{from:{number:YM},to:{number:YM},__type__:{object:QM,number:YM}},arrowStrikethrough:{boolean:VM},background:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},dashes:{boolean:VM,array:WM},__type__:{object:QM,boolean:VM}},chosen:{label:{boolean:VM,function:"function"},edge:{boolean:VM,function:"function"},__type__:{object:QM,boolean:VM}},color:{color:{string:LM},highlight:{string:LM},hover:{string:LM},inherit:{string:["from","to","both"],boolean:VM},opacity:{number:YM},__type__:{object:QM,string:LM}},dashes:{boolean:VM,array:WM},font:{color:{string:LM},size:{number:YM},face:{string:LM},background:{string:LM},strokeWidth:{number:YM},strokeColor:{string:LM},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:YM},multi:{boolean:VM,string:LM},bold:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},boldital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},ital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},mono:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},hidden:{boolean:VM},hoverWidth:{function:"function",number:YM},label:{string:LM,undefined:"undefined"},labelHighlightBold:{boolean:VM},length:{number:YM,undefined:"undefined"},physics:{boolean:VM},scaling:{min:{number:YM},max:{number:YM},label:{enabled:{boolean:VM},min:{number:YM},max:{number:YM},maxVisible:{number:YM},drawThreshold:{number:YM},__type__:{object:QM,boolean:VM}},customScalingFunction:{function:"function"},__type__:{object:QM}},selectionWidth:{function:"function",number:YM},selfReferenceSize:{number:YM},selfReference:{size:{number:YM},angle:{number:YM},renderBehindTheNode:{boolean:VM},__type__:{object:QM}},shadow:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},x:{number:YM},y:{number:YM},__type__:{object:QM,boolean:VM}},smooth:{enabled:{boolean:VM},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:YM},forceDirection:{string:["horizontal","vertical","none"],boolean:VM},__type__:{object:QM,boolean:VM}},title:{string:LM,undefined:"undefined"},width:{number:YM},widthConstraint:{maximum:{number:YM},__type__:{object:QM,boolean:VM,number:YM}},value:{number:YM,undefined:"undefined"},__type__:{object:QM}},groups:{useDefaultGroups:{boolean:VM},__any__:_M,__type__:{object:QM}},interaction:{dragNodes:{boolean:VM},dragView:{boolean:VM},hideEdgesOnDrag:{boolean:VM},hideEdgesOnZoom:{boolean:VM},hideNodesOnDrag:{boolean:VM},hover:{boolean:VM},keyboard:{enabled:{boolean:VM},speed:{x:{number:YM},y:{number:YM},zoom:{number:YM},__type__:{object:QM}},bindToWindow:{boolean:VM},autoFocus:{boolean:VM},__type__:{object:QM,boolean:VM}},multiselect:{boolean:VM},navigationButtons:{boolean:VM},selectable:{boolean:VM},selectConnectedEdges:{boolean:VM},hoverConnectedEdges:{boolean:VM},tooltipDelay:{number:YM},zoomView:{boolean:VM},zoomSpeed:{number:YM},__type__:{object:QM}},layout:{randomSeed:{undefined:"undefined",number:YM,string:LM},improvedLayout:{boolean:VM},clusterThreshold:{number:YM},hierarchical:{enabled:{boolean:VM},levelSeparation:{number:YM},nodeSpacing:{number:YM},treeSpacing:{number:YM},blockShifting:{boolean:VM},edgeMinimization:{boolean:VM},parentCentralization:{boolean:VM},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:QM,boolean:VM}},__type__:{object:QM}},manipulation:{enabled:{boolean:VM},initiallyActive:{boolean:VM},addNode:{boolean:VM,function:"function"},addEdge:{boolean:VM,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:QM,boolean:VM,function:"function"}},deleteNode:{boolean:VM,function:"function"},deleteEdge:{boolean:VM,function:"function"},controlNodeStyle:_M,__type__:{object:QM,boolean:VM}},nodes:_M,physics:{enabled:{boolean:VM},barnesHut:{theta:{number:YM},gravitationalConstant:{number:YM},centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},forceAtlas2Based:{theta:{number:YM},gravitationalConstant:{number:YM},centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},repulsion:{centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},nodeDistance:{number:YM},damping:{number:YM},__type__:{object:QM}},hierarchicalRepulsion:{centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},nodeDistance:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},maxVelocity:{number:YM},minVelocity:{number:YM},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:VM},iterations:{number:YM},updateInterval:{number:YM},onlyDynamicEdges:{boolean:VM},fit:{boolean:VM},__type__:{object:QM,boolean:VM}},timestep:{number:YM},adaptiveTimestep:{boolean:VM},wind:{x:{number:YM},y:{number:YM},__type__:{object:QM}},__type__:{object:QM,boolean:VM}},autoResize:{boolean:VM},clickToUse:{boolean:VM},locale:{string:LM},locales:{__any__:{any:"any"},__type__:{object:QM}},height:{string:LM},width:{string:LM},__type__:{object:QM}},HM={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},XM=function(g,t,A){var e;return!(!Ic(g).call(g,"physics")||!Ic(e=HM.physics.solver).call(e,t)||A.physics.solver===t||"wind"===t)},JM=Object.freeze({__proto__:null,allOptions:KM,configuratorHideOption:XM,configureOptions:HM}),qM=function(){function g(){cn(this,g)}return kd(g,[{key:"getDistances",value:function(g,t,A){for(var e={},C=g.edges,I=0;I2&&void 0!==arguments[2]&&arguments[2],e=this.distanceSolver.getDistances(this.body,g,t);this._createL_matrix(e),this._createK_matrix(e),this._createE_matrix();for(var C=0,I=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),i=1e9,o=0,n=0,r=0,s=0,a=0;i>.01&&C1&&a<5;){a+=1,this._moveNode(o,n,r);var h=lh(this._getEnergy(o),3);s=h[0],n=h[1],r=h[2]}}}},{key:"_getHighestEnergyNode",value:function(g){for(var t=this.body.nodeIndices,A=this.body.nodes,e=0,C=t[0],I=0,i=0,o=0;o