From e6989fc570d307841117fa87a3687f45298c4386 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Mon, 25 Nov 2024 00:28:32 -0500 Subject: [PATCH] Use NGL .2.1.1 for nbclassic and VSCode (#1134) --- nglview/static/index.js | 3093 ++++++++++++++++++++++------------- nglview/static/index.js.map | 2 +- 2 files changed, 1913 insertions(+), 1182 deletions(-) diff --git a/nglview/static/index.js b/nglview/static/index.js index fd4a2ce5..4f7615f6 100644 --- a/nglview/static/index.js +++ b/nglview/static/index.js @@ -60,11 +60,138 @@ define(["@jupyter-widgets/base"], function(__WEBPACK_EXTERNAL_MODULE_22__) { ret /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 109); +/******/ return __webpack_require__(__webpack_require__.s = 108); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; }); +// Current version. +var VERSION = '1.13.7'; + +// Establish the root object, `window` (`self`) in the browser, `global` +// on the server, or `this` in some virtual machines. We use `self` +// instead of `window` for `WebWorker` support. +var root = (typeof self == 'object' && self.self === self && self) || + (typeof global == 'object' && global.global === global && global) || + Function('return this')() || + {}; + +// Save bytes in the minified (but not gzipped) version: +var ArrayProto = Array.prototype, ObjProto = Object.prototype; +var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; + +// Create quick reference variables for speed access to core prototypes. +var push = ArrayProto.push, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + +// Modern feature detection. +var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', + supportsDataView = typeof DataView !== 'undefined'; + +// All **ECMAScript 5+** native function implementations that we hope to use +// are declared here. +var nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeCreate = Object.create, + nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; + +// Create references to these builtin functions because we override them. +var _isNaN = isNaN, + _isFinite = isFinite; + +// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. +var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); +var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + +// The largest integer that can be represented exactly. +var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(33))) + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function() { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + var result = []; + for(var i = 0; i < this.length; i++) { + var item = this[i]; + if(item[2]) { + result.push("@media " + item[2] + "{" + item[1] + "}"); + } else { + result.push(item[1]); + } + } + return result.join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; +}; + + +/***/ }), +/* 2 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -10787,134 +10914,53 @@ return jQuery; /***/ }), -/* 1 */ +/* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; }); -// Current version. -var VERSION = '1.13.6'; - -// Establish the root object, `window` (`self`) in the browser, `global` -// on the server, or `this` in some virtual machines. We use `self` -// instead of `window` for `WebWorker` support. -var root = (typeof self == 'object' && self.self === self && self) || - (typeof global == 'object' && global.global === global && global) || - Function('return this')() || - {}; +/* harmony export (immutable) */ __webpack_exports__["a"] = keys; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(64); -// Save bytes in the minified (but not gzipped) version: -var ArrayProto = Array.prototype, ObjProto = Object.prototype; -var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; -// Create quick reference variables for speed access to core prototypes. -var push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; -// Modern feature detection. -var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', - supportsDataView = typeof DataView !== 'undefined'; -// All **ECMAScript 5+** native function implementations that we hope to use -// are declared here. -var nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeCreate = Object.create, - nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; -// Create references to these builtin functions because we override them. -var _isNaN = isNaN, - _isFinite = isFinite; +// Retrieve the names of an object's own properties. +// Delegates to **ECMAScript 5**'s native `Object.keys`. +function keys(obj) { + if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return []; + if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj); + var keys = []; + for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys); + return keys; +} -// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. -var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); -var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; -// The largest integer that can be represented exactly. -var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; +/***/ }), +/* 4 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(115))) +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = tagTester; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(0); -/***/ }), -/* 2 */ -/***/ (function(module, exports) { -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function() { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - var result = []; - for(var i = 0; i < this.length; i++) { - var item = this[i]; - if(item[2]) { - result.push("@media " + item[2] + "{" + item[1] + "}"); - } else { - result.push(item[1]); - } - } - return result.join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; -}; +// Internal function for creating a `toString`-based type tester. +function tagTester(name) { + var tag = '[object ' + name + ']'; + return function(obj) { + return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag; + }; +} /***/ }), -/* 3 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) { @@ -10923,7 +10969,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ if ( true ) { // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -10937,57 +10983,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ $.ui = $.ui || {}; -return $.ui.version = "1.13.3"; +return $.ui.version = "1.14.1"; } ); -/***/ }), -/* 4 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = keys; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(14); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(63); - - - - - -// Retrieve the names of an object's own properties. -// Delegates to **ECMAScript 5**'s native `Object.keys`. -function keys(obj) { - if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return []; - if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj); - var keys = []; - for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys); - return keys; -} - - -/***/ }), -/* 5 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = tagTester; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(1); - - -// Internal function for creating a `toString`-based type tester. -function tagTester(name) { - var tag = '[object ' + name + ']'; - return function(obj) { - return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag; - }; -} - - /***/ }), /* 6 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -10995,8 +10995,8 @@ function tagTester(name) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = cb; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(72); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(73); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(73); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(74); @@ -11050,7 +11050,7 @@ function restArguments(func, startIndex) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = _; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(0); // If Underscore is called as a function, it returns a wrapped object that can @@ -11083,7 +11083,7 @@ _.prototype.toString = function() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(61); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(62); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(11); @@ -11100,8 +11100,8 @@ _.prototype.toString = function() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(0); @@ -11124,7 +11124,7 @@ if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(62); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(63); // Internal helper to obtain the `length` property of an object. @@ -11135,7 +11135,7 @@ if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist /* 12 */ /***/ (function(module, exports) { -module.exports = {"name":"nglview-js-widgets","version":"3.1.4","description":"nglview-js-widgets","keywords":["ipython","ipywidgets","jupyter","jupyterlab","jupyterlab-extension","molecular graphics","molecular structure","science","widgets"],"homepage":"https://github.com/nglviewer/nglview/js","bugs":{"url":"https://github.com/nglviewer/nglview/issues"},"license":"MIT","author":{"name":"Alexander Rose, Hai Nguyen","email":"alexander.rose@weirdbyte.de, hainm.comp@gmail.com"},"files":["dist","src","lib","style/index.js"],"main":"lib/index.js","repository":{"type":"git","url":"https://github.com/nglviewer/nglview.git"},"scripts":{"prepublish":"yarn build:prod && webpack && yarn run copy:labextension","copy:labextension":"cp -r nglview-js-widgets/labextension/* ../nglview/staticlab/","build":"yarn run build:lib && yarn run build:labextension:dev","build:prod":"yarn run build:lib && yarn run build:labextension","build:labextension":"jupyter labextension build .","build:labextension:dev":"jupyter labextension build --development True .","build:lib":"tsc","clean":"yarn run clean:lib","clean:lib":"rimraf lib tsconfig.tsbuildinfo","clean:labextension":"rimraf myextension/labextension","clean:all":"yarn run clean:lib && yarn run clean:labextension","eslint":"eslint '**/*.ts' --fix","eslint:check":"eslint '**/*.ts'","install:extension":"jupyter labextension develop --overwrite .","prepare":"yarn run clean && yarn run build:prod","watch":"run-p watch:src watch:labextension","watch:src":"tsc -w","watch:labextension":"jupyter labextension watch .","test":"mocha"},"dependencies":{"@jupyter-widgets/base":"^1 || ^2.0.2 || ^3 || ^4 || ^5 || ^6","@jupyter-widgets/jupyterlab-manager":"^3.0.0","jquery":"^3.2.1","jquery-ui":"^1.12.1","lodash":"^4.17.4","ngl":"2.2.2","underscore":"^1.8.3"},"devDependencies":{"@jupyterlab/builder":"^3.0.5 || ^4","@types/chai":"^4.1.4","@types/expect.js":"^0.3.29","@types/mocha":"^2.2.48","@types/node":"^16.0.0","@types/requirejs":"^2.1.31","@typescript-eslint/eslint-plugin":"^7.13.1","@typescript-eslint/parser":"^7.13.1","babel-register":"^6.11.6","css-loader":"^0.23.1","eslint":"^8.5.6","file-loader":"^1.1.6","json-loader":"^0.5.4","mkdirp":"^1.0.3","ngl":"2.2.2","npm-run-all":"^4.1.5","prettier":"^2.1.1","rimraf":"^3.0.2","style-loader":"^0.13.1","typescript":"~5.4.5","webpack":"^3.12.0"},"sideEffects":["style/*.css","style/index.js"],"styleModule":"style/index.js","jupyterlab":{"extension":"lib/jupyterlab-plugin","outputDir":"nglview-js-widgets/labextension","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}},"directories":{"test":"test"},"packageManager":"yarn@1.22.1"} +module.exports = {"name":"nglview-js-widgets","version":"3.1.4","description":"nglview-js-widgets","keywords":["ipython","ipywidgets","jupyter","jupyterlab","jupyterlab-extension","molecular graphics","molecular structure","science","widgets"],"homepage":"https://github.com/nglviewer/nglview/js","bugs":{"url":"https://github.com/nglviewer/nglview/issues"},"license":"MIT","author":{"name":"Alexander Rose, Hai Nguyen","email":"alexander.rose@weirdbyte.de, hainm.comp@gmail.com"},"files":["dist","src","lib","style/index.js"],"main":"lib/index.js","repository":{"type":"git","url":"https://github.com/nglviewer/nglview.git"},"scripts":{"prepublish":"yarn build:prod && webpack && yarn run copy:labextension","copy:labextension":"mkdir -p ../nglview/staticlab && cp -r nglview-js-widgets/labextension/* ../nglview/staticlab/","build":"yarn run build:lib && yarn run build:labextension:dev","build:prod":"yarn run build:lib && yarn run build:labextension","build:labextension":"jupyter labextension build .","build:labextension:dev":"jupyter labextension build --development True .","build:lib":"tsc","clean":"yarn run clean:lib","clean:lib":"rimraf lib tsconfig.tsbuildinfo","clean:labextension":"rimraf myextension/labextension","clean:all":"yarn run clean:lib && yarn run clean:labextension","eslint":"eslint '**/*.ts' --fix","eslint:check":"eslint '**/*.ts'","install:extension":"jupyter labextension develop --overwrite .","prepare":"yarn run clean && yarn run build:prod","watch":"run-p watch:src watch:labextension","watch:src":"tsc -w","watch:labextension":"jupyter labextension watch .","test":"mocha"},"dependencies":{"@jupyter-widgets/base":"^1 || ^2.0.2 || ^3 || ^4 || ^5 || ^6","@jupyter-widgets/jupyterlab-manager":"^3.0.0","jquery":"^3.2.1","jquery-ui":"^1.12.1","lodash":"^4.17.4","underscore":"^1.8.3"},"devDependencies":{"@jupyterlab/builder":"^3.0.5 || ^4","@types/chai":"^4.1.4","@types/expect.js":"^0.3.29","@types/mocha":"^2.2.48","@types/node":"^16.0.0","@types/requirejs":"^2.1.31","@typescript-eslint/eslint-plugin":"^7.13.1","@typescript-eslint/parser":"^7.13.1","babel-register":"^6.11.6","css-loader":"^0.23.1","eslint":"^8.5.6","file-loader":"^1.1.6","json-loader":"^0.5.4","mkdirp":"^1.0.3","ngl":"2.1.1","npm-run-all":"^4.1.5","prettier":"^2.1.1","rimraf":"^3.0.2","style-loader":"^0.13.1","typescript":"~5.4.5","webpack":"^3.12.0"},"sideEffects":["style/*.css","style/index.js"],"styleModule":"style/index.js","jupyterlab":{"extension":"lib/jupyterlab-plugin","outputDir":"nglview-js-widgets/labextension","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}},"directories":{"test":"test"},"packageManager":"yarn@1.22.1"} /***/ }), /* 13 */ @@ -11143,7 +11143,7 @@ module.exports = {"name":"nglview-js-widgets","version":"3.1.4","description":"n "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = has; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(0); // Internal function to check whether `key` is an own property name of `obj`. @@ -11170,8 +11170,8 @@ function isObject(obj) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(4); @@ -11188,7 +11188,7 @@ function isObject(obj) { /* harmony export (immutable) */ __webpack_exports__["a"] = each; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(3); @@ -11219,7 +11219,7 @@ function each(obj, iteratee, context) { /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - * jQuery UI Widget 1.13.3 + * jQuery UI Widget 1.14.1 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors @@ -11239,7 +11239,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ if ( true ) { // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(3) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2), __webpack_require__(5) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -11279,6 +11279,9 @@ $.widget = function( name, base, prototype ) { var namespace = name.split( "." )[ 0 ]; name = name.split( "." )[ 1 ]; + if ( name === "__proto__" || name === "constructor" ) { + return $.error( "Invalid widget name: " + name ); + } var fullName = namespace + "-" + name; if ( !prototype ) { @@ -11985,128 +11988,131 @@ return $.widget; "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AngleRepresentation", function() { return zh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrowBuffer", function() { return hu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Assembly", function() { return La; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AxesRepresentation", function() { return ed; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BackboneRepresentation", function() { return rd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BallAndStickRepresentation", function() { return id; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseRepresentation", function() { return sd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoxBuffer", function() { return fu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BufferRepresentation", function() { return Tc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CartoonRepresentation", function() { return dd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return hl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Colormaker", function() { return zt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColormakerRegistry", function() { return Fe; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return ll; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentCollection", function() { return $l; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConeBuffer", function() { return au; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContactRepresentation", function() { return ud; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Counter", function() { return ui; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CylinderBuffer", function() { return td; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DatasourceRegistry", function() { return Le; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return De; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecompressorRegistry", function() { return Ge; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DihedralHistogramRepresentation", function() { return gd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DihedralRepresentation", function() { return md; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DistanceRepresentation", function() { return bd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EllipsoidBuffer", function() { return wu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Frames", function() { return pl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HelixorientRepresentation", function() { return Ad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HyperballRepresentation", function() { return Bd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Kdtree", function() { return $a; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyActions", function() { return ta; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LabelRepresentation", function() { return $d; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LeftMouseButton", function() { return tr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LicoriceRepresentation", function() { return _d; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineRepresentation", function() { return Rd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListingDatasource", function() { return We; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MdsrvDatasource", function() { return eg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeasurementDefaultParams", function() { return Te; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MeshBuffer", function() { return Uo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MiddleMouseButton", function() { return er; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MolecularSurface", function() { return zd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MolecularSurfaceRepresentation", function() { return Vd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseActions", function() { return Ko; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OctahedronBuffer", function() { return Pu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParserRegistry", function() { return ze; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PdbWriter", function() { return ai; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PickingProxy", function() { return br; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointBuffer", function() { return Wc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointRepresentation", function() { return Gd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Queue", function() { return Nr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepresentationCollection", function() { return dl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepresentationElement", function() { return nl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepresentationRegistry", function() { return Ne; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RibbonRepresentation", function() { return Wd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RightMouseButton", function() { return ir; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RocketRepresentation", function() { return qd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RopeRepresentation", function() { return Xd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScriptExtensions", function() { return Re; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SdfWriter", function() { return ci; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return pe; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Shape", function() { return Mc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShapeComponent", function() { return Ll; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpacefillRepresentation", function() { return Yd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpatialHash", function() { return Ts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SphereBuffer", function() { return Gc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Stage", function() { return Fl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticDatasource", function() { return tg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StlWriter", function() { return di; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Structure", function() { return Cc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StructureComponent", function() { return Tl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StructureComponentDefaultParameters", function() { return Ml; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StructureRepresentation", function() { return Sh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Superposition", function() { return fl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurfaceComponent", function() { return Bl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TetrahedronBuffer", function() { return Bu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextBuffer", function() { return Eh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TorusBuffer", function() { return Fu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TraceRepresentation", function() { return Qd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrajectoryDatasource", function() { return qe; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrajectoryPlayer", function() { return yl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TubeRepresentation", function() { return Jd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UIStageParameters", function() { return og; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnitcellRepresentation", function() { return tu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValidationRepresentation", function() { return eu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Version", function() { return ag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Viewer", function() { return Ji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Volume", function() { return Eo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VolumeComponent", function() { return Dl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WidelineBuffer", function() { return Nh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoLoad", function() { return ni; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatStructures", function() { return ic; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "download", function() { return dt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return at; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataInfo", function() { return si; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFileInfo", function() { return ri; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getQuery", function() { return rt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "guessElement", function() { return tc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDebug", function() { return Oe; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setListingDatasource", function() { return Xe; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMeasurementDefaultParams", function() { return Be; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTrajectoryDatasource", function() { return Ye; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "superpose", function() { return kl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return ut; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueArray", function() { return gt; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_three__ = __webpack_require__(52); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Box3", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["d"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["i"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Euler", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["n"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix3", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["y"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix4", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["z"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Plane", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["H"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Quaternion", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["K"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Vector2", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["X"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Vector3", function() { return __WEBPACK_IMPORTED_MODULE_0_three__["Y"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_chroma_js__ = __webpack_require__(111); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_chroma_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_chroma_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_signals__ = __webpack_require__(33); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_signals___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_signals__); -/* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_signals__, "Signal")) __webpack_require__.d(__webpack_exports__, "Signal", function() { return __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js__ = __webpack_require__(113); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__); -function rt(t){if("undefined"==typeof window)return;const e=new RegExp(`${t}=([^&#=]*)`).exec(window.location.search);return e?decodeURIComponent(e[1]):void 0}function st(t,e){return void 0!==t?t:e}function nt(t,e){const i=Object.assign({},t);for(const r in e){void 0===t[r]&&(i[r]=e[r])}return i}function ot(t,e){for(const i in e){const r=e[i];void 0!==r&&(t[i]=r)}return t}function at(t,e){e=st(e,[]);for(let i=0;ie?(o&&(clearTimeout(o),o=null),a=l,n=t.apply(r,s),o||(r=s=null)):o||!1===i.trailing||(o=setTimeout(c,h)),n}}function mt(t,e){return te?1:0}function pt(t,e,i=mt){let r=0,s=t.length-1;for(;r<=s;){const n=r+s>>1,o=i(e,t[n]);if(o>0)r=n+1;else{if(!(o<0))return n;s=n-1}}return-r-1}function ft(t,e,i){const r=function(t,e){let i=t.length-1;if(t[i]>1;t[s]>=e?i=s-1:r=s+1}return i+1}(t,e),s=function(t,e){if(t[0]>e)return-1;let i=0,r=t.length-1;for(;i<=r;){const s=i+r>>1;t[s]>e?r=s-1:i=s+1}return i-1}(t,i);return-1===r||-1===s||r>s?0:s-r+1}function gt(t){return t.sort().filter((function(t,e,i){return 0===e||t!==i[e-1]}))}function yt(t){const e=28672;if(t.length>e){const i=[];for(let r=0;r65535?Uint32Array:Uint16Array)(t)}function vt(t){return t.buffer&&t.buffer instanceof ArrayBuffer?t.buffer:t}function wt(t,e){return void 0===t?t=new e:Array.isArray(t)&&(t=(new e).fromArray(t)),t}function At(t){return wt(t,e)}function _t(t){return wt(t,i)}function St(t){return wt(t,r)}function Ct(t){return e=t,i=Float32Array,e instanceof i?e:new i(e);var e,i}function Pt(t){return st(t,"").toString().toLowerCase()}class It{constructor(t){this.name=t,this._dict={}}add(t,e){this._dict[Pt(t)]=e}get(t){return this._dict[Pt(t)]}get names(){return Object.keys(this._dict)}}function kt(t){return.01745*t}const Mt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Tt=new Array(36);function Bt(){let t,e=0;for(let i=0;i<36;i++)8===i||13===i||18===i||23===i?Tt[i]="-":14===i?Tt[i]="4":(e<=2&&(e=33554432+16777216*Math.random()|0),t=15&e,e>>=4,Tt[i]=Mt[19===i?3&t|8:t]);return Tt.join("")}function Dt(t,e,i){return Math.max(e,Math.min(i,t))}function $t(t,e,i){return t+(e-t)*i}function Ot(t,e,i,r,s,n){const o=(i-t)*n,a=(r-e)*n,c=s*s;return(2*e-2*i+o+a)*(s*c)+(-3*e+3*i-2*o-a)*c+o*s+e}function Rt(t,e,i){var r;return r=function(t,e,i){return(t-e)/(i-e)}(i,t,e),(i=Dt(r,0,1))*i*(3-2*i)}var Et="sRGB";const Ft={scale:"uniform",mode:"hcl",domain:[0,1],value:16777215,reverse:!1},Lt=new s;function Nt(t,e,i){const r=i.value;return i.value=function(t,e){let i=r.bind(this,t,e)();return"linear"==Et?(Lt.set(i),Lt.convertSRGBToLinear(),Lt.getHex()):i},i}class zt{constructor(t={}){this.parameters=nt(t,Ft),"string"==typeof this.parameters.value&&(this.parameters.value=Lt.set(this.parameters.value).getHex()),this.parameters.structure&&(this.atomProxy=this.parameters.structure.getAtomProxy())}getScale(t={}){const e=nt(t,this.parameters);return"rainbow"===e.scale?e.scale=["red","orange","yellow","green","blue"]:"rwb"===e.scale&&(e.scale=["red","white","blue"]),e.reverse&&(e.domain=e.domain.slice().reverse()),__WEBPACK_IMPORTED_MODULE_1_chroma_js__["scale"](e.scale).mode(e.mode).domain(e.domain).out("num")}colorToArray(t,e=[],i=0){return e[i]=(t>>16&255)/255,e[i+1]=(t>>8&255)/255,e[i+2]=(255&t)/255,e}atomColorToArray(t,e,i){return this.colorToArray(this.atomColor?this.atomColor(t):0,e,i)}bondColor(t,e){return this.atomProxy&&this.atomColor?(this.atomProxy.index=e?t.atomIndex1:t.atomIndex2,this.atomColor(this.atomProxy)):0}bondColorToArray(t,e,i,r){return this.colorToArray(this.bondColor(t,e),i,r)}volumeColorToArray(t,e,i){return this.colorToArray(this.volumeColor?this.volumeColor(t):0,e,i)}positionColorToArray(t,e,i){return this.colorToArray(this.positionColor?this.positionColor(t):0,e,i)}}var Vt;!function(t){t[t.PROTEIN=1]="PROTEIN",t[t.NUCLEIC=2]="NUCLEIC",t[t.RNA=3]="RNA",t[t.DNA=4]="DNA",t[t.POLYMER=5]="POLYMER",t[t.WATER=6]="WATER",t[t.HELIX=7]="HELIX",t[t.SHEET=8]="SHEET",t[t.TURN=9]="TURN",t[t.BACKBONE=10]="BACKBONE",t[t.SIDECHAIN=11]="SIDECHAIN",t[t.ALL=12]="ALL",t[t.HETERO=13]="HETERO",t[t.ION=14]="ION",t[t.SACCHARIDE=15]="SACCHARIDE",t[t.SUGAR=15]="SUGAR",t[t.BONDED=16]="BONDED",t[t.RING=17]="RING",t[t.AROMATICRING=18]="AROMATICRING",t[t.METAL=19]="METAL",t[t.POLARH=20]="POLARH",t[t.NONE=21]="NONE"}(Vt||(Vt={}));const Gt=["*","","ALL"],Ut=["NONE"],jt=[Vt.BACKBONE,Vt.SIDECHAIN,Vt.BONDED,Vt.RING,Vt.AROMATICRING,Vt.METAL,Vt.POLARH],Ht=[Vt.POLYMER,Vt.WATER],Wt=["ALA","GLY","SER"],qt=["CYS","SER","THR"],Xt=["ALA","ILE","LEU","MET","PHE","PRO","TRP","VAL"],Yt=["PHE","TRP","TYR","HIS"],Kt=["ASN","GLN"],Zt=["ASP","GLU"],Qt=["ARG","HIS","LYS"],Jt=["ARG","ASP","GLU","HIS","LYS"],te=["ASN","ARG","ASP","CYS","GLY","GLN","GLU","HIS","LYS","SER","THR","TYR"],ee=["ALA","ILE","LEU","MET","PHE","PRO","TRP","VAL"],ie=["HIS","PHE","PRO","TRP","TYR"],re=["ALA","GLY","ILE","LEU","VAL"];function se(t,e){if(void 0===e.atomname&&void 0===e.element&&void 0===e.altloc&&void 0===e.atomindex&&void 0===e.keyword&&void 0===e.inscode&&void 0===e.resname&&void 0===e.sstruc&&void 0===e.resno&&void 0===e.chainname&&void 0===e.model)return-1;if(void 0!==e.keyword){if(e.keyword===Vt.BACKBONE&&!t.isBackbone())return!1;if(e.keyword===Vt.SIDECHAIN&&!t.isSidechain())return!1;if(e.keyword===Vt.BONDED&&!t.isBonded())return!1;if(e.keyword===Vt.RING&&!t.isRing())return!1;if(e.keyword===Vt.AROMATICRING&&!t.isAromatic())return!1;if(e.keyword===Vt.HETERO&&!t.isHetero())return!1;if(e.keyword===Vt.PROTEIN&&!t.isProtein())return!1;if(e.keyword===Vt.NUCLEIC&&!t.isNucleic())return!1;if(e.keyword===Vt.RNA&&!t.isRna())return!1;if(e.keyword===Vt.DNA&&!t.isDna())return!1;if(e.keyword===Vt.POLYMER&&!t.isPolymer())return!1;if(e.keyword===Vt.WATER&&!t.isWater())return!1;if(e.keyword===Vt.HELIX&&!t.isHelix())return!1;if(e.keyword===Vt.SHEET&&!t.isSheet())return!1;if(e.keyword===Vt.TURN&&!t.isTurn())return!1;if(e.keyword===Vt.ION&&!t.isIon())return!1;if(e.keyword===Vt.SACCHARIDE&&!t.isSaccharide())return!1;if(e.keyword===Vt.METAL&&!t.isMetal())return!1;if(e.keyword===Vt.POLARH&&!t.isPolarHydrogen())return!1}if(void 0!==e.atomname&&e.atomname!==t.atomname)return!1;if(void 0!==e.element&&e.element!==t.element)return!1;if(void 0!==e.altloc&&e.altloc!==t.altloc)return!1;if(void 0!==e.atomindex&&pt(e.atomindex,t.index)<0)return!1;if(void 0!==e.resname)if(Array.isArray(e.resname)){if(!e.resname.includes(t.resname))return!1}else if(e.resname!==t.resname)return!1;if(void 0!==e.sstruc&&e.sstruc!==t.sstruc)return!1;if(void 0!==e.resno)if(Array.isArray(e.resno)&&2===e.resno.length){if(e.resno[0]>t.resno||e.resno[1]t.resno||e.resno[1]0?t:null}function he(t,e=!1){let i=t;return e&&(i=le(t,(function(t){return void 0!==t.keyword&&!jt.includes(t.keyword)||(void 0!==t.model||(void 0!==t.chainname||(void 0!==t.resname||(void 0!==t.resno||void 0!==t.sstruc))))}))),ce(i,se)}function de(t,e=!1){let i=t;return e&&(i=le(t,(function(t){return!(void 0===t.keyword||!jt.includes(t.keyword))||(void 0!==t.model||(void 0!==t.chainname||(void 0!==t.atomname||(void 0!==t.element||void 0!==t.altloc))))}))),ce(i,ne)}function ue(t,e=!1){let i=t;return e&&(i=le(t,(function(t){return void 0!==t.keyword&&!Ht.includes(t.keyword)||(void 0!==t.resname||(void 0!==t.resno||(void 0!==t.atomname||(void 0!==t.element||(void 0!==t.altloc||(void 0!==t.sstruc||void 0!==t.inscode))))))}))),ce(i,oe)}function me(t,e=!1){let i=t;return e&&(i=le(t,(function(t){return void 0!==t.keyword||(void 0!==t.chainname||(void 0!==t.resname||(void 0!==t.resno||(void 0!==t.atomname||(void 0!==t.element||(void 0!==t.altloc||(void 0!==t.sstruc||void 0!==t.inscode)))))))}))),ce(i,ae)}class pe{constructor(t){this.signals={stringChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.setString(t)}get type(){return"selection"}setString(t,e){if(void 0===t&&(t=this.string||""),t===this.string)return;try{this.selection=function(t){let e={operator:void 0,rules:[]};if(!t)return e;let i,r,s=e;const n=[];"("===(t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").trim()).charAt(0)&&")"===t.substr(-1)&&(t=t.slice(1,-1).trim());const o=t.split(/\s+/),a=t=>{i={operator:t,rules:[]},void 0===s?(s=i,e=i):(s.rules.push(i),n.push(s),s=i)},c=function(t){r=s,s=n.pop(),void 0===s&&(a(t),l(r))},l=function(t){s.rules.push(t)};let h=!1;for(let t=0;t0)if("NOT"===i)h=1;else if(1===h)h=2;else{if(2!==h)throw new Error("something went wrong with 'not'");h=!1,c()}if("AND"===i){if("OR"===s.operator){const t=s.rules.pop();a("AND"),l(t)}else s.operator="AND";continue}if("OR"===i){"AND"===s.operator?c("OR"):s.operator="OR";continue}if("NOT"===e.toUpperCase()){h=1,a(),s.negate=!0;continue}if(+i!=+i){const t=Vt[i];if(void 0!==t){l({keyword:t});continue}}if("HYDROGEN"===i){l({operator:"OR",rules:[{element:"H"},{element:"D"}]});continue}if("SMALL"===i){l({resname:Wt});continue}if("NUCLEOPHILIC"===i){l({resname:qt});continue}if("HYDROPHOBIC"===i){l({resname:Xt});continue}if("AROMATIC"===i){l({resname:Yt});continue}if("AMIDE"===i){l({resname:Kt});continue}if("ACIDIC"===i){l({resname:Zt});continue}if("BASIC"===i){l({resname:Qt});continue}if("CHARGED"===i){l({resname:Jt});continue}if("POLAR"===i){l({resname:te});continue}if("NONPOLAR"===i){l({resname:ee});continue}if("CYCLIC"===i){l({resname:ie});continue}if("ALIPHATIC"===i){l({resname:re});continue}if("SIDECHAINATTACHED"===i){l({operator:"OR",rules:[{keyword:Vt.SIDECHAIN},{operator:"AND",negate:!1,rules:[{keyword:Vt.PROTEIN},{operator:"OR",negate:!1,rules:[{atomname:"CA"},{atomname:"BB"}]}]},{operator:"AND",negate:!1,rules:[{resname:"PRO"},{atomname:"N"}]},{operator:"AND",negate:!1,rules:[{keyword:Vt.NUCLEIC},{operator:"OR",negate:!0,rules:[{atomname:"P"},{atomname:"OP1"},{atomname:"OP2"},{atomname:"O3'"},{atomname:"O3*"},{atomname:"HO3'"},{atomname:"O5'"},{atomname:"O5*"},{atomname:"HO5'"},{atomname:"C5'"},{atomname:"C5*"},{atomname:"H5'"},{atomname:"H5''"}]}]}]});continue}if("APOLARH"===i){l({operator:"AND",negate:!1,rules:[{element:"H"},{negate:!0,operator:void 0,rules:[{keyword:Vt.POLARH}]}]});continue}if("LIGAND"===i){l({operator:"AND",rules:[{operator:"OR",rules:[{operator:"AND",rules:[{keyword:Vt.HETERO},{negate:!0,operator:void 0,rules:[{keyword:Vt.POLYMER}]}]},{negate:!0,operator:void 0,rules:[{keyword:Vt.POLYMER}]}]},{negate:!0,operator:void 0,rules:[{operator:"OR",rules:[{keyword:Vt.WATER},{keyword:Vt.ION}]}]}]});continue}if(-1!==Gt.indexOf(i)){l({keyword:Vt.ALL});continue}if("@"===e.charAt(0)){const t=e.substr(1).split(",").map((t=>parseInt(t)));t.sort((function(t,e){return t-e})),l({atomindex:t});continue}if("#"===e.charAt(0)){console.error("# for element selection deprecated, use _"),l({element:i.substr(1)});continue}if("_"===e.charAt(0)){l({element:i.substr(1)});continue}if("["===e[0]&&"]"===e[e.length-1]){const t=i.substr(1,e.length-2).split(","),r=t.length>1?t:t[0];l({resname:r});continue}if(e.length>=1&&e.length<=4&&"^"!==e[0]&&":"!==e[0]&&"."!==e[0]&&"%"!==e[0]&&"/"!==e[0]&&isNaN(parseInt(e))){l({resname:i});continue}const r={operator:"AND",rules:[]},n=e.split("/");if(n.length>1&&n[1]){if(isNaN(parseInt(n[1])))throw new Error("model must be an integer");r.rules.push({model:parseInt(n[1])})}const d=n[0].split("%");d.length>1&&r.rules.push({altloc:d[1]});const u=d[0].split(".");if(u.length>1&&u[1]){if(u[1].length>4)throw new Error("atomname must be one to four characters");r.rules.push({atomname:u[1].substring(0,4).toUpperCase()})}const m=u[0].split(":");m.length>1&&m[1]&&r.rules.push({chainname:m[1]});const p=m[0].split("^");if(p.length>1&&r.rules.push({inscode:p[1]}),p[0]){let t,e;"-"===p[0][0]&&(p[0]=p[0].substr(1),t=!0),p[0].includes("--")&&(p[0]=p[0].replace("--","-"),e=!0);let i=p[0].split("-");if(1===i.length){let e=parseInt(i[0]);if(isNaN(e))throw new Error("resi must be an integer");t&&(e*=-1),r.rules.push({resno:e})}else{if(2!==i.length)throw new Error("resi range must contain one '-'");{const s=i.map((t=>parseInt(t)));t&&(s[0]*=-1),e&&(s[1]*=-1),r.rules.push({resno:[s[0],s[1]]})}}}if(1===r.rules.length)l(r.rules[0]);else{if(!(r.rules.length>1))throw new Error("empty selection chunk");l(r)}}return void 0===e.operator&&1===e.rules.length&&e.rules[0].hasOwnProperty("operator")&&(e=e.rules[0]),e}(t)}catch(t){this.selection={error:t.message}}const i=this.selection;this.string=t,this.test=he(i),this.residueTest=de(i),this.chainTest=ue(i),this.modelTest=me(i),this.atomOnlyTest=he(i,!0),this.residueOnlyTest=de(i,!0),this.chainOnlyTest=ue(i,!0),this.modelOnlyTest=me(i,!0),e||this.signals.stringChanged.dispatch(this.string)}isAllSelection(){return Gt.includes(this.string.toUpperCase())}isNoneSelection(){return Ut.includes(this.string.toUpperCase())}}class fe extends zt{constructor(t){super(t),this.colormakerList=[],this.selectionList=[];(t.dataList||[]).forEach((t=>{const[e,i,r={}]=t;Fe.hasScheme(e)?Object.assign(r,{scheme:e,structure:this.parameters.structure}):Object.assign(r,{scheme:"uniform",value:new s(e).getHex()}),this.colormakerList.push(Fe.getScheme(r)),this.selectionList.push(new pe(i))}))}atomColor(t){for(let e=0,i=this.selectionList.length;e{}),t)}catch(t){}const Se="undefined"!=typeof window&&void 0!==window.orientation;let Ce=!1;function Pe(t){Ce=t}let Ie=!1;function ke(t){Ie=t}const Me={log:Function.prototype.bind.call(console.log,console),info:Function.prototype.bind.call(console.info,console),warn:Function.prototype.bind.call(console.warn,console),error:Function.prototype.bind.call(console.error,console),time:Function.prototype.bind.call(console.time,console),timeEnd:Function.prototype.bind.call(console.timeEnd,console)};let Te={color:"green",labelColor:8421504,labelAttachment:"bottom-center",labelSize:.7,labelZOffset:.5,labelYOffset:.1,labelBorder:!0,labelBorderColor:13882323,labelBorderWidth:.25,lineOpacity:.8,linewidth:5,opacity:.6,labelUnit:"angstrom",arcVisible:!0,planeVisible:!1};function Be(t={}){Object.assign(Te,t)}let De=!!($e=rt("debug"))&&("string"!=typeof $e||/^1|true|t|yes|y$/i.test($e));var $e;function Oe(t){De=t}const Re=["ngl","js"],Ee=new class{constructor(){this.activeWorkerCount=0,this._funcDict={},this._depsDict={},this._blobDict={}}add(t,e,i){this._funcDict[t]=e,this._depsDict[t]=i}get(t){return this._blobDict[t]||(this._blobDict[t]=we(this._funcDict[t],this._depsDict[t])),this._blobDict[t]}},Fe=new class{constructor(){this.schemes={},this.userSchemes={}}getScheme(t){const e=((t||{}).scheme||"").toLowerCase();let i;return i=e in this.schemes?this.schemes[e]:e in this.userSchemes?this.userSchemes[e]:zt,new i(t)}getSchemes(){const t={};return Object.keys(this.schemes).forEach((function(e){t[e]=e})),Object.keys(this.userSchemes).forEach((function(e){t[e]=e.split("|")[1]})),t}getScales(){return ge}getModes(){return ye}add(t,e){t=t.toLowerCase(),this.schemes[t]=e}addScheme(t,e){return function(t){return t instanceof zt}(t)||(t=this._createScheme(t)),this._addUserScheme(t,e)}_addUserScheme(t,e){e=e||"";const i=`${Bt()}|${e}`.toLowerCase();return this.userSchemes[i]=t,i}removeScheme(t){t=t.toLowerCase(),delete this.userSchemes[t]}_createScheme(t){return class extends zt{constructor(e){super(e),t.call(this,e)}}}addSelectionScheme(t,e){return this._addUserScheme(class extends fe{constructor(e){super(Object.assign({dataList:t},e))}},e)}hasScheme(t){return(t=t.toLowerCase())in this.schemes||t in this.userSchemes}},Le=new It("datasource"),Ne=new It("representatation"),ze=new class extends It{constructor(){super("parser")}__hasObjName(t,e){const i=this.get(t);return i&&i.prototype.__objName===e}isTrajectory(t){return this.__hasObjName(t,"frames")}isStructure(t){return this.__hasObjName(t,"structure")}isVolume(t){return this.__hasObjName(t,"volume")}isSurface(t){return this.__hasObjName(t,"surface")}isBinary(t){const e=this.get(t);return e&&e.prototype.isBinary}isXml(t){const e=this.get(t);return e&&e.prototype.isXml}isJson(t){const e=this.get(t);return e&&e.prototype.isJson}getTrajectoryExtensions(){return this.names.filter((t=>this.isTrajectory(t)))}getStructureExtensions(){return this.names.filter((t=>this.isStructure(t)))}getVolumeExtensions(){return this.names.filter((t=>this.isVolume(t)))}getSurfaceExtensions(){return this.names.filter((t=>this.isSurface(t)))}},Ve=new It("shader"),Ge=new It("decompressor"),Ue=new It("component"),je=new It("buffer"),He=new It("picker");let We,qe;function Xe(t){We=t}function Ye(t){qe=t}class Ke{constructor(t,e={}){this.chunkSize=10485760,this.newline="\n",this.__pointer=0,this.__partialLine="",this.compressed=st(e.compressed,!1),this.binary=st(e.binary,!1),this.json=st(e.json,!1),this.xml=st(e.xml,!1),this.src=t}isBinary(){return this.binary||this.compressed}read(){return this._read().then((t=>{const e=this.compressed?Ge.get(this.compressed):void 0;return this.compressed&&e?this.data=e(t):((this.binary||this.compressed)&&t instanceof ArrayBuffer&&(t=new Uint8Array(t)),this.data=t),this.data}))}_chunk(t,e){return e=Math.min(this.data.length,e),0===t&&this.data.length===e?this.data:this.isBinary()?this.data.subarray(t,e):this.data.substring(t,e)}chunk(t){const e=t+this.chunkSize;return this._chunk(t,e)}peekLines(t){const e=this.data,i=e.length,r=this.isBinary()?this.newline.charCodeAt(0):this.newline;let s,n=0;for(s=0;si).lines}chunkCount(){return Math.floor(this.data.length/this.chunkSize)+1}asText(){return this.isBinary()?yt(this.data):this.data}chunkToLines(t,e,i){const r=this.newline;if(!this.isBinary()&&t.length===this.data.length)return{lines:t.split(r),partialLine:""};let s=[];const n=this.isBinary()?yt(t):t,o=n.lastIndexOf(r);if(-1===o)e+=n;else{const t=e+n.substr(0,o);s=s.concat(t.split(r)),e=o===n.length-r.length?"":n.substr(o+r.length)}return i&&""!==e&&s.push(e),{lines:s,partialLine:e}}nextChunk(){const t=this.__pointer;if(!(t>this.data.length))return this.__pointer+=this.chunkSize,this.chunk(t)}nextChunkOfLines(){const t=this.nextChunk();if(void 0===t)return;const e=this.__pointer>this.data.length,i=this.chunkToLines(t,this.__partialLine,e);return this.__partialLine=i.partialLine,i.lines}eachChunk(t){const e=this.chunkSize,i=this.data.length,r=this.chunkCount();for(let s=0;s{const s=i===r+1,n=this.chunkToLines(e,this.__partialLine,s);this.__partialLine=n.partialLine,t(n.lines,i,r)}))}dispose(){delete this.src}}class Ze extends Ke{_read(){return new Promise(((t,e)=>{const i=this.src,r=new FileReader;r.onload=e=>{e.target&&t(e.target.result)},r.onerror=t=>e(t),this.binary||this.compressed?r.readAsArrayBuffer(i):r.readAsText(i)}))}}class Qe extends Ke{_read(){return new Promise(((t,e)=>{const i=this.src,r=new XMLHttpRequest;r.open("GET",i,!0),r.addEventListener("load",(()=>{if(200===r.status||304===r.status||0===r.status)try{t(r.response)}catch(t){e(t)}else e(r.statusText)}),!1),r.addEventListener("error",(t=>e("network error")),!1),this.isBinary()?r.responseType="arraybuffer":this.json?r.responseType="json":this.xml?r.responseType="document":r.responseType="text",r.send()}))}}class Je{constructor(t,e={}){this.parameters=nt(e,{ext:"",compressed:!1,binary:ze.isBinary(e.ext||""),name:"",dir:"",path:"",protocol:""});const i={compressed:this.parameters.compressed,binary:this.parameters.binary,json:ze.isJson(this.parameters.ext),xml:ze.isXml(this.parameters.ext)};"undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob?this.streamer=new Ze(t,i):this.streamer=new Qe(t,i)}}class ti extends Je{constructor(t,e={}){super(t,e),this.parserParams={voxelSize:e.voxelSize,firstModelOnly:e.firstModelOnly,asTrajectory:e.asTrajectory,cAlphaOnly:e.cAlphaOnly,delimiter:e.delimiter,comment:e.comment,columnNames:e.columnNames,inferBonds:e.inferBonds,name:this.parameters.name,path:this.parameters.path}}load(){return new(ze.get(this.parameters.ext))(this.streamer,this.parserParams).parse()}}class ei{constructor(t,e,i){this.name=e,this.path=i,this.signals={elementAdded:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],elementRemoved:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],nameChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.type="Script",this.dir=i.substring(0,i.lastIndexOf("/")+1);try{this.fn=new Function("stage","__name","__path","__dir",t)}catch(t){Me.error("Script compilation failed",t),this.fn=function(){}}}run(t){return new Promise(((e,i)=>{try{this.fn.apply(null,[t,this.name,this.path,this.dir]),e()}catch(t){Me.error("Script.fn",t),i(t)}}))}}class ii extends Je{load(){return this.streamer.read().then((()=>new ei(this.streamer.asText(),this.parameters.name,this.parameters.path)))}}function ri(t){const e=Ge.names;let i,r,s="";i=t instanceof File?t.name:t instanceof Blob?"":t;const n=i.lastIndexOf("?"),o=-1!==n?i.substring(n):"";i=i.substring(0,-1===n?i.length:n);const a=i.replace(/^.*[\\/]/,"");let c=a.substring(0,a.lastIndexOf("."));const l=a.split(".");let h=l.length>1?(l.pop()||"").toLowerCase():"";const d=i.match(/^(.+):\/\/(.+)$/);d&&(s=d[1].toLowerCase(),i=d[2]||"");const u=i.substring(0,i.lastIndexOf("/")+1);if(e.includes(h)){r=h;const t=i.length-h.length-1;h=(i.substr(0,t).split(".").pop()||"").toLowerCase();const e=c.length-h.length-1;c=c.substr(0,e)}else r=!1;return{path:i,name:a,ext:h,base:c,dir:u,compressed:r,protocol:s,query:o,src:t}}function si(t){let e=ri(t);const i=Le.get(e.protocol);return i&&(e=ri(i.getUrl(e.src)),!e.ext&&i.getExt&&(e.ext=i.getExt(t))),e}function ni(t,e={}){const i=Object.assign(si(t),e);let r;return ze.names.includes(i.ext)?r=new ti(i.src,i):Re.includes(i.ext)&&(r=new ii(i.src,i)),r?r.load():Promise.reject(new Error(`autoLoad: ext '${i.ext}' unknown`))}class oi{getBlob(){return new Blob([this.getData()],{type:this.mimeType})}download(t,e){t=st(t,this.defaultName),e=st(e,this.defaultExt),dt(this.getBlob(),`${t}.${e}`)}}class ai extends oi{constructor(t,e){super(),this.mimeType="text/plain",this.defaultName="structure",this.defaultExt="pdb";const i=Object.assign({},e);this.renumberSerial=st(i.renumberSerial,!0),this.remarks=function(t){return Array.isArray(t)?t:[t]}(st(i.remarks,[])),this.structure=t,this._records=[]}_writeRecords(){this._records.length=0,this._writeTitle(),this._writeRemarks(),this._writeAtoms()}_writeTitle(){this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("TITLE %-74s",this.structure.name))}_writeRemarks(){this.remarks.forEach((t=>{this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("REMARK %-73s",t))})),this.structure.trajectory&&(this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("REMARK %-73s","Trajectory '"+this.structure.trajectory.name+"'")),this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("REMARK %-73s",`Frame ${this.structure.trajectory.frame}`)))}_writeAtoms(){let t=1,e=1,i=" ",r=" ";const s=this.structure.modelStore.count>1;this.structure.eachModel((n=>{s&&this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("MODEL %4d%-66s",e++,"")),n.eachAtom((e=>{const s=e.hetero?"HETATM%5d %-4s %3s %1s%4d %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%1s%1s":"ATOM %5d %-4s %3s %1s%4d %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%1s%1s",n=this.renumberSerial?t:e.serial;let o=e.atomname;(1===o.length||o.length<4&&1===e.element.length&&o[0]===e.element)&&(o=" "+o),e.formalCharge?(i=Math.abs(e.formalCharge).toPrecision(1),r=e.formalCharge>0?"+":"-"):(i=" ",r=" "),this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])(s,n,o,e.resname,st(e.chainname," "),e.resno,e.x,e.y,e.z,st(e.occupancy,1),st(e.bfactor,0),"",st(e.element,""),i,r)),t+=1}),this.structure.getSelection()),s&&this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("%-80s","ENDMDL"))})),this._records.push(Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("%-80s","END"))}getString(){return console.warn("PdbWriter.getString() is deprecated, use .getData instead"),this.getData()}getData(){return this._writeRecords(),this._records.join("\n")}}class ci extends oi{constructor(t){super(),this.mimeType="text/plain",this.defaultName="structure",this.defaultExt="sdf",this.structure=t,this._records=[]}get idString(){return this.structure.id}get titleString(){return" "+this.structure.title}get countsString(){return Object(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__["sprintf"])("%3i%3i 0 0 0 0 0 0 0 0999 V2000",this.structure.atomCount,this.structure.bondCount)}get chargeLines(){const t=[];this.structure.eachAtom((e=>{null!=e.formalCharge&&0!==e.formalCharge&&t.push([e.index,e.formalCharge])}));const e=[];for(let i=0;i{this._records.push(this.formatAtom(t))})),this.structure.eachBond((t=>{this._records.push(this.formatBond(t))})),this.chargeLines.forEach((t=>{this._records.push(t)})),this._records.push("M END")}_writeFooter(){this._records.push("$$$$")}getData(){return this._writeRecords(),this._records.join("\n")}}const li=[];class hi{constructor(t,e={}){this._mark=0,this._marks=[],this.offset=0,this.littleEndian=!0;let i=!1;void 0===t&&(t=8192),"number"==typeof t?t=new ArrayBuffer(t):i=!0;const r=e.offset?e.offset>>>0:0;let s=t.byteLength-r,n=r;t instanceof ArrayBuffer||(t.byteLength!==t.buffer.byteLength&&(n=t.byteOffset+r),t=t.buffer),this._lastWrittenByte=i?s:0,this.buffer=t,this.length=s,this.byteLength=s,this.byteOffset=n,this._data=new DataView(this.buffer,n,s)}available(t){return void 0===t&&(t=1),this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t){return void 0===t&&(t=1),this.offset+=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t){if(void 0===t&&(t=1),!this.available(t)){const e=2*(this.offset+t),i=new Uint8Array(e);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t){void 0===t&&(t=1);for(var e=new Uint8Array(t),i=0;ithis._lastWrittenByte&&(this._lastWrittenByte=this.offset)}}class di extends oi{constructor(t){super(),this.mimeType="application/vnd.ms-pki.stl",this.defaultName="surface",this.defaultExt="stl",this.surface=t}getData(){const t=this.surface.index.length/3,i=new hi(2*t+3*t*4*4+80+4);i.skip(80),i.writeUint32(t);const r=new e,s=new e,n=new e,o=new e;for(let e=0;e{0===this.count&&(this.signals.countChanged.remove(i,this),t.call(e))};this.signals.countChanged.add(i,this)}}dispose(){this.clear(),this.signals.countChanged.dispose()}}Ve.add("shader/BasicLine.vert","void main(){\n#include begin_vertex\n#include project_vertex\n}"),Ve.add("shader/BasicLine.frag","uniform vec3 uColor;\n#include common\n#include fog_pars_fragment\nvoid main(){\ngl_FragColor = vec4( uColor, 1.0 );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n}"),Ve.add("shader/Quad.vert","varying vec2 vUv;\nvoid main() {\nvUv = uv;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"),Ve.add("shader/Quad.frag","varying vec2 vUv;\nuniform sampler2D tForeground;\nuniform float scale;\nvoid main() {\nvec4 foreground = texture2D( tForeground, vUv );\ngl_FragColor = foreground * scale;\n}");class mi{constructor(){this.signals={updated:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.maxDuration=-1/0,this.minDuration=1/0,this.avgDuration=14,this.lastDuration=1/0,this.prevFpsTime=0,this.lastFps=1/0,this.lastFrames=1,this.frames=0,this.count=0,this.begin()}update(){this.startTime=this.end(),this.currentTime=this.startTime,this.signals.updated.dispatch()}begin(){this.startTime=window.performance.now(),this.lastFrames=this.frames}end(){const t=window.performance.now();return this.count+=1,this.frames+=1,this.lastDuration=t-this.startTime,this.minDuration=Math.min(this.minDuration,this.lastDuration),this.maxDuration=Math.max(this.maxDuration,this.lastDuration),this.avgDuration-=this.avgDuration/30,this.avgDuration+=this.lastDuration/30,t>this.prevFpsTime+1e3&&(this.lastFps=this.frames,this.prevFpsTime=t,this.frames=0),t}}Ve.add("shader/chunk/fog_fragment.glsl","#ifdef USE_FOG\nfloat depth = length( vViewPosition );\n#ifdef FOG_EXP2\nfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif"),Ve.add("shader/chunk/interior_fragment.glsl","if( gl_FrontFacing == false ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}"),Ve.add("shader/chunk/matrix_scale.glsl","float matrixScale( in mat4 m ){\nvec4 r = m[ 0 ];\nreturn sqrt( r[ 0 ] * r[ 0 ] + r[ 1 ] * r[ 1 ] + r[ 2 ] * r[ 2 ] );\n}"),Ve.add("shader/chunk/nearclip_vertex.glsl","#ifdef NEAR_CLIP\nif( vViewPosition.z < clipNear - 5.0 )\ngl_Position.z = 2.0 * gl_Position.w;\n#endif"),Ve.add("shader/chunk/nearclip_fragment.glsl","#ifdef NEAR_CLIP\nif( vViewPosition.z < clipNear )\ndiscard;\n#endif"),Ve.add("shader/chunk/opaque_back_fragment.glsl","#ifdef OPAQUE_BACK\n#ifdef FLIP_SIDED\nif( gl_FrontFacing == true ){\ngl_FragColor.a = 1.0;\n}\n#else\nif( gl_FrontFacing == false ){\ngl_FragColor.a = 1.0;\n}\n#endif\n#endif"),Ve.add("shader/chunk/radiusclip_vertex.glsl","#ifdef RADIUS_CLIP\nif( distance( vViewPosition, vClipCenter ) > clipRadius + 5.0 )\ngl_Position.z = 2.0 * gl_Position.w;\n#endif"),Ve.add("shader/chunk/radiusclip_fragment.glsl","#ifdef RADIUS_CLIP\nif( distance( vViewPosition, vClipCenter ) > clipRadius )\ndiscard;\n#endif"),Ve.add("shader/chunk/unpack_color.glsl","vec3 unpackColor(float f) {\nvec3 color;\ncolor.r = floor(f / 256.0 / 256.0);\ncolor.g = floor((f - color.r * 256.0 * 256.0) / 256.0);\ncolor.b = floor(f - color.r * 256.0 * 256.0 - color.g * 256.0);\nreturn color / 255.0;\n}");const pi=/^(?!\/\/)\s*#include\s+(\S+)/gim,fi={};function gi(t,e={}){let i=t+"|";for(const t in e)i+=t+":"+e[t];if(!fi[i]){const r=function(t){if(void 0===t)return"";const e=[];for(const i in t){const r=t[i];r&&e.push(`#define ${i} ${r}`)}return e.join("\n")+"\n"}(e);let s=Ve.get(`shader/${t}`);if(!s)throw new Error(`empty shader, '${t}'`);s=s.replace(pi,(function(t,e){const i=`shader/chunk/${e}.glsl`,r=Ve.get(i)||__WEBPACK_IMPORTED_MODULE_0_three__["N" /* ShaderChunk */][e];if(!r)throw new Error(`empty chunk, '${e}'`);return r})),fi[i]=r+s}return fi[i]}if("undefined"!=typeof WebGLRenderingContext){const t=WebGLRenderingContext.prototype,e=t.getShaderParameter;t.getShaderParameter=function(){return!De||e.apply(this,arguments)};const i=t.getShaderInfoLog;t.getShaderInfoLog=function(){return De?i.apply(this,arguments):""};const r=t.getProgramParameter;t.getProgramParameter=function(e,i){return!De&&i===t.LINK_STATUS||r.apply(this,arguments)};const s=t.getProgramInfoLog;t.getProgramInfoLog=function(){return De?s.apply(this,arguments):""}}const yi=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];yi.forEach((t=>{t.forEach((t=>{t[0]*=.0625,t[1]*=.0625}))}));class bi{constructor(t,e,i,r){this.canvas=document.createElement("canvas"),this._viewer=i,this._factor=st(r.factor,2),this._antialias=st(r.antialias,!1),this._onProgress=r.onProgress,this._onFinish=r.onFinish,this._antialias&&(this._factor*=2),this._n=this._factor*this._factor,this._width=this._viewer.width,this._height=this._viewer.height,this._antialias?(this.canvas.width=this._width*this._factor/2,this.canvas.height=this._height*this._factor/2):(this.canvas.width=this._width*this._factor,this.canvas.height=this._height*this._factor),this._ctx=this.canvas.getContext("2d"),this._viewerSampleLevel=i.sampleLevel,this._viewer.setSampling(-1)}_renderTile(t){const e=this._viewer,i=this._width,r=this._height,s=this._factor,n=t%s*i,o=Math.floor(t/s)*r;if(e.camera.setViewOffset(i*s,r*s,n,o,i,r),e.render(),this._antialias){const t=Math.round((n+i)/2)-Math.round(n/2),s=Math.round((o+r)/2)-Math.round(o/2);this._ctx.drawImage(e.renderer.domElement,Math.round(n/2),Math.round(o/2),t,s)}else this._ctx.drawImage(e.renderer.domElement,Math.floor(n),Math.floor(o),Math.ceil(i),Math.ceil(r));"function"==typeof this._onProgress&&this._onProgress(t+1,this._n,!1)}_finalize(){this._viewer.setSampling(this._viewerSampleLevel),this._viewer.camera.view=null,"function"==typeof this._onFinish&&this._onFinish(this._n+1,this._n,!1)}render(){for(let t=0;t<=this._n;++t)t===this._n?this._finalize():this._renderTile(t)}renderAsync(){let t=0;const e=this._n,i=()=>{t===e?this._finalize():this._renderTile(t),t+=1};for(let t=0;t<=e;++t)setTimeout(i,0)}}const xi=2*Math.PI,vi=180/Math.PI;function wi(t,e,i=1,r=0,s){const n=s?s.length:t.length/i;let o=0,a=0;if(s)for(let c=0;ce&&(e=t[i]);return e}function Di(t){let e=1/0;for(let i=0,r=t.length;i=0;l--){for(c=o-1;c>=0;c--)if(d=4*(l*o+c),a[d]!==e||a[d+1]!==i||a[d+2]!==r||a[d+3]!==s){h=!0;break}if(h)break}const p=l;for(h=!1,c=o-1;c>=0;c--){for(l=n-1;l>=0;l--)if(d=4*(l*o+c),a[d]!==e||a[d+1]!==i||a[d+2]!==r||a[d+3]!==s){h=!0;break}if(h)break}const f=c,g=document.createElement("canvas");return g.width=f-m,g.height=p-u,g.getContext("2d").drawImage(t,m,u,g.width,g.height,0,0,g.width,g.height),g}(t,n?0:255*e.r,n?0:255*e.g,n?0:255*e.b,n?0:255)}return t}function u(t,i,r){"function"==typeof e.onProgress&&e.onProgress(t,i,r)}return new Promise((function(e,i){const l=new bi(o,a,t,{factor:r,antialias:s,onProgress:u,onFinish:function(r,s){d(l.canvas).toBlob((function(r){o.setClearAlpha(c),h(!0),t.requestRender(),u(s,s,!0),r?e(r):i("error creating image")}),"image/png")}});o.setClearAlpha(n?0:1),h(),l.renderAsync()}))}const Fi=new e,Li=new i,Ni=new i;const zi=new t,Vi=new i,Gi=new i;function Ui(t,e){Vi.getInverse(e.projectionMatrix),Gi.copy(e.projectionMatrix).transpose(),t.traverse((function(t){const e=t.material;if(!e)return;const i=e.uniforms;i&&(i.projectionMatrixInverse&&i.projectionMatrixInverse.value.copy(Vi),i.projectionMatrixTranspose&&i.projectionMatrixTranspose.value.copy(Gi))}))}function ji(t,e,i){const r=t.createShader(i);if(!r)return void console.log(`error creating WebGL shader ${i}`);t.shaderSource(r,e),t.compileShader(r);return t.getShaderParameter(r,t.COMPILE_STATUS)?r:(console.log(`error compiling shader ${r}: ${t.getShaderInfoLog(r)}`),t.deleteShader(r),null)}function Hi(t,e){const i=t.getExtension(e);return i||console.log(`extension '${e}' not available`),i}const Wi=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]);function qi(t){const e=document.createElement("canvas");e.width=16,e.height=16,e.style.width="16px",e.style.height="16px";const i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return console.log(`error creating webgl context for ${t}`),!1;if(!(i instanceof WebGLRenderingContext))return console.log("Got unexpected type for WebGL rendering context"),!1;Hi(i,"OES_texture_float"),Hi(i,"OES_texture_half_float"),Hi(i,"WEBGL_color_buffer_float");const r=ji(i,"\nattribute vec4 a_position;\n\nvoid main() {\n gl_Position = a_position;\n}",i.VERTEX_SHADER),s=ji(i,"\nprecision mediump float;\nuniform vec4 u_color;\nuniform sampler2D u_texture;\n\nvoid main() {\n gl_FragColor = texture2D(u_texture, vec2(0.5, 0.5)) * u_color;\n}",i.FRAGMENT_SHADER);if(!r||!s)return!1;const n=function(t,e,i,r){const s=t.createProgram();return s?(e.forEach((e=>t.attachShader(s,e))),i&&i.forEach(((e,i)=>{t.bindAttribLocation(s,r?r[i]:i,e)})),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)?s:(console.log(`error linking program: ${t.getProgramInfoLog(s)}`),t.deleteProgram(s),null)):void console.log("error creating WebGL program")}(i,[r,s]);if(!n)return console.log("error creating WebGL program"),!1;i.useProgram(n);const o=i.getAttribLocation(n,"a_position"),a=i.getUniformLocation(n,"u_color");if(!a)return console.log("error getting 'u_color' uniform location"),!1;const c=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,Wi,i.STATIC_DRAW),i.enableVertexAttribArray(o),i.vertexAttribPointer(o,2,i.FLOAT,!1,0,0);const l=i.createTexture(),h=new Uint8Array([255,255,255,255]);i.bindTexture(i.TEXTURE_2D,l),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,h);const d=i.createTexture();i.bindTexture(i.TEXTURE_2D,d),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,1,1,0,i.RGBA,t,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST);const u=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,u),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,d,0);if(i.checkFramebufferStatus(i.FRAMEBUFFER)!==i.FRAMEBUFFER_COMPLETE)return console.log(`error creating framebuffer for ${t}`),!1;i.bindTexture(i.TEXTURE_2D,l),i.uniform4fv(a,[0,10,20,1]),i.drawArrays(i.TRIANGLES,0,6),i.bindTexture(i.TEXTURE_2D,d),i.bindFramebuffer(i.FRAMEBUFFER,null),i.clearColor(1,0,0,1),i.clear(i.COLOR_BUFFER_BIT),i.uniform4fv(a,[0,.1,.05,1]),i.drawArrays(i.TRIANGLES,0,6);const m=new Uint8Array(4);if(i.readPixels(0,0,1,1,i.RGBA,i.UNSIGNED_BYTE,m),0!==m[0]||m[1]<248||m[2]<248||m[3]<254)return console.log(`not able to actually render to ${t} texture`),!1;if(t===i.FLOAT){i.bindFramebuffer(i.FRAMEBUFFER,u);const t=new Float32Array(4);i.readPixels(0,0,1,1,i.RGBA,i.FLOAT,t);const e=i.getError();if(e)return console.log(`error reading pixels as float: '${function(t,e){switch(e){case t.NO_ERROR:return"no error";case t.INVALID_ENUM:return"invalid enum";case t.INVALID_VALUE:return"invalid value";case t.INVALID_OPERATION:return"invalid operation";case t.INVALID_FRAMEBUFFER_OPERATION:return"invalid framebuffer operation";case t.OUT_OF_MEMORY:return"out of memory";case t.CONTEXT_LOST_WEBGL:return"context lost"}return"unknown error"}(i,e)}'`),!1}return!0}const Xi=new Float32Array(100),Yi=new Uint8Array(100),Ki=[12,7,13,17,11,6,8,18,16,2,14,22,10,1,3,9,19,23,21,15,5,0,4,24,20],Zi=new i;function Qi(t,e,i,r,s){const n=s.uniforms,o=[];if(n&&(n.objectId&&(n.objectId.value=Ce?this.id:this.id/255,o.push("objectId")),(n.modelViewMatrixInverse||n.modelViewMatrixInverseTranspose||n.modelViewProjectionMatrix||n.modelViewProjectionMatrixInverse)&&this.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,this.matrixWorld),n.modelViewMatrixInverse&&(n.modelViewMatrixInverse.value.getInverse(this.modelViewMatrix),o.push("modelViewMatrixInverse")),n.modelViewMatrixInverseTranspose&&(n.modelViewMatrixInverse?n.modelViewMatrixInverseTranspose.value.copy(n.modelViewMatrixInverse.value).transpose():n.modelViewMatrixInverseTranspose.value.getInverse(this.modelViewMatrix).transpose(),o.push("modelViewMatrixInverseTranspose")),n.modelViewProjectionMatrix&&(n.modelViewProjectionMatrix.value.multiplyMatrices(i.projectionMatrix,this.modelViewMatrix),o.push("modelViewProjectionMatrix")),n.modelViewProjectionMatrixInverse&&(n.modelViewProjectionMatrix?(Zi.copy(n.modelViewProjectionMatrix.value),n.modelViewProjectionMatrixInverse.value.getInverse(Zi)):(Zi.multiplyMatrices(i.projectionMatrix,this.modelViewMatrix),n.modelViewProjectionMatrixInverse.value.getInverse(Zi)),o.push("modelViewProjectionMatrixInverse")),o.length)){const e=t.properties.get(s);if(e.program){const i=t.getContext(),r=e.program;i.useProgram(r.program);const s=r.getUniforms();o.forEach((function(t){s.setValue(i,t,n[t].value)}))}}}class Ji{constructor(t){if(this.boundingBox=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],this.boundingBoxSize=new e,this.boundingBoxLength=0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}},this.distVector=new e,this.signals={ticked:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],rendered:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},"string"==typeof t){const e=document.getElementById(t);this.container=null===e?document.createElement("div"):e}else t instanceof HTMLElement?this.container=t:this.container=document.createElement("div");if(this.container===document.body)this.width=window.innerWidth||1,this.height=window.innerHeight||1;else{const t=this.container.getBoundingClientRect();this.width=t.width||1,this.height=t.height||1,this.container.style.overflow="hidden"}this.wrapper=document.createElement("div"),this.wrapper.style.position="relative",this.container.appendChild(this.wrapper),this._initParams(),this._initStats(),this._initCamera(),this._initScene(),!1!==this._initRenderer()?(this._initHelper(),this.setBackground(),this.setFog(),this.animate=this.animate.bind(this)):Me.error("Viewer: could not initialize renderer")}_initParams(){this.parameters={fogColor:new s(0),fogNear:50,fogFar:100,backgroundColor:new s(0),cameraType:"perspective",cameraFov:40,cameraEyeSep:.3,cameraZ:-80,clipNear:0,clipFar:100,clipDist:10,clipMode:"scene",clipScale:"relative",lightColor:new s(14540253),lightIntensity:1,ambientColor:new s(14540253),ambientIntensity:.2,sampleLevel:0,rendererEncoding:__WEBPACK_IMPORTED_MODULE_0_three__["w" /* LinearEncoding */]}}_initCamera(){const t=new e(0,0,0),{width:i,height:r}=this;this.perspectiveCamera=new __WEBPACK_IMPORTED_MODULE_0_three__["G" /* PerspectiveCamera */](this.parameters.cameraFov,i/r),this.perspectiveCamera.position.z=this.parameters.cameraZ,this.perspectiveCamera.lookAt(t),this.orthographicCamera=new __WEBPACK_IMPORTED_MODULE_0_three__["F" /* OrthographicCamera */](i/-2,i/2,r/2,r/-2),this.orthographicCamera.position.z=this.parameters.cameraZ,this.orthographicCamera.lookAt(t),this.stereoCamera=new __WEBPACK_IMPORTED_MODULE_0_three__["Q" /* StereoCamera */],this.stereoCamera.aspect=.5,this.stereoCamera.eyeSep=this.parameters.cameraEyeSep;const s=this.parameters.cameraType;if("orthographic"===s)this.camera=this.orthographicCamera;else{if("perspective"!==s&&"stereo"!==s)throw new Error(`Unknown cameraType '${s}'`);this.camera=this.perspectiveCamera}this.camera.updateProjectionMatrix()}_initStats(){this.stats=new mi}_initScene(){this.scene||(this.scene=new __WEBPACK_IMPORTED_MODULE_0_three__["M" /* Scene */],this.scene.name="scene"),this.rotationGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.rotationGroup.name="rotationGroup",this.scene.add(this.rotationGroup),this.translationGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.translationGroup.name="translationGroup",this.rotationGroup.add(this.translationGroup),this.modelGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.modelGroup.name="modelGroup",this.translationGroup.add(this.modelGroup),this.pickingGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.pickingGroup.name="pickingGroup",this.translationGroup.add(this.pickingGroup),this.backgroundGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.backgroundGroup.name="backgroundGroup",this.translationGroup.add(this.backgroundGroup),this.helperGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.helperGroup.name="helperGroup",this.translationGroup.add(this.helperGroup),this.scene.fog=new __WEBPACK_IMPORTED_MODULE_0_three__["q" /* Fog */](this.parameters.fogColor.getHex()),this.spotLight=new __WEBPACK_IMPORTED_MODULE_0_three__["P" /* SpotLight */](this.parameters.lightColor.getHex(),this.parameters.lightIntensity),this.scene.add(this.spotLight),this.ambientLight=new __WEBPACK_IMPORTED_MODULE_0_three__["b" /* AmbientLight */](this.parameters.ambientColor.getHex(),this.parameters.ambientIntensity),this.scene.add(this.ambientLight)}_initRenderer(){const t=window.devicePixelRatio,{width:e,height:i}=this;try{this.renderer=new __WEBPACK_IMPORTED_MODULE_0_three__["_0" /* WebGLRenderer */]({preserveDrawingBuffer:!0,alpha:!0,antialias:!0})}catch(t){return this.wrapper.innerHTML='

Your browser/graphics card does not seem to support WebGL.

Find out how to get it here.

',!1}this.renderer.setPixelRatio(t),this.renderer.setSize(e,i),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.outputEncoding=this.parameters.rendererEncoding;const r=this.renderer.getContext();this.renderer.capabilities.isWebGL2?(ke(!0),Pe(this.renderer.extensions.get("EXT_color_buffer_float")),this.supportsHalfFloat=!0):(ke(this.renderer.extensions.get("EXT_frag_depth")),this.renderer.extensions.get("OES_element_index_uint"),Pe(this.renderer.extensions.get("OES_texture_float")&&this.renderer.extensions.get("WEBGL_color_buffer_float")||this.renderer.extensions.get("OES_texture_float")&&qi(r.FLOAT)),this.renderer.extensions.get("OES_texture_float"),this.supportsHalfFloat=this.renderer.extensions.get("OES_texture_half_float")&&qi(36193)),this.wrapper.appendChild(this.renderer.domElement);const s=e*t,n=i*t;De&&console.log(JSON.stringify({Browser:Ae,OES_texture_float:!!this.renderer.extensions.get("OES_texture_float"),OES_texture_half_float:!!this.renderer.extensions.get("OES_texture_half_float"),WEBGL_color_buffer_float:!!this.renderer.extensions.get("WEBGL_color_buffer_float"),"testTextureSupport Float":qi(r.FLOAT),"testTextureSupport HalfFloat":qi(36193),"this.supportsHalfFloat":this.supportsHalfFloat,SupportsReadPixelsFloat:Ce},null,2)),this.pickingTarget=new __WEBPACK_IMPORTED_MODULE_0_three__["Z" /* WebGLRenderTarget */](s,n,{minFilter:__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],magFilter:__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],stencilBuffer:!1,format:__WEBPACK_IMPORTED_MODULE_0_three__["L" /* RGBAFormat */],type:Ce?__WEBPACK_IMPORTED_MODULE_0_three__["p" /* FloatType */]:__WEBPACK_IMPORTED_MODULE_0_three__["W" /* UnsignedByteType */]}),this.pickingTarget.texture.generateMipmaps=!1,this.pickingTarget.texture.encoding=this.parameters.rendererEncoding,this.renderer.setRenderTarget(this.pickingTarget),this.renderer.clear(),this.renderer.setRenderTarget(null),this.sampleTarget=new __WEBPACK_IMPORTED_MODULE_0_three__["Z" /* WebGLRenderTarget */](s,n,{minFilter:__WEBPACK_IMPORTED_MODULE_0_three__["x" /* LinearFilter */],magFilter:__WEBPACK_IMPORTED_MODULE_0_three__["x" /* LinearFilter */],format:__WEBPACK_IMPORTED_MODULE_0_three__["L" /* RGBAFormat */]}),this.sampleTarget.texture.encoding=this.parameters.rendererEncoding,this.holdTarget=new __WEBPACK_IMPORTED_MODULE_0_three__["Z" /* WebGLRenderTarget */](s,n,{minFilter:__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],magFilter:__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],format:__WEBPACK_IMPORTED_MODULE_0_three__["L" /* RGBAFormat */],type:__WEBPACK_IMPORTED_MODULE_0_three__["W" /* UnsignedByteType */]}),this.holdTarget.texture.encoding=this.parameters.rendererEncoding,this.compositeUniforms={tForeground:new __WEBPACK_IMPORTED_MODULE_0_three__["T" /* Uniform */](this.sampleTarget.texture),scale:new __WEBPACK_IMPORTED_MODULE_0_three__["T" /* Uniform */](1)},this.compositeMaterial=new __WEBPACK_IMPORTED_MODULE_0_three__["O" /* ShaderMaterial */]({uniforms:this.compositeUniforms,vertexShader:gi("Quad.vert"),fragmentShader:gi("Quad.frag"),premultipliedAlpha:!0,transparent:!0,blending:__WEBPACK_IMPORTED_MODULE_0_three__["a" /* AdditiveBlending */],depthTest:!1,depthWrite:!1}),this.compositeCamera=new __WEBPACK_IMPORTED_MODULE_0_three__["F" /* OrthographicCamera */](-1,1,1,-1,0,1),this.compositeScene=new __WEBPACK_IMPORTED_MODULE_0_three__["M" /* Scene */],this.compositeScene.name="compositeScene",this.compositeScene.add(new __WEBPACK_IMPORTED_MODULE_0_three__["A" /* Mesh */](new __WEBPACK_IMPORTED_MODULE_0_three__["I" /* PlaneGeometry */](2,2),this.compositeMaterial))}_initHelper(){const t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(24),i=new __WEBPACK_IMPORTED_MODULE_0_three__["g" /* BufferGeometry */];i.setIndex(new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](t,1)),i.setAttribute("position",new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](e,3));const r=new __WEBPACK_IMPORTED_MODULE_0_three__["O" /* ShaderMaterial */]({uniforms:{uColor:{value:new s("skyblue")}},vertexShader:gi("BasicLine.vert"),fragmentShader:gi("BasicLine.frag")});this.boundingBoxMesh=new __WEBPACK_IMPORTED_MODULE_0_three__["v" /* LineSegments */](i,r),this.helperGroup.add(this.boundingBoxMesh)}updateHelper(){const t=this.boundingBoxMesh.geometry.attributes.position,e=t.array,{min:i,max:r}=this.boundingBox;e[0]=r.x,e[1]=r.y,e[2]=r.z,e[3]=i.x,e[4]=r.y,e[5]=r.z,e[6]=i.x,e[7]=i.y,e[8]=r.z,e[9]=r.x,e[10]=i.y,e[11]=r.z,e[12]=r.x,e[13]=r.y,e[14]=i.z,e[15]=i.x,e[16]=r.y,e[17]=i.z,e[18]=i.x,e[19]=i.y,e[20]=i.z,e[21]=r.x,e[22]=i.y,e[23]=i.z,t.needsUpdate=!0,this.boundingBox.isEmpty()||this.boundingBoxMesh.geometry.computeBoundingSphere()}get cameraDistance(){return Math.abs(this.camera.position.z)}set cameraDistance(t){this.camera.position.z=-t}add(t,e){e?e.forEach((e=>this.addBuffer(t,e))):this.addBuffer(t),t.group.name="meshGroup",t.wireframeGroup.name="wireframeGroup",t.parameters.background?(this.backgroundGroup.add(t.group),this.backgroundGroup.add(t.wireframeGroup)):(this.modelGroup.add(t.group),this.modelGroup.add(t.wireframeGroup)),t.pickable&&this.pickingGroup.add(t.pickingGroup),De&&this.updateHelper()}addBuffer(t,e){function i(r){r instanceof __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */]?r.children.forEach(i):(r.userData.buffer=t,r.userData.instance=e,r.onBeforeRender=Qi)}const r=t.getMesh();e&&r.applyMatrix4(e.matrix),i(r),t.group.add(r);const s=t.getWireframeMesh();if(e&&(s.matrix.copy(r.matrix),s.position.copy(r.position),s.quaternion.copy(r.quaternion),s.scale.copy(r.scale)),i(s),t.wireframeGroup.add(s),t.pickable){const s=t.getPickingMesh();e&&(s.matrix.copy(r.matrix),s.position.copy(r.position),s.quaternion.copy(r.quaternion),s.scale.copy(r.scale)),i(s),t.pickingGroup.add(s)}e?this._updateBoundingBox(t.geometry,t.matrix,e.matrix):this._updateBoundingBox(t.geometry,t.matrix)}remove(t){this.translationGroup.children.forEach((function(e){e.remove(t.group),e.remove(t.wireframeGroup)})),t.pickable&&this.pickingGroup.remove(t.pickingGroup),this.updateBoundingBox(),De&&this.updateHelper()}_updateBoundingBox(t,e,i){const r=this.boundingBox;function s(t,e,i){null==t.boundingBox&&t.computeBoundingBox();const s=t.boundingBox.clone();e&&s.applyMatrix4(e),i&&s.applyMatrix4(i),s.min.equals(s.max)&&s.expandByScalar(5),r.union(s)}function n(t){if(void 0!==t.geometry){let e,i;t.userData.buffer&&(e=t.userData.buffer.matrix),t.userData.instance&&(i=t.userData.instance.matrix),s(t.geometry,e,i)}}t?s(t,e,i):(r.makeEmpty(),this.modelGroup.traverse(n),this.backgroundGroup.traverse(n)),r.getSize(this.boundingBoxSize),this.boundingBoxLength=this.boundingBoxSize.length()}updateBoundingBox(){this._updateBoundingBox(),De&&this.updateHelper()}getPickingPixels(){const{width:t,height:e}=this,i=t*e*4,r=Ce?new Float32Array(i):new Uint8Array(i);return this.render(!0),this.renderer.readRenderTargetPixels(this.pickingTarget,0,0,t,e,r),r}getImage(t){return new Promise((e=>{if(t){const{width:t,height:i}=this,r=t*i*4;let s=this.getPickingPixels();if(Ce){const t=new Uint8Array(r);for(let e=0;e500&&!this.isStill&&this.sampleLevel<3&&-1!==this.sampleLevel){const t=this.sampleLevel;this.sampleLevel=3,this.renderPending=!0,this.render(),this.isStill=!0,this.sampleLevel=t,De&&Me.log("rendered still frame")}this.frameRequest=window.requestAnimationFrame(this.animate)}pick(t,e){if("stereo"===this.parameters.cameraType)return{pid:0,instance:void 0,picker:void 0};t*=window.devicePixelRatio,e*=window.devicePixelRatio,t=Math.max(t-2,0),e=Math.max(e-2,0);let i,r,s=0;const n=Ce?Xi:Yi;this.render(!0),this.renderer.readRenderTargetPixels(this.pickingTarget,t,e,5,5,n);for(let t=0;t22&&(this.stats.begin(),this.isStill=!1),this.renderPending=!0,window.requestAnimationFrame((()=>{this.render(),this.stats.update()})))}updateZoom(){const t=kt(this.perspectiveCamera.fov),e=2*Math.tan(t/2)*this.cameraDistance;this.orthographicCamera.zoom=this.height/e}absoluteToRelative(t){return 50*(1-t/this.bRadius)}relativeToAbsolute(t){return this.bRadius*(1-t/50)}__updateClipping(){const t=this.parameters;this.bRadius=Math.max(10,.5*this.boundingBoxLength),isFinite(this.bRadius)||(this.bRadius=50),this.camera.getWorldPosition(this.distVector),this.cDist=this.distVector.length(),this.cDist||(this.cameraDistance=Math.abs(t.cameraZ),this.cDist=Math.abs(t.cameraZ));const e=this.scene.fog;if(e.color.set(t.fogColor),"camera"===t.clipMode)this.camera.near=t.clipNear,this.camera.far=t.clipFar,e.near=t.fogNear,e.far=t.fogFar;else if("absolute"===t.clipScale)this.camera.near=this.cDist-t.clipNear,this.camera.far=this.cDist+t.clipFar,e.near=this.cDist-t.fogNear,e.far=this.cDist+t.fogFar;else{const i=(50-t.clipNear)/50,r=-(50-t.clipFar)/50;this.camera.near=this.cDist-this.bRadius*i,this.camera.far=this.cDist+this.bRadius*r;const s=(50-t.fogNear)/50,n=-(50-t.fogFar)/50;e.near=this.cDist-this.bRadius*s,e.far=this.cDist+this.bRadius*n}"camera"!==t.clipMode&&("PerspectiveCamera"===this.camera.type?(this.camera.near=Math.max(.1,t.clipDist,this.camera.near),this.camera.far=Math.max(1,this.camera.far),e.near=Math.max(.1,e.near),e.far=Math.max(1,e.far)):"OrthographicCamera"===this.camera.type&&t.clipDist>0&&(this.camera.near=Math.max(t.clipDist,this.camera.near)))}__updateCamera(){const e=this.camera;e.updateMatrix(),e.updateMatrixWorld(!0),e.updateProjectionMatrix(),function(e,i,r,s,n){let o=new t;r.getSize(o);const a=o.height,c=r.getPixelRatio(),l="OrthographicCamera"===i.type;zi.set(o.width,o.height),Vi.getInverse(i.projectionMatrix),Gi.copy(i.projectionMatrix).transpose(),e.traverse((function(t){const e=t.material;if(!e)return;const i=e.uniforms;if(i){if(e.clipNear){const t=(50-e.clipNear)/50,r=s-n*t;i.clipNear.value=r}i.canvasHeight&&(i.canvasHeight.value=a),i.resolution&&i.resolution.value.copy(zi),i.pixelRatio&&(i.pixelRatio.value=c),i.projectionMatrixInverse&&i.projectionMatrixInverse.value.copy(Vi),i.projectionMatrixTranspose&&i.projectionMatrixTranspose.value.copy(Gi),i.ortho&&(i.ortho.value=l)}}))}(this.scene,e,this.renderer,this.cDist,this.bRadius),function(t,e){t.traverseVisible((function(t){if(!(t instanceof o&&t.userData.buffer.parameters.sortParticles))return;const i=t.geometry.attributes,r=i.position.count;if(0===r)return;let s,n,a,c,l,h,d,u;Li.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),Ni.multiplyMatrices(e.projectionMatrix,Li),t.userData.sortData?(s=t.userData.sortData,a=s.__zArray,n=s.__sortArray,c=s.__cmpFn):(a=new Float32Array(r),n=new Uint32Array(r),c=function(t,e){const i=a[t],r=a[e];return i>r?1:ie?1:t=l&&e(t[o],n)>0;)t[o+1]=t[o],--o;t[o+1]=n}if(-1===c)break;h=s[c--],l=s[c--]}else{for(o=l+1,a=h,d(l+h>>1,o),e(t[l],t[h])>0&&d(l,h),e(t[o],t[h])>0&&d(o,h),e(t[l],t[o])>0&&d(l,o),n=t[o];;){do{o++}while(e(t[o],n)<0);do{a--}while(e(t[a],n)>0);if(a=a-l?(s[++c]=o,s[++c]=h,h=a-1):(s[++c]=l,s[++c]=a-1,l=o)}}(n,c);for(let t in i){const e=i[t],o=e.array,a=e.itemSize;s[t]||(s[t]=new Float32Array(a*r)),u=s[t],s[t]=o;for(let t=0;t0&&"stereo"!==this.parameters.cameraType?this.__renderSuperSample(e,i):this.__renderModelGroup(e,i)}render(t=!1,e){if(this.rendering)Me.warn("'tried to call 'render' from within 'render'");else{this.rendering=!0;try{this.__updateClipping(),this.__updateCamera(),this.__updateLights(),this.updateInfo(!0),"stereo"===this.parameters.cameraType?this.__renderStereo(t,e):this.__render(t,this.camera,e),this.lastRenderedPicking=t}finally{this.rendering=!1,this.renderPending=!1}this.signals.rendered.dispatch()}}clear(){Me.log("scene cleared"),this.scene.remove(this.rotationGroup),this._initScene(),this.renderer.clear()}dispose(){this.renderer.dispose(),window.cancelAnimationFrame(this.frameRequest)}}const tr=1,er=2,ir=3;function rr(t){const e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY;return Math.sqrt(e*e+i*i)}class sr{constructor(e,i={}){this.domElement=e,this.signals={moved:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],scrolled:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],dragged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],dropped:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],clicked:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],hovered:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],doubleClicked:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.position=new t,this.prevPosition=new t,this.down=new t,this.canvasPosition=new t,this.prevClickCP=new t,this.moving=!1,this.hovering=!0,this.scrolled=!1,this.lastMoved=1/0,this.which=0,this.buttons=0,this.pressed=!1,this.altKey=!1,this.ctrlKey=!1,this.metaKey=!1,this.shiftKey=!1,this.domElement.style.touchAction="none",this.hoverTimeout=st(i.hoverTimeout,50),this.handleScroll=st(i.handleScroll,!0),this.doubleClickSpeed=st(i.doubleClickSpeed,500),this._listen=this._listen.bind(this),this._onMousewheel=this._onMousewheel.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMousedown=this._onMousedown.bind(this),this._onMouseup=this._onMouseup.bind(this),this._onContextmenu=this._onContextmenu.bind(this),this._onTouchstart=this._onTouchstart.bind(this),this._onTouchend=this._onTouchend.bind(this),this._onTouchmove=this._onTouchmove.bind(this),this._listen();const r={passive:!1};document.addEventListener("mousewheel",this._onMousewheel,r),document.addEventListener("wheel",this._onMousewheel,r),document.addEventListener("MozMousePixelScroll",this._onMousewheel,r),document.addEventListener("mousemove",this._onMousemove,r),document.addEventListener("mousedown",this._onMousedown,r),document.addEventListener("mouseup",this._onMouseup,r),document.addEventListener("contextmenu",this._onContextmenu,r),document.addEventListener("touchstart",this._onTouchstart,r),document.addEventListener("touchend",this._onTouchend,r),document.addEventListener("touchmove",this._onTouchmove,r)}get key(){let t=0;return this.altKey&&(t+=1),this.ctrlKey&&(t+=2),this.metaKey&&(t+=4),this.shiftKey&&(t+=8),t}setParameters(t={}){this.hoverTimeout=st(t.hoverTimeout,this.hoverTimeout)}_listen(){const t=window.performance.now(),e=this.canvasPosition;this.doubleClickPending&&t-this.lastClicked>this.doubleClickSpeed&&(this.doubleClickPending=!1),t-this.lastMoved>this.hoverTimeout&&(this.moving=!1),(this.scrolled||!this.moving&&!this.hovering)&&(this.scrolled=!1,-1!==this.hoverTimeout&&this.overElement&&(this.hovering=!0,this.signals.hovered.dispatch(e.x,e.y))),this.frameRequest=window.requestAnimationFrame(this._listen)}_onMousewheel(t){if(t.target!==this.domElement||!this.handleScroll)return;t.preventDefault(),this._setKeys(t);let e=0;"deltaY"in t&&"deltaMode"in t&&void 0!==t.deltaY&&void 0!==t.deltaMode?e=t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?.025*-t.deltaY:t.deltaMode===WheelEvent.DOM_DELTA_LINE?-t.deltaY*(2.5/3):2.5*-t.deltaY:"deltaY"in t&&!("detail"in t)?e=.025*-t.deltaY:void 0!==t.wheelDelta?e=.025*-t.wheelDelta:void 0!==t.wheelDeltaY?e=.025*-t.wheelDeltaY:void 0!==t.detail&&(e=-t.detail/3),this.signals.scrolled.dispatch(e),setTimeout((()=>{this.scrolled=!0}),this.hoverTimeout)}_onMousemove(t){t.target===this.domElement?(t.preventDefault(),this.overElement=!0):this.overElement=!1,this._setKeys(t),this.moving=!0,this.hovering=!1,this.lastMoved=window.performance.now(),this.prevPosition.copy(this.position),this.position.set(t.clientX,t.clientY),this._setCanvasPosition(t);const e=this.prevPosition.x-this.position.x,i=this.prevPosition.y-this.position.y;this.signals.moved.dispatch(e,i),this.pressed&&this.signals.dragged.dispatch(e,i)}_onMousedown(t){t.target===this.domElement&&(t.preventDefault(),this._setKeys(t),this.moving=!1,this.hovering=!1,this.down.set(t.clientX,t.clientY),this.position.set(t.clientX,t.clientY),this.which=t.which,this.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){const e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<2&&this.handleScroll&&this.position.distanceTo(this.prevPosition)<2)this.which=0,this.buttons=0,this.signals.scrolled.dispatch(i/2);else{this.which=3,this.buttons=2;const t=this.prevPosition.x-this.position.x,e=this.prevPosition.y-this.position.y;this.signals.moved.dispatch(t,e),this.pressed&&this.signals.dragged.dispatch(t,e)}}}}_distance(){return this.position.distanceTo(this.down)}_setCanvasPosition(t){const e=this.domElement.getBoundingClientRect();let i,r;"clientX"in t&&"clientY"in t?(i=t.clientX-e.left,r=t.clientY-e.top):(i=t.offsetX,r=t.offsetY),this.canvasPosition.set(i,e.height-r)}_setKeys(t){this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.metaKey=t.metaKey,this.shiftKey=t.shiftKey}dispose(){document.removeEventListener("mousewheel",this._onMousewheel),document.removeEventListener("wheel",this._onMousewheel),document.removeEventListener("MozMousePixelScroll",this._onMousewheel),document.removeEventListener("mousemove",this._onMousemove),document.removeEventListener("mousedown",this._onMousedown),document.removeEventListener("mouseup",this._onMouseup),document.removeEventListener("contextmenu",this._onContextmenu),document.removeEventListener("touchstart",this._onTouchstart),document.removeEventListener("touchend",this._onTouchend),document.removeEventListener("touchmove",this._onTouchmove),window.cancelAnimationFrame(this.frameRequest)}}const nr=new i,or=new i,ar=new i,cr=new i,lr=new i,hr=new e,dr=new r,ur=new r,mr=new i,pr=new e,fr=new e;class gr{constructor(t,e={}){this.stage=t,this.rotateSpeed=st(e.rotateSpeed,2),this.zoomSpeed=st(e.zoomSpeed,1.2),this.panSpeed=st(e.panSpeed,1),this.viewer=t.viewer,this.mouse=t.mouseObserver,this.controls=t.viewerControls}get component(){return this.stage.transformComponent}get atom(){return this.stage.transformAtom}_setPanVector(t,e,i=0){const r=this.controls.getCanvasScaleFactor(i);pr.set(t,e,0),pr.multiplyScalar(this.panSpeed*r)}_getRotateXY(t,e){return[this.rotateSpeed*-t*.01,this.rotateSpeed*e*.01]}_getCameraRotation(t){return t.extractRotation(this.viewer.camera.matrixWorld),t.multiply(or.makeRotationY(Math.PI)),t}_transformPanVector(){this.component&&(mr.extractRotation(this.component.transform),mr.premultiply(this.viewer.rotationGroup.matrix),mr.getInverse(mr),mr.multiply(this._getCameraRotation(cr)),pr.applyMatrix4(mr))}zoom(t){this.controls.zoom(this.zoomSpeed*t*.02)}pan(t,e){this._setPanVector(t,e),mr.getInverse(this.viewer.rotationGroup.matrix),mr.multiply(this._getCameraRotation(cr)),pr.applyMatrix4(mr),this.controls.translate(pr)}panComponent(t,e){this.component&&(this._setPanVector(t,e),this._transformPanVector(),this.component.position.add(pr),this.component.updateMatrix())}panAtom(t,e){this.atom&&this.component&&(this.atom.positionToVector3(fr),fr.add(this.viewer.translationGroup.position),fr.applyMatrix4(this.viewer.rotationGroup.matrix),this._setPanVector(t,e,fr.z),this._transformPanVector(),this.atom.positionAdd(pr),this.component.updateRepresentations({position:!0}))}rotate(t,e){const[i,r]=this._getRotateXY(t,e);this._getCameraRotation(cr),hr.set(1,0,0),hr.applyMatrix4(cr),dr.setFromAxisAngle(hr,r),hr.set(0,1,0),hr.applyMatrix4(cr),ur.setFromAxisAngle(hr,i),dr.multiply(ur),cr.makeRotationFromQuaternion(dr),this.controls.applyMatrix(cr)}zRotate(t,e){const i=this.rotateSpeed*((-t+e)/-2)*.01;ar.makeRotationZ(i),this.controls.applyMatrix(ar)}rotateComponent(t,e){if(!this.component)return;const[i,r]=this._getRotateXY(t,e);this._getCameraRotation(lr),cr.extractRotation(this.component.transform),cr.premultiply(this.viewer.rotationGroup.matrix),cr.getInverse(cr),cr.premultiply(lr),hr.set(1,0,0),hr.applyMatrix4(cr),nr.makeRotationAxis(hr,r),hr.set(0,1,0),hr.applyMatrix4(cr),or.makeRotationAxis(hr,i),nr.multiply(or),dr.setFromRotationMatrix(nr),this.component.quaternion.premultiply(dr),this.component.quaternion.normalize(),this.component.updateMatrix()}}const yr=new e;class br{constructor(t,e){this.stage=e,this.pid=t.pid,this.picker=t.picker,this.instance=t.instance,this.stage=e,this.controls=e.viewerControls,this.mouse=e.mouseObserver}get type(){return this.picker.type}get altKey(){return this.mouse.altKey}get ctrlKey(){return this.mouse.ctrlKey}get metaKey(){return this.mouse.metaKey}get shiftKey(){return this.mouse.shiftKey}get canvasPosition(){return this.mouse.canvasPosition}get component(){return this.stage.getComponentsByObject(this.picker.data).list[0]}get object(){return this.picker.getObject(this.pid)}get position(){return this.picker.getPosition(this.pid,this.instance,this.component)}get closestBondAtom(){if("bond"!==this.type||!this.bond)return;const t=this.bond,e=this.controls,i=this.canvasPosition,r=t.atom1.positionToVector3(),s=t.atom2.positionToVector3();r.applyMatrix4(this.component.matrix),s.applyMatrix4(this.component.matrix);const n=e.getPositionOnCanvas(r),o=e.getPositionOnCanvas(s);return c=n,l=o,(a=i).distanceTo(c)=t.length))return new br(i,this.stage);console.error("pid >= picker.array.length")}}}const vr=new r,wr=new e,Ar=new e,_r=new e,Sr=new e,Cr=new i,Pr=new e,Ir=new i;class kr{constructor(t){this.stage=t,this.signals={changed:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.viewer=t.viewer}get position(){return this.viewer.translationGroup.position}get rotation(){return this.viewer.rotationGroup.quaternion}changed(){this.viewer.requestRender(),this.signals.changed.dispatch()}getPositionOnCanvas(e,i){const r=wt(i,t);const s=this.viewer;return _r.copy(e).add(s.translationGroup.position).applyMatrix4(s.rotationGroup.matrix).project(s.camera),r.set((_r.x+1)*s.width/2,(_r.y+1)*s.height/2)}getCanvasScaleFactor(t=0){const e=this.viewer.camera;if(e instanceof __WEBPACK_IMPORTED_MODULE_0_three__["F" /* OrthographicCamera */])return 1/e.zoom;{t=Math.abs(t),t+=this.getCameraDistance();const i=kt(e.fov);return 2*t*Math.tan(i/2)/this.viewer.height}}getOrientation(t){const e=_t(t);e.copy(this.viewer.rotationGroup.matrix);const i=this.getCameraDistance();return e.scale(Sr.set(i,i,i)),e.setPosition(this.viewer.translationGroup.position),e}orient(t){_t(t).decompose(wr,vr,Ar);const e=this.viewer;e.rotationGroup.setRotationFromQuaternion(vr),e.translationGroup.position.copy(wr),e.cameraDistance=Ar.z,e.updateZoom(),this.changed()}translate(t){this.viewer.translationGroup.position.add(At(t)),this.changed()}center(t){this.viewer.translationGroup.position.copy(At(t)).negate(),this.changed()}zoom(t){this.distance(this.getCameraDistance()*(1-t))}getCameraDistance(){return this.viewer.cameraDistance}distance(t){this.viewer.cameraDistance=Math.max(Math.abs(t),.2),this.viewer.updateZoom(),this.changed()}spin(t,e){Cr.getInverse(this.viewer.rotationGroup.matrix),Pr.copy(At(t)).applyMatrix4(Cr),this.viewer.rotationGroup.rotateOnAxis(Pr,e),this.changed()}rotate(t){this.viewer.rotationGroup.setRotationFromQuaternion(St(t)),this.changed()}align(t){Ir.getInverse(_t(t)),this.viewer.rotationGroup.setRotationFromMatrix(Ir),this.changed()}applyMatrix(t){this.viewer.rotationGroup.applyMatrix4(_t(t)),this.changed()}}class Mr{constructor(t,e,...i){this.pausedTime=-1,this.elapsedDuration=0,this.pausedDuration=0,this.ignoreGlobalToggle=!1,this._paused=!1,this._resolveList=[],this.duration=st(t,1e3),this.controls=e,this.startTime=window.performance.now(),this._init(...i)}get done(){return 1===this.alpha}get paused(){return this._paused}tick(t){if(!this._paused)return this.elapsedDuration=t.currentTime-this.startTime-this.pausedDuration,0===this.duration?this.alpha=1:this.alpha=Rt(0,1,this.elapsedDuration/this.duration),this._tick(t),this.done&&this._resolveList.forEach((t=>t())),this.done}pause(t){t&&(this._hold=!0),-1===this.pausedTime&&(this.pausedTime=window.performance.now()),this._paused=!0}resume(t){!t&&this._hold||(this.pausedDuration+=window.performance.now()-this.pausedTime,this._paused=!1,this._hold=!1,this.pausedTime=-1)}toggle(){this._paused?this.resume():this.pause()}then(t){let e;return e=this.done?Promise.resolve():new Promise((t=>this._resolveList.push(t))),e.then(t)}}class Tr extends Mr{constructor(t,e,...i){super(st(t,1/0),e,...i)}_init(t,i){Array.isArray(t)?this.axis=(new e).fromArray(t):this.axis=st(t,new e(0,1,0)),this.angle=st(i,.01)}_tick(t){this.axis&&this.angle&&this.controls.spin(this.axis,this.angle*t.lastDuration/16)}}class Br extends Mr{constructor(t,e,...i){super(st(t,1/0),e,...i),this.angleSum=0,this.direction=1}_init(t,i,r){Array.isArray(t)?this.axis=(new e).fromArray(t):this.axis=st(t,new e(0,1,0)),this.angleStep=st(i,.01),this.angleEnd=st(r,.2)}_tick(t){if(!this.axis||!this.angleStep||!this.angleEnd)return;const e=Rt(0,1,Math.abs(this.angleSum)/this.angleEnd),i=this.angleStep*this.direction*(1.1-e);this.controls.spin(this.axis,i*t.lastDuration/16),this.angleSum+=this.angleStep,this.angleSum>=this.angleEnd&&(this.direction*=-1,this.angleSum=-this.angleEnd)}}class Dr extends Mr{_init(t,i){this.moveFrom=At(st(t,new e)),this.moveTo=At(st(i,new e))}_tick(){this.controls.position.lerpVectors(this.moveFrom,this.moveTo,this.alpha).negate(),this.controls.changed()}}class $r extends Mr{_init(t,e){this.zoomFrom=t,this.zoomTo=e}_tick(){this.controls.distance($t(this.zoomFrom,this.zoomTo,this.alpha))}}class Or extends Mr{constructor(){super(...arguments),this._currentRotation=new r}_init(t,e){this.rotateFrom=St(t),this.rotateTo=St(e),this._currentRotation=new r}_tick(){this._currentRotation.copy(this.rotateFrom).slerp(this.rotateTo,this.alpha),this.controls.rotate(this._currentRotation)}}class Rr extends Mr{_init(t,e,i){this.valueFrom=t,this.valueTo=e,this.callback=i}_tick(){this.callback($t(this.valueFrom,this.valueTo,this.alpha))}}class Er extends Mr{_init(t){this.callback=t}_tick(){1===this.alpha&&this.callback()}}class Fr{constructor(t=[]){this._resolveList=[],this._list=t}get done(){return this._list.every((t=>t.done))}then(t){let e;return e=this.done?Promise.resolve():new Promise((t=>{this._resolveList.push(t),this._list.forEach((t=>{t.then((()=>{this._resolveList.forEach((t=>{t()})),this._resolveList.length=0}))}))})),e.then(t)}}class Lr{constructor(t){this.stage=t,this.animationList=[],this.finishedList=[],this.viewer=t.viewer,this.controls=t.viewerControls}get paused(){return this.animationList.every((t=>t.paused))}add(t){return 0===t.duration?t.tick(this.viewer.stats):this.animationList.push(t),t}remove(t){const e=this.animationList,i=e.indexOf(t);i>-1&&e.splice(i,1)}run(t){const e=this.finishedList,i=this.animationList,r=i.length;for(let s=0;st.pause()))}resume(){this.animationList.forEach((t=>t.resume()))}toggle(){this.paused?this.resume():this.pause()}clear(){this.animationList.length=0}dispose(){this.clear()}}class Nr{constructor(t,e){if(this.fn=t,this.queue=[],this.pending=!1,this.next=this.next.bind(this),e){for(let t=0,i=e.length;tthis.run(t)))):this.pending=!1}push(t){this.queue.push(t),this.pending||this.next()}kill(){this.queue.length=0}length(){return this.queue.length}}class zr{constructor(t,e,i){this.type="",this.parameters={lazy:{type:"boolean"},clipNear:{type:"range",step:1,max:100,min:0,buffer:!0},clipRadius:{type:"number",precision:1,max:1e3,min:0,buffer:!0},clipCenter:{type:"vector3",precision:1,buffer:!0},flatShaded:{type:"boolean",buffer:!0},opacity:{type:"range",step:.01,max:1,min:0,buffer:!0},depthWrite:{type:"boolean",buffer:!0},side:{type:"select",buffer:!0,options:{front:"front",back:"back",double:"double"}},wireframe:{type:"boolean",buffer:!0},colorData:{type:"hidden",update:"color"},colorScheme:{type:"select",update:"color",options:{}},colorScale:{type:"select",update:"color",options:Fe.getScales()},colorReverse:{type:"boolean",update:"color"},colorValue:{type:"color",update:"color"},colorDomain:{type:"hidden",update:"color"},colorMode:{type:"select",update:"color",options:Fe.getModes()},roughness:{type:"range",step:.01,max:1,min:0,buffer:!0},metalness:{type:"range",step:.01,max:1,min:0,buffer:!0},diffuse:{type:"color",buffer:!0},diffuseInterior:{type:"boolean",buffer:!0},useInteriorColor:{type:"boolean",buffer:!0},interiorColor:{type:"color",buffer:!0},interiorDarkening:{type:"range",step:.01,max:1,min:0,buffer:!0},matrix:{type:"hidden",buffer:!0},disablePicking:{type:"boolean",rebuild:!0}},this.viewer=e,this.tasks=new ui,this.queue=new Nr(this.make.bind(this)),this.bufferList=[],this.parameters.colorScheme&&(this.parameters.colorScheme.options=Fe.getSchemes()),this.toBePrepared=!1}init(t){const r=t||{};this.clipNear=st(r.clipNear,0),this.clipRadius=st(r.clipRadius,0),this.clipCenter=st(r.clipCenter,new e),this.flatShaded=st(r.flatShaded,!1),this.side=st(r.side,"double"),this.opacity=st(r.opacity,1),this.depthWrite=st(r.depthWrite,!0),this.wireframe=st(r.wireframe,!1),this.setColor(r.color,r),this.colorData=st(r.colorData,void 0),this.colorScheme=st(r.colorScheme,"uniform"),this.colorScale=st(r.colorScale,""),this.colorReverse=st(r.colorReverse,!1),this.colorValue=st(r.colorValue,9474192),this.colorDomain=st(r.colorDomain,void 0),this.colorMode=st(r.colorMode,"hcl"),this.visible=st(r.visible,!0),this.quality=st(r.quality,void 0),this.roughness=st(r.roughness,.4),this.metalness=st(r.metalness,0),this.diffuse=st(r.diffuse,16777215),this.diffuseInterior=st(r.diffuseInterior,!1),this.useInteriorColor=st(r.useInteriorColor,!1),this.interiorColor=st(r.interiorColor,2236962),this.interiorDarkening=st(r.interiorDarkening,0),this.lazy=st(r.lazy,!1),this.lazyProps={build:!1,bufferParams:{},what:{}},this.matrix=st(r.matrix,new i),this.disablePicking=st(r.disablePicking,!1);const s=this.parameters;!0===s.sphereDetail&&(s.sphereDetail={type:"integer",max:3,min:0,rebuild:"impostor"}),!0===s.radialSegments&&(s.radialSegments={type:"integer",max:25,min:5,rebuild:"impostor"}),!0===s.openEnded&&(s.openEnded={type:"boolean",rebuild:"impostor",buffer:!0}),!0===s.disableImpostor&&(s.disableImpostor={type:"boolean",rebuild:!0}),"low"===r.quality?(s.sphereDetail&&(this.sphereDetail=0),s.radialSegments&&(this.radialSegments=5)):"medium"===r.quality?(s.sphereDetail&&(this.sphereDetail=1),s.radialSegments&&(this.radialSegments=10)):"high"===r.quality?(s.sphereDetail&&(this.sphereDetail=2),s.radialSegments&&(this.radialSegments=20)):(s.sphereDetail&&(this.sphereDetail=st(r.sphereDetail,1)),s.radialSegments&&(this.radialSegments=st(r.radialSegments,10))),s.openEnded&&(this.openEnded=st(r.openEnded,!0)),s.disableImpostor&&(this.disableImpostor=st(r.disableImpostor,!1))}getColorParams(t){return Object.assign({data:this.colorData,scheme:this.colorScheme,scale:this.colorScale,reverse:this.colorReverse,value:this.colorValue,domain:this.colorDomain,mode:this.colorMode,colorSpace:this.colorSpace},t)}getBufferParams(t={}){return Object.assign({clipNear:this.clipNear,clipRadius:this.clipRadius,clipCenter:this.clipCenter,flatShaded:this.flatShaded,opacity:this.opacity,depthWrite:this.depthWrite,side:this.side,wireframe:this.wireframe,roughness:this.roughness,metalness:this.metalness,diffuse:this.diffuse,diffuseInterior:this.diffuseInterior,useInteriorColor:this.useInteriorColor,interiorColor:this.interiorColor,interiorDarkening:this.interiorDarkening,matrix:this.matrix,disablePicking:this.disablePicking},t)}setColor(t,e){const i=Object.keys(Fe.getSchemes());if("string"==typeof t&&i.includes(t.toLowerCase()))e?e.colorScheme=t:this.setParameters({colorScheme:t});else if(void 0!==t){let i=new s(t).getHex();e?(e.colorScheme="uniform",e.colorValue=i):this.setParameters({colorScheme:"uniform",colorValue:i})}return this}prepare(t){}create(){}update(t){this.build()}build(t){if(!this.lazy||this.visible&&this.opacity){if(!this.toBePrepared)return this.tasks.increment(),void this.make();this.queue.length()>0?(this.tasks.change(1-this.queue.length()),this.queue.kill()):this.tasks.increment(),this.queue.push(t||!1)}else this.lazyProps.build=!0}make(t,e){De&&Me.time("Representation.make "+this.type);const i=()=>{t?(this.update(t),this.viewer.requestRender(),this.tasks.decrement(),e&&e()):(this.clear(),this.create(),this.manualAttach||this.disposed||(De&&Me.time("Representation.attach "+this.type),this.attach((()=>{De&&Me.timeEnd("Representation.attach "+this.type),this.tasks.decrement(),e&&e()})))),De&&Me.timeEnd("Representation.make "+this.type)};this.toBePrepared?this.prepare(i):i()}attach(t){this.setVisibility(this.visible),t()}setVisibility(t,e){if(this.visible=t,this.visible&&this.opacity){const t=this.lazyProps,e=t.bufferParams,i=t.what;if(t.build)return t.build=!1,this.build(),this;(Object.keys(e).length||Object.keys(i).length)&&(t.bufferParams={},t.what={},this.updateParameters(e,i))}return this.bufferList.forEach((function(e){e.setVisibility(t)})),e||this.viewer.requestRender(),this}setParameters(t,e={},i=!1){const r=t||{},s=this.parameters,n={};this.opacity||void 0===r.opacity||(this.lazyProps.build?(this.lazyProps.build=!1,i=!0):(Object.assign(n,this.lazyProps.bufferParams),Object.assign(e,this.lazyProps.what),this.lazyProps.bufferParams={},this.lazyProps.what={})),this.setColor(r.color,r);for(let t in r)if(void 0!==r[t]&&null!=s[t]&&(s[t].int&&(r[t]=parseInt(r[t])),s[t].float&&(r[t]=parseFloat(r[t])),r[t]!==this[t]||r[t].equals&&!r[t].equals(this[t]))){if(this[t]&&this[t].copy&&r[t].copy?this[t].copy(r[t]):this[t]&&this[t].set?this[t].set(r[t]):this[t]=r[t],s[t].buffer)if(!0===s[t].buffer)n[t]=r[t];else{n[s[t].buffer]=r[t]}s[t].update&&(e[s[t].update]=!0),!s[t].rebuild||"impostor"===s[t].rebuild&&Ie&&!this.disableImpostor||(i=!0)}return i?this.build():this.updateParameters(n,e),this}updateParameters(t={},e){if(this.lazy&&(!this.visible||!this.opacity)&&!1===t.hasOwnProperty("opacity"))return Object.assign(this.lazyProps.bufferParams,t),void Object.assign(this.lazyProps.what,e);this.bufferList.forEach((function(e){e.setParameters(t)})),Object.keys(e).length&&this.update(e),this.viewer.requestRender()}getParameters(){const t={lazy:this.lazy,visible:this.visible,quality:this.quality};return Object.keys(this.parameters).forEach((e=>{null!==this.parameters[e]&&(t[e]=this[e])})),t}clear(){this.bufferList.forEach((t=>{this.viewer.remove(t),t.dispose()})),this.bufferList.length=0,this.viewer.requestRender()}dispose(){this.disposed=!0,this.queue.kill(),this.tasks.dispose(),this.clear()}}class Vr{constructor(t){this.pending=0,this.postCount=0,this.onmessageDict={},this.onerrorDict={},this.name=t,this.blobUrl=window.URL.createObjectURL(Ee.get(t)),this.worker=new Worker(this.blobUrl),Ee.activeWorkerCount+=1,this.worker.onmessage=e=>{this.pending-=1;const i=e.data.__postId;De&&Me.timeEnd("Worker.postMessage "+t+" #"+i);const r=this.onmessageDict[i];r&&r.call(this.worker,e),delete this.onmessageDict[i],delete this.onerrorDict[i]},this.worker.onerror=e=>{if(this.pending-=1,e.data){const i=e.data.__postId,r=this.onerrorDict[i];r?r.call(this.worker,e):Me.error("Worker.onerror",i,t,e),delete this.onmessageDict[i],delete this.onerrorDict[i]}else Me.error("Worker.onerror",t,e)}}post(t={},e,i,r){this.onmessageDict[this.postCount]=i,this.onerrorDict[this.postCount]=r,t.__name=this.name,t.__postId=this.postCount,t.__debug=De,De&&Me.time(`Worker.postMessage ${this.name} #${this.postCount}`);try{this.worker.postMessage(t,e)}catch(e){Me.error("worker.post:",e),this.worker.postMessage(t)}return this.pending+=1,this.postCount+=1,this}terminate(){this.worker?(this.worker.terminate(),window.URL.revokeObjectURL(this.blobUrl),Ee.activeWorkerCount-=1):Me.log("no worker to terminate")}}class Gr{constructor(t,e=2){this.pool=[],this.count=0,this.maxCount=Math.min(8,e),this.name=t}post(t={},e,i,r){const s=this.getNextWorker();return s?s.post(t,e,i,r):console.error("unable to get worker from pool"),this}terminate(){this.pool.forEach((function(t){t.terminate()}))}getNextWorker(){let t,e=1/0;for(let i=0;i=this.count){t=new Vr(this.name),this.pool.push(t),this.count+=1;break}const r=this.pool[i];if(0===r.pending){t=r;break}r.pendings&&(s=c),l>n&&(n=l),h>o&&(o=h)}return[Yr([e,i,r]),Yr([s,n,o])]}function Wr(t,e){for(let i=0,r=e.length;i0){const o=1/Math.sqrt(n);t[e]=i*o,t[e+1]=r*o,t[e+2]=s*o}}}function Yr(t){return new Float32Array(t||3)}function Kr(t,e,i){const r=e[0],s=e[1],n=e[2],o=i[0],a=i[1],c=i[2];t[0]=s*c-n*a,t[1]=n*o-r*c,t[2]=r*a-s*o}function Zr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Qr(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2]}function Jr(t,e,i){t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2]}function ts(t,e,i=0){t[0]=e[i],t[1]=e[i+1],t[2]=e[i+2]}function es(t,e,i=0){e[i]=t[0],e[i+1]=t[1],e[i+2]=t[2]}function is(t){return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}function rs(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function ss(t,e,i){ns(t,e,1/i)}function ns(t,e,i){t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i}function os(t,e){const i=is(e);0==i?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):ns(t,e,1/Math.sqrt(i))}function as(t,e,i){t[0]=e[0]-i,t[1]=e[1]-i,t[2]=e[2]-i}function cs(t,e,i){t[0]=e[0]+i,t[1]=e[1]+i,t[2]=e[2]+i}function ls(t,e){t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2])}function hs(t,e){t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2])}function ds(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2]}function us(t,e){const i=t[0],r=t[1],s=t[2],n=e[0],o=e[1],a=e[2],c=r*a-s*o,l=s*n-i*a,h=i*o-r*n,d=Math.sqrt(c*c+l*l+h*h),u=i*n+r*o+s*a;return Math.atan2(d,u)}function ms(t,i=9){const r=Math.floor(i/2),s=t.position1.length/3,n=3*(r*s),o=1/i,a=_i(t.position1,t.position2),c=new Float32Array(n),l=new Float32Array(n),h=new e;for(let e=0;e0){const e=3*p;n[e]=t.position2[3*d-3],n[e+1]=t.position2[3*d-2],n[e+1]=t.position2[3*d-1]}const y=new Float32Array(s),b=new Float32Array(n),x=Ai(y,b),v=new Float32Array(o),w={position:x,position1:y,position2:b,color:v,color2:v};return a&&(w.radius=new Float32Array(a)),c&&t.picking&&(t.picking.array=new Float32Array(c),w.picking=t.picking),l&&(w.primitiveId=new Float32Array(l)),w}Gr.prototype.constructor=Gr,Hr.__deps=[Yr],ss.__deps=[ns],os.__deps=[ns,is];const gs=new e;class ys{static get Picker(){return He.get(this.type)}static get Buffer(){return je.get(this.type)}static getShapeKey(t){return this.type+t[0].toUpperCase()+t.substr(1)}static expandBoundingBox(t,e){}static valueToShape(t,e,i){const r=t._primitiveData[this.getShapeKey(e)];switch(this.fields[e]){case"v3":case"c":n=r,void 0!==(s=i).toArray?s=s.toArray():void 0!==s.x?s=[s.x,s.y,s.z]:void 0!==s.r&&(s=[s.r,s.g,s.b]),n.push.apply(n,s);break;default:r.push(i)}var s,n}static objectToShape(t,e){Object.keys(this.fields).forEach((i=>{this.valueToShape(t,i,e[i])})),this.valueToShape(t,"name",e.name),this.expandBoundingBox(t.boundingBox,e)}static valueFromShape(t,i,r){const n=t._primitiveData[this.getShapeKey(r)];switch(this.fields[r]){case"v3":return(new e).fromArray(n,3*i);case"c":return(new s).fromArray(n,3*i);default:return n[i]}}static objectFromShape(t,e){let i=this.valueFromShape(t,e,"name");void 0===i&&(i=`${this.type}: ${e} (${t.name})`);const r={shape:t,name:i};return Object.keys(this.fields).forEach((i=>{r[i]=this.valueFromShape(t,e,i)})),r}static arrayFromShape(t,e){const i=t._primitiveData[this.getShapeKey(e)];return"s"===this.fields[e]?i:new Float32Array(i)}static dataFromShape(t){const e={};return this.Picker&&(e.picking=new this.Picker(t)),Object.keys(this.fields).forEach((i=>{e[i]=this.arrayFromShape(t,i)})),e}static bufferFromShape(t,e){return new this.Buffer(this.dataFromShape(t),e)}}ys.type="",ys.fields={};class bs extends ys{static positionFromShape(t,e){return this.valueFromShape(t,e,"position")}static expandBoundingBox(t,e){t.expandByPoint(gs.fromArray(e.position))}}bs.type="sphere",bs.fields={position:"v3",color:"c",radius:"f"};class xs extends ys{static positionFromShape(t,e){return this.valueFromShape(t,e,"position")}static expandBoundingBox(t,e){t.expandByPoint(gs.fromArray(e.position))}}xs.type="box",xs.fields={position:"v3",color:"c",size:"f",heightAxis:"v3",depthAxis:"v3"};class vs extends xs{}vs.type="octahedron";class ws extends xs{}ws.type="tetrahedron";class As extends ys{static positionFromShape(t,e){const i=this.valueFromShape(t,e,"position1"),r=this.valueFromShape(t,e,"position2");return i.add(r).multiplyScalar(.5)}static expandBoundingBox(t,e){t.expandByPoint(gs.fromArray(e.position1)),t.expandByPoint(gs.fromArray(e.position2))}static bufferFromShape(t,e={}){let i=this.dataFromShape(t);return"cylinder"===this.type&&e.dashedCylinder&&(i=ps(i)),new this.Buffer(i,e)}}As.type="cylinder",As.fields={position1:"v3",position2:"v3",color:"c",radius:"f"};class _s extends As{}_s.type="arrow";class Ss extends As{}Ss.type="cone";class Cs extends bs{}Cs.type="ellipsoid",Cs.fields={position:"v3",color:"c",radius:"f",majorAxis:"v3",minorAxis:"v3"};class Ps extends Cs{}Ps.type="torus";class Is extends ys{static positionFromShape(t,e){return this.valueFromShape(t,e,"position")}static expandBoundingBox(t,e){t.expandByPoint(gs.fromArray(e.position))}}Is.type="text",Is.fields={position:"v3",color:"c",size:"f",text:"s"};class ks extends ys{static positionFromShape(t,e){return this.valueFromShape(t,e,"position")}static expandBoundingBox(t,e){t.expandByPoint(gs.fromArray(e.position))}}ks.type="point",ks.fields={position:"v3",color:"c"};class Ms extends ys{static positionFromShape(t,e){const i=this.valueFromShape(t,e,"position1"),r=this.valueFromShape(t,e,"position2");return i.add(r).multiplyScalar(.5)}static expandBoundingBox(t,e){t.expandByPoint(gs.fromArray(e.position1)),t.expandByPoint(gs.fromArray(e.position2))}}Ms.type="wideline",Ms.fields={position1:"v3",position2:"v3",color:"c"};class Ts{constructor(t,e){this.exp=3;const i=e||function(t){const{x:e,y:i,z:r}=t,s=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],n=e.length,{min:o,max:c}=s;for(let t=0;t>this.exp),this.boundY=1+(i.max.y-this.minY>>this.exp),this.boundZ=1+(i.max.z-this.minZ>>this.exp);const r=this.boundX*this.boundY*this.boundZ,s=void 0!==t.count?t.count:t.x.length,n=t.x,o=t.y,c=t.z;let l=0;const h=new Uint32Array(r),d=new Int32Array(s);for(let t=0;t>this.exp,i=o[t]-this.minY>>this.exp,r=c[t]-this.minZ>>this.exp,s=(e*this.boundY+i)*this.boundZ+r;1===(h[s]+=1)&&(l+=1),d[t]=s}const u=new Uint16Array(l);for(let t=0,e=0;t0&&(h[t]=e+1,u[e]=i,e+=1)}const m=new Uint32Array(l);for(let t=1;t0){const i=e-1;f[m[i]+p[i]]=t,p[i]+=1}}this.grid=h,this.bucketCount=u,this.bucketOffset=m,this.bucketArray=f,this.xArray=n,this.yArray=o,this.zArray=c}within(t,e,i,r){const s=[];return this.eachWithin(t,e,i,r,(t=>s.push(t))),s}eachWithin(t,e,i,r,s){const n=r*r,o=Math.max(0,t-r-this.minX>>this.exp),a=Math.max(0,e-r-this.minY>>this.exp),c=Math.max(0,i-r-this.minZ>>this.exp),l=Math.min(this.boundX,1+(t+r-this.minX>>this.exp)),h=Math.min(this.boundY,1+(e+r-this.minY>>this.exp)),d=Math.min(this.boundZ,1+(i+r-this.minZ>>this.exp));for(let r=o;r0){const r=l-1,o=this.bucketOffset[r],a=o+this.bucketCount[r];for(let r=o;rr?s.set(this[e].subarray(0,r)):s.set(this[e]),this[e]=s}}growIfFull(){if(this.count>=this.length){const t=Math.round(1.5*this.length);this.resize(Math.max(256,t))}}copyFrom(t,e,i,r){for(let s=0,n=this._fields.length;s0;)h-=1;l<=h&&(l===c?c=h:h===c&&(c=l),(o=l)!==(a=h)&&(i.copyFrom(e,0,o,1),e.copyWithin(o,a,1),e.copyFrom(i,a,0,1)),l+=1,h-=1)}while(l<=h);r(s,h),r(l,n)}var o,a}(0,this.count-1),Me.timeEnd("Store.sort")}clear(){this.count=0}dispose(){for(let t=0,e=this._fields.length;t>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24}class Os{constructor(t,e){this.length=t,this._words=new Uint32Array(t+32>>>5),!0===e&&this.setAll()}get(t){return 0!=(this._words[t>>>5]&1<>>5]|=1<>>5]&=~(1<>>5]^=1<>>5,o=e>>>5;for(let t=n+1;t>>5]|=1<>>5]|=1<>>5]|=1<>>5]&=~(1<>>5]&=~(1<>>5]&=~(1<>>5]|=1<>>5]&=~(1<>>i,this}_isRangeValue(t,e,i){if(e>>5,o=e>>>5;for(let t=n+1;t>>5]&1<>>5]&1<>>5]&1<>>5]&1<>>5]&1<0){const{types:r,groups:s,centers:n,atomSets:o}=t;r.push(e.type),s.push(e.group),n.x.push(e.x/i),n.y.push(e.y/i),n.z.push(e.z/i),o.push(e.atomSet)}}const Ns=0,zs=["D-BETA-PEPTIDE, C-GAMMA LINKING","D-GAMMA-PEPTIDE, C-DELTA LINKING","D-PEPTIDE COOH CARBOXY TERMINUS","D-PEPTIDE NH3 AMINO TERMINUS","D-PEPTIDE LINKING","L-BETA-PEPTIDE, C-GAMMA LINKING","L-GAMMA-PEPTIDE, C-DELTA LINKING","L-PEPTIDE COOH CARBOXY TERMINUS","L-PEPTIDE NH3 AMINO TERMINUS","L-PEPTIDE LINKING","PEPTIDE LINKING","PEPTIDE-LIKE"],Vs=["RNA OH 3 PRIME TERMINUS","RNA OH 5 PRIME TERMINUS","RNA LINKING"],Gs=["DNA OH 3 PRIME TERMINUS","DNA OH 5 PRIME TERMINUS","DNA LINKING","L-DNA LINKING","L-RNA LINKING"],Us=["D-SACCHARIDE","D-SACCHARIDE 1,4 AND 1,4 LINKING","D-SACCHARIDE 1,4 AND 1,6 LINKING","L-SACCHARIDE","L-SACCHARIDE 1,4 AND 1,4 LINKING","L-SACCHARIDE 1,4 AND 1,6 LINKING","SACCHARIDE"],js=["NON-POLYMER"].concat(["OTHER"],Us),Hs=["h","g","i"],Ws=["e","b"],qs=["s","t","l",""],Xs={H:1,D:1,T:1,HE:2,LI:3,BE:4,B:5,C:6,N:7,O:8,F:9,NE:10,NA:11,MG:12,AL:13,SI:14,P:15,S:16,CL:17,AR:18,K:19,CA:20,SC:21,TI:22,V:23,CR:24,MN:25,FE:26,CO:27,NI:28,CU:29,ZN:30,GA:31,GE:32,AS:33,SE:34,BR:35,KR:36,RB:37,SR:38,Y:39,ZR:40,NB:41,MO:42,TC:43,RU:44,RH:45,PD:46,AG:47,CD:48,IN:49,SN:50,SB:51,TE:52,I:53,XE:54,CS:55,BA:56,LA:57,CE:58,PR:59,ND:60,PM:61,SM:62,EU:63,GD:64,TB:65,DY:66,HO:67,ER:68,TM:69,YB:70,LU:71,HF:72,TA:73,W:74,RE:75,OS:76,IR:77,PT:78,AU:79,HG:80,TL:81,PB:82,BI:83,PO:84,AT:85,RN:86,FR:87,RA:88,AC:89,TH:90,PA:91,U:92,NP:93,PU:94,AM:95,CM:96,BK:97,CF:98,ES:99,FM:100,MD:101,NO:102,LR:103,RF:104,DB:105,SG:106,BH:107,HS:108,MT:109,DS:110,RG:111,CN:112,NH:113,FL:114,MC:115,LV:116,TS:117,OG:118},Ys={1:1.1,2:1.4,3:1.81,4:1.53,5:1.92,6:1.7,7:1.55,8:1.52,9:1.47,10:1.54,11:2.27,12:1.73,13:1.84,14:2.1,15:1.8,16:1.8,17:1.75,18:1.88,19:2.75,20:2.31,21:2.3,22:2.15,23:2.05,24:2.05,25:2.05,26:2.05,27:2,28:2,29:2,30:2.1,31:1.87,32:2.11,33:1.85,34:1.9,35:1.83,36:2.02,37:3.03,38:2.49,39:2.4,40:2.3,41:2.15,42:2.1,43:2.05,44:2.05,45:2,46:2.05,47:2.1,48:2.2,49:2.2,50:1.93,51:2.17,52:2.06,53:1.98,54:2.16,55:3.43,56:2.68,57:2.5,58:2.48,59:2.47,60:2.45,61:2.43,62:2.42,63:2.4,64:2.38,65:2.37,66:2.35,67:2.33,68:2.32,69:2.3,70:2.28,71:2.27,72:2.25,73:2.2,74:2.1,75:2.05,76:2,77:2,78:2.05,79:2.1,80:2.05,81:1.96,82:2.02,83:2.07,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:2.4,91:2,92:2.3,93:2,94:2,95:2,96:2,97:2,98:2,99:2,100:2,101:2,102:2,103:2,104:2,105:2,106:2,107:2,108:2,109:2,110:2,111:2,112:2,113:2,114:2,115:2,116:2,117:2,118:2},Ks={1:.31,2:.28,3:1.28,4:.96,5:.84,6:.76,7:.71,8:.66,9:.57,10:.58,11:1.66,12:1.41,13:1.21,14:1.11,15:1.07,16:1.05,17:1.02,18:1.06,19:2.03,20:1.76,21:1.7,22:1.6,23:1.53,24:1.39,25:1.39,26:1.32,27:1.26,28:1.24,29:1.32,30:1.22,31:1.22,32:1.2,33:1.19,34:1.2,35:1.2,36:1.16,37:2.2,38:1.95,39:1.9,40:1.75,41:1.64,42:1.54,43:1.47,44:1.46,45:1.42,46:1.39,47:1.45,48:1.44,49:1.42,50:1.39,51:1.39,52:1.38,53:1.39,54:1.4,55:2.44,56:2.15,57:2.07,58:2.04,59:2.03,60:2.01,61:1.99,62:1.98,63:1.98,64:1.96,65:1.94,66:1.92,67:1.92,68:1.89,69:1.9,70:1.87,71:1.87,72:1.75,73:1.7,74:1.62,75:1.51,76:1.44,77:1.41,78:1.36,79:1.36,80:1.32,81:1.45,82:1.46,83:1.48,84:1.4,85:1.5,86:1.5,87:2.6,88:2.21,89:2.15,90:2.06,91:2,92:1.96,93:1.9,94:1.87,95:1.8,96:1.69,97:1.6,98:1.6,99:1.6,100:1.6,101:1.6,102:1.6,103:1.6,104:1.6,105:1.6,106:1.6,107:1.6,108:1.6,109:1.6,110:1.6,111:1.6,112:1.6,113:1.6,114:1.6,115:1.6,116:1.6,117:1.6,118:1.6},Zs={1:[1],2:[0],3:[1],4:[2],5:[3],6:[4],7:[3],8:[2],9:[1],10:[0],11:[1],12:[2],13:[6],14:[6],15:[3,5,7],16:[2,4,6],17:[1],18:[0],19:[1],20:[2],31:[3],32:[4],33:[3,5],34:[2,4,6],35:[1],36:[0],37:[1],38:[2],49:[3],50:[4],51:[3,5],52:[2],53:[1,2,5],54:[0,2],55:[1],56:[2],81:[3],82:[4],83:[3],84:[2],85:[1],86:[0],87:[1],88:[2]},Qs={1:1,2:2,3:1,4:2,5:3,6:4,7:5,8:6,9:7,10:8,11:1,12:2,13:3,14:4,15:5,16:6,17:7,18:8,19:1,20:2,21:3,22:4,23:5,24:6,25:7,26:8,27:9,28:10,29:11,30:2,31:3,32:4,33:5,34:6,35:7,36:8,37:1,38:2,39:3,40:4,41:5,42:6,43:7,44:8,45:9,46:10,47:11,48:2,49:3,50:4,51:5,52:6,53:7,54:8,55:1,56:2,57:3,58:4,59:3,60:4,61:5,62:6,63:7,64:8,65:9,66:10,67:11,68:12,69:13,70:14,71:15,72:4,73:5,74:6,75:7,76:8,77:9,78:10,79:11,80:2,81:3,82:4,83:5,84:6,85:7,86:8,87:1,88:2,89:3,90:4,91:3,92:4,93:5,94:6,95:7,96:8,97:9,98:10,99:11,100:12,101:13,102:14,103:15,104:2,105:2,106:2,107:2,108:2,109:2,110:2,111:2,112:2,113:3,114:4,115:5,116:6,117:7,118:8},Js={ALA:[.17,.5,.33],ARG:[.81,1.81,1],ASN:[.42,.85,.43],ASP:[1.23,3.64,2.41],ASH:[-.07,.43,.5],CYS:[-.24,-.02,.22],GLN:[.58,.77,.19],GLU:[2.02,3.63,1.61],GLH:[-.01,.11,.12],GLY:[.01,1.15,1.14],HIS:[.17,.11,-.06],ILE:[-.31,-1.12,-.81],LEU:[-.56,-1.25,-.69],LYS:[.99,2.8,1.81],MET:[-.23,-.67,-.44],PHE:[-1.13,-1.71,-.58],PRO:[.45,.14,-.31],SER:[.13,.46,.33],THR:[.14,.25,.11],TRP:[-1.85,-2.09,-.24],TYR:[-.94,-.71,.23],VAL:[.07,-.46,-.53]},tn=[0,0,0],en={HIS:"H",ARG:"R",LYS:"K",ILE:"I",PHE:"F",LEU:"L",TRP:"W",ALA:"A",MET:"M",PRO:"P",CYS:"C",ASN:"N",VAL:"V",GLY:"G",SER:"S",GLN:"Q",TYR:"Y",ASP:"D",GLU:"E",THR:"T",SEC:"U",PYL:"O"},rn=Object.keys(en),sn=["A","C","T","G","U","I"],nn=["DA","DC","DT","DG","DU","DI"],on=["A","G","I","DA","DG","DI"],an=sn.concat(nn),cn=["SOL","WAT","HOH","H2O","W","DOD","D3O","TIP3","TIP4","SPC"],ln=["118","119","1AL","1CU","2FK","2HP","2OF","3CO","3MT","3NI","3OF","3P8","4MO","4PU","543","6MO","ACT","AG","AL","ALF","AM","ATH","AU","AU3","AUC","AZI","BA","BCT","BEF","BF4","BO4","BR","BS3","BSY","CA","CAC","CD","CD1","CD3","CD5","CE","CHT","CL","CO","CO3","CO5","CON","CR","CS","CSB","CU","CU1","CU3","CUA","CUZ","CYN","DME","DMI","DSC","DTI","DY","E4N","EDR","EMC","ER3","EU","EU3","F","FE","FE2","FPO","GA","GD3","GEP","HAI","HG","HGC","IN","IOD","IR","IR3","IRI","IUM","K","KO4","LA","LCO","LCP","LI","LU","MAC","MG","MH2","MH3","MLI","MLT","MMC","MN","MN3","MN5","MN6","MO1","MO2","MO3","MO4","MO5","MO6","MOO","MOS","MOW","MW1","MW2","MW3","NA","NA2","NA5","NA6","NAO","NAW","NCO","NET","NH4","NI","NI1","NI2","NI3","NO2","NO3","NRU","O4M","OAA","OC1","OC2","OC3","OC4","OC5","OC6","OC7","OC8","OCL","OCM","OCN","OCO","OF1","OF2","OF3","OH","OS","OS4","OXL","PB","PBM","PD","PDV","PER","PI","PO3","PO4","PR","PT","PT4","PTN","RB","RH3","RHD","RU","SB","SCN","SE4","SEK","SM","SMO","SO3","SO4","SR","T1A","TB","TBA","TCN","TEA","TH","THE","TL","TMA","TRA","UNX","V","VN3","VO4","W","WO5","Y1","YB","YB2","YH","YT3","ZCM","ZN","ZN2","ZN3","ZNO","ZO3","OHX"],hn=["045","0AT","0BD","0MK","0NZ","0TS","0V4","0XY","0YT","10M","147","149","14T","15L","16G","18T","18Y","1AR","1BW","1GL","1GN","1JB","1LL","1NA","1S3","26M","26Q","26R","26V","26W","26Y","27C","289","291","293","2DG","2F8","2FG","2FL","2FP","2GL","2M4","2M5","32O","34V","3CM","3DO","3DY","3FM","3LR","3MF","3MG","3SA","3ZW","46D","46M","46Z","48Z","4CQ","4GC","4NN","50A","5DI","5GF","5MM","5RP","5SA","5SP","64K","6PG","6SA","7JZ","7SA","A1Q","A2G","AAB","AAL","AAO","ABC","ABD","ABE","ABF","ABL","ACG","ACI","ACR","ACX","ADA","ADG","ADR","AF1","AFD","AFL","AFO","AFP","AFR","AGC","AGH","AGL","AHR","AIG","ALL","ALX","AMU","AOG","AOS","ARA","ARB","ARE","ARI","ASG","ASO","AXP","AXR","B0D","B16","B2G","B4G","B6D","B8D","B9D","BBK","BCD","BDG","BDP","BDR","BEM","BFP","BGC","BGL","BGP","BGS","BHG","BMA","BMX","BNG","BNX","BOG","BRI","BXF","BXP","BXX","BXY","C3X","C4X","C5X","CAP","CBI","CBK","CBS","CDR","CEG","CGF","CHO","CR1","CR6","CRA","CT3","CTO","CTR","CTT","D6G","DAF","DAG","DDA","DDB","DDL","DEL","DFR","DFX","DG0","DGC","DGD","DGM","DGS","DIG","DLF","DLG","DMU","DNO","DOM","DP5","DQQ","DQR","DR2","DR3","DR4","DRI","DSR","DT6","DVC","E4P","E5G","EAG","EBG","EBQ","EGA","EJT","EPG","ERE","ERI","F1P","F1X","F6P","FBP","FCA","FCB","FCT","FDP","FDQ","FFC","FIX","FMO","FRU","FSI","FU4","FUB","FUC","FUD","FUL","FXP","G16","G1P","G2F","G3I","G4D","G4S","G6D","G6P","G6S","GAC","GAD","GAL","GC1","GC4","GCD","GCN","GCO","GCS","GCT","GCU","GCV","GCW","GCX","GE1","GFG","GFP","GIV","GL0","GL2","GL5","GL6","GL7","GL9","GLA","GLB","GLC","GLD","GLF","GLG","GLO","GLP","GLS","GLT","GLW","GMH","GN1","GNX","GP1","GP4","GPH","GPM","GQ1","GQ2","GQ4","GS1","GS4","GSA","GSD","GTE","GTH","GTK","GTR","GTZ","GU0","GU1","GU2","GU3","GU4","GU5","GU6","GU8","GU9","GUF","GUP","GUZ","GYP","GYV","H2P","HDL","HMS","HS2","HSD","HSG","HSH","HSJ","HSQ","HSR","HSU","HSX","HSY","HSZ","IAB","IDG","IDR","IDS","IDT","IDU","IDX","IDY","IMK","IN1","IPT","ISL","KBG","KD2","KDA","KDM","KDO","KFN","KO1","KO2","KTU","L6S","LAG","LAI","LAK","LAO","LAT","LB2","LBT","LCN","LDY","LGC","LGU","LM2","LMT","LMU","LOG","LOX","LPK","LSM","LTM","LVZ","LXB","LXZ","M1F","M3M","M6P","M8C","MA1","MA2","MA3","MAB","MAG","MAL","MAN","MAT","MAV","MAW","MBG","MCU","MDA","MDM","MDP","MFA","MFB","MFU","MG5","MGA","MGL","MLB","MMA","MMN","MN0","MRP","MTT","MUG","MVP","MXY","N1L","N9S","NAA","NAG","NBG","NDG","NED","NG1","NG6","NGA","NGB","NGC","NGE","NGF","NGL","NGS","NGY","NHF","NM6","NM9","NTF","NTO","NTP","NXD","NYT","OPG","OPM","ORP","OX2","P3M","P53","P6P","PA5","PNA","PNG","PNW","PRP","PSJ","PSV","PTQ","QDK","QPS","QV4","R1P","R1X","R2B","R5P","RAA","RAE","RAF","RAM","RAO","RAT","RB5","RBL","RCD","RDP","REL","RER","RF5","RG1","RGG","RHA","RIB","RIP","RNS","RNT","ROB","ROR","RPA","RST","RUB","RUU","RZM","S6P","S7P","SA0","SCR","SDD","SF6","SF9","SG4","SG5","SG6","SG7","SGA","SGC","SGD","SGN","SGS","SHB","SHG","SI3","SIO","SOE","SOL","SSG","SUC","SUP","SUS","T6P","T6T","TAG","TCB","TDG","TGK","TGY","TH1","TIA","TM5","TM6","TM9","TMR","TMX","TOA","TOC","TRE","TYV","UCD","UDC","VG1","X0X","X1X","X2F","X4S","X5S","X6X","XBP","XDN","XDP","XIF","XIM","XLF","XLS","XMM","XUL","XXR","XYP","XYS","YO5","Z3Q","Z6J","Z9M","ZDC","ZDM"],dn=["CA","C","N","O","O1","O2","OC1","OC2","OX1","OXT","OT1","OT2","H","H1","H2","H3","HA","HN","BB"],un=["P","OP1","OP2","HOP2","HOP3","O2'","O3'","O4'","O5'","C1'","C2'","C3'","C4'","C5'","H1'","H2'","H2''","HO2'","H3'","H4'","H5'","H5''","HO3'","HO5'","O2*","O3*","O4*","O5*","C1*","C2*","C3*","C4*","C5*"],mn={1:{trace:"CA",direction1:"C",direction2:["O","OC1","O1","OX1","OXT","OT1","OT2"],backboneStart:"N",backboneEnd:"C"},2:{trace:["C4'","C4*"],direction1:["C1'","C1*"],direction2:["C3'","C3*"],backboneStart:"P",backboneEnd:["O3'","O3*"]},3:{trace:["C3'","C3*"],direction1:["C2'","C2*"],direction2:["O4'","O4*"],backboneStart:"P",backboneEnd:["O3'","O3*"]},4:{trace:["CA","BB"],backboneStart:["CA","BB"],backboneEnd:["CA","BB"]},5:{trace:["C4'","C4*","P"],backboneStart:["C4'","C4*","P"],backboneEnd:["C4'","C4*","P"]},6:{trace:["C3'","C3*","C2'","P"],backboneStart:["C3'","C3*","C2'","P"],backboneEnd:["C3'","C3*","C2'","P"]}};mn[Ns]={};const pn={HD:"H",HS:"H",A:"C",NA:"N",NS:"N",OA:"O",OS:"O",SA:"S",G0:"C",G1:"C",G2:"C",G3:"C",CG0:"C",CG1:"C",CG2:"C",CG3:"C",W:"O"};function fn(t){switch(t){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;default:return 8}}const gn=new Map([[2,kt(180)],[3,kt(120)],[4,kt(109.4721)],[6,kt(90)]]);function yn(t,i){let r=[];const s=new e,n=new e;return s.subVectors(i,t),t.eachBondedAtom((e=>{1!==e.number&&(n.subVectors(e,t),r.push(s.angleTo(n)))})),r}function bn(t,i){const r=t.clone(),s=new e;s.subVectors(i,t);const n=[new e,new e];let o=0;if(t.eachBondedAtom((e=>{o>1||1!==e.number&&(r.index=e.index,n[o++].subVectors(e,t))})),1===o&&r.eachBondedAtom((e=>{o>1||1!==e.number&&e.index!==t.index&&n[o++].subVectors(e,t)})),2!==o)return;const a=n[0].cross(n[1]);return Math.abs(Math.PI/2-a.angleTo(s))}function xn(t,e){const i=t.structure,r=i.atomCount,s=new Int8Array(r),n=new Int8Array(r),o=new Int8Array(r),a=new Int8Array(r);return i.eachAtom((t=>{const i=t.index,[r,c,l,h]=function(t,e){const i=t.bondToElementCount(1);let r=t.formalCharge||0;const s="always"===e.assignCharge||"auto"===e.assignCharge&&0===r,n="always"===e.assignH||"auto"===e.assignH&&0===i,o=t.bondCount,a=function(t){let e=0;return t.eachBond((t=>e+=t.bondOrder)),e}(t),c=function(t){const e=t.structure.getBondProxy(),i=t.number,r=8===i||7===i;if(r&&4===t.bondCount)return!1;let s=!1;return t.eachBond((i=>{if(i.bondOrder>1)s=!0;else if(r){const r=i.getOtherAtom(t);r.eachBond((t=>{if(t.bondOrder>1){const e=r.number;if((15===e||16===e)&&8===t.getOtherAtom(r).number)return;s=!0}}),e)}})),s}(t),l=a-o>0;let h=0,d=8;switch(t.number){case 1:s&&(0===o?(r=1,d=0):1===o&&(r=0,d=1));break;case 6:s&&(r=0),n&&(h=Math.max(0,4-a-Math.abs(r))),d=fn(o+h+Math.max(0,-r));break;case 7:if(s)if(n)if(c&&a<4)r=o-i==1&&a-i==2?1:0;else{let e=!1;t.eachBondedAtom((t=>{(16===t.number||t.isMetal())&&(e=!0)})),r=e?0:1}else r=a-3;n&&(h=Math.max(0,3-a+r)),d=fn(c&&!l?o+h-r:o+h+1-r);break;case 8:s&&(n||(r=a-2),1===a&&t.eachBondedAtom((e=>{e.eachBond((i=>{const s=i.getOtherAtom(e);s.index!==t.index&&8===s.number&&2===i.bondOrder&&(r=-1)}))}))),n&&(h=Math.max(0,2-a+r)),d=fn(c&&!l?o+h-r+1:o+h-r+2);break;case 16:s&&(n||(r=a<=3&&!t.bondToElementCount(8)?a-2:0)),n&&a<2&&(h=Math.max(0,2-a+r)),a<=3&&(d=fn(o+h-r+2));break;case 9:case 17:case 35:case 53:case 85:s&&(r=a-1);break;case 3:case 11:case 19:case 37:case 55:case 87:s&&(r=1-a);break;case 4:case 12:case 20:case 38:case 56:case 88:s&&(r=2-a);break;default:console.warn("Requested charge, protonation for an unhandled element",t.element)}return[r,h,h+i,d]}(t,e);s[i]=r,n[i]=c,o[i]=l,a[i]=h})),{charge:s,implicitH:n,totalH:o,idealGeometry:a}}function vn(t){if(t["@valenceModel"])return t["@valenceModel"];const e=xn(t,{assignCharge:"auto",assignH:"auto"});return t["@valenceModel"]=e,e}function wn(t){return 15===t.number&&t.bondToElementCount(8)===t.bondCount}const An=["ARG","HIS","LYS"],_n=["GLU","ASP"];function Sn(t,e){return 2===t&&1===e||1===t&&2===e}function Cn(t,e){return 3===t&&3===e}function Pn(t,e){return 3===t&&1===e||1===t&&3===e}function In(t){return"HIS"===t.resname&&7==t.number&&t.isRing()}function kn(t,e){return 5===t&&4===e||4===t&&5===e}function Mn(t,e){return 9===t&&5===e||5===t&&9===e}const Tn=[3,11,19,37,55,12,20,38,56,13,31,49,81,21,50,82,83,51,80];function Bn(t,e){return 12===t?11===e||12===e:13===t?10===e:void 0}const Dn=[17,35,53,85];const $n=[7,8,16],On=[6,7,15,16];const Rn=kt(180),En=kt(120);function Fn(t,e,i){return!Nn(t,e,i)&&(t.modelIndex!==e.modelIndex||t.altloc&&e.altloc&&t.altloc!==e.altloc)}const Ln={maxHydrophobicDist:4,maxHbondDist:3.5,maxHbondSulfurDist:4.1,maxHbondAccAngle:45,maxHbondDonAngle:45,maxHbondAccPlaneAngle:90,maxHbondDonPlaneAngle:30,maxPiStackingDist:5.5,maxPiStackingOffset:2,maxPiStackingAngle:30,maxCationPiDist:6,maxCationPiOffset:2,maxIonicDist:5,maxHalogenBondDist:4,maxHalogenBondAngle:30,maxMetalDist:3,refineSaltBridges:!0,masterModelIndex:-1,lineOfSightDistFactor:1};function Nn(t,e,i){return t.modelIndex===i&&e.modelIndex!==i||e.modelIndex===i&&t.modelIndex!==i}function zn(t,e,i){return!Nn(t,e,i)&&(t.modelIndex!==e.modelIndex||t.residueIndex===e.residueIndex||t.altloc&&e.altloc&&t.altloc!==e.altloc)}function Vn(t){const e={types:[],groups:[],centers:{x:[],y:[],z:[]},atomSets:[]};return De&&Me.time("calculateFeatures"),function(t,e){const{charge:i}=vn(t.data),r={};t.eachResidue((t=>{if(An.includes(t.resname)){const i=Es(1);t.eachAtom((t=>{7===t.number&&t.isSidechain()&&Fs(i,t)})),Ls(e,i)}else rn.includes(t.resname)||t.isNucleic()||(t.eachAtom((t=>{let i=!1;const s=Es(1);!function(t){let e=0;return 6===t.number&&3===t.bondCount&&3===t.bondToElementCount(7)&&t.eachBondedAtom((t=>{t.bondCount-t.bondToElementCount(1)==1&&++e})),2===e}(t)?function(t){let e=0;return 6===t.number&&3===t.bondCount&&2===t.bondToElementCount(7)&&1===t.bondToElementCount(6)&&t.eachBondedAtom((t=>{t.bondCount-t.bondToElementCount(1)==1&&++e})),2===e}(t)&&(s.group=9,i=!0):(s.group=8,i=!0),i&&(t.eachBondedAtom((t=>{7===t.number&&(r[t.index]=!0,Fs(s,t))})),Ls(e,s))})),t.eachAtom((t=>{const s=Es(1);i[t.index]>0&&(r[t.index]||(Fs(s,t),Ls(e,s)))})))}))}(t,e),function(t,e){const{charge:i}=vn(t.data),r={};t.eachResidue((t=>{if(_n.includes(t.resname)){const i=Es(2);t.eachAtom((t=>{8===t.number&&t.isSidechain()&&Fs(i,t)})),Ls(e,i)}else if(an.includes(t.resname)){const i=Es(2);t.eachAtom((t=>{wn(t)&&(i.group=6,t.eachBondedAtom((t=>{8===t.number&&Fs(i,t)})),Ls(e,i))}))}else rn.includes(t.resname)||an.includes(t.resname)||(t.eachAtom((t=>{let i=!1;const s=Es(2);!function(t){return 16===t.number&&3===t.bondToElementCount(8)}(t)?wn(t)?(s.group=6,i=!0):function(t){return 16===t.number&&4===t.bondToElementCount(8)}(t)?(s.group=5,i=!0):function(t){let e=0;return 6===t.number&&2===t.bondToElementCount(8)&&1===t.bondToElementCount(6)&&t.eachBondedAtom((t=>{8===t.number&&t.bondCount-t.bondToElementCount(1)==1&&++e})),2===e}(t)&&(s.group=10,i=!0):(s.group=4,i=!0),i&&(t.eachBondedAtom((t=>{8===t.number&&(r[t.index]=!0,Fs(s,t))})),Ls(e,s))})),t.eachAtom((t=>{const s=Es(2);i[t.index]<0&&(r[t.index]||(Fs(s,t),Ls(e,s)))})))}))}(t,e),function(t,e){const i=t.getAtomProxy();t.eachResidue((t=>{const r=t.getAromaticRings();if(r){const s=t.atomOffset;r.forEach((t=>{const r=Es(3);t.forEach((t=>{i.index=t+s,Fs(r,i)})),Ls(e,r)}))}}))}(t,e),function(t,e){const{charge:i,implicitH:r,idealGeometry:s}=vn(t.data);t.eachAtom((t=>{const n=Es(5),o=t.number;if(8===o)Fs(n,t),Ls(e,n);else if(7===o){if(In(t))Fs(n,t),Ls(e,n);else if(i[t.index]<1){const i=t.bondCount+r[t.index],o=s[t.index];(4===o&&i<4||3===o&&i<3||2===o&&i<2)&&(Fs(n,t),Ls(e,n))}}else 16===o&&("CYS"!==t.resname&&"MET"!==t.resname&&-1!==t.formalCharge||(Fs(n,t),Ls(e,n)))}))}(t,e),function(t,e){const{totalH:i}=vn(t.data);t.eachAtom((t=>{const r=Es(4),s=t.number;(In(t)||i[t.index]>0&&(7===s||8===s||16===s))&&(Fs(r,t),Ls(e,r))}))}(t,e),function(t,e){const{totalH:i}=vn(t.data);t.eachAtom((t=>{if(6===t.number&&i[t.index]>0&&(t.bondToElementCount(7)>0||t.bondToElementCount(8)>0||function(t){if(!t.isAromatic())return!1;const e=t.residueType.getRings();if(!e)return!1;let i=!1;return e.rings.forEach((e=>{i||e.some((e=>t.index-t.residueAtomOffset===e))&&(i=e.some((e=>{const i=t.residueType.atomTypeIdList[e],r=t.atomMap.get(i).number;return 7===r||8===r})))})),i}(t))){const i=Es(9);Fs(i,t),Ls(e,i)}}))}(t,e),function(t,e){t.eachAtom((t=>{let i=!1,r=!1;const s=rn.includes(t.resname),n=an.includes(t.resname);if(s||n?s?8===t.number?(["ASP","GLU","SER","THR","TYR","ASN","GLN"].includes(t.resname)&&t.isSidechain()||t.isBackbone())&&(i=!0,r=!0):16===t.number&&"CYS"===t.resname?(i=!0,r=!0):7===t.number&&"HIS"===t.resname&&t.isSidechain()&&(i=!0):n&&(8===t.number&&t.isBackbone()?(i=!0,r=!0):["N3","N4","N7"].includes(t.atomname)?i=!0:["O2","O4","O6"].includes(t.atomname)&&(i=!0,r=!0)):t.isHalogen()||8===t.number||16===t.number?(i=!0,r=!0):7===t.number&&(i=!0),i){const i=Es(11);Fs(i,t),Ls(e,i)}if(r){const i=Es(10);Fs(i,t),Ls(e,i)}}))}(t,e),function(t,e){t.eachAtom((t=>{if(t.isTransitionMetal()||30===t.number||48===t.number){const i=Es(12);Fs(i,t),Ls(e,i)}else if(Tn.includes(t.number)){const i=Es(13);Fs(i,t),Ls(e,i)}}))}(t,e),function(t,e){t.eachAtom((t=>{const i=Es(8);let r=!1;6===t.number?(r=!0,t.eachBondedAtom((t=>{const e=t.number;6!==e&&1!==e&&(r=!1)}))):9===t.number&&(r=!0),r&&(Fs(i,t),Ls(e,i))}))}(t,e),function(t,e){t.eachAtom((t=>{if($n.includes(t.number)){let i=!1;if(t.eachBondedAtom((t=>{On.includes(t.number)&&(i=!0)})),i){const i=Es(7);Fs(i,t),Ls(e,i)}}}))}(t,e),function(t,e){t.eachAtom((t=>{if(Dn.includes(t.number)&&1===t.bondToElementCount(6)){const i=Es(6);Fs(i,t),Ls(e,i)}}))}(t,e),De&&Me.timeEnd("calculateFeatures"),e}function Gn(t,i=Ln){const r=function(t){const{types:e,centers:i}=t;return{features:t,spatialHash:new Ts(i),contactStore:new Ds,featureSet:new Os(e.length,!1)}}(Vn(t));De&&Me.time("calculateContacts"),function(t,i,r={}){const s=st(r.maxIonicDist,Ln.maxIonicDist),n=st(r.maxPiStackingDist,Ln.maxPiStackingDist),o=st(r.maxPiStackingOffset,Ln.maxPiStackingOffset),a=st(r.maxPiStackingAngle,Ln.maxPiStackingAngle),c=st(r.maxCationPiDist,Ln.maxCationPiDist),l=st(r.maxCationPiOffset,Ln.maxCationPiOffset),h=st(r.masterModelIndex,Ln.masterModelIndex),d=Math.max(s+2,n,c),u=n*n,m=c*c,{features:p,spatialHash:f,contactStore:g,featureSet:y}=i,{types:b,centers:x,atomSets:v}=p,{x:w,y:A,z:_}=x,S=b.length,C=t.atomStore.x,P=t.atomStore.y,I=t.atomStore.z,k=t.getAtomProxy(),M=t.getAtomProxy(),T=function(t,e,i){const r=t.length,s=e.length;for(let n=0;n{if(e<=t)return;if(k.index=v[t][0],M.index=v[e][0],zn(k,M,h))return;const r=b[t],n=b[e];if(Sn(r,n))T(v[t],v[e],s)&&z(t,e,1);else if(Cn(r,n)){if(i<=u){L(v[t],E),L(v[e],F);const i=57.29578*E.angleTo(F);Math.min(N(t,e,F),N(e,t,E))<=o&&(i<=a||i>=180-a||i<=a+90&&i>=90-a)&&z(t,e,3)}}else if(Pn(r,n)&&i<=m){const[i,s]=3===r?[t,e]:[e,t];L(v[i],E),N(s,i,E)<=l&&z(i,s,2)}}))}(t,r,i),function(t,e,i={}){const r=st(i.maxHbondDist,Ln.maxHbondDist),s=st(i.maxHbondSulfurDist,Ln.maxHbondSulfurDist),n=kt(st(i.maxHbondAccAngle,Ln.maxHbondAccAngle)),o=kt(st(i.maxHbondDonAngle,Ln.maxHbondDonAngle)),a=kt(st(i.maxHbondAccPlaneAngle,Ln.maxHbondAccPlaneAngle)),c=kt(st(i.maxHbondDonPlaneAngle,Ln.maxHbondDonPlaneAngle)),l=st(i.masterModelIndex,Ln.masterModelIndex),h=Math.max(r,s),d=r*r,{features:u,spatialHash:m,contactStore:p,featureSet:f}=e,{types:g,centers:y,atomSets:b}=u,{x:x,y:v,z:w}=y,A=g.length,{idealGeometry:_}=vn(t.data),S=t.getAtomProxy(),C=t.getAtomProxy();for(let t=0;t{if(e<=t)return;const r=g[t],s=g[e],h=Mn(r,s);if(!h&&!kn(r,s))return;const[u,m]=5===s?[t,e]:[e,t];if(S.index=b[u][0],C.index=b[m][0],C.index===S.index)return;if(zn(S,C,l))return;if(16!==S.number&&16!==C.number&&i>d)return;if(S.connectedTo(C))return;const y=yn(S,C),x=gn.get(_[S.index])||kt(120);if(y.some((t=>Math.abs(x-t)>o)))return;if(3===_[S.index]){const t=bn(S,C);if(void 0!==t&&t>c)return}const v=yn(C,S),w=gn.get(_[C.index])||kt(120);if(v.some((t=>w-t>n)))return;if(3===_[C.index]){const t=bn(C,S);if(void 0!==t&&t>a)return}f.setBits(u,m);const A=h?8:function(t,e){return t.isWater()&&e.isWater()}(P=S,I=C)?9:function(t,e){return t.isBackbone()&&e.isBackbone()}(P,I)?10:4;var P,I;p.addContact(u,m,A)}))}(t,r,i),function(t,e,i={}){const r=st(i.maxMetalDist,Ln.maxMetalDist),s=st(i.masterModelIndex,Ln.masterModelIndex),{features:n,spatialHash:o,contactStore:a,featureSet:c}=e,{types:l,centers:h,atomSets:d}=n,{x:u,y:m,z:p}=h,f=l.length,g=t.getAtomProxy(),y=t.getAtomProxy();for(let t=0;t{if(e<=t)return;if(g.index=d[t][0],y.index=d[e][0],zn(g,y,s))return;const r=g.isMetal(),n=y.isMetal();if(!r&&!n)return;const[o,h]=r?[l[t],l[e]]:[l[e],l[t]];Bn(o,h)&&(c.setBits(t,e),a.addContact(t,e,7))}))}(t,r,i),function(t,e,i={}){const r=st(i.maxHydrophobicDist,Ln.maxHydrophobicDist),s=st(i.masterModelIndex,Ln.masterModelIndex),{features:n,spatialHash:o,contactStore:a,featureSet:c}=e,{types:l,centers:h,atomSets:d}=n,{x:u,y:m,z:p}=h,f=l.length,g=t.getAtomProxy(),y=t.getAtomProxy();for(let t=0;t{var r,n;e<=t||(g.index=d[t][0],y.index=d[e][0],zn(g,y,s)||9===g.number&&9===y.number||g.connectedTo(y)||(r=l[t],n=l[e],8===r&&8===n&&(c.setBits(t,e),a.addContact(t,e,6))))}))}(t,r,i),function(t,e,i={}){const r=st(i.maxHalogenBondDist,Ln.maxHalogenBondDist),s=kt(st(i.maxHalogenBondAngle,Ln.maxHalogenBondAngle)),n=st(i.masterModelIndex,Ln.masterModelIndex),{features:o,spatialHash:a,contactStore:c,featureSet:l}=e,{types:h,centers:d,atomSets:u}=o,{x:m,y:p,z:f}=d,g=h.length,y=t.getAtomProxy(),b=t.getAtomProxy();for(let t=0;t{if(e<=t)return;if(y.index=u[t][0],b.index=u[e][0],zn(y,b,n))return;if(r=h[t],o=h[e],!(7===r&&6===o||6===r&&7===o))return;var r,o;const[a,d]=6===h[t]?[y,b]:[b,y],m=yn(a,d);if(1!==m.length)return;if(Rn-m[0]>s)return;const p=yn(d,a);0!==p.length&&(p.some((t=>En-t>s))||(l.setBits(t,e),c.addContact(t,e,5)))}))}(t,r,i);const s=function(t){const{index1:e,index2:i,count:r}=t.contactStore,s=Rs({nodeArray1:e,nodeArray2:i,edgeCount:r,nodeCount:t.featureSet.length}),n=new Os(t.contactStore.count,!0);return Object.assign({adjacencyList:s,contactSet:n},t)}(r);return function(t,i,r={}){De&&Me.time("refineLineOfSight");const s=st(r.lineOfSightDistFactor,Ln.lineOfSightDistFactor),n=st(r.masterModelIndex,Ln.masterModelIndex),o=t.spatialHash,{contactSet:a,contactStore:c,features:l}=i,{index1:h,index2:d}=c,{centers:u,atomSets:m}=l,{x:p,y:f,z:g}=u,y=t.getAtomProxy(),b=t.getAtomProxy(),x=t.getAtomProxy(),v=new e,w=new e,A=3*s,_=s*s;a.forEach((t=>{v.set(p[h[t]],f[h[t]],g[h[t]]),w.set(p[d[t]],f[d[t]],g[d[t]]);const e=(v.x+w.x)/2,i=(v.y+w.y)/2,r=(v.z+w.z)/2,s=m[h[t]],c=m[d[t]];y.index=s[0],b.index=c[0],o.eachWithin(e,i,r,A,((e,i)=>{x.index=e,1!==x.number&&x.vdw*x.vdw*_>i&&!Fn(y,x,n)&&!Fn(b,x,n)&&!s.includes(e)&&!c.includes(e)&&v.distanceToSquared(x)>1&&w.distanceToSquared(x)>1&&(a.clear(t),De&&Me.log("removing",y.qualifiedName(),b.qualifiedName(),"because",x.qualifiedName()))}))})),De&&Me.timeEnd("refineLineOfSight")}(t,s,i),function(t,e){const{contactSet:i,contactStore:r,features:s}=e,{type:n,index1:o,index2:a}=r,{atomSets:c}=s,l=t.getAtomProxy(),h=t.getAtomProxy(),d={},u=function(t,e,r){const[s,n]=d[r]||[1/0,-1];t{if(6!==n[t])return;l.index=c[o[t]][0],h.index=c[a[t]][0];const e=l.distanceTo(h);u(e,t,`${l.index}|${h.residueIndex}`),u(e,t,`${h.index}|${l.residueIndex}`)}))}(t,s),i.refineSaltBridges&&function(t,e){const{contactSet:i,contactStore:r,features:s}=e,{type:n,index1:o,index2:a}=r,{atomSets:c}=s,l={},h=function(t,e){l[t]||(l[t]=[]),l[t].push(e)};i.forEach((t=>{1===n[t]&&(c[o[t]].forEach((e=>h(e,t))),c[a[t]].forEach((e=>h(e,t))))})),i.forEach((t=>{if(!function(t){return 4===t||9===t||10===t}(n[t]))return;const e=l[c[o[t]][0]],r=l[c[a[t]][0]];if(!e||!r)return;const s=e.length;for(let n=0;n{3===n[t]&&(c[o[t]].forEach((e=>h(e,t))),c[a[t]].forEach((e=>h(e,t))))})),i.forEach((t=>{if(6!==n[t]&&2!==n[t])return;const e=l[c[o[t]][0]],r=l[c[a[t]][0]];if(!e||!r)return;const s=e.length;for(let n=0;n{1===n[t]&&(c[o[t]].forEach((e=>h(e,t))),c[a[t]].forEach((e=>h(e,t))))})),i.forEach((t=>{if(7!==n[t])return;const e=l[c[o[t]][0]],r=l[c[a[t]][0]];if(!e||!r)return;const s=e.length;for(let t=0;te.getAtomSet(new pe(t)))):e.getAtomSet(new pe(r.filterSele))),o.forEach((t=>{const e=f[t];if(!s.includes(e))return;if(w){const e=l[m[t]][0],i=l[p[t]][0];if(Array.isArray(w)){if(!(w[0].isSet(e)&&w[1].isSet(i)||w[1].isSet(e)&&w[0].isSet(i)))return}else if(!w.isSet(e)&&!w.isSet(i))return}const i=m[t],n=p[t];g.push(h[i],d[i],u[i]),y.push(h[n],d[n],u[n]),b.push(...function(t){switch(t){case 4:case 9:case 10:return Hn.setHex(2851770).toArray();case 6:return Hn.setHex(8421504).toArray();case 5:return Hn.setHex(4259775).toArray();case 1:return Hn.setHex(15779860).toArray();case 7:return Hn.setHex(9191577).toArray();case 2:return Hn.setHex(16744448).toArray();case 3:return Hn.setHex(9220966).toArray();case 8:return Hn.setHex(12967404).toArray();default:return Hn.setHex(13421772).toArray()}}(e)),x.push(r.radius),v.push(t)})),{position1:new Float32Array(g),position2:new Float32Array(y),color:new Float32Array(b),color2:new Float32Array(b),radius:new Float32Array(x),picking:new Qn(v,t,e)}}class qn{constructor(t){this.array=t}get type(){return""}get data(){return{}}getIndex(t){return this.array?this.array[t]:t}getObject(t){return{}}_applyTransformations(t,e,i){return e&&t.applyMatrix4(e.matrix),i&&t.applyMatrix4(i.matrix),t}_getPosition(t){return new e}getPosition(t,e,i){return this._applyTransformations(this._getPosition(t),e,i)}}class Xn extends qn{constructor(t){super(),this.shape=t}get primitive(){}get data(){return this.shape}get type(){return this.primitive.type}getObject(t){return this.primitive.objectFromShape(this.shape,this.getIndex(t))}_getPosition(t){return this.primitive.positionFromShape(this.shape,this.getIndex(t))}}class Yn extends qn{constructor(t,e){super(t),this.structure=e}get type(){return"atom"}get data(){return this.structure}getObject(t){return this.structure.getAtomProxy(this.getIndex(t))}_getPosition(t){return(new e).copy(this.getObject(t))}}class Kn extends qn{constructor(t){super(),this.axes=t}get type(){return"axes"}get data(){return this.axes}getObject(){return{axes:this.axes}}_getPosition(){return this.axes.center.clone()}}class Zn extends qn{constructor(t,e,i){super(t),this.structure=e,this.bondStore=i||e.bondStore}get type(){return"bond"}get data(){return this.structure}getObject(t){const e=this.structure.getBondProxy(this.getIndex(t));return e.bondStore=this.bondStore,e}_getPosition(t){const i=this.getObject(t);return(new e).copy(i.atom1).add(i.atom2).multiplyScalar(.5)}}class Qn extends qn{constructor(t,e,i){super(t),this.contacts=e,this.structure=i}get type(){return"contact"}get data(){return this.contacts}getObject(t){const i=this.getIndex(t),{features:r,contactStore:s}=this.contacts,{centers:n,atomSets:o}=r,{x:a,y:c,z:l}=n,{index1:h,index2:d,type:u}=s,m=h[i],p=d[i];return{center1:new e(a[m],c[m],l[m]),center2:new e(a[p],c[p],l[p]),atom1:this.structure.getAtomProxy(o[m][0]),atom2:this.structure.getAtomProxy(o[p][0]),type:Un(u[i])}}_getPosition(t){const{center1:i,center2:r}=this.getObject(t);return(new e).addVectors(i,r).multiplyScalar(.5)}}class Jn extends qn{constructor(t,e,i){super(t),this.validation=e,this.structure=i}get type(){return"clash"}get data(){return this.validation}getObject(t){const e=this.validation,i=this.getIndex(t);return{validation:e,index:i,clash:e.clashArray[i]}}_getAtomProxyFromSele(t){const e=new pe(t),i=this.structure.getAtomIndices(e)[0];return this.structure.getAtomProxy(i)}_getPosition(t){const i=this.getObject(t).clash,r=this._getAtomProxyFromSele(i.sele1),s=this._getAtomProxyFromSele(i.sele2);return(new e).copy(r).add(s).multiplyScalar(.5)}}class to extends Zn{get type(){return"distance"}}class eo extends qn{get type(){return"ignore"}}class io extends Xn{constructor(t,e){super(t),this.mesh=e}get type(){return"mesh"}getObject(){const t=this.mesh;return{shape:this.shape,name:t.name,serial:t.serial}}_getPosition(){return this.__position||(this.__position=Ur(this.mesh.position)),this.__position}}class ro extends qn{constructor(t,e){super(t),this.surface=e}get type(){return"surface"}get data(){return this.surface}getObject(t){return{surface:this.surface,index:this.getIndex(t)}}_getPosition(){return this.surface.center.clone()}}class so extends qn{constructor(t,e){super(),this.unitcell=t,this.structure=e}get type(){return"unitcell"}get data(){return this.unitcell}getObject(){return{unitcell:this.unitcell,structure:this.structure}}_getPosition(){return this.unitcell.getCenter(this.structure)}}class no extends qn{constructor(t,e){super(t),this.volume=e}get type(){return"volume"}get data(){return this.volume}getObject(t){const e=this.volume,i=this.getIndex(t);return{volume:e,index:i,value:e.data[i]}}_getPosition(t){const i=this.volume.position,r=this.getIndex(t);return new e(i[3*r],i[3*r+1],i[3*r+2])}}class oo extends no{get type(){return"slice"}}function ao(){return new Uint32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0])}function co(){return new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1,3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1,3,9,0,3,11,9,11,10,9,-1,-1,-1,-1,-1,-1,-1,9,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,4,7,3,0,4,1,2,10,-1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8,0,0,8,0,8],[0,0,8,1,0,0,8,1,1,0,8,0]],m=0,p=!1,f=!1,g=!1,y=!1,b=-1,x=e*i*r,v=e,w=e*i,A=new Int32Array(12),_=[],S=[],C=[],P=[],I=ao(),k=co();function M(t,e,i){return t+(e-t)*i}function T(t,s,n){return w*(n=(n+d)%r)+v*(s=(s+h)%i)+(t=(t+l)%e)}function B(t,e,i,r,c,l,h){var d=3*t;if(o[d]<0){var u=(m-l)/(h-l),f=n,g=3*a;if(_[g]=i+u,_[g+1]=r,_[g+2]=c,!p){var y=3*t;S[g]=b*M(f[y],f[y+3],u),S[g+1]=b*M(f[y+1],f[y+4],u),S[g+2]=b*M(f[y+2],f[y+5],u)}s&&(P[a]=s[t+Math.round(u)]),o[d]=a,A[e]=a,a+=1}else A[e]=o[d]}function D(t,e,i,r,c,l,h){var d=3*t+1;if(o[d]<0){var u=(m-l)/(h-l),f=n,g=3*a;if(_[g]=i,_[g+1]=r+u,_[g+2]=c,!p){var y=3*t,x=y+3*v;S[g]=b*M(f[y],f[x],u),S[g+1]=b*M(f[y+1],f[x+1],u),S[g+2]=b*M(f[y+2],f[x+2],u)}s&&(P[a]=s[t+Math.round(u)*v]),o[d]=a,A[e]=a,a+=1}else A[e]=o[d]}function $(t,e,i,r,c,l,h){var d=3*t+2;if(o[d]<0){var u=(m-l)/(h-l),f=n,g=3*a;if(_[g]=i,_[g+1]=r,_[g+2]=c+u,!p){var y=3*t,x=y+3*w;S[g]=b*M(f[y],f[x],u),S[g+1]=b*M(f[y+1],f[x+1],u),S[g+2]=b*M(f[y+2],f[x+2],u)}s&&(P[a]=s[t+Math.round(u)*w]),o[d]=a,A[e]=a,a+=1}else A[e]=o[d]}function O(e){var i=3*e;0===n[i]&&(n[i]=t[(e-1+x)%x]-t[(e+1)%x],n[i+1]=t[(e-v+x)%x]-t[(e+v)%x],n[i+2]=t[(e-w+x)%x]-t[(e+w)%x])}function R(e,i,r,s,n){var o,a,l,h,d,b,x;g?(s=T(e,i,r),o=T(e+1,i,r),a=T(e,i+1,r),l=T(e,i,r+1),h=T(e+1,i+1,r),d=T(e+1,i,r+1),b=T(e,i+1,r+1),x=T(e+1,i+1,r+1)):(o=s+1,h=(a=s+v)+1,d=(l=s+w)+1,x=(b=a+w)+1);var _=0,S=t[s],P=t[o],M=t[a],R=t[h],E=t[l],F=t[d],L=t[b],N=t[x];S=m){$=b,M=!0;break}if(M)break}if(M)break}for(M=!1,y=n;y=m){D=y,M=!0;break}if(M)break}if(M)break}for(M=!1,f=s;f=m){B=f,M=!0;break}if(M)break}if(M)break}for(M=!1,b=h;b>=a;--b){for(y=l;y>=n;--y){for(f=c;f>=s;--f)if(d=e*i*b+e*y+f,t[d]>=m){F=b,M=!0;break}if(M)break}if(M)break}for(M=!1,y=l;y>=n;--y){for(b=F;b>=a;--b){for(f=c;f>=s;--f)if(d=e*i*b+e*y+f,t[d]>=m){E=y,M=!0;break}if(M)break}if(M)break}for(M=!1,f=c;f>=s;--f){for(y=E;y>=n;--y){for(b=F;b>=a;--b)if(d=e*i*b+e*y+f,t[d]>=m){O=f,M=!0;break}if(M)break}if(M)break}p?(s=Math.max(0,B-1),n=Math.max(0,D-1),a=Math.max(0,$-1),c=Math.min(e-1,O+1),l=Math.min(i-1,E+1),h=Math.min(r-1,F+1)):(s=Math.max(1,B-1),n=Math.max(1,D-1),a=Math.max(1,$-1),c=Math.min(e-2,O+1),l=Math.min(i-2,E+1),h=Math.min(r-2,F+1))}var L=15;for(b=a;b0?-1:1,n||(n=new Float32Array(3*x)));var I=3*x;if(o&&o.length===I||(o=new Int32Array(I)),a=0,c=0,void 0!==v){var k=v[0].map(Math.round),M=v[1].map(Math.round);l=e*Math.ceil(Math.abs(k[0])/e),h=i*Math.ceil(Math.abs(k[1])/i),d=r*Math.ceil(Math.abs(k[2])/r),E(k[0],k[1],k[2],M[0],M[1],M[2])}else l=h=d=0,E();return _.length=3*a,p||(S.length=3*a),C.length=c,s&&(P.length=a),{position:new Float32Array(_),normal:p?void 0:new Float32Array(S),index:xt(C,_.length/3),atomindex:s?new Int32Array(P):void 0,contour:f}}}He.add("arrow",class extends Xn{get primitive(){return _s}}),He.add("box",class extends Xn{get primitive(){return xs}}),He.add("cone",class extends Xn{get primitive(){return Ss}}),He.add("cylinder",class extends Xn{get primitive(){return As}}),He.add("ellipsoid",class extends Xn{get primitive(){return Cs}}),He.add("octahedron",class extends Xn{get primitive(){return vs}}),He.add("sphere",class extends Xn{get primitive(){return bs}}),He.add("tetrahedron",class extends Xn{get primitive(){return ws}}),He.add("torus",class extends Xn{get primitive(){return Ps}}),He.add("point",class extends Xn{get primitive(){return ks}}),He.add("wideline",class extends Xn{get primitive(){return Ms}}),Object.assign(lo,{__deps:[ao,co,xt]});class ho{constructor(t,e){this.cols=t,this.rows=e,this.size=this.cols*this.rows,this.data=new Float32Array(this.size)}copyTo(t){t.data.set(this.data)}}function uo(t,e){let i=0,r=0;const s=e.rows,n=e.cols;let o=0,a=0,c=0;const l=e.data,h=t.data;for(;i(e=Math.abs(e))?(e/=t,t*Math.sqrt(1+e*e)):e>0?(t/=e,e*Math.sqrt(1+t*t)):0}const xo=1.192092896e-7,vo=1e-37;function wo(t,e,i,r){let s=0,n=0;const o=t.rows,a=t.cols;let c=o,l=a;c>16)?O:-O,t[h*e+u]=$;for(m=0;m<2;m++)for(d=0;d{const e=t.data.sd,i=t.data.p;o(this._makeSurface(e,i.isolevel,i.smooth))}),(a=>{console.warn("Volume.getSurfaceWorker error - trying without worker",a);const c=this.getSurface(t,e,i,r,s,n);o(c)}))}else{const a=this.getSurface(t,e,i,r,s,n);o(a)}}getValueForSigma(t){return this.mean+st(t,2)*this.rms}getSigmaForValue(t){return(st(t,0)-this.mean)/this.rms}get position(){if(!this._position){const t=this.nz,e=this.ny,i=this.nx,r=new Float32Array(i*e*t*3);let s=0;for(let n=0;ni){const t=e;e=i,i=t}const r=t[e];return void 0===r?(t[e]=[i],!0):!r.includes(i)&&(r.push(i),!0)}const i=this.geometry,r=i.index;if(this.parameters.wireframe)if(r){const s=r.array;let n,o=s.length;if(i.drawRange.count!==1/0&&(o=i.drawRange.count),this.wireframeIndex&&this.wireframeIndex.length>2*o)n=this.wireframeIndex;else{n=xt(2*o,i.attributes.position.count)}let a=0;t.length=0;for(let t=0;t2*t?this.wireframeIndex:xt(2*t,t);for(let i=0,r=0;ithis.wireframeGeometry.index.array.length)this.wireframeGeometry.setIndex(new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](this.wireframeIndex,1).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0));else{const t=this.wireframeGeometry.getIndex();if(!t)return void Me.error("Index is null");t.set(this.wireframeIndex),t.needsUpdate=this.wireframeIndexCount>0,t.updateRange.count=this.wireframeIndexCount}this.wireframeGeometry.setDrawRange(0,this.wireframeIndexCount)}}getRenderOrder(){let t=0;return this.isText?t=1:this.transparent&&(t=this.isSurface?3:2),t}_getMesh(t){this.material||this.makeMaterial();const e=this.geometry,i=this[t];let r;return r=this.isLine?new __WEBPACK_IMPORTED_MODULE_0_three__["v" /* LineSegments */](e,i):this.isPoint?new __WEBPACK_IMPORTED_MODULE_0_three__["J" /* Points */](e,i):new __WEBPACK_IMPORTED_MODULE_0_three__["A" /* Mesh */](e,i),r.frustumCulled=!1,r.renderOrder=this.getRenderOrder(),r}getMesh(){return this._getMesh("material")}getWireframeMesh(){let t;return this.material||this.makeMaterial(),this.wireframeGeometry||this.makeWireframeGeometry(),t=new __WEBPACK_IMPORTED_MODULE_0_three__["v" /* LineSegments */](this.wireframeGeometry,this.wireframeMaterial),t.frustumCulled=!1,t.renderOrder=this.getRenderOrder(),t}getPickingMesh(){return this._getMesh("pickingMaterial")}getShader(t,e){return gi(t,this.getDefines(e))}getVertexShader(t){return this.getShader(this.vertexShader,t)}getFragmentShader(t){return this.getShader(this.fragmentShader,t)}getDefines(t){const e={};return this.parameters.clipNear&&(e.NEAR_CLIP=1),this.parameters.clipRadius&&(e.RADIUS_CLIP=1),"picking"===t?e.PICKING=1:(("background"===t||this.parameters.background)&&(e.NOLIGHT=1),this.parameters.flatShaded&&(e.FLAT_SHADED=1),this.parameters.opaqueBack&&(e.OPAQUE_BACK=1),this.parameters.diffuseInterior&&(e.DIFFUSE_INTERIOR=1),this.parameters.useInteriorColor&&(e.USE_INTERIOR_COLOR=1)),e}getParameters(){return this.parameters}addUniforms(t){this.uniforms=__WEBPACK_IMPORTED_MODULE_0_three__["V" /* UniformsUtils */].merge([this.uniforms,t]),this.pickingUniforms=__WEBPACK_IMPORTED_MODULE_0_three__["V" /* UniformsUtils */].merge([this.pickingUniforms,t])}addAttributes(t){for(let e in t){let i;const r=t[e],s=this.attributeSize*Lo[r.type];r.value?(s!==r.value.length&&Me.error("attribute value has wrong length",e),i=r.value):i=bt("float32",s),this.geometry.setAttribute(e,new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](i,Lo[r.type]).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0))}}updateRenderOrder(){const t=this.getRenderOrder();function e(e){e.renderOrder=t}this.group.children.forEach(e),this.pickingGroup&&this.pickingGroup.children.forEach(e)}updateShader(){const t=this.material,e=this.wireframeMaterial,i=this.pickingMaterial;t.vertexShader=this.getVertexShader(),t.fragmentShader=this.getFragmentShader(),t.needsUpdate=!0,e.vertexShader=this.getShader("Line.vert"),e.fragmentShader=this.getShader("Line.frag"),e.needsUpdate=!0,i.vertexShader=this.getVertexShader("picking"),i.fragmentShader=this.getFragmentShader("picking"),i.needsUpdate=!0}setParameters(t){const e=t,i=this.parameterTypes,r=this.parameters,s={},n={};let o=!1,a=!1;for(const t in e){const c=e[t];void 0!==c&&(r[t]=c,void 0!==i[t]&&(i[t].property&&(!0!==i[t].property?s[i[t].property]=c:s[t]=c),i[t].uniform&&(!0!==i[t].uniform?n[i[t].uniform]=c:n[t]=c),i[t].updateShader&&(o=!0),i[t].updateVisibility&&(a=!0),this.dynamic&&"wireframe"===t&&!0===c&&this.updateWireframeIndex(),"forceTransparent"===t&&(s.transparent=this.transparent),"matrix"===t&&(this.matrix=c)))}this.setProperties(s),this.setUniforms(n),o&&this.updateShader(),a&&this.setVisibility(this.visible)}setAttributes(t){const e=this.geometry,i=e.attributes;for(const r in t){if("picking"===r)continue;const s=t[r],n=s.length;if("index"===r){const t=e.getIndex();if(!t){Me.error("Index is null");continue}e.setDrawRange(0,1/0),n>t.array.length?e.setIndex(new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](s,1).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0)):(t.set(s),t.count=n,t.needsUpdate=n>0,t.updateRange.count=n,e.setDrawRange(0,n)),this.indexVersion++,this.parameters.wireframe&&this.updateWireframeIndex()}else{const t=i[r];n>t.array.length?e.setAttribute(r,new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](s,t.itemSize).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0)):(i[r].set(s),i[r].needsUpdate=n>0,i[r].updateRange.count=n)}}}setUniforms(t){if(!t)return;const e=this.material.uniforms,i=this.wireframeMaterial.uniforms,r=this.pickingMaterial.uniforms;for(let s in t)"opacity"===s&&this.setProperties({transparent:this.transparent}),void 0!==e[s]&&(e[s].value.isVector3?e[s].value.copy(t[s]):e[s].value.set?e[s].value.set(t[s]):e[s].value=t[s]),void 0!==i[s]&&(i[s].value.isVector3?i[s].value.copy(t[s]):i[s].value.set?i[s].value.set(t[s]):i[s].value=t[s]),void 0!==r[s]&&(r[s].value.isVector3?r[s].value.copy(t[s]):r[s].value.set?r[s].value.set(t[s]):r[s].value=t[s])}setProperties(t){if(!t)return;const e=this.material,i=this.wireframeMaterial,r=this.pickingMaterial;for(const s in t){const n=s;let o=t[n];"transparent"===n?this.updateRenderOrder():"side"===n&&(o=Fo(o)),e[n]=o,i[n]=o,r[n]=o}e.needsUpdate=!0,i.needsUpdate=!0,r.needsUpdate=!0}setVisibility(t){this.visible=t,this.parameters.wireframe?(this.group.visible=!1,this.wireframeGroup.visible=t,this.pickable&&(this.pickingGroup.visible=!1)):(this.group.visible=t,this.wireframeGroup.visible=!1,this.pickable&&(this.pickingGroup.visible=t))}dispose(){this.material&&this.material.dispose(),this.wireframeMaterial&&this.wireframeMaterial.dispose(),this.pickingMaterial&&this.pickingMaterial.dispose(),this.geometry.dispose(),this.wireframeGeometry&&this.wireframeGeometry.dispose()}toJSON(){var t={};for(var e in this)"group"!==e&&"wireframeGroup"!==e&&"pickingGroup"!=e&&"picking"!==e&&(t[e]=this[e]);return t}}class Uo extends Go{constructor(t,e={}){super(t,e),this.vertexShader="Mesh.vert",this.fragmentShader="Mesh.frag",this.addAttributes({normal:{type:"v3",value:t.normal}}),void 0===t.normal&&this.geometry.computeVertexNormals()}}class jo extends Uo{constructor(){super(...arguments),this.isSurface=!0}}function Ho(t){t.visible=!0}function Wo(t){t.visible=!1}class qo{constructor(t){this.group=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.wireframeGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.pickingGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.frontMeshes=[],this.backMeshes=[],this.size=t.size,this.side=t.parameters.side,this.visible=t.visible,this.geometry=t.geometry,this.picking=t.picking,this.group=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.wireframeGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.pickingGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.matrix=t.matrix;const e=t,i=new t.constructor({position:new Float32Array(0)});e.makeMaterial(),i.makeMaterial(),i.picking=t.picking,i.geometry=t.geometry,i.wireframeGeometry=t.wireframeGeometry,i.setParameters(t.getParameters()),i.updateShader(),e.setParameters({side:"front"}),i.setParameters({side:"back",opacity:i.parameters.opacity}),this.buffer=t,this.frontBuffer=e,this.backBuffer=i}set matrix(t){Go.prototype.setMatrix.call(this,t)}get matrix(){return this.group.matrix.clone()}get pickable(){return!!this.picking&&!this.parameters.disablePicking}get parameters(){return this.buffer.parameters}getParameters(){const t=Object.assign({},this.buffer.parameters);return t.side=this.side,t}getMesh(t){let e,i;return t?(i=this.backBuffer.getPickingMesh(),e=this.frontBuffer.getPickingMesh()):(i=this.backBuffer.getMesh(),e=this.frontBuffer.getMesh()),this.frontMeshes.push(e),this.backMeshes.push(i),this.setParameters({side:this.side}),(new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */]).add(i,e)}getWireframeMesh(){return this.buffer.getWireframeMesh()}getPickingMesh(){return this.getMesh(!0)}setAttributes(t){this.buffer.setAttributes(t)}setParameters(t){"front"===(t=Object.assign({},t)).side?(this.frontMeshes.forEach(Ho),this.backMeshes.forEach(Wo)):"back"===t.side?(this.frontMeshes.forEach(Wo),this.backMeshes.forEach(Ho)):"double"===t.side&&(this.frontMeshes.forEach(Ho),this.backMeshes.forEach(Ho)),void 0!==t.side&&(this.side=t.side),delete t.side,void 0!==t.matrix&&(this.matrix=t.matrix),delete t.matrix,this.frontBuffer.setParameters(t),void 0!==t.wireframe&&(this.wireframe=t.wireframe,this.setVisibility(this.visible)),delete t.wireframe,this.backBuffer.setParameters(t)}setVisibility(t){this.visible=t,this.parameters.wireframe?(this.group.visible=!1,this.wireframeGroup.visible=t,this.pickable&&(this.pickingGroup.visible=!1)):(this.group.visible=t,this.wireframeGroup.visible=!1,this.pickable&&(this.pickingGroup.visible=t))}dispose(){this.frontBuffer.dispose(),this.backBuffer.dispose()}toJSON(){var t={};for(var e in this)["side","size","visible","matrix","parameters"].includes(e)&&(t[e]=this[e]);return t}}Ve.add("shader/Line.vert","uniform float clipNear;\nuniform vec3 clipCenter;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include color_pars_vertex\nvoid main(){\n#include color_vertex\n#include begin_vertex\n#include project_vertex\nvViewPosition = -mvPosition.xyz;\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}"),Ve.add("shader/Line.frag","uniform float opacity;\nuniform float clipNear;\nuniform float clipRadius;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include common\n#include color_pars_fragment\n#include fog_pars_fragment\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\ngl_FragColor = vec4( vColor, opacity );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n}");class Xo extends Go{constructor(){super(...arguments),this.isLine=!0,this.vertexShader="Line.vert",this.fragmentShader="Line.frag"}}class Yo extends zr{constructor(t,r,s){super(t,r,s),this.type="surface",this.parameters=Object.assign({isolevelType:{type:"select",options:{value:"value",sigma:"sigma"}},isolevel:{type:"number",precision:2,max:1e3,min:-1e3},negateIsolevel:{type:"boolean"},isolevelScroll:{type:"boolean"},smooth:{type:"integer",precision:1,max:10,min:0},background:{type:"boolean",rebuild:!0},opaqueBack:{type:"boolean",buffer:!0},boxSize:{type:"integer",precision:1,max:100,min:0},colorVolume:{type:"hidden"},contour:{type:"boolean",rebuild:!0},useWorker:{type:"boolean",rebuild:!0},wrap:{type:"boolean",rebuild:!0}},this.parameters),t instanceof Eo?(this.surface=void 0,this.volume=t):(this.surface=t,this.volume=void 0),this.boxCenter=new e,this.__boxCenter=new e,this.box=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],this.__box=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],this._position=new e,this.inverseMatrix=new i,this.setBox=function(){this._position.copy(r.translationGroup.position).negate(),this._position.applyMatrix4(this.inverseMatrix),this._position.equals(this.boxCenter)||this.setParameters({boxCenter:this._position})},this.toBePrepared=!0,this.viewer.signals.ticked.add(this.setBox,this),this.init(s)}init(t){const e=t||{};e.colorScheme=st(e.colorScheme,"uniform"),e.colorValue=st(e.colorValue,14540253),this.isolevelType=st(e.isolevelType,"sigma"),this.isolevel=st(e.isolevel,2),this.negateIsolevel=st(e.negateIsolevel,!1),this.isolevelScroll=st(e.isolevelScroll,!1),this.smooth=st(e.smooth,0),this.background=st(e.background,!1),this.opaqueBack=st(e.opaqueBack,!0),this.boxSize=st(e.boxSize,0),this.colorVolume=st(e.colorVolume,void 0),this.contour=st(e.contour,!1),this.useWorker=st(e.useWorker,!0),this.wrap=st(e.wrap,!1),super.init(e),this.inverseMatrix.getInverse(this.matrix),this.build()}attach(t){this.bufferList.forEach((t=>{this.viewer.add(t)})),this.setVisibility(this.visible),t()}prepare(t){if(this.volume){let e;if(e="sigma"===this.isolevelType?this.volume.getValueForSigma(this.isolevel):this.isolevel,this.negateIsolevel&&(e*=-1),!this.surface||this.__isolevel!==e||this.__smooth!==this.smooth||this.__contour!==this.contour||this.__wrap!==this.wrap||this.__boxSize!==this.boxSize||this.boxSize>0&&!this.__boxCenter.equals(this.boxCenter)){this.__isolevel=e,this.__smooth=this.smooth,this.__contour=this.contour,this.__wrap=this.wrap,this.__boxSize=this.boxSize,this.__boxCenter.copy(this.boxCenter),this.__box.copy(this.box);const i=e=>{this.surface=e,t()};this.useWorker?this.volume.getSurfaceWorker(e,this.smooth,this.boxCenter,this.boxSize,this.contour,this.wrap,i):i(this.volume.getSurface(e,this.smooth,this.boxCenter,this.boxSize,this.contour,this.wrap))}else t()}else t()}create(){const t={position:this.surface.getPosition(),color:this.surface.getColor(this.getColorParams()),index:this.surface.getIndex()};let e;if(this.contour)e=new Xo(t,this.getBufferParams({wireframe:!1}));else{Object.assign(t,{normal:this.surface.getNormal(),picking:this.surface.getPicking()});const i=new jo(t,this.getBufferParams({background:this.background,opaqueBack:this.opaqueBack,dullInterior:!1}));e=new qo(i)}this.bufferList.push(e)}update(t){if(0===this.bufferList.length)return;const e={};(t=t||{}).position&&(e.position=this.surface.getPosition()),t.color&&(e.color=this.surface.getColor(this.getColorParams())),t.index&&(e.index=this.surface.getIndex()),t.normal&&(e.normal=this.surface.getNormal()),this.bufferList.forEach((function(t){t.setAttributes(e)}))}setParameters(t,e,i){return t&&void 0!==t.isolevelType&&this.volume&&("value"===this.isolevelType&&"sigma"===t.isolevelType?this.isolevel=this.volume.getSigmaForValue(this.isolevel):"sigma"===this.isolevelType&&"value"===t.isolevelType&&(this.isolevel=this.volume.getValueForSigma(this.isolevel)),this.isolevelType=t.isolevelType),t&&t.boxCenter&&(this.boxCenter.copy(t.boxCenter),delete t.boxCenter),t&&t.wireframe&&(t.contour||void 0===t.contour&&this.contour)&&(t.wireframe=!1),super.setParameters(t,e,i),t.matrix&&this.inverseMatrix.getInverse(t.matrix),this.volume&&this.volume.getBox(this.boxCenter,this.boxSize,this.box),t&&void 0!==t.colorVolume&&e&&(e.color=!0),this.surface&&(void 0!==t.isolevel||void 0!==t.negateIsolevel||void 0!==t.smooth||void 0!==t.wrap||void 0!==t.boxSize||this.boxSize>0&&!this.__box.equals(this.box))&&this.build({position:!0,color:!0,index:!0,normal:!this.contour}),this}getColorParams(){const t=super.getColorParams();return t.volume=this.colorVolume,t}dispose(){this.viewer.signals.ticked.remove(this.setBox,this),super.dispose()}}class Ko{static zoomScroll(t,e){t.trackballControls.zoom(e)}static clipNearScroll(t,e){const i=t.getParameters();t.setParameters({clipNear:i.clipNear+e/10})}static focusScroll(t,e){const i=t.getFocus(),r=Math.sign(e)*function(t,e,i){if(t>e)return t;const r=t/e;return((2*i-e)*r+(2*e-3*i))*r*r+i}((100-i)/10,5,.2);t.setFocus(i+r)}static zoomFocusScroll(t,e){t.trackballControls.zoom(e);const i=t.viewer.camera.position.z;t.setFocus(100-Math.abs(i/8))}static isolevelScroll(t,e){const i=Math.sign(e)/10;t.eachRepresentation(((t,e)=>{if(t.repr instanceof Yo){const e=t.getParameters();e.isolevelScroll&&t.setParameters({isolevel:e.isolevel+i})}}))}static panDrag(t,e,i){t.trackballControls.pan(e,i)}static rotateDrag(t,e,i){t.trackballControls.rotate(e,i)}static zRotateDrag(t,e,i){t.trackballControls.zRotate(e,i)}static zoomDrag(t,e,i){t.trackballControls.zoom((e+i)/-2)}static zoomFocusDrag(t,e,i){t.trackballControls.zoom((e+i)/-2);const r=t.viewer.camera.position.z;t.setFocus(100-Math.abs(r/8))}static panComponentDrag(t,e,i){t.trackballControls.panComponent(e,i)}static panAtomDrag(t,e,i){t.trackballControls.panAtom(e,i)}static rotateComponentDrag(t,e,i){t.trackballControls.rotateComponent(e,i)}static movePick(t,e){e&&t.animationControls.move(e.position.clone())}static tooltipPick(t,e){const i=t.tooltip;if(t.getParameters().tooltip&&e){const t=e.mouse.position;i.innerText=e.getLabel(),i.style.bottom=window.innerHeight-t.y+3+"px",i.style.left=t.x+3+"px",i.style.display="block"}else i.style.display="none"}static measurePick(t,e){if(e&&(e.atom||e.bond)){const t=e.atom||e.closestBondAtom;e.component.measurePick(t)}else t.measureClear()}}const Zo={default:[["scroll",Ko.zoomScroll],["scroll-shift",Ko.focusScroll],["scroll-ctrl",Ko.isolevelScroll],["scroll-shift-ctrl",Ko.zoomFocusScroll],["drag-left",Ko.rotateDrag],["drag-right",Ko.panDrag],["drag-ctrl-left",Ko.panDrag],["drag-ctrl-right",Ko.zRotateDrag],["drag-shift-left",Ko.zoomDrag],["drag-middle",Ko.zoomFocusDrag],["drag-ctrl-shift-right",Ko.panComponentDrag],["drag-ctrl-shift-left",Ko.rotateComponentDrag],["clickPick-right",Ko.measurePick],["clickPick-ctrl-left",Ko.measurePick],["clickPick-middle",Ko.movePick],["clickPick-left",Ko.movePick],["hoverPick",Ko.tooltipPick]],pymol:[["drag-left",Ko.rotateDrag],["drag-middle",Ko.panDrag],["drag-right",Ko.zoomDrag],["scroll",Ko.focusScroll],["drag-shift-right",Ko.focusScroll],["clickPick-ctrl+shift-middle",Ko.movePick],["hoverPick",Ko.tooltipPick]],coot:[["scroll",Ko.isolevelScroll],["drag-left",Ko.rotateDrag],["drag-middle",Ko.panDrag],["drag-ctrl-left",Ko.panDrag],["drag-right",Ko.zoomFocusDrag],["drag-ctrl-right",Ko.focusScroll],["clickPick-middle",Ko.movePick],["hoverPick",Ko.tooltipPick]],astexviewer:[["drag-left",Ko.rotateDrag],["drag-ctrl-left",Ko.panDrag],["drag-shift-left",Ko.zoomDrag],["scroll",Ko.focusScroll],["clickPick-middle",Ko.movePick],["hoverPick",Ko.tooltipPick]]};function Qo(t){const e=t.split(/[-+]/);let i="";e.includes("scroll")&&(i="scroll"),e.includes("drag")&&(i="drag"),e.includes("click")&&(i="click"),e.includes("doubleClick")&&(i="doubleClick"),e.includes("hover")&&(i="hover"),e.includes("clickPick")&&(i="clickPick"),e.includes("hoverPick")&&(i="hoverPick");let r=0;e.includes("alt")&&(r+=1),e.includes("ctrl")&&(r+=2),e.includes("meta")&&(r+=4),e.includes("shift")&&(r+=8);let s=0;return e.includes("left")&&(s+=1),e.includes("right")&&(s+=2),e.includes("middle")&&(s+=4),[i,r,s]}class Jo{constructor(t,e={}){this.stage=t,this.actionList=[],this.mouse=t.mouseObserver,this.disabled=e.disabled||!1,this.preset(e.preset||"default")}run(t,...e){if(this.disabled)return;const i=this.mouse.key||0,r=this.mouse.buttons||0;this.actionList.forEach((s=>{s.type===t&&s.key===i&&s.button===r&&s.callback(this.stage,...e)}))}add(t,e){const[i,r,s]=Qo(t);this.actionList.push({type:i,key:r,button:s,callback:e})}remove(t,e){const i=t.includes("*"),[r,s,n]=Qo(t),o=this.actionList.filter((function(t){return!((t.type===r||i&&""===r)&&(t.key===s||i&&0===s)&&(t.button===n||i&&0===n)&&(t.callback===e||void 0===e))}));this.actionList=o}preset(t){this.clear();(Zo[t]||[]).forEach((t=>this.add(t[0],t[1])))}clear(){this.actionList.length=0}}class ta{static autoView(t){t.autoView(1e3)}static toggleAnimations(t){t.animationControls.toggle()}static toggleRock(t){t.toggleRock()}static toggleSpin(t){t.toggleSpin()}static toggleAntialiasing(t){const e=t.getParameters();t.setParameters({sampleLevel:-1===e.sampleLevel?0:-1})}}const ea={default:[["i",ta.toggleSpin],["k",ta.toggleRock],["p",ta.toggleAnimations],["a",ta.toggleAntialiasing],["r",ta.autoView]]};class ia{constructor(t,e={}){this.stage=t,this.actionList=[],this.disabled=e.disabled||!1,this.preset(e.preset||"default")}run(t){this.disabled||this.actionList.forEach((e=>{e.key===t&&e.callback(this.stage)}))}add(t,e){this.actionList.push({key:t,callback:e})}remove(t,e){const i=this.actionList.filter((function(i){return!(i.key===t&&(i.callback===e||void 0===e))}));this.actionList=i}preset(t){this.clear();(ea[t]||[]).forEach((t=>this.add(t[0],t[1])))}clear(){this.actionList.length=0}}class ra{constructor(t){this.stage=t,this.stage=t,this.mouse=t.mouseObserver,this.controls=t.mouseControls,this.mouse.signals.clicked.add(this._onClick,this),this.mouse.signals.hovered.add(this._onHover,this)}_onClick(t,e){const i=this.stage.pickingControls.pick(t,e);this.stage.signals.clicked.dispatch(i),this.controls.run("clickPick",i)}_onHover(t,e){const i=this.stage.pickingControls.pick(t,e);i&&this.mouse.down.equals(this.mouse.position)&&(this.stage.transformComponent=i.component,this.stage.transformAtom=i.atom),this.stage.signals.hovered.dispatch(i),this.controls.run("hoverPick",i)}dispose(){this.mouse.signals.clicked.remove(this._onClick,this),this.mouse.signals.hovered.remove(this._onHover,this)}}class sa{constructor(t){this.stage=t,this.stage=t,this.mouse=t.mouseObserver,this.controls=t.mouseControls,this.mouse.signals.moved.add(this._onMove,this),this.mouse.signals.scrolled.add(this._onScroll,this),this.mouse.signals.dragged.add(this._onDrag,this),this.mouse.signals.clicked.add(this._onClick,this),this.mouse.signals.hovered.add(this._onHover,this),this.mouse.signals.doubleClicked.add(this._onDblclick,this)}_onMove(){this.stage.tooltip.style.display="none"}_onScroll(t){this.controls.run("scroll",t)}_onDrag(t,e){this.controls.run("drag",t,e)}_onClick(t,e){this.controls.run("click",t,e)}_onDblclick(t,e){this.controls.run("doubleClick",t,e)}_onHover(t,e){this.controls.run("hover",t,e)}dispose(){this.mouse.signals.moved.remove(this._onMove,this),this.mouse.signals.scrolled.remove(this._onScroll,this),this.mouse.signals.dragged.remove(this._onDrag,this),this.mouse.signals.clicked.remove(this._onClick,this),this.mouse.signals.hovered.remove(this._onHover,this)}}class na{constructor(t){this.stage=t,this.viewer=t.viewer,this.animationControls=t.animationControls,this.viewer.signals.ticked.add(this._onTick,this)}_onTick(t){this.animationControls.run(t)}dispose(){this.viewer.signals.ticked.remove(this._onTick,this)}}const oa=!!_e&&{passive:!0};class aa{constructor(t){this.stage=t,this.stage=t,this.controls=t.keyControls,this.domElement=t.viewer.renderer.domElement,this.domElement.setAttribute("tabIndex","-1"),this.domElement.style.outline="none",this._focusDomElement=this._focusDomElement.bind(this),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this),this._onKeypress=this._onKeypress.bind(this),this.domElement.addEventListener("mousedown",this._focusDomElement),this.domElement.addEventListener("touchstart",this._focusDomElement,oa),this.domElement.addEventListener("keydown",this._onKeydown),this.domElement.addEventListener("keyup",this._onKeyup),this.domElement.addEventListener("keypress",this._onKeypress)}_onKeydown(){}_onKeyup(){}_onKeypress(t){let e;e="key"in KeyboardEvent.prototype?t.key:String.fromCharCode(t.which||t.keyCode),this.controls.run(e)}_focusDomElement(){this.domElement.focus()}dispose(){this.domElement.removeEventListener("mousedown",this._focusDomElement),this.domElement.removeEventListener("touchstart",this._focusDomElement,oa),this.domElement.removeEventListener("keydown",this._onKeypress),this.domElement.removeEventListener("keyup",this._onKeypress),this.domElement.removeEventListener("keypress",this._onKeypress)}}class ca{constructor(i,r,s,n={}){this.component=i,this.position=r,this.offsetX=st(n.offsetX,0),this.offsetY=st(n.offsetY,0),this.visible=st(n.visible,!0),this.stage=i.stage,this.viewer=i.stage.viewer,this._viewerPosition=new e,this._updateViewerPosition(),this._canvasPosition=new t,this._cameraPosition=new e,this.element=document.createElement("div"),Object.assign(this.element.style,{display:"block",position:"absolute",pointerEvents:"none",whiteSpace:"nowrap",left:"-10000px"}),this.viewer.wrapper.appendChild(this.element),this.setContent(s),this.updateVisibility(),this.viewer.signals.rendered.add(this._update,this),this.component.signals.matrixChanged.add(this._updateViewerPosition,this)}setContent(t){const e=this.element.style.display;if("none"===e&&(this.element.style.left="-10000px",this.element.style.display="block"),t instanceof HTMLElement)this.element.appendChild(t);else{const e=document.createElement("div");e.innerText=t,Object.assign(e.style,{backgroundColor:"rgba( 0, 0, 0, 0.6 )",color:"lightgrey",padding:"8px",fontFamily:"sans-serif"}),this.element.appendChild(e)}this._clientRect=this.element.getBoundingClientRect(),"none"===e&&(this.element.style.display=e)}setVisibility(t){this.visible=t,this.updateVisibility()}getVisibility(){return this.visible&&this.component.parameters.visible}updateVisibility(){this.element.style.display=this.getVisibility()?"block":"none"}_updateViewerPosition(){this._viewerPosition.copy(this.position).applyMatrix4(this.component.matrix)}_update(){if(!this.getVisibility())return;const t=this.element.style,e=this._canvasPosition,i=this._viewerPosition,r=this._clientRect;if(this._cameraPosition.copy(i).add(this.viewer.translationGroup.position).applyMatrix4(this.viewer.rotationGroup.matrix).sub(this.viewer.camera.position),this._cameraPosition.z<0)return void(t.display="none");t.display="block";const s=this._cameraPosition.length(),n=this.viewer.scene.fog;t.opacity=(1-Rt(n.near,n.far,s)).toString(),t.zIndex=Math.round(100*(n.far-s)).toString(),this.stage.viewerControls.getPositionOnCanvas(i,e),t.bottom=this.offsetX+e.y+r.height/2+"px",t.left=this.offsetY+e.x-r.width/2+"px"}dispose(){this.viewer.wrapper.removeChild(this.element),this.viewer.signals.ticked.remove(this._update,this),this.component.signals.matrixChanged.remove(this._updateViewerPosition,this)}}const la=new i,ha=new e,da=new r;class ua{constructor(t){this.component=t,this.signals={changed:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.stage=t.stage,this.viewer=t.stage.viewer}get position(){return this.component.position}get rotation(){return this.component.quaternion}changed(){this.component.updateMatrix(),this.viewer.requestRender(),this.signals.changed.dispatch()}spin(t,e){la.getInverse(this.viewer.rotationGroup.matrix),ha.copy(At(t)).applyMatrix4(la),la.extractRotation(this.component.transform),la.premultiply(this.viewer.rotationGroup.matrix),la.getInverse(la),ha.copy(At(t)),ha.applyMatrix4(la),la.makeRotationAxis(ha,e),da.setFromRotationMatrix(la),this.component.quaternion.premultiply(da),this.changed()}}const ma={"":"",vdw:"by vdW radius",covalent:"by covalent radius",sstruc:"by secondary structure",bfactor:"by bfactor",size:"size",data:"data",explicit:"explicit"};class pa{constructor(t={}){this.max=10,this.type=st(t.type,"size"),this.scale=st(t.scale,1),this.size=st(t.size,1),this.data=st(t.data,{})}atomRadius(t){let e;switch(this.type){case"vdw":e=t.vdw;break;case"covalent":e=t.covalent;break;case"bfactor":e=t.bfactor||1;break;case"sstruc":const i=t.sstruc;e="h"===i||"g"===i||"i"===i||"e"===i||"b"===i?.25:un.includes(t.atomname)?.4:.1;break;case"data":e=st(this.data[t.index],1);break;case"explicit":e=t.radius,null===e&&(e=this.size);break;default:e=this.size}return Math.min(e*this.scale,this.max)}}pa.types=ma;const fa=new e(-1,-1,-1),ga=new i;class ya{constructor(t){const i=t.rows,r=i/3,s=new ho(i,3),n=new ho(3,3),o=new ho(1,3),a=new ho(3,3),c=new ho(3,3),l=fo(t);go(t,l),uo(s,t),mo(n,s,s),wo(n,o,a,c);const h=new e(l[0],l[1],l[2]),d=new e(a.data[0],a.data[3],a.data[6]),u=new e(a.data[1],a.data[4],a.data[7]),m=new e(a.data[2],a.data[5],a.data[8]),p=d.clone().multiplyScalar(Math.sqrt(o.data[0]/r)),f=u.clone().multiplyScalar(Math.sqrt(o.data[1]/r)),g=m.clone().multiplyScalar(Math.sqrt(o.data[2]/r));this.begA=h.clone().sub(p),this.endA=h.clone().add(p),this.begB=h.clone().sub(f),this.endB=h.clone().add(f),this.begC=h.clone().sub(g),this.endC=h.clone().add(g),this.center=h,this.vecA=p,this.vecB=f,this.vecC=g,this.normVecA=d,this.normVecB=u,this.normVecC=m}getBasisMatrix(t=new i){const e=t;return e.makeBasis(this.normVecB,this.normVecA,this.normVecC),e.determinant()<0&&e.scale(fa),e}getRotationQuaternion(t=new r){const e=t;return e.setFromRotationMatrix(this.getBasisMatrix(ga)),e.inverse()}getProjectedScaleForAtoms(t){let i=-1/0,r=-1/0,s=-1/0,n=-1/0,o=-1/0,a=-1/0;const c=new e,l=new e,h=this.center,d=this.normVecA,u=this.normVecB,m=this.normVecC;return t.eachAtom((function(t){jr(c.copy(t),d,h);const e=l.subVectors(c,h).normalize().dot(d),p=c.distanceTo(h);e>0?p>i&&(i=p):p>r&&(r=p),jr(c.copy(t),u,h);const f=l.subVectors(c,h).normalize().dot(u),g=c.distanceTo(h);f>0?g>s&&(s=g):g>n&&(n=g),jr(c.copy(t),m,h);const y=l.subVectors(c,h).normalize().dot(m),b=c.distanceTo(h);y>0?b>o&&(o=b):b>a&&(a=b)})),{d1a:i,d2a:s,d3a:o,d1b:-r,d2b:-n,d3b:-a}}}class ba{constructor(t,e,i,r){this.volume=t,this.setFilter(e,i,r)}get header(){return this.volume.header}get matrix(){return this.volume.matrix}get normalMatrix(){return this.volume.normalMatrix}get inverseMatrix(){return this.volume.inverseMatrix}get center(){return this.volume.center}get boundingBox(){return this.volume.boundingBox}get min(){return this.volume.min}get max(){return this.volume.max}get mean(){return this.volume.mean}get rms(){return this.volume.rms}_getFilterHash(t,e,i){return JSON.stringify([t,e,i])}setFilter(t,e,i){isNaN(t)&&this.header&&(t=this.header.DMEAN+2*this.header.ARMS),t=void 0===t||isNaN(t)?-1/0:t,e=st(e,1/0),i=st(i,!1);const r=this.volume.data,s=this.volume.position,n=this.volume.atomindex,o=this._getFilterHash(t,e,i);if(o!==this._filterHash){if(t===-1/0&&e===1/0)this.data=r,this.position=s,this.atomindex=n;else{const o=r.length;this._dataBuffer||(this._dataBuffer=new ArrayBuffer(4*o),this._positionBuffer=new ArrayBuffer(3*o*4),n&&(this._atomindexBuffer=new ArrayBuffer(4*o)));const a=new Float32Array(this._dataBuffer),c=new Float32Array(this._positionBuffer);let l;n&&(l=new Uint32Array(this._atomindexBuffer));let h=0;for(let d=0;d=t&&u<=e||i&&(ue)){const t=3*h;a[h]=u,c[t+0]=s[o+0],c[t+1]=s[o+1],c[t+2]=s[o+2],n&&l&&(l[h]=n[d]),h+=1}}this.data=new Float32Array(this._dataBuffer,0,h),this.position=new Float32Array(this._positionBuffer,0,3*h),n&&(this.atomindex=new Int32Array(this._atomindexBuffer,0,h))}this._filterHash=o}}}ba.prototype.getValueForSigma=Eo.prototype.getValueForSigma,ba.prototype.getSigmaForValue=Eo.prototype.getSigmaForValue,ba.prototype.getDataAtomindex=Eo.prototype.getDataAtomindex,ba.prototype.getDataPosition=Eo.prototype.getDataPosition,ba.prototype.getDataColor=Eo.prototype.getDataColor,ba.prototype.getDataPicking=Eo.prototype.getDataPicking,ba.prototype.getDataSize=Eo.prototype.getDataSize;class xa{constructor(t,e){const i=Rs({nodeArray1:t.atomIndex1,nodeArray2:t.atomIndex2,edgeCount:t.count,nodeCount:e});this.countArray=i.countArray,this.offsetArray=i.offsetArray,this.indexArray=i.indexArray}}class va extends Bs{get _defaultFields(){return[["atomIndex1",1,"int32"],["atomIndex2",1,"int32"],["bondOrder",1,"int8"]]}addBond(t,e,i){this.growIfFull();const r=this.count,s=t.index,n=e.index;s0&&(a[e]=v.angleTo(w));const r=Math.cos(f.angleTo(g));h[e]=180/Math.PI*Math.acos(r);const s=f.length(),x=g.length();c[e]=Math.sqrt(x*s)/Math.max(2,2*(1-r)),l[e]=Math.abs(m.dot(v)),y.copy(f).multiplyScalar(c[e]/s),b.copy(g).multiplyScalar(c[e]/x),y.subVectors(P,y),b.subVectors(I,b),y.toArray(n,i+3),b.toArray(n,i+6),A.subVectors(C,_),A.toArray(d,i),w.copy(v),_.copy(y)}y.fromArray(n,3),b.fromArray(n,6),v.subVectors(y,b).normalize(),C.index=t.getAtomIndexByType(0,S),_.copy(C),x.copy(C),jr(x,v,y),x.toArray(n,0),A.subVectors(_,y),A.toArray(d,0),y.fromArray(n,3*r-6),b.fromArray(n,3*r-9),v.subVectors(y,b).normalize(),C.index=t.getAtomIndexByType(r-1,S),_.copy(C),x.copy(C),jr(x,v,y),x.toArray(n,3*r-3);for(let e=r-3;ei||h.bending[e]>t)&&(E=!0)),E){if(e-p<4){p=e,E=!1;continue}$.index=B.traceAtomIndex,I=h.axis.subarray(3*p+3,3*e),k=h.center.subarray(3*p,3*e+3),C=Ur(I).normalize(),P=Ur(k),M.fromArray(k),jr(M,C,P),T.fromArray(k,k.length-3),jr(T,C,P),C.subVectors(T,M),C.toArray(g,f),P.toArray(y,f),M.toArray(b,f),T.toArray(x,f),u.atomColorToArray($,v,f),w.push($.index),A.push(m.atomRadius($)),_.push(l+p),S.push(l+e+1-p),f+=3,p=e,E=!1}const F=new Float32Array(w);return{axis:new Float32Array(g),center:new Float32Array(y),begin:new Float32Array(b),end:new Float32Array(x),color:new Float32Array(v),picking:new Yn(F,a),size:new Float32Array(A),residueOffset:_,residueCount:S}}}class Ia{constructor(t){this.scoreFunction=t,this.content=[],this.scoreFunction=t}push(t){this.content.push(t),this.bubbleUp(this.content.length-1)}pop(){const t=this.content[0],e=this.content.pop();return e&&this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t}peek(){return this.content[0]}remove(t){const e=this.content.length;for(let i=0;i0;){const i=Math.floor((t+1)/2)-1,r=this.content[i];if(!(this.scoreFunction(e)e?(a&&(clearTimeout(a),a=null),s=u,n=t.apply(i,o),a||(i=o=null)):a||!1===r.trailing||(a=setTimeout(c,h)),n}}function bt(t,e){return te?1:0}function xt(t,e,r){void 0===r&&(r=bt);for(var i=0,o=t.length-1;i<=o;){var n=i+o>>1,a=r(e,t[n]);if(a>0)i=n+1;else{if(!(a<0))return n;o=n-1}}return-i-1}function _t(t,e,r){var i=function(t,e){var r=t.length-1;if(t[r]>1;t[o]>=e?r=o-1:i=o+1}return r+1}(t,e),o=function(t,e){if(t[0]>e)return-1;for(var r=0,i=t.length-1;r<=i;){var o=r+i>>1;t[o]>e?i=o-1:r=o+1}return r-1}(t,r);return-1===i||-1===o||i>o?0:o-i+1}function wt(t){return t.sort().filter((function(t,e,r){return 0===e||t!==r[e-1]}))}function At(t){var e=28672;if(t.length>e){for(var r=[],i=0;i65535?Uint32Array:Uint16Array)(t)}function Pt(t){return t.buffer&&t.buffer instanceof ArrayBuffer?t.buffer:t}function It(t,e){return void 0===t?t=new e:Array.isArray(t)&&(t=(new e).fromArray(t)),t}function Ot(t){return It(t,__WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */])}function kt(t){return It(t,__WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */])}function Mt(t){return It(t,__WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */])}function Tt(t){return e=t,r=Float32Array,e instanceof r?e:new r(e);var e,r}function Bt(t){return ht(t,"").toString().toLowerCase()}"undefined"!=typeof window&&function(){window.console=window.console||{};for(var t,e,r=window.console,i={},o=function(){},n="memory".split(","),a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=n.pop();)r[t]||(r[t]=i);for(;e=a.pop();)r[e]||(r[e]=o)}(),"undefined"==typeof window||void 0===window.HTMLCanvasElement||window.HTMLCanvasElement.prototype.toBlob||Object.defineProperty(window.HTMLCanvasElement.prototype,"toBlob",{value:function(t,e,r){for(var i=window.atob(this.toDataURL(e,r).split(",")[1]),o=i.length,n=o>>2,a=new Uint8Array(o),s=new Uint32Array(a.buffer,0,n),c=0,u=0;c0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&t>-9007199254740992&&t<9007199254740992&&Math.floor(t)===t}),Number.isNaN||(Number.isNaN=function(t){return t!=t}),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var e=arguments;if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r,i=Object(t),o=!1,n=1;n1?arguments[1]:void 0,s=a?Number(a):0;Number.isNaN(s)&&(s=0);var c=Math.min(Math.max(s,0),i);if(n+c>i)return!1;for(var u=-1;++ur.length)&&(e=r.length),e-=t.length;var i=r.indexOf(t,e);return-1!==i&&i===e}),String.prototype.repeat||(String.prototype.repeat=function(t){if(null===this)throw new TypeError("can't convert "+this+" to object");var e=""+this;if(t=+t,Number.isNaN(t)&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t===1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0===e.length||0===t)return"";if(e.length*t>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var r="";1==(1&t)&&(r+=e),0!==(t>>>=1);)e+=e;return r}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.includes||(Array.prototype.includes=function(t){if(null==this)throw new TypeError("Array.prototype.includes called on null or undefined");var e=Object(this),r=parseInt(e.length,10)||0;if(0===r)return!1;var i,o,n=parseInt(arguments[1],10)||0;for(n>=0?i=n:(i=r+n)<0&&(i=0);i0?1:-1)*Math.floor(Math.abs(e)):e}(t);return Math.min(Math.max(e,0),at)},function(t){var e=this,r=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i,o=arguments.length>1?arguments[1]:void 0;if(void 0!==o){if(!nt(o))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(i=arguments[2])}for(var n,a=st(r.length),s=nt(e)?Object(new e(a)):new Array(a),c=0;c>=4,$t[r]=Rt[19===r?3&t|8:t]);return $t.join("")}function Nt(t,e,r){return Math.max(e,Math.min(r,t))}function zt(t,e,r){return t+(e-t)*r}function jt(t,e,r,i,o,n){var a=(r-t)*n,s=(i-e)*n,c=o*o;return(2*e-2*r+a+s)*(o*c)+(-3*e+3*r-2*a-s)*c+a*o+e}function Vt(t,e,r){var i;return i=function(t,e,r){return(t-e)/(r-e)}(r,t,e),(r=Nt(i,0,1))*r*(3-2*r)}var Gt="sRGB";var Ut={scale:"uniform",mode:"hcl",domain:[0,1],value:16777215,reverse:!1},Ht=new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */];function Wt(t,e,r){var i=r.value;return r.value=function(t,e){var r=i.bind(this,t,e)();return"linear"==Gt?(Ht.set(r),Ht.convertSRGBToLinear(),Ht.getHex()):r},r}var qt,Xt=function(t){void 0===t&&(t={}),this.parameters=lt(t,Ut),"string"==typeof this.parameters.value&&(this.parameters.value=Ht.set(this.parameters.value).getHex()),this.parameters.structure&&(this.atomProxy=this.parameters.structure.getAtomProxy())};Xt.prototype.getScale=function(t){void 0===t&&(t={});var e=lt(t,this.parameters);return"rainbow"===e.scale?e.scale=["red","orange","yellow","green","blue"]:"rwb"===e.scale&&(e.scale=["red","white","blue"]),e.reverse&&(e.domain=e.domain.slice().reverse()),__WEBPACK_IMPORTED_MODULE_2_chroma_js__["scale"](e.scale).mode(e.mode).domain(e.domain).out("num")},Xt.prototype.colorToArray=function(t,e,r){return void 0===e&&(e=[]),void 0===r&&(r=0),e[r]=(t>>16&255)/255,e[r+1]=(t>>8&255)/255,e[r+2]=(255&t)/255,e},Xt.prototype.atomColorToArray=function(t,e,r){return this.colorToArray(this.atomColor?this.atomColor(t):0,e,r)},Xt.prototype.bondColor=function(t,e){return this.atomProxy&&this.atomColor?(this.atomProxy.index=e?t.atomIndex1:t.atomIndex2,this.atomColor(this.atomProxy)):0},Xt.prototype.bondColorToArray=function(t,e,r,i){return this.colorToArray(this.bondColor(t,e),r,i)},Xt.prototype.volumeColorToArray=function(t,e,r){return this.colorToArray(this.volumeColor?this.volumeColor(t):0,e,r)},Xt.prototype.positionColorToArray=function(t,e,r){return this.colorToArray(this.positionColor?this.positionColor(t):0,e,r)},function(t){t[t.PROTEIN=1]="PROTEIN",t[t.NUCLEIC=2]="NUCLEIC",t[t.RNA=3]="RNA",t[t.DNA=4]="DNA",t[t.POLYMER=5]="POLYMER",t[t.WATER=6]="WATER",t[t.HELIX=7]="HELIX",t[t.SHEET=8]="SHEET",t[t.TURN=9]="TURN",t[t.BACKBONE=10]="BACKBONE",t[t.SIDECHAIN=11]="SIDECHAIN",t[t.ALL=12]="ALL",t[t.HETERO=13]="HETERO",t[t.ION=14]="ION",t[t.SACCHARIDE=15]="SACCHARIDE",t[t.SUGAR=15]="SUGAR",t[t.BONDED=16]="BONDED",t[t.RING=17]="RING",t[t.AROMATICRING=18]="AROMATICRING",t[t.METAL=19]="METAL",t[t.POLARH=20]="POLARH",t[t.NONE=21]="NONE"}(qt||(qt={}));var Yt=["*","","ALL"],Kt=["NONE"],Zt=[qt.BACKBONE,qt.SIDECHAIN,qt.BONDED,qt.RING,qt.AROMATICRING,qt.METAL,qt.POLARH],Qt=[qt.POLYMER,qt.WATER],Jt=["ALA","GLY","SER"],te=["CYS","SER","THR"],ee=["ALA","ILE","LEU","MET","PHE","PRO","TRP","VAL"],re=["PHE","TRP","TYR","HIS"],ie=["ASN","GLN"],oe=["ASP","GLU"],ne=["ARG","HIS","LYS"],ae=["ARG","ASP","GLU","HIS","LYS"],se=["ASN","ARG","ASP","CYS","GLY","GLN","GLU","HIS","LYS","SER","THR","TYR"],ce=["ALA","ILE","LEU","MET","PHE","PRO","TRP","VAL"],ue=["HIS","PHE","PRO","TRP","TYR"],he=["ALA","GLY","ILE","LEU","VAL"];function le(t,e){if(void 0===e.atomname&&void 0===e.element&&void 0===e.altloc&&void 0===e.atomindex&&void 0===e.keyword&&void 0===e.inscode&&void 0===e.resname&&void 0===e.sstruc&&void 0===e.resno&&void 0===e.chainname&&void 0===e.model)return-1;if(void 0!==e.keyword){if(e.keyword===qt.BACKBONE&&!t.isBackbone())return!1;if(e.keyword===qt.SIDECHAIN&&!t.isSidechain())return!1;if(e.keyword===qt.BONDED&&!t.isBonded())return!1;if(e.keyword===qt.RING&&!t.isRing())return!1;if(e.keyword===qt.AROMATICRING&&!t.isAromatic())return!1;if(e.keyword===qt.HETERO&&!t.isHetero())return!1;if(e.keyword===qt.PROTEIN&&!t.isProtein())return!1;if(e.keyword===qt.NUCLEIC&&!t.isNucleic())return!1;if(e.keyword===qt.RNA&&!t.isRna())return!1;if(e.keyword===qt.DNA&&!t.isDna())return!1;if(e.keyword===qt.POLYMER&&!t.isPolymer())return!1;if(e.keyword===qt.WATER&&!t.isWater())return!1;if(e.keyword===qt.HELIX&&!t.isHelix())return!1;if(e.keyword===qt.SHEET&&!t.isSheet())return!1;if(e.keyword===qt.TURN&&!t.isTurn())return!1;if(e.keyword===qt.ION&&!t.isIon())return!1;if(e.keyword===qt.SACCHARIDE&&!t.isSaccharide())return!1;if(e.keyword===qt.METAL&&!t.isMetal())return!1;if(e.keyword===qt.POLARH&&!t.isPolarHydrogen())return!1}if(void 0!==e.atomname&&e.atomname!==t.atomname)return!1;if(void 0!==e.element&&e.element!==t.element)return!1;if(void 0!==e.altloc&&e.altloc!==t.altloc)return!1;if(void 0!==e.atomindex&&xt(e.atomindex,t.index)<0)return!1;if(void 0!==e.resname)if(Array.isArray(e.resname)){if(!e.resname.includes(t.resname))return!1}else if(e.resname!==t.resname)return!1;if(void 0!==e.sstruc&&e.sstruc!==t.sstruc)return!1;if(void 0!==e.resno)if(Array.isArray(e.resno)&&2===e.resno.length){if(e.resno[0]>t.resno||e.resno[1]t.resno||e.resno[1]0?t:null}function ye(t,e){void 0===e&&(e=!1);var r=t;return e&&(r=ge(t,(function(t){return void 0!==t.keyword&&!Zt.includes(t.keyword)||(void 0!==t.model||(void 0!==t.chainname||(void 0!==t.resname||(void 0!==t.resno||void 0!==t.sstruc))))}))),me(r,le)}function ve(t,e){void 0===e&&(e=!1);var r=t;return e&&(r=ge(t,(function(t){return!(void 0===t.keyword||!Zt.includes(t.keyword))||(void 0!==t.model||(void 0!==t.chainname||(void 0!==t.atomname||(void 0!==t.element||void 0!==t.altloc))))}))),me(r,pe)}function be(t,e){void 0===e&&(e=!1);var r=t;return e&&(r=ge(t,(function(t){return void 0!==t.keyword&&!Qt.includes(t.keyword)||(void 0!==t.resname||(void 0!==t.resno||(void 0!==t.atomname||(void 0!==t.element||(void 0!==t.altloc||(void 0!==t.sstruc||void 0!==t.inscode))))))}))),me(r,de)}function xe(t,e){void 0===e&&(e=!1);var r=t;return e&&(r=ge(t,(function(t){return void 0!==t.keyword||(void 0!==t.chainname||(void 0!==t.resname||(void 0!==t.resno||(void 0!==t.atomname||(void 0!==t.element||(void 0!==t.altloc||(void 0!==t.sstruc||void 0!==t.inscode)))))))}))),me(r,fe)}var _e=function(t){this.signals={stringChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]},this.setString(t)},we={type:{configurable:!0}};we.type.get=function(){return"selection"},_e.prototype.setString=function(t,e){if(void 0===t&&(t=this.string||""),t!==this.string){try{this.selection=function(t){var e={operator:void 0,rules:[]};if(!t)return e;var r,i,o=e,n=[];"("===(t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").trim()).charAt(0)&&")"===t.substr(-1)&&(t=t.slice(1,-1).trim());for(var a=t.split(/\s+/),s=function(t){r={operator:t,rules:[]},void 0===o?(o=r,e=r):(o.rules.push(r),n.push(o),o=r)},c=function(t){i=o,void 0===(o=n.pop())&&(s(t),u(i))},u=function(t){o.rules.push(t)},h=!1,l=0;l0)if("NOT"===d)h=1;else if(1===h)h=2;else{if(2!==h)throw new Error("something went wrong with 'not'");h=!1,c()}if("AND"!==d)if("OR"!==d)if("NOT"!==p.toUpperCase()){if(+d!=+d){var f=qt[d];if(void 0!==f){u({keyword:f});continue}}if("HYDROGEN"!==d)if("SMALL"!==d)if("NUCLEOPHILIC"!==d)if("HYDROPHOBIC"!==d)if("AROMATIC"!==d)if("AMIDE"!==d)if("ACIDIC"!==d)if("BASIC"!==d)if("CHARGED"!==d)if("POLAR"!==d)if("NONPOLAR"!==d)if("CYCLIC"!==d)if("ALIPHATIC"!==d)if("SIDECHAINATTACHED"!==d)if("APOLARH"!==d)if("LIGAND"!==d)if(-1===Yt.indexOf(d))if("@"!==p.charAt(0))if("#"!==p.charAt(0))if("_"!==p.charAt(0))if("["!==p[0]||"]"!==p[p.length-1])if(p.length>=1&&p.length<=4&&"^"!==p[0]&&":"!==p[0]&&"."!==p[0]&&"%"!==p[0]&&"/"!==p[0]&&isNaN(parseInt(p)))u({resname:d});else{var m={operator:"AND",rules:[]},g=p.split("/");if(g.length>1&&g[1]){if(isNaN(parseInt(g[1])))throw new Error("model must be an integer");m.rules.push({model:parseInt(g[1])})}var y=g[0].split("%");y.length>1&&m.rules.push({altloc:y[1]});var v=y[0].split(".");if(v.length>1&&v[1]){if(v[1].length>4)throw new Error("atomname must be one to four characters");m.rules.push({atomname:v[1].substring(0,4).toUpperCase()})}var b=v[0].split(":");b.length>1&&b[1]&&m.rules.push({chainname:b[1]});var x=b[0].split("^");if(x.length>1&&m.rules.push({inscode:x[1]}),x[0]){var _=void 0,w=void 0;"-"===x[0][0]&&(x[0]=x[0].substr(1),_=!0),x[0].includes("--")&&(x[0]=x[0].replace("--","-"),w=!0);var A=x[0].split("-");if(1===A.length){var S=parseInt(A[0]);if(isNaN(S))throw new Error("resi must be an integer");_&&(S*=-1),m.rules.push({resno:S})}else{if(2!==A.length)throw new Error("resi range must contain one '-'");var C=A.map((function(t){return parseInt(t)}));_&&(C[0]*=-1),w&&(C[1]*=-1),m.rules.push({resno:[C[0],C[1]]})}}if(1===m.rules.length)u(m.rules[0]);else{if(!(m.rules.length>1))throw new Error("empty selection chunk");u(m)}}else{var P=d.substr(1,p.length-2).split(","),I=P.length>1?P:P[0];u({resname:I})}else u({element:d.substr(1)});else console.error("# for element selection deprecated, use _"),u({element:d.substr(1)});else{var O=p.substr(1).split(",").map((function(t){return parseInt(t)}));O.sort((function(t,e){return t-e})),u({atomindex:O})}else u({keyword:qt.ALL});else u({operator:"AND",rules:[{operator:"OR",rules:[{operator:"AND",rules:[{keyword:qt.HETERO},{negate:!0,operator:void 0,rules:[{keyword:qt.POLYMER}]}]},{negate:!0,operator:void 0,rules:[{keyword:qt.POLYMER}]}]},{negate:!0,operator:void 0,rules:[{operator:"OR",rules:[{keyword:qt.WATER},{keyword:qt.ION}]}]}]});else u({operator:"AND",negate:!1,rules:[{element:"H"},{negate:!0,operator:void 0,rules:[{keyword:qt.POLARH}]}]});else u({operator:"OR",rules:[{keyword:qt.SIDECHAIN},{operator:"AND",negate:!1,rules:[{keyword:qt.PROTEIN},{operator:"OR",negate:!1,rules:[{atomname:"CA"},{atomname:"BB"}]}]},{operator:"AND",negate:!1,rules:[{resname:"PRO"},{atomname:"N"}]},{operator:"AND",negate:!1,rules:[{keyword:qt.NUCLEIC},{operator:"OR",negate:!0,rules:[{atomname:"P"},{atomname:"OP1"},{atomname:"OP2"},{atomname:"O3'"},{atomname:"O3*"},{atomname:"HO3'"},{atomname:"O5'"},{atomname:"O5*"},{atomname:"HO5'"},{atomname:"C5'"},{atomname:"C5*"},{atomname:"H5'"},{atomname:"H5''"}]}]}]});else u({resname:he});else u({resname:ue});else u({resname:ce});else u({resname:se});else u({resname:ae});else u({resname:ne});else u({resname:oe});else u({resname:ie});else u({resname:re});else u({resname:ee});else u({resname:te});else u({resname:Jt});else u({operator:"OR",rules:[{element:"H"},{element:"D"}]})}else h=1,s(),o.negate=!0;else"AND"===o.operator?c("OR"):o.operator="OR";else if("OR"===o.operator){var k=o.rules.pop();s("AND"),u(k)}else o.operator="AND"}else c(),o.negate&&c();else h=!1,s()}return void 0===e.operator&&1===e.rules.length&&e.rules[0].hasOwnProperty("operator")&&(e=e.rules[0]),e}(t)}catch(t){this.selection={error:t.message}}var r=this.selection;this.string=t,this.test=ye(r),this.residueTest=ve(r),this.chainTest=be(r),this.modelTest=xe(r),this.atomOnlyTest=ye(r,!0),this.residueOnlyTest=ve(r,!0),this.chainOnlyTest=be(r,!0),this.modelOnlyTest=xe(r,!0),e||this.signals.stringChanged.dispatch(this.string)}},_e.prototype.isAllSelection=function(){return Yt.includes(this.string.toUpperCase())},_e.prototype.isNoneSelection=function(){return Kt.includes(this.string.toUpperCase())},Object.defineProperties(_e.prototype,we);var Ae=function(t){function e(e){var r=this;t.call(this,e),this.colormakerList=[],this.selectionList=[],(e.dataList||[]).forEach((function(t){var e=t[0],i=t[1],o=t[2];void 0===o&&(o={}),Ze.hasScheme(e)?Object.assign(o,{scheme:e,structure:r.parameters.structure}):Object.assign(o,{scheme:"uniform",value:new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](e).getHex()}),r.colormakerList.push(Ze.getScheme(o)),r.selectionList.push(new _e(i))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){for(var e=0,r=this.selectionList.length;ei).lines},cr.prototype.chunkCount=function(){return Math.floor(this.data.length/this.chunkSize)+1},cr.prototype.asText=function(){return this.isBinary()?At(this.data):this.data},cr.prototype.chunkToLines=function(t,e,r){var i=this.newline;if(!this.isBinary()&&t.length===this.data.length)return{lines:t.split(i),partialLine:""};var o=[],n=this.isBinary()?At(t):t,a=n.lastIndexOf(i);if(-1===a)e+=n;else{var s=e+n.substr(0,a);o=o.concat(s.split(i)),e=a===n.length-i.length?"":n.substr(a+i.length)}return r&&""!==e&&o.push(e),{lines:o,partialLine:e}},cr.prototype.nextChunk=function(){var t=this.__pointer;if(!(t>this.data.length))return this.__pointer+=this.chunkSize,this.chunk(t)},cr.prototype.nextChunkOfLines=function(){var t=this.nextChunk();if(void 0!==t){var e=this.__pointer>this.data.length,r=this.chunkToLines(t,this.__partialLine,e);return this.__partialLine=r.partialLine,r.lines}},cr.prototype.eachChunk=function(t){for(var e=this.chunkSize,r=this.data.length,i=this.chunkCount(),o=0;o1?(u.pop()||"").toLowerCase():"",l=e.match(/^(.+):\/\/(.+)$/);l&&(o=l[1].toLowerCase(),e=l[2]||"");var p=e.substring(0,e.lastIndexOf("/")+1);if(i.includes(h)){r=h;var d=e.length-h.length-1;h=(e.substr(0,d).split(".").pop()||"").toLowerCase();var f=c.length-h.length-1;c=c.substr(0,f)}else r=!1;return{path:e,name:s,ext:h,base:c,dir:p,compressed:r,protocol:o,query:a,src:t}}function gr(t){var e=mr(t),r=Qe.get(e.protocol);return r&&!(e=mr(r.getUrl(e.src))).ext&&r.getExt&&(e.ext=r.getExt(t)),e}function yr(t,e){void 0===e&&(e={});var r,i=Object.assign(gr(t),e);return tr.names.includes(i.ext)?r=new pr(i.src,i):Ye.includes(i.ext)&&(r=new fr(i.src,i)),r?r.load():Promise.reject(new Error("autoLoad: ext '"+i.ext+"' unknown"))}var vr=function(){};vr.prototype.getBlob=function(){return new Blob([this.getData()],{type:this.mimeType})},vr.prototype.download=function(t,e){t=ht(t,this.defaultName),e=ht(e,this.defaultExt),yt(this.getBlob(),t+"."+e)};var br=function(t){function e(e,r){t.call(this),this.mimeType="text/plain",this.defaultName="structure",this.defaultExt="pdb";var i=Object.assign({},r);this.renumberSerial=ht(i.renumberSerial,!0),this.remarks=function(t){return Array.isArray(t)?t:[t]}(ht(i.remarks,[])),this.structure=e,this._records=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._writeRecords=function(){this._records.length=0,this._writeTitle(),this._writeRemarks(),this._writeAtoms()},e.prototype._writeTitle=function(){this._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("TITLE %-74s",this.structure.name))},e.prototype._writeRemarks=function(){var t=this;this.remarks.forEach((function(e){t._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("REMARK %-73s",e))})),this.structure.trajectory&&(this._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("REMARK %-73s","Trajectory '"+this.structure.trajectory.name+"'")),this._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("REMARK %-73s","Frame "+this.structure.trajectory.frame)))},e.prototype._writeAtoms=function(){var t=this,e=1,r=1,i=" ",o=" ",n=this.structure.modelStore.count>1;this.structure.eachModel((function(a){n&&t._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("MODEL %4d%-66s",r++,"")),a.eachAtom((function(r){var n=r.hetero?"HETATM%5d %-4s %3s %1s%4d %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%1s%1s":"ATOM %5d %-4s %3s %1s%4d %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%1s%1s",a=t.renumberSerial?e:r.serial,s=r.atomname;(1===s.length||s.length<4&&1===r.element.length&&s[0]===r.element)&&(s=" "+s),r.formalCharge?(i=Math.abs(r.formalCharge).toPrecision(1),o=r.formalCharge>0?"+":"-"):(i=" ",o=" "),t._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])(n,a,s,r.resname,ht(r.chainname," "),r.resno,r.x,r.y,r.z,ht(r.occupancy,1),ht(r.bfactor,0),"",ht(r.element,""),i,o)),e+=1}),t.structure.getSelection()),n&&t._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("%-80s","ENDMDL"))})),this._records.push(Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("%-80s","END"))},e.prototype.getString=function(){return console.warn("PdbWriter.getString() is deprecated, use .getData instead"),this.getData()},e.prototype.getData=function(){return this._writeRecords(),this._records.join("\n")},e}(vr),xr=function(t){function e(e){t.call(this),this.mimeType="text/plain",this.defaultName="structure",this.defaultExt="sdf",this.structure=e,this._records=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={idString:{configurable:!0},titleString:{configurable:!0},countsString:{configurable:!0},chargeLines:{configurable:!0}};return r.idString.get=function(){return this.structure.id},r.titleString.get=function(){return" "+this.structure.title},r.countsString.get=function(){return Object(__WEBPACK_IMPORTED_MODULE_4_sprintf_js__["sprintf"])("%3i%3i 0 0 0 0 0 0 0 0999 V2000",this.structure.atomCount,this.structure.bondCount)},r.chargeLines.get=function(){var t=[];this.structure.eachAtom((function(e){null!=e.formalCharge&&0!==e.formalCharge&&t.push([e.index,e.formalCharge])}));for(var e=[],r=0;r>>0:0,o=t.byteLength-i,n=i;t instanceof ArrayBuffer||(t.byteLength!==t.buffer.byteLength&&(n=t.byteOffset+i),t=t.buffer),this._lastWrittenByte=r?o:0,this.buffer=t,this.length=o,this.byteLength=o,this.byteOffset=n,this._data=new DataView(this.buffer,n,o)};wr.prototype.available=function(t){return void 0===t&&(t=1),this.offset+t<=this.length},wr.prototype.isLittleEndian=function(){return this.littleEndian},wr.prototype.setLittleEndian=function(){return this.littleEndian=!0,this},wr.prototype.isBigEndian=function(){return!this.littleEndian},wr.prototype.setBigEndian=function(){return this.littleEndian=!1,this},wr.prototype.skip=function(t){return void 0===t&&(t=1),this.offset+=t,this},wr.prototype.seek=function(t){return this.offset=t,this},wr.prototype.mark=function(){return this._mark=this.offset,this},wr.prototype.reset=function(){return this.offset=this._mark,this},wr.prototype.pushMark=function(){return this._marks.push(this.offset),this},wr.prototype.popMark=function(){var t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this},wr.prototype.rewind=function(){return this.offset=0,this},wr.prototype.ensureAvailable=function(t){if(void 0===t&&(t=1),!this.available(t)){var e=2*(this.offset+t),r=new Uint8Array(e);r.set(new Uint8Array(this.buffer)),this.buffer=r.buffer,this.length=this.byteLength=e,this._data=new DataView(this.buffer)}return this},wr.prototype.readBoolean=function(){return 0!==this.readUint8()},wr.prototype.readInt8=function(){return this._data.getInt8(this.offset++)},wr.prototype.readUint8=function(){return this._data.getUint8(this.offset++)},wr.prototype.readByte=function(){return this.readUint8()},wr.prototype.readBytes=function(t){void 0===t&&(t=1);for(var e=new Uint8Array(t),r=0;rthis._lastWrittenByte&&(this._lastWrittenByte=this.offset)};var Ar=function(t){function e(e){t.call(this),this.mimeType="application/vnd.ms-pki.stl",this.defaultName="surface",this.defaultExt="stl",this.surface=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getData=function(){var t=this.surface.index.length/3,e=new wr(2*t+3*t*4*4+80+4);e.skip(80),e.writeUint32(t);for(var i=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],o=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],n=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],a=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],s=0;sthis.prevFpsTime+1e3&&(this.lastFps=this.frames,this.prevFpsTime=t,this.frames=0),t},er.add("shader/chunk/fog_fragment.glsl","#ifdef USE_FOG\nfloat depth = length( vViewPosition );\n#ifdef FOG_EXP2\nfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif"),er.add("shader/chunk/interior_fragment.glsl","if( gl_FrontFacing == false ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}"),er.add("shader/chunk/matrix_scale.glsl","float matrixScale( in mat4 m ){\nvec4 r = m[ 0 ];\nreturn sqrt( r[ 0 ] * r[ 0 ] + r[ 1 ] * r[ 1 ] + r[ 2 ] * r[ 2 ] );\n}"),er.add("shader/chunk/nearclip_vertex.glsl","#ifdef NEAR_CLIP\nif( vViewPosition.z < clipNear - 5.0 )\ngl_Position.z = 2.0 * gl_Position.w;\n#endif"),er.add("shader/chunk/nearclip_fragment.glsl","#ifdef NEAR_CLIP\nif( vViewPosition.z < clipNear )\ndiscard;\n#endif"),er.add("shader/chunk/opaque_back_fragment.glsl","#ifdef OPAQUE_BACK\n#ifdef FLIP_SIDED\nif( gl_FrontFacing == true ){\ngl_FragColor.a = 1.0;\n}\n#else\nif( gl_FrontFacing == false ){\ngl_FragColor.a = 1.0;\n}\n#endif\n#endif"),er.add("shader/chunk/radiusclip_vertex.glsl","#ifdef RADIUS_CLIP\nif( distance( vViewPosition, vClipCenter ) > clipRadius + 5.0 )\ngl_Position.z = 2.0 * gl_Position.w;\n#endif"),er.add("shader/chunk/radiusclip_fragment.glsl","#ifdef RADIUS_CLIP\nif( distance( vViewPosition, vClipCenter ) > clipRadius )\ndiscard;\n#endif"),er.add("shader/chunk/unpack_color.glsl","vec3 unpackColor(float f) {\nvec3 color;\ncolor.r = floor(f / 256.0 / 256.0);\ncolor.g = floor((f - color.r * 256.0 * 256.0) / 256.0);\ncolor.b = floor(f - color.r * 256.0 * 256.0 - color.g * 256.0);\nreturn color / 255.0;\n}");var Pr=/^(?!\/\/)\s*#include\s+(\S+)/gim,Ir={};function Or(t,e){void 0===e&&(e={});var r=t+"|";for(var i in e)r+=i+":"+e[i];if(!Ir[r]){var o=function(t){if(void 0===t)return"";var e=[];for(var r in t){var i=t[r];i&&e.push("#define "+r+" "+i)}return e.join("\n")+"\n"}(e),n=er.get("shader/"+t);if(!n)throw new Error("empty shader, '"+t+"'");n=n.replace(Pr,(function(t,e){var r="shader/chunk/"+e+".glsl",i=er.get(r)||__WEBPACK_IMPORTED_MODULE_1_three__["N" /* ShaderChunk */][e];if(!i)throw new Error("empty chunk, '"+e+"'");return i})),Ir[r]=o+n}return Ir[r]}if("undefined"!=typeof WebGLRenderingContext){var kr=WebGLRenderingContext.prototype,Mr=kr.getShaderParameter;kr.getShaderParameter=function(){return!He||Mr.apply(this,arguments)};var Tr=kr.getShaderInfoLog;kr.getShaderInfoLog=function(){return He?Tr.apply(this,arguments):""};var Br=kr.getProgramParameter;kr.getProgramParameter=function(t,e){return!He&&e===kr.LINK_STATUS||Br.apply(this,arguments)};var Dr=kr.getProgramInfoLog;kr.getProgramInfoLog=function(){return He?Dr.apply(this,arguments):""}}var Er=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];Er.forEach((function(t){t.forEach((function(t){t[0]*=.0625,t[1]*=.0625}))}));var Fr=function(t,e,r,i){this.canvas=document.createElement("canvas"),this._viewer=r,this._factor=ht(i.factor,2),this._antialias=ht(i.antialias,!1),this._onProgress=i.onProgress,this._onFinish=i.onFinish,this._antialias&&(this._factor*=2),this._n=this._factor*this._factor,this._width=this._viewer.width,this._height=this._viewer.height,this._antialias?(this.canvas.width=this._width*this._factor/2,this.canvas.height=this._height*this._factor/2):(this.canvas.width=this._width*this._factor,this.canvas.height=this._height*this._factor),this._ctx=this.canvas.getContext("2d"),this._viewerSampleLevel=r.sampleLevel,this._viewer.setSampling(-1)};Fr.prototype._renderTile=function(t){var e=this._viewer,r=this._width,i=this._height,o=this._factor,n=t%o*r,a=Math.floor(t/o)*i;if(e.camera.setViewOffset(r*o,i*o,n,a,r,i),e.render(),this._antialias){var s=Math.round((n+r)/2)-Math.round(n/2),c=Math.round((a+i)/2)-Math.round(a/2);this._ctx.drawImage(e.renderer.domElement,Math.round(n/2),Math.round(a/2),s,c)}else this._ctx.drawImage(e.renderer.domElement,Math.floor(n),Math.floor(a),Math.ceil(r),Math.ceil(i));"function"==typeof this._onProgress&&this._onProgress(t+1,this._n,!1)},Fr.prototype._finalize=function(){this._viewer.setSampling(this._viewerSampleLevel),this._viewer.camera.view=null,"function"==typeof this._onFinish&&this._onFinish(this._n+1,this._n,!1)},Fr.prototype.render=function(){for(var t=0;t<=this._n;++t)t===this._n?this._finalize():this._renderTile(t)},Fr.prototype.renderAsync=function(){for(var t=this,e=0,r=this._n,i=function(){e===r?t._finalize():t._renderTile(e),e+=1},o=0;o<=r;++o)setTimeout(i,0)};var Rr=2*Math.PI,$r=180/Math.PI;function Lr(t,e,r,i,o){void 0===r&&(r=1),void 0===i&&(i=0);var n=o?o.length:t.length/r,a=0,s=0;if(o)for(var c=0;ce&&(e=t[r]);return e}function Yr(t){for(var e=1/0,r=0,i=t.length;r=0;a--){for(n=h-1;n>=0;n--)if(l[c=4*(a*h+n)]!==e||l[c+1]!==r||l[c+2]!==i||l[c+3]!==o){s=!0;break}if(s)break}var f=a;for(s=!1,n=h-1;n>=0;n--){for(a=u-1;a>=0;a--)if(l[c=4*(a*h+n)]!==e||l[c+1]!==r||l[c+2]!==i||l[c+3]!==o){s=!0;break}if(s)break}var m=n,g=document.createElement("canvas");return g.width=m-d,g.height=f-p,g.getContext("2d").drawImage(t,d,p,g.width,g.height,0,0,g.width,g.height),g}(t,a?0:255*e.r,a?0:255*e.g,a?0:255*e.b,a?0:255)}return t}function d(t,r,i){"function"==typeof e.onProgress&&e.onProgress(t,r,i)}return new Promise((function(e,r){var i=new Fr(s,c,t,{factor:o,antialias:n,onProgress:d,onFinish:function(o,n){p(i.canvas).toBlob((function(i){s.setClearAlpha(u),l(!0),t.requestRender(),d(n,n,!0),i?e(i):r("error creating image")}),"image/png")}});s.setClearAlpha(a?0:1),l(),i.renderAsync()}))}var ti=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],ei=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],ri=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */];var ii=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */],oi=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],ni=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */];function ai(t,e){oi.getInverse(e.projectionMatrix),ni.copy(e.projectionMatrix).transpose(),t.traverse((function(t){var e=t.material;if(e){var r=e.uniforms;r&&(r.projectionMatrixInverse&&r.projectionMatrixInverse.value.copy(oi),r.projectionMatrixTranspose&&r.projectionMatrixTranspose.value.copy(ni))}}))}function si(t,e,r){var i=t.createShader(r);if(i)return t.shaderSource(i,e),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)?i:(console.log("error compiling shader "+i+": "+t.getShaderInfoLog(i)),t.deleteShader(i),null);console.log("error creating WebGL shader "+r)}function ci(t,e){var r=t.getExtension(e);return r||console.log("extension '"+e+"' not available"),r}var ui=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]);function hi(t){var e=document.createElement("canvas");e.width=16,e.height=16,e.style.width="16px",e.style.height="16px";var r=e.getContext("webgl")||e.getContext("experimental-webgl");if(!r)return console.log("error creating webgl context for "+t),!1;if(!(r instanceof WebGLRenderingContext))return console.log("Got unexpected type for WebGL rendering context"),!1;ci(r,"OES_texture_float"),ci(r,"OES_texture_half_float"),ci(r,"WEBGL_color_buffer_float");var i=si(r,"\nattribute vec4 a_position;\n\nvoid main() {\n gl_Position = a_position;\n}",r.VERTEX_SHADER),o=si(r,"\nprecision mediump float;\nuniform vec4 u_color;\nuniform sampler2D u_texture;\n\nvoid main() {\n gl_FragColor = texture2D(u_texture, vec2(0.5, 0.5)) * u_color;\n}",r.FRAGMENT_SHADER);if(!i||!o)return!1;var n=function(t,e,r,i){var o=t.createProgram();if(o)return e.forEach((function(e){return t.attachShader(o,e)})),r&&r.forEach((function(e,r){t.bindAttribLocation(o,i?i[r]:r,e)})),t.linkProgram(o),t.getProgramParameter(o,t.LINK_STATUS)?o:(console.log("error linking program: "+t.getProgramInfoLog(o)),t.deleteProgram(o),null);console.log("error creating WebGL program")}(r,[i,o]);if(!n)return console.log("error creating WebGL program"),!1;r.useProgram(n);var a=r.getAttribLocation(n,"a_position"),s=r.getUniformLocation(n,"u_color");if(!s)return console.log("error getting 'u_color' uniform location"),!1;var c=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,c),r.bufferData(r.ARRAY_BUFFER,ui,r.STATIC_DRAW),r.enableVertexAttribArray(a),r.vertexAttribPointer(a,2,r.FLOAT,!1,0,0);var u=r.createTexture(),h=new Uint8Array([255,255,255,255]);r.bindTexture(r.TEXTURE_2D,u),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,h);var l=r.createTexture();r.bindTexture(r.TEXTURE_2D,l),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,t,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST);var p=r.createFramebuffer();if(r.bindFramebuffer(r.FRAMEBUFFER,p),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,l,0),r.checkFramebufferStatus(r.FRAMEBUFFER)!==r.FRAMEBUFFER_COMPLETE)return console.log("error creating framebuffer for "+t),!1;r.bindTexture(r.TEXTURE_2D,u),r.uniform4fv(s,[0,10,20,1]),r.drawArrays(r.TRIANGLES,0,6),r.bindTexture(r.TEXTURE_2D,l),r.bindFramebuffer(r.FRAMEBUFFER,null),r.clearColor(1,0,0,1),r.clear(r.COLOR_BUFFER_BIT),r.uniform4fv(s,[0,.1,.05,1]),r.drawArrays(r.TRIANGLES,0,6);var d=new Uint8Array(4);if(r.readPixels(0,0,1,1,r.RGBA,r.UNSIGNED_BYTE,d),0!==d[0]||d[1]<248||d[2]<248||d[3]<254)return console.log("not able to actually render to "+t+" texture"),!1;if(t===r.FLOAT){r.bindFramebuffer(r.FRAMEBUFFER,p);var f=new Float32Array(4);r.readPixels(0,0,1,1,r.RGBA,r.FLOAT,f);var m=r.getError();if(m)return console.log("error reading pixels as float: '"+function(t,e){switch(e){case t.NO_ERROR:return"no error";case t.INVALID_ENUM:return"invalid enum";case t.INVALID_VALUE:return"invalid value";case t.INVALID_OPERATION:return"invalid operation";case t.INVALID_FRAMEBUFFER_OPERATION:return"invalid framebuffer operation";case t.OUT_OF_MEMORY:return"out of memory";case t.CONTEXT_LOST_WEBGL:return"context lost"}return"unknown error"}(r,m)+"'"),!1}return!0}var li=new Float32Array(100),pi=new Uint8Array(100),di=[12,7,13,17,11,6,8,18,16,2,14,22,10,1,3,9,19,23,21,15,5,0,4,24,20],fi=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */];function mi(t,e,r,i,o){var n=o.uniforms,a=[];if(n&&(n.objectId&&(n.objectId.value=$e?this.id:this.id/255,a.push("objectId")),(n.modelViewMatrixInverse||n.modelViewMatrixInverseTranspose||n.modelViewProjectionMatrix||n.modelViewProjectionMatrixInverse)&&this.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,this.matrixWorld),n.modelViewMatrixInverse&&(n.modelViewMatrixInverse.value.getInverse(this.modelViewMatrix),a.push("modelViewMatrixInverse")),n.modelViewMatrixInverseTranspose&&(n.modelViewMatrixInverse?n.modelViewMatrixInverseTranspose.value.copy(n.modelViewMatrixInverse.value).transpose():n.modelViewMatrixInverseTranspose.value.getInverse(this.modelViewMatrix).transpose(),a.push("modelViewMatrixInverseTranspose")),n.modelViewProjectionMatrix&&(n.modelViewProjectionMatrix.value.multiplyMatrices(r.projectionMatrix,this.modelViewMatrix),a.push("modelViewProjectionMatrix")),n.modelViewProjectionMatrixInverse&&(n.modelViewProjectionMatrix?(fi.copy(n.modelViewProjectionMatrix.value),n.modelViewProjectionMatrixInverse.value.getInverse(fi)):(fi.multiplyMatrices(r.projectionMatrix,this.modelViewMatrix),n.modelViewProjectionMatrixInverse.value.getInverse(fi)),a.push("modelViewProjectionMatrixInverse")),a.length)){var s=t.properties.get(o);if(s.program){var c=t.getContext(),u=s.program;c.useProgram(u.program);var h=u.getUniforms();a.forEach((function(t){h.setValue(c,t,n[t].value)}))}}}var gi=function(t){if(this.boundingBox=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */],this.boundingBoxSize=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.boundingBoxLength=0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}},this.distVector=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.signals={ticked:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],rendered:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]},"string"==typeof t){var e=document.getElementById(t);this.container=null===e?document.createElement("div"):e}else t instanceof HTMLElement?this.container=t:this.container=document.createElement("div");if(this.container===document.body)this.width=window.innerWidth||1,this.height=window.innerHeight||1;else{var i=this.container.getBoundingClientRect();this.width=i.width||1,this.height=i.height||1,this.container.style.overflow="hidden"}this.wrapper=document.createElement("div"),this.wrapper.style.position="relative",this.container.appendChild(this.wrapper),this._initParams(),this._initStats(),this._initCamera(),this._initScene(),!1!==this._initRenderer()?(this._initHelper(),this.setBackground(),this.setFog(),this.animate=this.animate.bind(this)):je.error("Viewer: could not initialize renderer")},yi={cameraDistance:{configurable:!0}};gi.prototype._initParams=function(){this.parameters={fogColor:new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](0),fogNear:50,fogFar:100,backgroundColor:new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](0),cameraType:"perspective",cameraFov:40,cameraEyeSep:.3,cameraZ:-80,clipNear:0,clipFar:100,clipDist:10,clipMode:"scene",clipScale:"relative",lightColor:new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](14540253),lightIntensity:1,ambientColor:new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](14540253),ambientIntensity:.2,sampleLevel:0,rendererEncoding:__WEBPACK_IMPORTED_MODULE_1_three__["w" /* LinearEncoding */]}},gi.prototype._initCamera=function(){var t=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](0,0,0),e=this.width,i=this.height;this.perspectiveCamera=new __WEBPACK_IMPORTED_MODULE_1_three__["G" /* PerspectiveCamera */](this.parameters.cameraFov,e/i),this.perspectiveCamera.position.z=this.parameters.cameraZ,this.perspectiveCamera.lookAt(t),this.orthographicCamera=new __WEBPACK_IMPORTED_MODULE_1_three__["F" /* OrthographicCamera */](e/-2,e/2,i/2,i/-2),this.orthographicCamera.position.z=this.parameters.cameraZ,this.orthographicCamera.lookAt(t),this.stereoCamera=new __WEBPACK_IMPORTED_MODULE_1_three__["Q" /* StereoCamera */],this.stereoCamera.aspect=.5,this.stereoCamera.eyeSep=this.parameters.cameraEyeSep;var o=this.parameters.cameraType;if("orthographic"===o)this.camera=this.orthographicCamera;else{if("perspective"!==o&&"stereo"!==o)throw new Error("Unknown cameraType '"+o+"'");this.camera=this.perspectiveCamera}this.camera.updateProjectionMatrix()},gi.prototype._initStats=function(){this.stats=new Cr},gi.prototype._initScene=function(){this.scene||(this.scene=new __WEBPACK_IMPORTED_MODULE_1_three__["M" /* Scene */],this.scene.name="scene"),this.rotationGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.rotationGroup.name="rotationGroup",this.scene.add(this.rotationGroup),this.translationGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.translationGroup.name="translationGroup",this.rotationGroup.add(this.translationGroup),this.modelGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.modelGroup.name="modelGroup",this.translationGroup.add(this.modelGroup),this.pickingGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.pickingGroup.name="pickingGroup",this.translationGroup.add(this.pickingGroup),this.backgroundGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.backgroundGroup.name="backgroundGroup",this.translationGroup.add(this.backgroundGroup),this.helperGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.helperGroup.name="helperGroup",this.translationGroup.add(this.helperGroup),this.scene.fog=new __WEBPACK_IMPORTED_MODULE_1_three__["q" /* Fog */](this.parameters.fogColor.getHex()),this.spotLight=new __WEBPACK_IMPORTED_MODULE_1_three__["P" /* SpotLight */](this.parameters.lightColor.getHex(),this.parameters.lightIntensity),this.scene.add(this.spotLight),this.ambientLight=new __WEBPACK_IMPORTED_MODULE_1_three__["b" /* AmbientLight */](this.parameters.ambientColor.getHex(),this.parameters.ambientIntensity),this.scene.add(this.ambientLight)},gi.prototype._initRenderer=function(){var t=window.devicePixelRatio,e=this.width,r=this.height;try{this.renderer=new __WEBPACK_IMPORTED_MODULE_1_three__["_0" /* WebGLRenderer */]({preserveDrawingBuffer:!0,alpha:!0,antialias:!0})}catch(t){return this.wrapper.innerHTML='

Your browser/graphics card does not seem to support WebGL.

Find out how to get it here.

',!1}this.renderer.setPixelRatio(t),this.renderer.setSize(e,r),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.outputEncoding=this.parameters.rendererEncoding;var i=this.renderer.getContext();this.renderer.capabilities.isWebGL2?(ze(!0),Le(this.renderer.extensions.get("EXT_color_buffer_float")),this.supportsHalfFloat=!0):(ze(this.renderer.extensions.get("EXT_frag_depth")),this.renderer.extensions.get("OES_element_index_uint"),Le(this.renderer.extensions.get("OES_texture_float")&&this.renderer.extensions.get("WEBGL_color_buffer_float")||this.renderer.extensions.get("OES_texture_float")&&hi(i.FLOAT)),this.renderer.extensions.get("OES_texture_float"),this.supportsHalfFloat=this.renderer.extensions.get("OES_texture_half_float")&&hi(36193)),this.wrapper.appendChild(this.renderer.domElement);var o=e*t,n=r*t;He&&console.log(JSON.stringify({Browser:De,OES_texture_float:!!this.renderer.extensions.get("OES_texture_float"),OES_texture_half_float:!!this.renderer.extensions.get("OES_texture_half_float"),WEBGL_color_buffer_float:!!this.renderer.extensions.get("WEBGL_color_buffer_float"),"testTextureSupport Float":hi(i.FLOAT),"testTextureSupport HalfFloat":hi(36193),"this.supportsHalfFloat":this.supportsHalfFloat,SupportsReadPixelsFloat:$e},null,2)),this.pickingTarget=new __WEBPACK_IMPORTED_MODULE_1_three__["Z" /* WebGLRenderTarget */](o,n,{minFilter:__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],magFilter:__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],stencilBuffer:!1,format:__WEBPACK_IMPORTED_MODULE_1_three__["L" /* RGBAFormat */],type:$e?__WEBPACK_IMPORTED_MODULE_1_three__["p" /* FloatType */]:__WEBPACK_IMPORTED_MODULE_1_three__["W" /* UnsignedByteType */]}),this.pickingTarget.texture.generateMipmaps=!1,this.pickingTarget.texture.encoding=this.parameters.rendererEncoding,this.renderer.setRenderTarget(this.pickingTarget),this.renderer.clear(),this.renderer.setRenderTarget(null),this.sampleTarget=new __WEBPACK_IMPORTED_MODULE_1_three__["Z" /* WebGLRenderTarget */](o,n,{minFilter:__WEBPACK_IMPORTED_MODULE_1_three__["x" /* LinearFilter */],magFilter:__WEBPACK_IMPORTED_MODULE_1_three__["x" /* LinearFilter */],format:__WEBPACK_IMPORTED_MODULE_1_three__["L" /* RGBAFormat */]}),this.sampleTarget.texture.encoding=this.parameters.rendererEncoding,this.holdTarget=new __WEBPACK_IMPORTED_MODULE_1_three__["Z" /* WebGLRenderTarget */](o,n,{minFilter:__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],magFilter:__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],format:__WEBPACK_IMPORTED_MODULE_1_three__["L" /* RGBAFormat */],type:__WEBPACK_IMPORTED_MODULE_1_three__["W" /* UnsignedByteType */]}),this.holdTarget.texture.encoding=this.parameters.rendererEncoding,this.compositeUniforms={tForeground:new __WEBPACK_IMPORTED_MODULE_1_three__["T" /* Uniform */](this.sampleTarget.texture),scale:new __WEBPACK_IMPORTED_MODULE_1_three__["T" /* Uniform */](1)},this.compositeMaterial=new __WEBPACK_IMPORTED_MODULE_1_three__["O" /* ShaderMaterial */]({uniforms:this.compositeUniforms,vertexShader:Or("Quad.vert"),fragmentShader:Or("Quad.frag"),premultipliedAlpha:!0,transparent:!0,blending:__WEBPACK_IMPORTED_MODULE_1_three__["a" /* AdditiveBlending */],depthTest:!1,depthWrite:!1}),this.compositeCamera=new __WEBPACK_IMPORTED_MODULE_1_three__["F" /* OrthographicCamera */](-1,1,1,-1,0,1),this.compositeScene=new __WEBPACK_IMPORTED_MODULE_1_three__["M" /* Scene */],this.compositeScene.name="compositeScene",this.compositeScene.add(new __WEBPACK_IMPORTED_MODULE_1_three__["A" /* Mesh */](new __WEBPACK_IMPORTED_MODULE_1_three__["I" /* PlaneGeometry */](2,2),this.compositeMaterial))},gi.prototype._initHelper=function(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(24),r=new __WEBPACK_IMPORTED_MODULE_1_three__["g" /* BufferGeometry */];r.setIndex(new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](t,1)),r.setAttribute("position",new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](e,3));var i=new __WEBPACK_IMPORTED_MODULE_1_three__["O" /* ShaderMaterial */]({uniforms:{uColor:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */]("skyblue")}},vertexShader:Or("BasicLine.vert"),fragmentShader:Or("BasicLine.frag")});this.boundingBoxMesh=new __WEBPACK_IMPORTED_MODULE_1_three__["v" /* LineSegments */](r,i),this.helperGroup.add(this.boundingBoxMesh)},gi.prototype.updateHelper=function(){var t=this.boundingBoxMesh.geometry.attributes.position,e=t.array,r=this.boundingBox,i=r.min,o=r.max;e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=i.x,e[4]=o.y,e[5]=o.z,e[6]=i.x,e[7]=i.y,e[8]=o.z,e[9]=o.x,e[10]=i.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=i.z,e[15]=i.x,e[16]=o.y,e[17]=i.z,e[18]=i.x,e[19]=i.y,e[20]=i.z,e[21]=o.x,e[22]=i.y,e[23]=i.z,t.needsUpdate=!0,this.boundingBox.isEmpty()||this.boundingBoxMesh.geometry.computeBoundingSphere()},yi.cameraDistance.get=function(){return Math.abs(this.camera.position.z)},yi.cameraDistance.set=function(t){this.camera.position.z=-t},gi.prototype.add=function(t,e){var r=this;e?e.forEach((function(e){return r.addBuffer(t,e)})):this.addBuffer(t),t.group.name="meshGroup",t.wireframeGroup.name="wireframeGroup",t.parameters.background?(this.backgroundGroup.add(t.group),this.backgroundGroup.add(t.wireframeGroup)):(this.modelGroup.add(t.group),this.modelGroup.add(t.wireframeGroup)),t.pickable&&this.pickingGroup.add(t.pickingGroup),He&&this.updateHelper()},gi.prototype.addBuffer=function(t,e){function r(i){i instanceof __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */]?i.children.forEach(r):(i.userData.buffer=t,i.userData.instance=e,i.onBeforeRender=mi)}var i=t.getMesh();e&&i.applyMatrix4(e.matrix),r(i),t.group.add(i);var o=t.getWireframeMesh();if(e&&(o.matrix.copy(i.matrix),o.position.copy(i.position),o.quaternion.copy(i.quaternion),o.scale.copy(i.scale)),r(o),t.wireframeGroup.add(o),t.pickable){var n=t.getPickingMesh();e&&(n.matrix.copy(i.matrix),n.position.copy(i.position),n.quaternion.copy(i.quaternion),n.scale.copy(i.scale)),r(n),t.pickingGroup.add(n)}e?this._updateBoundingBox(t.geometry,t.matrix,e.matrix):this._updateBoundingBox(t.geometry,t.matrix)},gi.prototype.remove=function(t){this.translationGroup.children.forEach((function(e){e.remove(t.group),e.remove(t.wireframeGroup)})),t.pickable&&this.pickingGroup.remove(t.pickingGroup),this.updateBoundingBox(),He&&this.updateHelper()},gi.prototype._updateBoundingBox=function(t,e,r){var i=this.boundingBox;function o(t,e,r){null==t.boundingBox&&t.computeBoundingBox();var o=t.boundingBox.clone();e&&o.applyMatrix4(e),r&&o.applyMatrix4(r),o.min.equals(o.max)&&o.expandByScalar(5),i.union(o)}function n(t){var e,r;void 0!==t.geometry&&(t.userData.buffer&&(e=t.userData.buffer.matrix),t.userData.instance&&(r=t.userData.instance.matrix),o(t.geometry,e,r))}t?o(t,e,r):(i.makeEmpty(),this.modelGroup.traverse(n),this.backgroundGroup.traverse(n)),i.getSize(this.boundingBoxSize),this.boundingBoxLength=this.boundingBoxSize.length()},gi.prototype.updateBoundingBox=function(){this._updateBoundingBox(),He&&this.updateHelper()},gi.prototype.getPickingPixels=function(){var t=this.width,e=this.height,r=t*e*4,i=$e?new Float32Array(r):new Uint8Array(r);return this.render(!0),this.renderer.readRenderTargetPixels(this.pickingTarget,0,0,t,e,i),i},gi.prototype.getImage=function(t){var e=this;return new Promise((function(r){if(t){var i=e,o=i.width,n=i.height,a=o*n*4,s=e.getPickingPixels();if($e){for(var c=new Uint8Array(a),u=0;u500&&!this.isStill&&this.sampleLevel<3&&-1!==this.sampleLevel){var t=this.sampleLevel;this.sampleLevel=3,this.renderPending=!0,this.render(),this.isStill=!0,this.sampleLevel=t,He&&je.log("rendered still frame")}this.frameRequest=window.requestAnimationFrame(this.animate)},gi.prototype.pick=function(t,e){if("stereo"===this.parameters.cameraType)return{pid:0,instance:void 0,picker:void 0};t*=window.devicePixelRatio,e*=window.devicePixelRatio,t=Math.max(t-2,0),e=Math.max(e-2,0);var r,i,o=0,n=$e?li:pi;this.render(!0),this.renderer.readRenderTargetPixels(this.pickingTarget,t,e,5,5,n);for(var a=0;a22&&(this.stats.begin(),this.isStill=!1),this.renderPending=!0,window.requestAnimationFrame((function(){t.render(),t.stats.update()})))},gi.prototype.updateZoom=function(){var t=Ft(this.perspectiveCamera.fov),e=2*Math.tan(t/2)*this.cameraDistance;this.orthographicCamera.zoom=this.height/e},gi.prototype.absoluteToRelative=function(t){return 50*(1-t/this.bRadius)},gi.prototype.relativeToAbsolute=function(t){return this.bRadius*(1-t/50)},gi.prototype.__updateClipping=function(){var t=this.parameters;this.bRadius=Math.max(10,.5*this.boundingBoxLength),isFinite(this.bRadius)||(this.bRadius=50),this.camera.getWorldPosition(this.distVector),this.cDist=this.distVector.length(),this.cDist||(this.cameraDistance=Math.abs(t.cameraZ),this.cDist=Math.abs(t.cameraZ));var e=this.scene.fog;if(e.color.set(t.fogColor),"camera"===t.clipMode)this.camera.near=t.clipNear,this.camera.far=t.clipFar,e.near=t.fogNear,e.far=t.fogFar;else if("absolute"===t.clipScale)this.camera.near=this.cDist-t.clipNear,this.camera.far=this.cDist+t.clipFar,e.near=this.cDist-t.fogNear,e.far=this.cDist+t.fogFar;else{var r=(50-t.clipNear)/50,i=-(50-t.clipFar)/50;this.camera.near=this.cDist-this.bRadius*r,this.camera.far=this.cDist+this.bRadius*i;var o=(50-t.fogNear)/50,n=-(50-t.fogFar)/50;e.near=this.cDist-this.bRadius*o,e.far=this.cDist+this.bRadius*n}"camera"!==t.clipMode&&("PerspectiveCamera"===this.camera.type?(this.camera.near=Math.max(.1,t.clipDist,this.camera.near),this.camera.far=Math.max(1,this.camera.far),e.near=Math.max(.1,e.near),e.far=Math.max(1,e.far)):"OrthographicCamera"===this.camera.type&&t.clipDist>0&&(this.camera.near=Math.max(t.clipDist,this.camera.near)))},gi.prototype.__updateCamera=function(){var t=this.camera;t.updateMatrix(),t.updateMatrixWorld(!0),t.updateProjectionMatrix(),function(t,r,i,o,n){var a=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */];i.getSize(a);var s=a.height,c=i.getPixelRatio(),u="OrthographicCamera"===r.type;ii.set(a.width,a.height),oi.getInverse(r.projectionMatrix),ni.copy(r.projectionMatrix).transpose(),t.traverse((function(t){var e=t.material;if(e){var r=e.uniforms;if(r){if(e.clipNear){var i=(50-e.clipNear)/50,a=o-n*i;r.clipNear.value=a}r.canvasHeight&&(r.canvasHeight.value=s),r.resolution&&r.resolution.value.copy(ii),r.pixelRatio&&(r.pixelRatio.value=c),r.projectionMatrixInverse&&r.projectionMatrixInverse.value.copy(oi),r.projectionMatrixTranspose&&r.projectionMatrixTranspose.value.copy(ni),r.ortho&&(r.ortho.value=u)}}}))}(this.scene,t,this.renderer,this.cDist,this.bRadius),function(t,e){t.traverseVisible((function(t){if(t instanceof __WEBPACK_IMPORTED_MODULE_1_three__["J" /* Points */]&&t.userData.buffer.parameters.sortParticles){var r=t.geometry.attributes,i=r.position.count;if(0!==i){var o,n,a,c,u,h,l;ei.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),ri.multiplyMatrices(e.projectionMatrix,ei),t.userData.sortData?(o=t.userData.sortData,a=o.__zArray,n=o.__sortArray,c=o.__cmpFn):(a=new Float32Array(i),n=new Uint32Array(i),o={__zArray:a,__sortArray:n,__cmpFn:c=function(t,e){var r=a[t],i=a[e];return r>i?1:re?1:t=u&&e(t[n],o)>0;)t[n+1]=t[n],--n;t[n+1]=o}if(-1===c)break;h=s[c--],u=s[c--]}else{for(a=h,l(u+h>>1,n=u+1),e(t[u],t[h])>0&&l(u,h),e(t[n],t[h])>0&&l(n,h),e(t[u],t[n])>0&&l(u,n),o=t[n];;){do{n++}while(e(t[n],o)<0);do{a--}while(e(t[a],o)>0);if(a=a-u?(s[++c]=n,s[++c]=h,h=a-1):(s[++c]=u,s[++c]=a-1,u=n)}}(n,c),r){var f=r[d],m=f.array,g=f.itemSize;o[d]||(o[d]=new Float32Array(g*i)),l=o[d],o[d]=m;for(var y=0;y0&&"stereo"!==this.parameters.cameraType?this.__renderSuperSample(e,r):this.__renderModelGroup(e,r)},gi.prototype.render=function(t,e){if(void 0===t&&(t=!1),this.rendering)je.warn("'tried to call 'render' from within 'render'");else{this.rendering=!0;try{this.__updateClipping(),this.__updateCamera(),this.__updateLights(),this.updateInfo(!0),"stereo"===this.parameters.cameraType?this.__renderStereo(t,e):this.__render(t,this.camera,e),this.lastRenderedPicking=t}finally{this.rendering=!1,this.renderPending=!1}this.signals.rendered.dispatch()}},gi.prototype.clear=function(){je.log("scene cleared"),this.scene.remove(this.rotationGroup),this._initScene(),this.renderer.clear()},gi.prototype.dispose=function(){this.renderer.dispose(),window.cancelAnimationFrame(this.frameRequest)},Object.defineProperties(gi.prototype,yi);var vi=1,bi=2,xi=3;function _i(t){var e=t.touches[0].pageX-t.touches[1].pageX,r=t.touches[0].pageY-t.touches[1].pageY;return Math.sqrt(e*e+r*r)}var wi=function(t,r){void 0===r&&(r={}),this.domElement=t,this.signals={moved:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],scrolled:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],dragged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],dropped:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],clicked:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],hovered:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],doubleClicked:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]},this.position=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */],this.prevPosition=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */],this.down=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */],this.canvasPosition=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */],this.prevClickCP=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */],this.moving=!1,this.hovering=!0,this.scrolled=!1,this.lastMoved=1/0,this.which=0,this.buttons=0,this.pressed=!1,this.altKey=!1,this.ctrlKey=!1,this.metaKey=!1,this.shiftKey=!1,this.domElement.style.touchAction="none",this.hoverTimeout=ht(r.hoverTimeout,50),this.handleScroll=ht(r.handleScroll,!0),this.doubleClickSpeed=ht(r.doubleClickSpeed,500),this._listen=this._listen.bind(this),this._onMousewheel=this._onMousewheel.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMousedown=this._onMousedown.bind(this),this._onMouseup=this._onMouseup.bind(this),this._onContextmenu=this._onContextmenu.bind(this),this._onTouchstart=this._onTouchstart.bind(this),this._onTouchend=this._onTouchend.bind(this),this._onTouchmove=this._onTouchmove.bind(this),this._listen();var i={passive:!1};document.addEventListener("mousewheel",this._onMousewheel,i),document.addEventListener("wheel",this._onMousewheel,i),document.addEventListener("MozMousePixelScroll",this._onMousewheel,i),document.addEventListener("mousemove",this._onMousemove,i),document.addEventListener("mousedown",this._onMousedown,i),document.addEventListener("mouseup",this._onMouseup,i),document.addEventListener("contextmenu",this._onContextmenu,i),document.addEventListener("touchstart",this._onTouchstart,i),document.addEventListener("touchend",this._onTouchend,i),document.addEventListener("touchmove",this._onTouchmove,i)},Ai={key:{configurable:!0}};Ai.key.get=function(){var t=0;return this.altKey&&(t+=1),this.ctrlKey&&(t+=2),this.metaKey&&(t+=4),this.shiftKey&&(t+=8),t},wi.prototype.setParameters=function(t){void 0===t&&(t={}),this.hoverTimeout=ht(t.hoverTimeout,this.hoverTimeout)},wi.prototype._listen=function(){var t=window.performance.now(),e=this.canvasPosition;this.doubleClickPending&&t-this.lastClicked>this.doubleClickSpeed&&(this.doubleClickPending=!1),t-this.lastMoved>this.hoverTimeout&&(this.moving=!1),(this.scrolled||!this.moving&&!this.hovering)&&(this.scrolled=!1,-1!==this.hoverTimeout&&this.overElement&&(this.hovering=!0,this.signals.hovered.dispatch(e.x,e.y))),this.frameRequest=window.requestAnimationFrame(this._listen)},wi.prototype._onMousewheel=function(t){var e=this;if(t.target===this.domElement&&this.handleScroll){t.preventDefault(),this._setKeys(t);var r=0;"deltaY"in t&&"deltaMode"in t&&void 0!==t.deltaY&&void 0!==t.deltaMode?r=t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?.025*-t.deltaY:t.deltaMode===WheelEvent.DOM_DELTA_LINE?-t.deltaY*(2.5/3):2.5*-t.deltaY:"deltaY"in t&&!("detail"in t)?r=.025*-t.deltaY:void 0!==t.wheelDelta?r=.025*-t.wheelDelta:void 0!==t.wheelDeltaY?r=.025*-t.wheelDeltaY:void 0!==t.detail&&(r=-t.detail/3),this.signals.scrolled.dispatch(r),setTimeout((function(){e.scrolled=!0}),this.hoverTimeout)}},wi.prototype._onMousemove=function(t){t.target===this.domElement?(t.preventDefault(),this.overElement=!0):this.overElement=!1,this._setKeys(t),this.moving=!0,this.hovering=!1,this.lastMoved=window.performance.now(),this.prevPosition.copy(this.position),this.position.set(t.clientX,t.clientY),this._setCanvasPosition(t);var e=this.prevPosition.x-this.position.x,r=this.prevPosition.y-this.position.y;this.signals.moved.dispatch(e,r),this.pressed&&this.signals.dragged.dispatch(e,r)},wi.prototype._onMousedown=function(t){t.target===this.domElement&&(t.preventDefault(),this._setKeys(t),this.moving=!1,this.hovering=!1,this.down.set(t.clientX,t.clientY),this.position.set(t.clientX,t.clientY),this.which=t.which,this.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<2&&this.handleScroll&&this.position.distanceTo(this.prevPosition)<2)this.which=0,this.buttons=0,this.signals.scrolled.dispatch(o/2);else{this.which=3,this.buttons=2;var n=this.prevPosition.x-this.position.x,a=this.prevPosition.y-this.position.y;this.signals.moved.dispatch(n,a),this.pressed&&this.signals.dragged.dispatch(n,a)}}},wi.prototype._distance=function(){return this.position.distanceTo(this.down)},wi.prototype._setCanvasPosition=function(t){var e,r,i=this.domElement.getBoundingClientRect();"clientX"in t&&"clientY"in t?(e=t.clientX-i.left,r=t.clientY-i.top):(e=t.offsetX,r=t.offsetY),this.canvasPosition.set(e,i.height-r)},wi.prototype._setKeys=function(t){this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.metaKey=t.metaKey,this.shiftKey=t.shiftKey},wi.prototype.dispose=function(){document.removeEventListener("mousewheel",this._onMousewheel),document.removeEventListener("wheel",this._onMousewheel),document.removeEventListener("MozMousePixelScroll",this._onMousewheel),document.removeEventListener("mousemove",this._onMousemove),document.removeEventListener("mousedown",this._onMousedown),document.removeEventListener("mouseup",this._onMouseup),document.removeEventListener("contextmenu",this._onContextmenu),document.removeEventListener("touchstart",this._onTouchstart),document.removeEventListener("touchend",this._onTouchend),document.removeEventListener("touchmove",this._onTouchmove),window.cancelAnimationFrame(this.frameRequest)},Object.defineProperties(wi.prototype,Ai);var Si=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Ci=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Pi=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Ii=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Oi=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],ki=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Mi=new __WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */],Ti=new __WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */],Bi=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Di=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Ei=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Fi=function(t,e){void 0===e&&(e={}),this.stage=t,this.rotateSpeed=ht(e.rotateSpeed,2),this.zoomSpeed=ht(e.zoomSpeed,1.2),this.panSpeed=ht(e.panSpeed,1),this.viewer=t.viewer,this.mouse=t.mouseObserver,this.controls=t.viewerControls},Ri={component:{configurable:!0},atom:{configurable:!0}};Ri.component.get=function(){return this.stage.transformComponent},Ri.atom.get=function(){return this.stage.transformAtom},Fi.prototype._setPanVector=function(t,e,r){void 0===r&&(r=0);var i=this.controls.getCanvasScaleFactor(r);Di.set(t,e,0),Di.multiplyScalar(this.panSpeed*i)},Fi.prototype._getRotateXY=function(t,e){return[this.rotateSpeed*-t*.01,this.rotateSpeed*e*.01]},Fi.prototype._getCameraRotation=function(t){return t.extractRotation(this.viewer.camera.matrixWorld),t.multiply(Ci.makeRotationY(Math.PI)),t},Fi.prototype._transformPanVector=function(){this.component&&(Bi.extractRotation(this.component.transform),Bi.premultiply(this.viewer.rotationGroup.matrix),Bi.getInverse(Bi),Bi.multiply(this._getCameraRotation(Ii)),Di.applyMatrix4(Bi))},Fi.prototype.zoom=function(t){this.controls.zoom(this.zoomSpeed*t*.02)},Fi.prototype.pan=function(t,e){this._setPanVector(t,e),Bi.getInverse(this.viewer.rotationGroup.matrix),Bi.multiply(this._getCameraRotation(Ii)),Di.applyMatrix4(Bi),this.controls.translate(Di)},Fi.prototype.panComponent=function(t,e){this.component&&(this._setPanVector(t,e),this._transformPanVector(),this.component.position.add(Di),this.component.updateMatrix())},Fi.prototype.panAtom=function(t,e){this.atom&&this.component&&(this.atom.positionToVector3(Ei),Ei.add(this.viewer.translationGroup.position),Ei.applyMatrix4(this.viewer.rotationGroup.matrix),this._setPanVector(t,e,Ei.z),this._transformPanVector(),this.atom.positionAdd(Di),this.component.updateRepresentations({position:!0}))},Fi.prototype.rotate=function(t,e){var r=this._getRotateXY(t,e),i=r[0],o=r[1];this._getCameraRotation(Ii),ki.set(1,0,0),ki.applyMatrix4(Ii),Mi.setFromAxisAngle(ki,o),ki.set(0,1,0),ki.applyMatrix4(Ii),Ti.setFromAxisAngle(ki,i),Mi.multiply(Ti),Ii.makeRotationFromQuaternion(Mi),this.controls.applyMatrix(Ii)},Fi.prototype.zRotate=function(t,e){var r=this.rotateSpeed*((-t+e)/-2)*.01;Pi.makeRotationZ(r),this.controls.applyMatrix(Pi)},Fi.prototype.rotateComponent=function(t,e){if(this.component){var r=this._getRotateXY(t,e),i=r[0],o=r[1];this._getCameraRotation(Oi),Ii.extractRotation(this.component.transform),Ii.premultiply(this.viewer.rotationGroup.matrix),Ii.getInverse(Ii),Ii.premultiply(Oi),ki.set(1,0,0),ki.applyMatrix4(Ii),Si.makeRotationAxis(ki,o),ki.set(0,1,0),ki.applyMatrix4(Ii),Ci.makeRotationAxis(ki,i),Si.multiply(Ci),Mi.setFromRotationMatrix(Si),this.component.quaternion.premultiply(Mi),this.component.quaternion.normalize(),this.component.updateMatrix()}},Object.defineProperties(Fi.prototype,Ri);var $i=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */];var Li=function(t,e){this.stage=e,this.pid=t.pid,this.picker=t.picker,this.instance=t.instance,this.stage=e,this.controls=e.viewerControls,this.mouse=e.mouseObserver},Ni={type:{configurable:!0},altKey:{configurable:!0},ctrlKey:{configurable:!0},metaKey:{configurable:!0},shiftKey:{configurable:!0},canvasPosition:{configurable:!0},component:{configurable:!0},object:{configurable:!0},position:{configurable:!0},closestBondAtom:{configurable:!0},closeAtom:{configurable:!0},arrow:{configurable:!0},atom:{configurable:!0},axes:{configurable:!0},bond:{configurable:!0},box:{configurable:!0},cone:{configurable:!0},clash:{configurable:!0},contact:{configurable:!0},cylinder:{configurable:!0},distance:{configurable:!0},ellipsoid:{configurable:!0},octahedron:{configurable:!0},point:{configurable:!0},mesh:{configurable:!0},slice:{configurable:!0},sphere:{configurable:!0},tetrahedron:{configurable:!0},torus:{configurable:!0},surface:{configurable:!0},unitcell:{configurable:!0},unknown:{configurable:!0},volume:{configurable:!0},wideline:{configurable:!0}};Ni.type.get=function(){return this.picker.type},Ni.altKey.get=function(){return this.mouse.altKey},Ni.ctrlKey.get=function(){return this.mouse.ctrlKey},Ni.metaKey.get=function(){return this.mouse.metaKey},Ni.shiftKey.get=function(){return this.mouse.shiftKey},Ni.canvasPosition.get=function(){return this.mouse.canvasPosition},Ni.component.get=function(){return this.stage.getComponentsByObject(this.picker.data).list[0]},Ni.object.get=function(){return this.picker.getObject(this.pid)},Ni.position.get=function(){return this.picker.getPosition(this.pid,this.instance,this.component)},Ni.closestBondAtom.get=function(){if("bond"===this.type&&this.bond){var t=this.bond,e=this.controls,r=this.canvasPosition,i=t.atom1.positionToVector3(),o=t.atom2.positionToVector3();i.applyMatrix4(this.component.matrix),o.applyMatrix4(this.component.matrix);var n,a,s,c=e.getPositionOnCanvas(i),u=e.getPositionOnCanvas(o);return a=c,s=u,(n=r).distanceTo(a)=i.length))return new Li(r,this.stage);console.error("pid >= picker.array.length")}};var ji=new __WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */],Vi=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Gi=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Ui=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Hi=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Wi=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],qi=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Xi=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Yi=function(t){this.stage=t,this.signals={changed:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]},this.viewer=t.viewer},Ki={position:{configurable:!0},rotation:{configurable:!0}};Ki.position.get=function(){return this.viewer.translationGroup.position},Ki.rotation.get=function(){return this.viewer.rotationGroup.quaternion},Yi.prototype.changed=function(){this.viewer.requestRender(),this.signals.changed.dispatch()},Yi.prototype.getPositionOnCanvas=function(t,r){var i=It(r,__WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */]),o=this.viewer;return Ui.copy(t).add(o.translationGroup.position).applyMatrix4(o.rotationGroup.matrix).project(o.camera),i.set((Ui.x+1)*o.width/2,(Ui.y+1)*o.height/2)},Yi.prototype.getCanvasScaleFactor=function(t){void 0===t&&(t=0);var e=this.viewer.camera;if(e instanceof __WEBPACK_IMPORTED_MODULE_1_three__["F" /* OrthographicCamera */])return 1/e.zoom;t=Math.abs(t),t+=this.getCameraDistance();var r=Ft(e.fov);return 2*t*Math.tan(r/2)/this.viewer.height},Yi.prototype.getOrientation=function(t){var e=kt(t);e.copy(this.viewer.rotationGroup.matrix);var r=this.getCameraDistance();return e.scale(Hi.set(r,r,r)),e.setPosition(this.viewer.translationGroup.position),e},Yi.prototype.orient=function(t){kt(t).decompose(Vi,ji,Gi);var e=this.viewer;e.rotationGroup.setRotationFromQuaternion(ji),e.translationGroup.position.copy(Vi),e.cameraDistance=Gi.z,e.updateZoom(),this.changed()},Yi.prototype.translate=function(t){this.viewer.translationGroup.position.add(Ot(t)),this.changed()},Yi.prototype.center=function(t){this.viewer.translationGroup.position.copy(Ot(t)).negate(),this.changed()},Yi.prototype.zoom=function(t){this.distance(this.getCameraDistance()*(1-t))},Yi.prototype.getCameraDistance=function(){return this.viewer.cameraDistance},Yi.prototype.distance=function(t){this.viewer.cameraDistance=Math.max(Math.abs(t),.2),this.viewer.updateZoom(),this.changed()},Yi.prototype.spin=function(t,e){Wi.getInverse(this.viewer.rotationGroup.matrix),qi.copy(Ot(t)).applyMatrix4(Wi),this.viewer.rotationGroup.rotateOnAxis(qi,e),this.changed()},Yi.prototype.rotate=function(t){this.viewer.rotationGroup.setRotationFromQuaternion(Mt(t)),this.changed()},Yi.prototype.align=function(t){Xi.getInverse(kt(t)),this.viewer.rotationGroup.setRotationFromMatrix(Xi),this.changed()},Yi.prototype.applyMatrix=function(t){this.viewer.rotationGroup.applyMatrix4(kt(t)),this.changed()},Object.defineProperties(Yi.prototype,Ki);var Zi=function(t,e){for(var r,i=[],o=arguments.length-2;o-- >0;)i[o]=arguments[o+2];this.pausedTime=-1,this.elapsedDuration=0,this.pausedDuration=0,this.ignoreGlobalToggle=!1,this._paused=!1,this._resolveList=[],this.duration=ht(t,1e3),this.controls=e,this.startTime=window.performance.now(),(r=this)._init.apply(r,i)},Qi={done:{configurable:!0},paused:{configurable:!0}};Qi.done.get=function(){return 1===this.alpha},Qi.paused.get=function(){return this._paused},Zi.prototype.tick=function(t){if(!this._paused)return this.elapsedDuration=t.currentTime-this.startTime-this.pausedDuration,0===this.duration?this.alpha=1:this.alpha=Vt(0,1,this.elapsedDuration/this.duration),this._tick(t),this.done&&this._resolveList.forEach((function(t){return t()})),this.done},Zi.prototype.pause=function(t){t&&(this._hold=!0),-1===this.pausedTime&&(this.pausedTime=window.performance.now()),this._paused=!0},Zi.prototype.resume=function(t){!t&&this._hold||(this.pausedDuration+=window.performance.now()-this.pausedTime,this._paused=!1,this._hold=!1,this.pausedTime=-1)},Zi.prototype.toggle=function(){this._paused?this.resume():this.pause()},Zi.prototype.then=function(t){var e=this;return(this.done?Promise.resolve():new Promise((function(t){return e._resolveList.push(t)}))).then(t)},Object.defineProperties(Zi.prototype,Qi);var Ji=function(t){function e(e,r){for(var i=[],o=arguments.length-2;o-- >0;)i[o]=arguments[o+2];t.apply(this,[ht(e,1/0),r].concat(i))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){Array.isArray(t)?this.axis=(new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]).fromArray(t):this.axis=ht(t,new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](0,1,0)),this.angle=ht(e,.01)},e.prototype._tick=function(t){this.axis&&this.angle&&this.controls.spin(this.axis,this.angle*t.lastDuration/16)},e}(Zi),to=function(t){function e(e,r){for(var i=[],o=arguments.length-2;o-- >0;)i[o]=arguments[o+2];t.apply(this,[ht(e,1/0),r].concat(i)),this.angleSum=0,this.direction=1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e,i){Array.isArray(t)?this.axis=(new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]).fromArray(t):this.axis=ht(t,new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](0,1,0)),this.angleStep=ht(e,.01),this.angleEnd=ht(i,.2)},e.prototype._tick=function(t){if(this.axis&&this.angleStep&&this.angleEnd){var e=Vt(0,1,Math.abs(this.angleSum)/this.angleEnd),r=this.angleStep*this.direction*(1.1-e);this.controls.spin(this.axis,r*t.lastDuration/16),this.angleSum+=this.angleStep,this.angleSum>=this.angleEnd&&(this.direction*=-1,this.angleSum=-this.angleEnd)}},e}(Zi),eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){this.moveFrom=Ot(ht(t,new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */])),this.moveTo=Ot(ht(e,new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]))},e.prototype._tick=function(){this.controls.position.lerpVectors(this.moveFrom,this.moveTo,this.alpha).negate(),this.controls.changed()},e}(Zi),ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){this.zoomFrom=t,this.zoomTo=e},e.prototype._tick=function(){this.controls.distance(zt(this.zoomFrom,this.zoomTo,this.alpha))},e}(Zi),io=function(t){function e(){t.apply(this,arguments),this._currentRotation=new __WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){this.rotateFrom=Mt(t),this.rotateTo=Mt(e),this._currentRotation=new __WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */]},e.prototype._tick=function(){this._currentRotation.copy(this.rotateFrom).slerp(this.rotateTo,this.alpha),this.controls.rotate(this._currentRotation)},e}(Zi),oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e,r){this.valueFrom=t,this.valueTo=e,this.callback=r},e.prototype._tick=function(){this.callback(zt(this.valueFrom,this.valueTo,this.alpha))},e}(Zi),no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t){this.callback=t},e.prototype._tick=function(){1===this.alpha&&this.callback()},e}(Zi),ao=function(t){void 0===t&&(t=[]),this._resolveList=[],this._list=t},so={done:{configurable:!0}};so.done.get=function(){return this._list.every((function(t){return t.done}))},ao.prototype.then=function(t){var e,r=this;return e=this.done?Promise.resolve():new Promise((function(t){r._resolveList.push(t),r._list.forEach((function(t){t.then((function(){r._resolveList.forEach((function(t){t()})),r._resolveList.length=0}))}))})),e.then(t)},Object.defineProperties(ao.prototype,so);var co=function(t){this.stage=t,this.animationList=[],this.finishedList=[],this.viewer=t.viewer,this.controls=t.viewerControls},uo={paused:{configurable:!0}};uo.paused.get=function(){return this.animationList.every((function(t){return t.paused}))},co.prototype.add=function(t){return 0===t.duration?t.tick(this.viewer.stats):this.animationList.push(t),t},co.prototype.remove=function(t){var e=this.animationList,r=e.indexOf(t);r>-1&&e.splice(r,1)},co.prototype.run=function(t){for(var e=this.finishedList,r=this.animationList,i=r.length,o=0;o0?(this.tasks.change(1-this.queue.length()),this.queue.kill()):this.tasks.increment(),this.queue.push(t||!1)}else this.lazyProps.build=!0},lo.prototype.make=function(t,e){var r=this;He&&je.time("Representation.make "+this.type);var i=function(){t?(r.update(t),r.viewer.requestRender(),r.tasks.decrement(),e&&e()):(r.clear(),r.create(),r.manualAttach||r.disposed||(He&&je.time("Representation.attach "+r.type),r.attach((function(){He&&je.timeEnd("Representation.attach "+r.type),r.tasks.decrement(),e&&e()})))),He&&je.timeEnd("Representation.make "+r.type)};this.toBePrepared?this.prepare(i):i()},lo.prototype.attach=function(t){this.setVisibility(this.visible),t()},lo.prototype.setVisibility=function(t,e){if(this.visible=t,this.visible&&this.opacity){var r=this.lazyProps,i=r.bufferParams,o=r.what;if(r.build)return r.build=!1,this.build(),this;(Object.keys(i).length||Object.keys(o).length)&&(r.bufferParams={},r.what={},this.updateParameters(i,o))}return this.bufferList.forEach((function(e){e.setVisibility(t)})),e||this.viewer.requestRender(),this},lo.prototype.setParameters=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r=!1);var i=t||{},o=this.parameters,n={};for(var a in this.opacity||void 0===i.opacity||(this.lazyProps.build?(this.lazyProps.build=!1,r=!0):(Object.assign(n,this.lazyProps.bufferParams),Object.assign(e,this.lazyProps.what),this.lazyProps.bufferParams={},this.lazyProps.what={})),this.setColor(i.color,i),i)if(void 0!==i[a]&&void 0!==o[a]&&(o[a].int&&(i[a]=parseInt(i[a])),o[a].float&&(i[a]=parseFloat(i[a])),i[a]!==this[a]||i[a].equals&&!i[a].equals(this[a]))){if(this[a]&&this[a].copy&&i[a].copy?this[a].copy(i[a]):this[a]&&this[a].set?this[a].set(i[a]):this[a]=i[a],o[a].buffer)if(!0===o[a].buffer)n[a]=i[a];else n[o[a].buffer]=i[a];o[a].update&&(e[o[a].update]=!0),!o[a].rebuild||"impostor"===o[a].rebuild&&Ne&&!this.disableImpostor||(r=!0)}return r?this.build():this.updateParameters(n,e),this},lo.prototype.updateParameters=function(t,e){if(void 0===t&&(t={}),this.lazy&&(!this.visible||!this.opacity)&&!1===t.hasOwnProperty("opacity"))return Object.assign(this.lazyProps.bufferParams,t),void Object.assign(this.lazyProps.what,e);this.bufferList.forEach((function(e){e.setParameters(t)})),Object.keys(e).length&&this.update(e),this.viewer.requestRender()},lo.prototype.getParameters=function(){var t=this,e={lazy:this.lazy,visible:this.visible,quality:this.quality};return Object.keys(this.parameters).forEach((function(r){null!==t.parameters[r]&&(e[r]=t[r])})),e},lo.prototype.clear=function(){var t=this;this.bufferList.forEach((function(e){t.viewer.remove(e),e.dispose()})),this.bufferList.length=0,this.viewer.requestRender()},lo.prototype.dispose=function(){this.disposed=!0,this.queue.kill(),this.tasks.dispose(),this.clear()};var po=function(t){var e=this;this.pending=0,this.postCount=0,this.onmessageDict={},this.onerrorDict={},this.name=t,this.blobUrl=window.URL.createObjectURL(Ke.get(t)),this.worker=new Worker(this.blobUrl),Ke.activeWorkerCount+=1,this.worker.onmessage=function(r){e.pending-=1;var i=r.data.__postId;He&&je.timeEnd("Worker.postMessage "+t+" #"+i);var o=e.onmessageDict[i];o&&o.call(e.worker,r),delete e.onmessageDict[i],delete e.onerrorDict[i]},this.worker.onerror=function(r){if(e.pending-=1,r.data){var i=r.data.__postId,o=e.onerrorDict[i];o?o.call(e.worker,r):je.error("Worker.onerror",i,t,r),delete e.onmessageDict[i],delete e.onerrorDict[i]}else je.error("Worker.onerror",t,r)}};po.prototype.post=function(t,e,r,i){void 0===t&&(t={}),this.onmessageDict[this.postCount]=r,this.onerrorDict[this.postCount]=i,t.__name=this.name,t.__postId=this.postCount,t.__debug=He,He&&je.time("Worker.postMessage "+this.name+" #"+this.postCount);try{this.worker.postMessage(t,e)}catch(e){je.error("worker.post:",e),this.worker.postMessage(t)}return this.pending+=1,this.postCount+=1,this},po.prototype.terminate=function(){this.worker?(this.worker.terminate(),window.URL.revokeObjectURL(this.blobUrl),Ke.activeWorkerCount-=1):je.log("no worker to terminate")};var fo=function(t,e){void 0===e&&(e=2),this.pool=[],this.count=0,this.maxCount=Math.min(8,e),this.name=t};function mo(t){for(var e=t.length,i=e/3,o=0,n=0,a=0,s=0;so&&(o=u),h>n&&(n=h),l>a&&(a=l)}return[_o([e,r,i]),_o([o,n,a])]}function vo(t,e){for(var r=0,i=e.length;r0){var s=1/Math.sqrt(a);t[e]=i*s,t[e+1]=o*s,t[e+2]=n*s}}}function _o(t){return new Float32Array(t||3)}function wo(t,e,r){var i=e[0],o=e[1],n=e[2],a=r[0],s=r[1],c=r[2];t[0]=o*c-n*s,t[1]=n*a-i*c,t[2]=i*s-o*a}function Ao(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function So(t,e,r){t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2]}function Co(t,e,r){t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2]}function Po(t,e,r){void 0===r&&(r=0),t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2]}function Io(t,e,r){void 0===r&&(r=0),e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2]}function Oo(t){return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}function ko(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function Mo(t,e,r){To(t,e,1/r)}function To(t,e,r){t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r}function Bo(t,e){var r=Oo(e);0==r?(t[0]=e[0],t[1]=e[1],t[2]=e[2]):To(t,e,1/Math.sqrt(r))}function Do(t,e,r){t[0]=e[0]-r,t[1]=e[1]-r,t[2]=e[2]-r}function Eo(t,e,r){t[0]=e[0]+r,t[1]=e[1]+r,t[2]=e[2]+r}function Fo(t,e){t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2])}function Ro(t,e){t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2])}function $o(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2]}function Lo(t,e){void 0===e&&(e=9);for(var i=Math.floor(e/2),o=t.position1.length/3,n=3*(i*o),a=1/e,s=zr(t.position1,t.position2),c=new Float32Array(n),u=new Float32Array(n),h=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],l=0;l0){var O=3*f;n[O]=t.position2[3*l-3],n[O+1]=t.position2[3*l-2],n[O+1]=t.position2[3*l-1]}var k=new Float32Array(o),M=new Float32Array(n),T=Nr(k,M),B=new Float32Array(a),D={position:T,position1:k,position2:M,color:B,color2:B};return s&&(D.radius=new Float32Array(s)),c&&t.picking&&(t.picking.array=new Float32Array(c),D.picking=t.picking),u&&(D.primitiveId=new Float32Array(u)),D}fo.prototype.post=function(t,e,r,i){void 0===t&&(t={});var o=this.getNextWorker();return o?o.post(t,e,r,i):console.error("unable to get worker from pool"),this},fo.prototype.terminate=function(){this.pool.forEach((function(t){t.terminate()}))},fo.prototype.getNextWorker=function(){for(var t,e=1/0,r=0;r=this.count){t=new po(this.name),this.pool.push(t),this.count+=1;break}var i=this.pool[r];if(0===i.pending){t=i;break}i.pending>this.exp),this.boundY=1+(r.max.y-this.minY>>this.exp),this.boundZ=1+(r.max.z-this.minZ>>this.exp);for(var i=this.boundX*this.boundY*this.boundZ,o=void 0!==t.count?t.count:t.x.length,n=t.x,a=t.y,s=t.z,u=0,h=new Uint32Array(i),l=new Int32Array(o),p=0;p>this.exp,f=a[p]-this.minY>>this.exp,m=s[p]-this.minZ>>this.exp,g=(d*this.boundY+f)*this.boundZ+m;1===(h[g]+=1)&&(u+=1),l[p]=g}for(var y=new Uint16Array(u),v=0,b=0;v0&&(h[v]=b+1,y[b]=x,b+=1)}for(var _=new Uint32Array(u),w=1;w0){var I=P-1;S[_[I]+A[I]]=C,A[I]+=1}}this.grid=h,this.bucketCount=y,this.bucketOffset=_,this.bucketArray=S,this.xArray=n,this.yArray=a,this.zArray=s};rn.prototype.within=function(t,e,r,i){var o=[];return this.eachWithin(t,e,r,i,(function(t){return o.push(t)})),o},rn.prototype.eachWithin=function(t,e,r,i,o){for(var n=i*i,a=Math.max(0,t-i-this.minX>>this.exp),s=Math.max(0,e-i-this.minY>>this.exp),c=Math.max(0,r-i-this.minZ>>this.exp),u=Math.min(this.boundX,1+(t+i-this.minX>>this.exp)),h=Math.min(this.boundY,1+(e+i-this.minY>>this.exp)),l=Math.min(this.boundZ,1+(r+i-this.minZ>>this.exp)),p=a;p0)for(var y=g-1,v=this.bucketOffset[y],b=v+this.bucketCount[y],x=v;xn?a.set(this[i].subarray(0,n)):a.set(this[i]),this[i]=a}},on.prototype.growIfFull=function(){if(this.count>=this.length){var t=Math.round(1.5*this.length);this.resize(Math.max(256,t))}},on.prototype.copyFrom=function(t,e,r,i){for(var o=0,n=this._fields.length;o0;)c-=1;s<=c&&(s===a?a=c:c===a&&(a=s),(u=s)!==(h=c)&&(r.copyFrom(e,0,u,1),e.copyWithin(u,h,1),e.copyFrom(r,h,0,1)),s+=1,c-=1)}while(s<=c);Object(__WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */])(o,c),Object(__WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */])(s,n)}var u,h}(0,this.count-1),je.timeEnd("Store.sort")},on.prototype.clear=function(){this.count=0},on.prototype.dispose=function(){for(var t=0,e=this._fields.length;t>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24}var cn=function(t,e){this.length=t,this._words=new Uint32Array(t+32>>>5),!0===e&&this.setAll()};function un(t){for(var e=t.edgeCount,r=t.nodeCount,i=t.nodeArray1,o=t.nodeArray2,n=new Uint8Array(r),a=new Int32Array(r),s=0;s0){var i=t.types,o=t.groups,n=t.centers,a=t.atomSets;i.push(e.type),o.push(e.group),n.x.push(e.x/r),n.y.push(e.y/r),n.z.push(e.z/r),a.push(e.atomSet)}}cn.prototype.get=function(t){return 0!=(this._words[t>>>5]&1<>>5]|=1<>>5]&=~(1<>>5]^=1<>>5,a=e>>>5,s=n+1;s>>5]|=1<>>5]|=1<>>5]|=1<>>5]&=~(1<>>5]&=~(1<>>5]&=~(1<>>5]|=1<>>5]&=~(1<>>r,this},cn.prototype._isRangeValue=function(t,e,r){if(!(e>>5,a=e>>>5,s=n+1;s>>5]&1<>>5]&1<>>5]&1<>>5]&1<>>5]&1<1||1!==e.number&&(i.index=e.index,n[a++].subVectors(e,t))})),1===a&&i.eachBondedAtom((function(e){a>1||1!==e.number&&e.index!==t.index&&n[a++].subVectors(e,t)})),2===a){var s=n[0].cross(n[1]);return Math.abs(Math.PI/2-s.angleTo(o))}}function Hn(t,e){var r=t.structure,i=r.atomCount,o=new Int8Array(i),n=new Int8Array(i),a=new Int8Array(i),s=new Int8Array(i);return r.eachAtom((function(t){var r=t.index,i=function(t,e){var r=t.bondToElementCount(1),i=t.formalCharge||0,o="always"===e.assignCharge||"auto"===e.assignCharge&&0===i,n="always"===e.assignH||"auto"===e.assignH&&0===r,a=t.bondCount,s=function(t){var e=0;return t.eachBond((function(t){return e+=t.bondOrder})),e}(t),c=function(t){var e=t.structure.getBondProxy(),r=t.number,i=8===r||7===r;if(i&&4===t.bondCount)return!1;var o=!1;return t.eachBond((function(r){if(r.bondOrder>1)o=!0;else if(i){var n=r.getOtherAtom(t);n.eachBond((function(t){if(t.bondOrder>1){var e=n.number;if((15===e||16===e)&&8===t.getOtherAtom(n).number)return;o=!0}}),e)}})),o}(t),u=s-a>0,h=0,l=8;switch(t.number){case 1:o&&(0===a?(i=1,l=0):1===a&&(i=0,l=1));break;case 6:o&&(i=0),n&&(h=Math.max(0,4-s-Math.abs(i))),l=jn(a+h+Math.max(0,-i));break;case 7:if(o)if(n)if(c&&s<4)i=a-r==1&&s-r==2?1:0;else{var p=!1;t.eachBondedAtom((function(t){(16===t.number||t.isMetal())&&(p=!0)})),i=p?0:1}else i=s-3;n&&(h=Math.max(0,3-s+i)),l=jn(c&&!u?a+h-i:a+h+1-i);break;case 8:o&&(n||(i=s-2),1===s&&t.eachBondedAtom((function(e){e.eachBond((function(r){var o=r.getOtherAtom(e);o.index!==t.index&&8===o.number&&2===r.bondOrder&&(i=-1)}))}))),n&&(h=Math.max(0,2-s+i)),l=jn(c&&!u?a+h-i+1:a+h-i+2);break;case 16:o&&(n||(i=s<=3&&!t.bondToElementCount(8)?s-2:0)),n&&s<2&&(h=Math.max(0,2-s+i)),s<=3&&(l=jn(a+h-i+2));break;case 9:case 17:case 35:case 53:case 85:o&&(i=s-1);break;case 3:case 11:case 19:case 37:case 55:case 87:o&&(i=1-s);break;case 4:case 12:case 20:case 38:case 56:case 88:o&&(i=2-s);break;default:console.warn("Requested charge, protonation for an unhandled element",t.element)}return[i,h,h+r,l]}(t,e),c=i[0],u=i[1],h=i[2],l=i[3];o[r]=c,n[r]=u,a[r]=h,s[r]=l})),{charge:o,implicitH:n,totalH:a,idealGeometry:s}}function Wn(t){if(t["@valenceModel"])return t["@valenceModel"];var e=Hn(t,{assignCharge:"auto",assignH:"auto"});return t["@valenceModel"]=e,e}function qn(t){return 15===t.number&&t.bondToElementCount(8)===t.bondCount}var Xn=["ARG","HIS","LYS"],Yn=["GLU","ASP"];function Kn(t,e,i){void 0===i&&(i={});for(var o=ht(i.maxIonicDist,na.maxIonicDist),n=ht(i.maxPiStackingDist,na.maxPiStackingDist),a=ht(i.maxPiStackingOffset,na.maxPiStackingOffset),s=ht(i.maxPiStackingAngle,na.maxPiStackingAngle),c=ht(i.maxCationPiDist,na.maxCationPiDist),u=ht(i.maxCationPiOffset,na.maxCationPiOffset),h=ht(i.masterModelIndex,na.masterModelIndex),l=Math.max(o+2,n,c),p=n*n,d=c*c,f=e.features,m=e.spatialHash,g=e.contactStore,y=e.featureSet,v=f.types,b=f.centers,x=f.atomSets,_=b.x,w=b.y,A=b.z,S=v.length,C=t.atomStore.x,P=t.atomStore.y,I=t.atomStore.z,O=t.getAtomProxy(),k=t.getAtomProxy(),M=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],T=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],B=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],D=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],E=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],F=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],R=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],$=function(t,e){M.set(C[t[0]],P[t[0]],I[t[0]]),T.set(C[t[1]],P[t[1]],I[t[1]]),B.set(C[t[2]],P[t[2]],I[t[2]]),D.subVectors(M,T),E.subVectors(M,B),e.crossVectors(D,E)},L=function(t,e,r){return M.set(_[t],w[t],A[t]),T.set(_[e],w[e],A[e]),M.sub(T).projectOnPlane(r).add(T).distanceTo(T)},N=function(t,e,r){y.setBits(t,e),g.addContact(t,e,r)},z=function(t){m.eachWithin(_[t],w[t],A[t],l,(function(e,r){if(!(e<=t||(O.index=x[t][0],k.index=x[e][0],sa(O,k,h)))){var i=v[t],n=v[e];if(function(t,e){return 2===t&&1===e||1===t&&2===e}(i,n))(function(t,e,r){for(var i=t.length,o=e.length,n=0;n=180-s||c<=s+90&&c>=90-s)&&N(t,e,3)}}else if(function(t,e){return 3===t&&1===e||1===t&&3===e}(i,n)&&r<=d){var l=3===i?[t,e]:[e,t],f=l[0],m=l[1];$(x[f],F),L(m,f,F)<=u&&N(f,m,2)}}}))},j=0;j0&&(i[t.index]||(ln(o,t),pn(e,o)))})))}))}(t,e),function(t,e){var r=Wn(t.data).charge,i={};t.eachResidue((function(t){if(Yn.includes(t.resname)){var o=hn(2);t.eachAtom((function(t){8===t.number&&t.isSidechain()&&ln(o,t)})),pn(e,o)}else if(Dn.includes(t.resname)){var n=hn(2);t.eachAtom((function(t){qn(t)&&(n.group=6,t.eachBondedAtom((function(t){8===t.number&&ln(n,t)})),pn(e,n))}))}else kn.includes(t.resname)||Dn.includes(t.resname)||(t.eachAtom((function(t){var r=!1,o=hn(2);!function(t){return 16===t.number&&3===t.bondToElementCount(8)}(t)?qn(t)?(o.group=6,r=!0):function(t){return 16===t.number&&4===t.bondToElementCount(8)}(t)?(o.group=5,r=!0):function(t){var e=0;return 6===t.number&&2===t.bondToElementCount(8)&&1===t.bondToElementCount(6)&&t.eachBondedAtom((function(t){8===t.number&&t.bondCount-t.bondToElementCount(1)==1&&++e})),2===e}(t)&&(o.group=10,r=!0):(o.group=4,r=!0),r&&(t.eachBondedAtom((function(t){8===t.number&&(i[t.index]=!0,ln(o,t))})),pn(e,o))})),t.eachAtom((function(t){var o=hn(2);r[t.index]<0&&(i[t.index]||(ln(o,t),pn(e,o)))})))}))}(t,e),function(t,e){var r=t.getAtomProxy();t.eachResidue((function(t){var i=t.getAromaticRings();if(i){var o=t.atomOffset;i.forEach((function(t){var i=hn(3);t.forEach((function(t){r.index=t+o,ln(i,r)})),pn(e,i)}))}}))}(t,e),function(t,e){var r=Wn(t.data),i=r.charge,o=r.implicitH,n=r.idealGeometry;t.eachAtom((function(t){var r=hn(5),a=t.number;if(8===a)ln(r,t),pn(e,r);else if(7===a){if(Zn(t))ln(r,t),pn(e,r);else if(i[t.index]<1){var s=t.bondCount+o[t.index],c=n[t.index];(4===c&&s<4||3===c&&s<3||2===c&&s<2)&&(ln(r,t),pn(e,r))}}else 16===a&&("CYS"!==t.resname&&"MET"!==t.resname&&-1!==t.formalCharge||(ln(r,t),pn(e,r)))}))}(t,e),function(t,e){var r=Wn(t.data).totalH;t.eachAtom((function(t){var i=hn(4),o=t.number;(Zn(t)||r[t.index]>0&&(7===o||8===o||16===o))&&(ln(i,t),pn(e,i))}))}(t,e),function(t,e){var r=Wn(t.data).totalH;t.eachAtom((function(t){if(6===t.number&&r[t.index]>0&&(t.bondToElementCount(7)>0||t.bondToElementCount(8)>0||function(t){if(!t.isAromatic())return!1;var e=t.residueType.getRings();if(!e)return!1;var r=!1;return e.rings.forEach((function(e){r||e.some((function(e){return t.index-t.residueAtomOffset===e}))&&(r=e.some((function(e){var r=t.residueType.atomTypeIdList[e],i=t.atomMap.get(r).number;return 7===i||8===i})))})),r}(t))){var i=hn(9);ln(i,t),pn(e,i)}}))}(t,e),function(t,e){t.eachAtom((function(t){var r=!1,i=!1,o=kn.includes(t.resname),n=Dn.includes(t.resname);if(o||n?o?8===t.number?(["ASP","GLU","SER","THR","TYR","ASN","GLN"].includes(t.resname)&&t.isSidechain()||t.isBackbone())&&(r=!0,i=!0):16===t.number&&"CYS"===t.resname?(r=!0,i=!0):7===t.number&&"HIS"===t.resname&&t.isSidechain()&&(r=!0):n&&(8===t.number&&t.isBackbone()?(r=!0,i=!0):["N3","N4","N7"].includes(t.atomname)?r=!0:["O2","O4","O6"].includes(t.atomname)&&(r=!0,i=!0)):t.isHalogen()||8===t.number||16===t.number?(r=!0,i=!0):7===t.number&&(r=!0),r){var a=hn(11);ln(a,t),pn(e,a)}if(i){var s=hn(10);ln(s,t),pn(e,s)}}))}(t,e),function(t,e){t.eachAtom((function(t){if(t.isTransitionMetal()||30===t.number||48===t.number){var r=hn(12);ln(r,t),pn(e,r)}else if(Qn.includes(t.number)){var i=hn(13);ln(i,t),pn(e,i)}}))}(t,e),function(t,e){t.eachAtom((function(t){var r=hn(8),i=!1;6===t.number?(i=!0,t.eachBondedAtom((function(t){var e=t.number;6!==e&&1!==e&&(i=!1)}))):9===t.number&&(i=!0),i&&(ln(r,t),pn(e,r))}))}(t,e),function(t,e){t.eachAtom((function(t){if(ta.includes(t.number)){var r=!1;if(t.eachBondedAtom((function(t){ea.includes(t.number)&&(r=!0)})),r){var i=hn(7);ln(i,t),pn(e,i)}}}))}(t,e),function(t,e){t.eachAtom((function(t){if(Jn.includes(t.number)&&1===t.bondToElementCount(6)){var r=hn(6);ln(r,t),pn(e,r)}}))}(t,e),He&&je.timeEnd("calculateFeatures"),e}function ua(t,e){void 0===e&&(e=na);var i=function(t){var e=t.types,r=t.centers;return{features:t,spatialHash:new rn(r),contactStore:new an,featureSet:new cn(e.length,!1)}}(ca(t));He&&je.time("calculateContacts"),Kn(t,i,e),function(t,e,r){void 0===r&&(r={});for(var i=ht(r.maxHbondDist,na.maxHbondDist),o=ht(r.maxHbondSulfurDist,na.maxHbondSulfurDist),n=Ft(ht(r.maxHbondAccAngle,na.maxHbondAccAngle)),a=Ft(ht(r.maxHbondDonAngle,na.maxHbondDonAngle)),s=Ft(ht(r.maxHbondAccPlaneAngle,na.maxHbondAccPlaneAngle)),c=Ft(ht(r.maxHbondDonPlaneAngle,na.maxHbondDonPlaneAngle)),u=ht(r.masterModelIndex,na.masterModelIndex),h=Math.max(i,o),l=i*i,p=e.features,d=e.spatialHash,f=e.contactStore,m=e.featureSet,g=p.types,y=p.centers,v=p.atomSets,b=y.x,x=y.y,_=y.z,w=g.length,A=Wn(t.data).idealGeometry,S=t.getAtomProxy(),C=t.getAtomProxy(),P=function(t){d.eachWithin(b[t],x[t],_[t],h,(function(e,r){if(!(e<=t)){var i=g[t],o=g[e],h=function(t,e){return 9===t&&5===e||5===t&&9===e}(i,o);if(h||function(t,e){return 5===t&&4===e||4===t&&5===e}(i,o)){var p=5===o?[t,e]:[e,t],d=p[0],y=p[1];if(S.index=v[d][0],C.index=v[y][0],C.index!==S.index&&!sa(S,C,u)&&!(16!==S.number&&16!==C.number&&r>l||S.connectedTo(C))){var b=Gn(S,C),x=Vn.get(A[S.index])||Ft(120);if(!b.some((function(t){return Math.abs(x-t)>a}))){if(3===A[S.index]){var _=Un(S,C);if(void 0!==_&&_>c)return}var w=Gn(C,S),P=Vn.get(A[C.index])||Ft(120);if(!w.some((function(t){return P-t>n}))){if(3===A[C.index]){var I=Un(C,S);if(void 0!==I&&I>s)return}m.setBits(d,y);var O,k,M=h?8:function(t,e){return t.isWater()&&e.isWater()}(O=S,k=C)?9:function(t,e){return t.isBackbone()&&e.isBackbone()}(O,k)?10:4;f.addContact(d,y,M)}}}}}}))},I=0;Io)){var m=Gn(d,l);0!==m.length&&(m.some((function(t){return ia-t>o}))||(u.setBits(t,e),c.addContact(t,e,5)))}}}))},x=0;xr&&!oa(y,b,n)&&!oa(v,b,n)&&!o.includes(e)&&!c.includes(e)&&x.distanceToSquared(b)>1&&_.distanceToSquared(b)>1&&(s.clear(t),He&&je.log("removing",y.qualifiedName(),v.qualifiedName(),"because",b.qualifiedName()))}))})),He&&je.timeEnd("refineLineOfSight")}(t,o,e),function(t,e){var r=e.contactSet,i=e.contactStore,o=e.features,n=i.type,a=i.index1,s=i.index2,c=o.atomSets,u=t.getAtomProxy(),h=t.getAtomProxy(),l={},p=function(t,e,i){var o=l[i]||[1/0,-1],n=o[0],a=o[1];t=d){D=v,k=!0;break}if(k)break}if(k)break}for(k=!1,y=n;y=d){B=y,k=!0;break}if(k)break}if(k)break}for(k=!1,m=o;m=d){T=m,k=!0;break}if(k)break}if(k)break}for(k=!1,v=h;v>=s;--v){for(y=u;y>=n;--y){for(m=c;m>=o;--m)if(t[l=e*r*v+e*y+m]>=d){$=v,k=!0;break}if(k)break}if(k)break}for(k=!1,y=u;y>=n;--y){for(v=$;v>=s;--v){for(m=c;m>=o;--m)if(t[l=e*r*v+e*y+m]>=d){R=y,k=!0;break}if(k)break}if(k)break}for(k=!1,m=c;m>=o;--m){for(y=R;y>=n;--y){for(v=$;v>=s;--v)if(t[l=e*r*v+e*y+m]>=d){E=m,k=!0;break}if(k)break}if(k)break}f?(o=Math.max(0,T-1),n=Math.max(0,B-1),s=Math.max(0,D-1),c=Math.min(e-1,E+1),u=Math.min(r-1,R+1),h=Math.min(i-1,$+1)):(o=Math.max(1,T-1),n=Math.max(1,B-1),s=Math.max(1,D-1),c=Math.min(e-2,E+1),u=Math.min(r-2,R+1),h=Math.min(i-2,$+1))}var L=15;for(v=s;v0?-1:1,n||(n=new Float32Array(3*b)));var I=3*b;if(a&&a.length===I||(a=new Int32Array(I)),s=0,c=0,void 0!==x){var O=x[0].map(Math.round),k=x[1].map(Math.round);u=e*Math.ceil(Math.abs(O[0])/e),h=r*Math.ceil(Math.abs(O[1])/r),l=i*Math.ceil(Math.abs(O[2])/i),R(O[0],O[1],O[2],k[0],k[1],k[2])}else u=h=l=0,R();return A.length=3*s,f||(S.length=3*s),C.length=c,o&&(P.length=s),{position:new Float32Array(A),normal:f?void 0:new Float32Array(S),index:Ct(C,A.length/3),atomindex:o?new Int32Array(P):void 0,contour:m}}}nr.add("arrow",va),nr.add("box",Oa),nr.add("cone",Aa),nr.add("cylinder",ya),nr.add("ellipsoid",Pa),nr.add("octahedron",Ia),nr.add("sphere",Ta),nr.add("tetrahedron",Da),nr.add("torus",Ea),nr.add("point",La),nr.add("wideline",Na),Object.assign(Va,{__deps:[za,ja,Ct]});var Ga=function(t,e){this.cols=t,this.rows=e,this.size=this.cols*this.rows,this.data=new Float32Array(this.size)};function Ua(t,e){for(var r=0,i=0,o=e.rows,n=e.cols,a=0,s=0,c=0,u=e.data,h=t.data;r(e=Math.abs(e))?(e/=t,t*Math.sqrt(1+e*e)):e>0?(t/=e,e*Math.sqrt(1+t*t)):0}Ga.prototype.copyTo=function(t){t.data.set(this.data)};function Za(t,e,r,i){var o=0,n=0,a=t.rows,s=t.cols,c=a,u=s;c>16)?B:-B,t[c*e+h]=T;for(l=0;l<2;l++)for(u=0;ur){var i=e;e=r,r=i}var o=t[e];return void 0===o?(t[e]=[r],!0):!o.includes(r)&&(o.push(r),!0)}var r=this.geometry,i=r.index;if(this.parameters.wireframe)if(i){var o,n=i.array,a=n.length;if(r.drawRange.count!==1/0&&(a=r.drawRange.count),this.wireframeIndex&&this.wireframeIndex.length>2*a)o=this.wireframeIndex;else o=Ct(2*a,r.attributes.position.count);var s=0;t.length=0;for(var c=0;c2*d?this.wireframeIndex:Ct(2*d,d);for(var f=0,m=0;fthis.wireframeGeometry.index.array.length)this.wireframeGeometry.setIndex(new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](this.wireframeIndex,1).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0));else{var t=this.wireframeGeometry.getIndex();if(!t)return void je.error("Index is null");t.set(this.wireframeIndex),t.needsUpdate=this.wireframeIndexCount>0,t.updateRange.count=this.wireframeIndexCount}this.wireframeGeometry.setDrawRange(0,this.wireframeIndexCount)}},xs.prototype.getRenderOrder=function(){var t=0;return this.isText?t=1:this.transparent&&(t=this.isSurface?3:2),t},xs.prototype._getMesh=function(t){this.material||this.makeMaterial();var e,r=this.geometry,i=this[t];return(e=this.isLine?new __WEBPACK_IMPORTED_MODULE_1_three__["v" /* LineSegments */](r,i):this.isPoint?new __WEBPACK_IMPORTED_MODULE_1_three__["J" /* Points */](r,i):new __WEBPACK_IMPORTED_MODULE_1_three__["A" /* Mesh */](r,i)).frustumCulled=!1,e.renderOrder=this.getRenderOrder(),e},xs.prototype.getMesh=function(){return this._getMesh("material")},xs.prototype.getWireframeMesh=function(){var t;return this.material||this.makeMaterial(),this.wireframeGeometry||this.makeWireframeGeometry(),(t=new __WEBPACK_IMPORTED_MODULE_1_three__["v" /* LineSegments */](this.wireframeGeometry,this.wireframeMaterial)).frustumCulled=!1,t.renderOrder=this.getRenderOrder(),t},xs.prototype.getPickingMesh=function(){return this._getMesh("pickingMaterial")},xs.prototype.getShader=function(t,e){return Or(t,this.getDefines(e))},xs.prototype.getVertexShader=function(t){return this.getShader(this.vertexShader,t)},xs.prototype.getFragmentShader=function(t){return this.getShader(this.fragmentShader,t)},xs.prototype.getDefines=function(t){var e={};return this.parameters.clipNear&&(e.NEAR_CLIP=1),this.parameters.clipRadius&&(e.RADIUS_CLIP=1),"picking"===t?e.PICKING=1:(("background"===t||this.parameters.background)&&(e.NOLIGHT=1),this.parameters.flatShaded&&(e.FLAT_SHADED=1),this.parameters.opaqueBack&&(e.OPAQUE_BACK=1),this.parameters.diffuseInterior&&(e.DIFFUSE_INTERIOR=1),this.parameters.useInteriorColor&&(e.USE_INTERIOR_COLOR=1)),e},xs.prototype.getParameters=function(){return this.parameters},xs.prototype.addUniforms=function(t){this.uniforms=__WEBPACK_IMPORTED_MODULE_1_three__["V" /* UniformsUtils */].merge([this.uniforms,t]),this.pickingUniforms=__WEBPACK_IMPORTED_MODULE_1_three__["V" /* UniformsUtils */].merge([this.pickingUniforms,t])},xs.prototype.addAttributes=function(t){for(var e in t){var r=void 0,i=t[e],o=this.attributeSize*gs[i.type];i.value?(o!==i.value.length&&je.error("attribute value has wrong length",e),r=i.value):r=St("float32",o),this.geometry.setAttribute(e,new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](r,gs[i.type]).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0))}},xs.prototype.updateRenderOrder=function(){var t=this.getRenderOrder();function e(e){e.renderOrder=t}this.group.children.forEach(e),this.pickingGroup&&this.pickingGroup.children.forEach(e)},xs.prototype.updateShader=function(){var t=this.material,e=this.wireframeMaterial,r=this.pickingMaterial;t.vertexShader=this.getVertexShader(),t.fragmentShader=this.getFragmentShader(),t.needsUpdate=!0,e.vertexShader=this.getShader("Line.vert"),e.fragmentShader=this.getShader("Line.frag"),e.needsUpdate=!0,r.vertexShader=this.getVertexShader("picking"),r.fragmentShader=this.getFragmentShader("picking"),r.needsUpdate=!0},xs.prototype.setParameters=function(t){var e=t,r=this.parameterTypes,i=this.parameters,o={},n={},a=!1,s=!1;for(var c in e){var u=e[c];void 0!==u&&(i[c]=u,void 0!==r[c]&&(r[c].property&&(!0!==r[c].property?o[r[c].property]=u:o[c]=u),r[c].uniform&&(!0!==r[c].uniform?n[r[c].uniform]=u:n[c]=u),r[c].updateShader&&(a=!0),r[c].updateVisibility&&(s=!0),this.dynamic&&"wireframe"===c&&!0===u&&this.updateWireframeIndex(),"forceTransparent"===c&&(o.transparent=this.transparent),"matrix"===c&&(this.matrix=u)))}this.setProperties(o),this.setUniforms(n),a&&this.updateShader(),s&&this.setVisibility(this.visible)},xs.prototype.setAttributes=function(t){var e=this.geometry,r=e.attributes;for(var i in t)if("picking"!==i){var o=t[i],n=o.length;if("index"===i){var a=e.getIndex();if(!a){je.error("Index is null");continue}e.setDrawRange(0,1/0),n>a.array.length?e.setIndex(new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](o,1).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0)):(a.set(o),a.count=n,a.needsUpdate=n>0,a.updateRange.count=n,e.setDrawRange(0,n)),this.indexVersion++,this.parameters.wireframe&&this.updateWireframeIndex()}else{var s=r[i];n>s.array.length?e.setAttribute(i,new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](o,s.itemSize).setUsage(this.dynamic?WebGLRenderingContext.DYNAMIC_DRAW:0)):(r[i].set(o),r[i].needsUpdate=n>0,r[i].updateRange.count=n)}}},xs.prototype.setUniforms=function(t){if(t){var e=this.material.uniforms,r=this.wireframeMaterial.uniforms,i=this.pickingMaterial.uniforms;for(var o in t)"opacity"===o&&this.setProperties({transparent:this.transparent}),void 0!==e[o]&&(e[o].value.isVector3?e[o].value.copy(t[o]):e[o].value.set?e[o].value.set(t[o]):e[o].value=t[o]),void 0!==r[o]&&(r[o].value.isVector3?r[o].value.copy(t[o]):r[o].value.set?r[o].value.set(t[o]):r[o].value=t[o]),void 0!==i[o]&&(i[o].value.isVector3?i[o].value.copy(t[o]):i[o].value.set?i[o].value.set(t[o]):i[o].value=t[o])}},xs.prototype.setProperties=function(t){if(t){var e=this.material,r=this.wireframeMaterial,i=this.pickingMaterial;for(var o in t){var n=o,a=t[n];"transparent"===n?this.updateRenderOrder():"side"===n&&(a=ms(a)),e[n]=a,r[n]=a,i[n]=a}e.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},xs.prototype.setVisibility=function(t){this.visible=t,this.parameters.wireframe?(this.group.visible=!1,this.wireframeGroup.visible=t,this.pickable&&(this.pickingGroup.visible=!1)):(this.group.visible=t,this.wireframeGroup.visible=!1,this.pickable&&(this.pickingGroup.visible=t))},xs.prototype.dispose=function(){this.material&&this.material.dispose(),this.wireframeMaterial&&this.wireframeMaterial.dispose(),this.pickingMaterial&&this.pickingMaterial.dispose(),this.geometry.dispose(),this.wireframeGeometry&&this.wireframeGeometry.dispose()},xs.prototype.toJSON=function(){var t={};for(var e in this)"group"!==e&&"wireframeGroup"!==e&&"pickingGroup"!=e&&"picking"!==e&&(t[e]=this[e]);return t},Object.defineProperties(xs.prototype,_s);var ws=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,e,r),this.vertexShader="Mesh.vert",this.fragmentShader="Mesh.frag",this.addAttributes({normal:{type:"v3",value:e.normal}}),void 0===e.normal&&this.geometry.computeVertexNormals()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(xs),As=function(t){function e(){t.apply(this,arguments),this.isSurface=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ws);function Ss(t){t.visible=!0}function Cs(t){t.visible=!1}var Ps=function(t){this.group=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.wireframeGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.pickingGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.frontMeshes=[],this.backMeshes=[],this.size=t.size,this.side=t.parameters.side,this.visible=t.visible,this.geometry=t.geometry,this.picking=t.picking,this.group=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.wireframeGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.pickingGroup=new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */],this.matrix=t.matrix;var e=t,r=new t.constructor({position:new Float32Array(0)});e.makeMaterial(),r.makeMaterial(),r.picking=t.picking,r.geometry=t.geometry,r.wireframeGeometry=t.wireframeGeometry,r.setParameters(t.getParameters()),r.updateShader(),e.setParameters({side:"front"}),r.setParameters({side:"back",opacity:r.parameters.opacity}),this.buffer=t,this.frontBuffer=e,this.backBuffer=r},Is={matrix:{configurable:!0},pickable:{configurable:!0},parameters:{configurable:!0}};Is.matrix.set=function(t){xs.prototype.setMatrix.call(this,t)},Is.matrix.get=function(){return this.group.matrix.clone()},Is.pickable.get=function(){return!!this.picking&&!this.parameters.disablePicking},Is.parameters.get=function(){return this.buffer.parameters},Ps.prototype.getParameters=function(){var t=Object.assign({},this.buffer.parameters);return t.side=this.side,t},Ps.prototype.getMesh=function(t){var e,r;return t?(r=this.backBuffer.getPickingMesh(),e=this.frontBuffer.getPickingMesh()):(r=this.backBuffer.getMesh(),e=this.frontBuffer.getMesh()),this.frontMeshes.push(e),this.backMeshes.push(r),this.setParameters({side:this.side}),(new __WEBPACK_IMPORTED_MODULE_1_three__["t" /* Group */]).add(r,e)},Ps.prototype.getWireframeMesh=function(){return this.buffer.getWireframeMesh()},Ps.prototype.getPickingMesh=function(){return this.getMesh(!0)},Ps.prototype.setAttributes=function(t){this.buffer.setAttributes(t)},Ps.prototype.setParameters=function(t){"front"===(t=Object.assign({},t)).side?(this.frontMeshes.forEach(Ss),this.backMeshes.forEach(Cs)):"back"===t.side?(this.frontMeshes.forEach(Cs),this.backMeshes.forEach(Ss)):"double"===t.side&&(this.frontMeshes.forEach(Ss),this.backMeshes.forEach(Ss)),void 0!==t.side&&(this.side=t.side),delete t.side,void 0!==t.matrix&&(this.matrix=t.matrix),delete t.matrix,this.frontBuffer.setParameters(t),void 0!==t.wireframe&&(this.wireframe=t.wireframe,this.setVisibility(this.visible)),delete t.wireframe,this.backBuffer.setParameters(t)},Ps.prototype.setVisibility=function(t){this.visible=t,this.parameters.wireframe?(this.group.visible=!1,this.wireframeGroup.visible=t,this.pickable&&(this.pickingGroup.visible=!1)):(this.group.visible=t,this.wireframeGroup.visible=!1,this.pickable&&(this.pickingGroup.visible=t))},Ps.prototype.dispose=function(){this.frontBuffer.dispose(),this.backBuffer.dispose()},Ps.prototype.toJSON=function(){var t={};for(var e in this)["side","size","visible","matrix","parameters"].includes(e)&&(t[e]=this[e]);return t},Object.defineProperties(Ps.prototype,Is),er.add("shader/Line.vert","uniform float clipNear;\nuniform vec3 clipCenter;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include color_pars_vertex\nvoid main(){\n#include color_vertex\n#include begin_vertex\n#include project_vertex\nvViewPosition = -mvPosition.xyz;\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}"),er.add("shader/Line.frag","uniform float opacity;\nuniform float clipNear;\nuniform float clipRadius;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include common\n#include color_pars_fragment\n#include fog_pars_fragment\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\ngl_FragColor = vec4( vColor, opacity );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n}");var Os=function(t){function e(){t.apply(this,arguments),this.isLine=!0,this.vertexShader="Line.vert",this.fragmentShader="Line.frag"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(xs),ks=function(t){function e(e,o,n){t.call(this,e,o,n),this.type="surface",this.parameters=Object.assign({isolevelType:{type:"select",options:{value:"value",sigma:"sigma"}},isolevel:{type:"number",precision:2,max:1e3,min:-1e3},negateIsolevel:{type:"boolean"},isolevelScroll:{type:"boolean"},smooth:{type:"integer",precision:1,max:10,min:0},background:{type:"boolean",rebuild:!0},opaqueBack:{type:"boolean",buffer:!0},boxSize:{type:"integer",precision:1,max:100,min:0},colorVolume:{type:"hidden"},contour:{type:"boolean",rebuild:!0},useWorker:{type:"boolean",rebuild:!0},wrap:{type:"boolean",rebuild:!0}},this.parameters),e instanceof ds?(this.surface=void 0,this.volume=e):(this.surface=e,this.volume=void 0),this.boxCenter=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.__boxCenter=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.box=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */],this.__box=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */],this._position=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.inverseMatrix=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],this.setBox=function(){this._position.copy(o.translationGroup.position).negate(),this._position.applyMatrix4(this.inverseMatrix),this._position.equals(this.boxCenter)||this.setParameters({boxCenter:this._position})},this.toBePrepared=!0,this.viewer.signals.ticked.add(this.setBox,this),this.init(n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};r.colorScheme=ht(r.colorScheme,"uniform"),r.colorValue=ht(r.colorValue,14540253),this.isolevelType=ht(r.isolevelType,"sigma"),this.isolevel=ht(r.isolevel,2),this.negateIsolevel=ht(r.negateIsolevel,!1),this.isolevelScroll=ht(r.isolevelScroll,!1),this.smooth=ht(r.smooth,0),this.background=ht(r.background,!1),this.opaqueBack=ht(r.opaqueBack,!0),this.boxSize=ht(r.boxSize,0),this.colorVolume=ht(r.colorVolume,void 0),this.contour=ht(r.contour,!1),this.useWorker=ht(r.useWorker,!0),this.wrap=ht(r.wrap,!1),t.prototype.init.call(this,r),this.inverseMatrix.getInverse(this.matrix),this.build()},e.prototype.attach=function(t){var e=this;this.bufferList.forEach((function(t){e.viewer.add(t)})),this.setVisibility(this.visible),t()},e.prototype.prepare=function(t){var e,r=this;if(this.volume)if(e="sigma"===this.isolevelType?this.volume.getValueForSigma(this.isolevel):this.isolevel,this.negateIsolevel&&(e*=-1),!this.surface||this.__isolevel!==e||this.__smooth!==this.smooth||this.__contour!==this.contour||this.__wrap!==this.wrap||this.__boxSize!==this.boxSize||this.boxSize>0&&!this.__boxCenter.equals(this.boxCenter)){this.__isolevel=e,this.__smooth=this.smooth,this.__contour=this.contour,this.__wrap=this.wrap,this.__boxSize=this.boxSize,this.__boxCenter.copy(this.boxCenter),this.__box.copy(this.box);var i=function(e){r.surface=e,t()};this.useWorker?this.volume.getSurfaceWorker(e,this.smooth,this.boxCenter,this.boxSize,this.contour,this.wrap,i):i(this.volume.getSurface(e,this.smooth,this.boxCenter,this.boxSize,this.contour,this.wrap))}else t();else t()},e.prototype.create=function(){var t,e={position:this.surface.getPosition(),color:this.surface.getColor(this.getColorParams()),index:this.surface.getIndex()};if(this.contour)t=new Os(e,this.getBufferParams({wireframe:!1}));else{Object.assign(e,{normal:this.surface.getNormal(),picking:this.surface.getPicking()});var r=new As(e,this.getBufferParams({background:this.background,opaqueBack:this.opaqueBack,dullInterior:!1}));t=new Ps(r)}this.bufferList.push(t)},e.prototype.update=function(t){if(0!==this.bufferList.length){var e={};(t=t||{}).position&&(e.position=this.surface.getPosition()),t.color&&(e.color=this.surface.getColor(this.getColorParams())),t.index&&(e.index=this.surface.getIndex()),t.normal&&(e.normal=this.surface.getNormal()),this.bufferList.forEach((function(t){t.setAttributes(e)}))}},e.prototype.setParameters=function(e,r,i){return e&&void 0!==e.isolevelType&&this.volume&&("value"===this.isolevelType&&"sigma"===e.isolevelType?this.isolevel=this.volume.getSigmaForValue(this.isolevel):"sigma"===this.isolevelType&&"value"===e.isolevelType&&(this.isolevel=this.volume.getValueForSigma(this.isolevel)),this.isolevelType=e.isolevelType),e&&e.boxCenter&&(this.boxCenter.copy(e.boxCenter),delete e.boxCenter),e&&e.wireframe&&(e.contour||void 0===e.contour&&this.contour)&&(e.wireframe=!1),t.prototype.setParameters.call(this,e,r,i),e.matrix&&this.inverseMatrix.getInverse(e.matrix),this.volume&&this.volume.getBox(this.boxCenter,this.boxSize,this.box),e&&void 0!==e.colorVolume&&r&&(r.color=!0),this.surface&&(void 0!==e.isolevel||void 0!==e.negateIsolevel||void 0!==e.smooth||void 0!==e.wrap||void 0!==e.boxSize||this.boxSize>0&&!this.__box.equals(this.box))&&this.build({position:!0,color:!0,index:!0,normal:!this.contour}),this},e.prototype.getColorParams=function(){var e=t.prototype.getColorParams.call(this);return e.volume=this.colorVolume,e},e.prototype.dispose=function(){this.viewer.signals.ticked.remove(this.setBox,this),t.prototype.dispose.call(this)},e}(lo),Ms=function(){};Ms.zoomScroll=function(t,e){t.trackballControls.zoom(e)},Ms.clipNearScroll=function(t,e){var r=t.getParameters();t.setParameters({clipNear:r.clipNear+e/10})},Ms.focusScroll=function(t,e){var r=t.getFocus(),i=Math.sign(e)*function(t,e,r){if(t>e)return t;var i=t/e;return((2*r-e)*i+(2*e-3*r))*i*i+r}((100-r)/10,5,.2);t.setFocus(r+i)},Ms.zoomFocusScroll=function(t,e){t.trackballControls.zoom(e);var r=t.viewer.camera.position.z;t.setFocus(100-Math.abs(r/8))},Ms.isolevelScroll=function(t,e){var r=Math.sign(e)/10;t.eachRepresentation((function(t,e){if(t.repr instanceof ks){var i=t.getParameters();i.isolevelScroll&&t.setParameters({isolevel:i.isolevel+r})}}))},Ms.panDrag=function(t,e,r){t.trackballControls.pan(e,r)},Ms.rotateDrag=function(t,e,r){t.trackballControls.rotate(e,r)},Ms.zRotateDrag=function(t,e,r){t.trackballControls.zRotate(e,r)},Ms.zoomDrag=function(t,e,r){t.trackballControls.zoom((e+r)/-2)},Ms.zoomFocusDrag=function(t,e,r){t.trackballControls.zoom((e+r)/-2);var i=t.viewer.camera.position.z;t.setFocus(100-Math.abs(i/8))},Ms.panComponentDrag=function(t,e,r){t.trackballControls.panComponent(e,r)},Ms.panAtomDrag=function(t,e,r){t.trackballControls.panAtom(e,r)},Ms.rotateComponentDrag=function(t,e,r){t.trackballControls.rotateComponent(e,r)},Ms.movePick=function(t,e){e&&t.animationControls.move(e.position.clone())},Ms.tooltipPick=function(t,e){var r=t.tooltip;if(t.getParameters().tooltip&&e){var i=e.mouse.position;r.innerText=e.getLabel(),r.style.bottom=window.innerHeight-i.y+3+"px",r.style.left=i.x+3+"px",r.style.display="block"}else r.style.display="none"};var Ts={default:[["scroll",Ms.zoomScroll],["scroll-shift",Ms.focusScroll],["scroll-ctrl",Ms.isolevelScroll],["scroll-shift-ctrl",Ms.zoomFocusScroll],["drag-left",Ms.rotateDrag],["drag-right",Ms.panDrag],["drag-ctrl-left",Ms.panDrag],["drag-ctrl-right",Ms.zRotateDrag],["drag-shift-left",Ms.zoomDrag],["drag-middle",Ms.zoomFocusDrag],["drag-ctrl-shift-right",Ms.panComponentDrag],["drag-ctrl-shift-left",Ms.rotateComponentDrag],["clickPick-right",Ms.measurePick=function(t,e){if(e&&(e.atom||e.bond)){var r=e.atom||e.closestBondAtom;e.component.measurePick(r)}else t.measureClear()}],["clickPick-ctrl-left",Ms.measurePick],["clickPick-middle",Ms.movePick],["clickPick-left",Ms.movePick],["hoverPick",Ms.tooltipPick]],pymol:[["drag-left",Ms.rotateDrag],["drag-middle",Ms.panDrag],["drag-right",Ms.zoomDrag],["drag-shift-right",Ms.focusScroll],["clickPick-ctrl+shift-middle",Ms.movePick],["hoverPick",Ms.tooltipPick]],coot:[["scroll",Ms.isolevelScroll],["drag-left",Ms.rotateDrag],["drag-middle",Ms.panDrag],["drag-ctrl-left",Ms.panDrag],["drag-right",Ms.zoomFocusDrag],["drag-ctrl-right",Ms.focusScroll],["clickPick-middle",Ms.movePick],["hoverPick",Ms.tooltipPick]],astexviewer:[["drag-left",Ms.rotateDrag],["drag-ctrl-left",Ms.panDrag],["drag-shift-left",Ms.zoomDrag],["scroll",Ms.focusScroll],["clickPick-middle",Ms.movePick],["hoverPick",Ms.tooltipPick]]};function Bs(t){var e=t.split(/[-+]/),r="";e.includes("scroll")&&(r="scroll"),e.includes("drag")&&(r="drag"),e.includes("click")&&(r="click"),e.includes("doubleClick")&&(r="doubleClick"),e.includes("hover")&&(r="hover"),e.includes("clickPick")&&(r="clickPick"),e.includes("hoverPick")&&(r="hoverPick");var i=0;e.includes("alt")&&(i+=1),e.includes("ctrl")&&(i+=2),e.includes("meta")&&(i+=4),e.includes("shift")&&(i+=8);var o=0;return e.includes("left")&&(o+=1),e.includes("right")&&(o+=2),e.includes("middle")&&(o+=4),[r,i,o]}var Ds=function(t,e){void 0===e&&(e={}),this.stage=t,this.actionList=[],this.mouse=t.mouseObserver,this.disabled=e.disabled||!1,this.preset(e.preset||"default")};Ds.prototype.run=function(t){for(var e=this,r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];if(!this.disabled){var o=this.mouse.key||0,n=this.mouse.buttons||0;this.actionList.forEach((function(i){i.type===t&&i.key===o&&i.button===n&&i.callback.apply(i,[e.stage].concat(r))}))}},Ds.prototype.add=function(t,e){var r=Bs(t),i=r[0],o=r[1],n=r[2];this.actionList.push({type:i,key:o,button:n,callback:e})},Ds.prototype.remove=function(t,e){var r=t.includes("*"),i=Bs(t),o=i[0],n=i[1],a=i[2],s=this.actionList.filter((function(t){return!((t.type===o||r&&""===o)&&(t.key===n||r&&0===n)&&(t.button===a||r&&0===a)&&(t.callback===e||void 0===e))}));this.actionList=s},Ds.prototype.preset=function(t){var e=this;this.clear(),(Ts[t]||[]).forEach((function(t){return e.add(t[0],t[1])}))},Ds.prototype.clear=function(){this.actionList.length=0};var Es=function(){};Es.autoView=function(t){t.autoView(1e3)},Es.toggleAnimations=function(t){t.animationControls.toggle()},Es.toggleRock=function(t){t.toggleRock()};var Fs={default:[["i",Es.toggleSpin=function(t){t.toggleSpin()}],["k",Es.toggleRock],["p",Es.toggleAnimations],["a",Es.toggleAntialiasing=function(t){var e=t.getParameters();t.setParameters({sampleLevel:-1===e.sampleLevel?0:-1})}],["r",Es.autoView]]},Rs=function(t,e){void 0===e&&(e={}),this.stage=t,this.actionList=[],this.disabled=e.disabled||!1,this.preset(e.preset||"default")};Rs.prototype.run=function(t){var e=this;this.disabled||this.actionList.forEach((function(r){r.key===t&&r.callback(e.stage)}))},Rs.prototype.add=function(t,e){this.actionList.push({key:t,callback:e})},Rs.prototype.remove=function(t,e){var r=this.actionList.filter((function(r){return!(r.key===t&&(r.callback===e||void 0===e))}));this.actionList=r},Rs.prototype.preset=function(t){var e=this;this.clear(),(Fs[t]||[]).forEach((function(t){return e.add(t[0],t[1])}))},Rs.prototype.clear=function(){this.actionList.length=0};var $s=function(t){this.stage=t,this.stage=t,this.mouse=t.mouseObserver,this.controls=t.mouseControls,this.mouse.signals.clicked.add(this._onClick,this),this.mouse.signals.hovered.add(this._onHover,this)};$s.prototype._onClick=function(t,e){var r=this.stage.pickingControls.pick(t,e);this.stage.signals.clicked.dispatch(r),this.controls.run("clickPick",r)},$s.prototype._onHover=function(t,e){var r=this.stage.pickingControls.pick(t,e);r&&this.mouse.down.equals(this.mouse.position)&&(this.stage.transformComponent=r.component,this.stage.transformAtom=r.atom),this.stage.signals.hovered.dispatch(r),this.controls.run("hoverPick",r)},$s.prototype.dispose=function(){this.mouse.signals.clicked.remove(this._onClick,this),this.mouse.signals.hovered.remove(this._onHover,this)};var Ls=function(t){this.stage=t,this.stage=t,this.mouse=t.mouseObserver,this.controls=t.mouseControls,this.mouse.signals.moved.add(this._onMove,this),this.mouse.signals.scrolled.add(this._onScroll,this),this.mouse.signals.dragged.add(this._onDrag,this),this.mouse.signals.clicked.add(this._onClick,this),this.mouse.signals.hovered.add(this._onHover,this),this.mouse.signals.doubleClicked.add(this._onDblclick,this)};Ls.prototype._onMove=function(){this.stage.tooltip.style.display="none"},Ls.prototype._onScroll=function(t){this.controls.run("scroll",t)},Ls.prototype._onDrag=function(t,e){this.controls.run("drag",t,e)},Ls.prototype._onClick=function(t,e){this.controls.run("click",t,e)},Ls.prototype._onDblclick=function(t,e){this.controls.run("doubleClick",t,e)},Ls.prototype._onHover=function(t,e){this.controls.run("hover",t,e)},Ls.prototype.dispose=function(){this.mouse.signals.moved.remove(this._onMove,this),this.mouse.signals.scrolled.remove(this._onScroll,this),this.mouse.signals.dragged.remove(this._onDrag,this),this.mouse.signals.clicked.remove(this._onClick,this),this.mouse.signals.hovered.remove(this._onHover,this)};var Ns=function(t){this.stage=t,this.viewer=t.viewer,this.animationControls=t.animationControls,this.viewer.signals.ticked.add(this._onTick,this)};Ns.prototype._onTick=function(t){this.animationControls.run(t)},Ns.prototype.dispose=function(){this.viewer.signals.ticked.remove(this._onTick,this)};var zs=!!Ee&&{passive:!0},js=function(t){this.stage=t,this.stage=t,this.controls=t.keyControls,this.domElement=t.viewer.renderer.domElement,this.domElement.setAttribute("tabIndex","-1"),this.domElement.style.outline="none",this._focusDomElement=this._focusDomElement.bind(this),this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this),this._onKeypress=this._onKeypress.bind(this),this.domElement.addEventListener("mousedown",this._focusDomElement),this.domElement.addEventListener("touchstart",this._focusDomElement,zs),this.domElement.addEventListener("keydown",this._onKeydown),this.domElement.addEventListener("keyup",this._onKeyup),this.domElement.addEventListener("keypress",this._onKeypress)};js.prototype._onKeydown=function(){},js.prototype._onKeyup=function(){},js.prototype._onKeypress=function(t){var e;e="key"in KeyboardEvent.prototype?t.key:String.fromCharCode(t.which||t.keyCode),this.controls.run(e)},js.prototype._focusDomElement=function(){this.domElement.focus()},js.prototype.dispose=function(){this.domElement.removeEventListener("mousedown",this._focusDomElement),this.domElement.removeEventListener("touchstart",this._focusDomElement,zs),this.domElement.removeEventListener("keydown",this._onKeypress),this.domElement.removeEventListener("keyup",this._onKeypress),this.domElement.removeEventListener("keypress",this._onKeypress)};var Vs=function(t,i,o,n){void 0===n&&(n={}),this.component=t,this.position=i,this.offsetX=ht(n.offsetX,0),this.offsetY=ht(n.offsetY,0),this.visible=ht(n.visible,!0),this.stage=t.stage,this.viewer=t.stage.viewer,this._viewerPosition=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this._updateViewerPosition(),this._canvasPosition=new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */],this._cameraPosition=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.element=document.createElement("div"),Object.assign(this.element.style,{display:"block",position:"absolute",pointerEvents:"none",whiteSpace:"nowrap",left:"-10000px"}),this.viewer.wrapper.appendChild(this.element),this.setContent(o),this.updateVisibility(),this.viewer.signals.rendered.add(this._update,this),this.component.signals.matrixChanged.add(this._updateViewerPosition,this)};Vs.prototype.setContent=function(t){var e=this.element.style.display;if("none"===e&&(this.element.style.left="-10000px",this.element.style.display="block"),t instanceof HTMLElement)this.element.appendChild(t);else{var r=document.createElement("div");r.innerText=t,Object.assign(r.style,{backgroundColor:"rgba( 0, 0, 0, 0.6 )",color:"lightgrey",padding:"8px",fontFamily:"sans-serif"}),this.element.appendChild(r)}this._clientRect=this.element.getBoundingClientRect(),"none"===e&&(this.element.style.display=e)},Vs.prototype.setVisibility=function(t){this.visible=t,this.updateVisibility()},Vs.prototype.getVisibility=function(){return this.visible&&this.component.parameters.visible},Vs.prototype.updateVisibility=function(){this.element.style.display=this.getVisibility()?"block":"none"},Vs.prototype._updateViewerPosition=function(){this._viewerPosition.copy(this.position).applyMatrix4(this.component.matrix)},Vs.prototype._update=function(){if(this.getVisibility()){var t=this.element.style,e=this._canvasPosition,r=this._viewerPosition,i=this._clientRect;if(this._cameraPosition.copy(r).add(this.viewer.translationGroup.position).applyMatrix4(this.viewer.rotationGroup.matrix).sub(this.viewer.camera.position),this._cameraPosition.z<0)t.display="none";else{t.display="block";var o=this._cameraPosition.length(),n=this.viewer.scene.fog;t.opacity=(1-Vt(n.near,n.far,o)).toString(),t.zIndex=Math.round(100*(n.far-o)).toString(),this.stage.viewerControls.getPositionOnCanvas(r,e),t.bottom=this.offsetX+e.y+i.height/2+"px",t.left=this.offsetY+e.x-i.width/2+"px"}}},Vs.prototype.dispose=function(){this.viewer.wrapper.removeChild(this.element),this.viewer.signals.ticked.remove(this._update,this),this.component.signals.matrixChanged.remove(this._updateViewerPosition,this)};var Gs=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Us=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Hs=new __WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */],Ws=function(t){this.component=t,this.signals={changed:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]},this.stage=t.stage,this.viewer=t.stage.viewer},qs={position:{configurable:!0},rotation:{configurable:!0}};qs.position.get=function(){return this.component.position},qs.rotation.get=function(){return this.component.quaternion},Ws.prototype.changed=function(){this.component.updateMatrix(),this.viewer.requestRender(),this.signals.changed.dispatch()},Ws.prototype.spin=function(t,e){Gs.getInverse(this.viewer.rotationGroup.matrix),Us.copy(Ot(t)).applyMatrix4(Gs),Gs.extractRotation(this.component.transform),Gs.premultiply(this.viewer.rotationGroup.matrix),Gs.getInverse(Gs),Us.copy(Ot(t)),Us.applyMatrix4(Gs),Gs.makeRotationAxis(Us,e),Hs.setFromRotationMatrix(Gs),this.component.quaternion.premultiply(Hs),this.changed()},Object.defineProperties(Ws.prototype,qs);var Xs={"":"",vdw:"by vdW radius",covalent:"by covalent radius",sstruc:"by secondary structure",bfactor:"by bfactor",size:"size",data:"data",explicit:"explicit"},Ys=function(t){void 0===t&&(t={}),this.max=10,this.type=ht(t.type,"size"),this.scale=ht(t.scale,1),this.size=ht(t.size,1),this.data=ht(t.data,{})};Ys.prototype.atomRadius=function(t){var e;switch(this.type){case"vdw":e=t.vdw;break;case"covalent":e=t.covalent;break;case"bfactor":e=t.bfactor||1;break;case"sstruc":var r=t.sstruc;e="h"===r||"g"===r||"i"===r||"e"===r||"b"===r?.25:Ln.includes(t.atomname)?.4:.1;break;case"data":e=ht(this.data[t.index],1);break;case"explicit":null===(e=t.radius)&&(e=this.size);break;default:e=this.size}return Math.min(e*this.scale,this.max)},Ys.types=Xs;var Ks=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](-1,-1,-1),Zs=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Qs=function(t){var e=t.rows,i=e/3,o=new Ga(e,3),n=new Ga(3,3),a=new Ga(1,3),s=new Ga(3,3),c=new Ga(3,3),u=qa(t);Xa(t,u),Ua(o,t),Ha(n,o,o),Za(n,a,s,c);var h=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](u[0],u[1],u[2]),l=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](s.data[0],s.data[3],s.data[6]),p=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](s.data[1],s.data[4],s.data[7]),d=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](s.data[2],s.data[5],s.data[8]),f=l.clone().multiplyScalar(Math.sqrt(a.data[0]/i)),m=p.clone().multiplyScalar(Math.sqrt(a.data[1]/i)),g=d.clone().multiplyScalar(Math.sqrt(a.data[2]/i));this.begA=h.clone().sub(f),this.endA=h.clone().add(f),this.begB=h.clone().sub(m),this.endB=h.clone().add(m),this.begC=h.clone().sub(g),this.endC=h.clone().add(g),this.center=h,this.vecA=f,this.vecB=m,this.vecC=g,this.normVecA=l,this.normVecB=p,this.normVecC=d};Qs.prototype.getBasisMatrix=function(t){void 0===t&&(t=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]);var e=t;return e.makeBasis(this.normVecB,this.normVecA,this.normVecC),e.determinant()<0&&e.scale(Ks),e},Qs.prototype.getRotationQuaternion=function(t){void 0===t&&(t=new __WEBPACK_IMPORTED_MODULE_1_three__["K" /* Quaternion */]);var e=t;return e.setFromRotationMatrix(this.getBasisMatrix(Zs)),e.inverse()},Qs.prototype.getProjectedScaleForAtoms=function(t){var e=-1/0,i=-1/0,o=-1/0,n=-1/0,a=-1/0,s=-1/0,c=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],u=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],h=this.center,l=this.normVecA,p=this.normVecB,d=this.normVecC;return t.eachAtom((function(t){go(c.copy(t),l,h);var r=u.subVectors(c,h).normalize().dot(l),f=c.distanceTo(h);r>0?f>e&&(e=f):f>i&&(i=f),go(c.copy(t),p,h);var m=u.subVectors(c,h).normalize().dot(p),g=c.distanceTo(h);m>0?g>o&&(o=g):g>n&&(n=g),go(c.copy(t),d,h);var y=u.subVectors(c,h).normalize().dot(d),v=c.distanceTo(h);y>0?v>a&&(a=v):v>s&&(s=v)})),{d1a:e,d2a:o,d3a:a,d1b:-i,d2b:-n,d3b:-s}};var Js=function(t,e,r,i){this.volume=t,this.setFilter(e,r,i)},tc={header:{configurable:!0},matrix:{configurable:!0},normalMatrix:{configurable:!0},inverseMatrix:{configurable:!0},center:{configurable:!0},boundingBox:{configurable:!0},min:{configurable:!0},max:{configurable:!0},mean:{configurable:!0},rms:{configurable:!0}};tc.header.get=function(){return this.volume.header},tc.matrix.get=function(){return this.volume.matrix},tc.normalMatrix.get=function(){return this.volume.normalMatrix},tc.inverseMatrix.get=function(){return this.volume.inverseMatrix},tc.center.get=function(){return this.volume.center},tc.boundingBox.get=function(){return this.volume.boundingBox},tc.min.get=function(){return this.volume.min},tc.max.get=function(){return this.volume.max},tc.mean.get=function(){return this.volume.mean},tc.rms.get=function(){return this.volume.rms},Js.prototype._getFilterHash=function(t,e,r){return JSON.stringify([t,e,r])},Js.prototype.setFilter=function(t,e,r){isNaN(t)&&this.header&&(t=this.header.DMEAN+2*this.header.ARMS),t=void 0===t||isNaN(t)?-1/0:t,e=ht(e,1/0),r=ht(r,!1);var i=this.volume.data,o=this.volume.position,n=this.volume.atomindex,a=this._getFilterHash(t,e,r);if(a!==this._filterHash){if(t===-1/0&&e===1/0)this.data=i,this.position=o,this.atomindex=n;else{var s=i.length;this._dataBuffer||(this._dataBuffer=new ArrayBuffer(4*s),this._positionBuffer=new ArrayBuffer(3*s*4),n&&(this._atomindexBuffer=new ArrayBuffer(4*s)));var c,u=new Float32Array(this._dataBuffer),h=new Float32Array(this._positionBuffer);n&&(c=new Uint32Array(this._atomindexBuffer));for(var l=0,p=0;p=t&&f<=e||r&&(fe)){var m=3*l;u[l]=f,h[m+0]=o[d+0],h[m+1]=o[d+1],h[m+2]=o[d+2],n&&c&&(c[l]=n[p]),l+=1}}this.data=new Float32Array(this._dataBuffer,0,l),this.position=new Float32Array(this._positionBuffer,0,3*l),n&&(this.atomindex=new Int32Array(this._atomindexBuffer,0,l))}this._filterHash=a}},Object.defineProperties(Js.prototype,tc),Js.prototype.getValueForSigma=ds.prototype.getValueForSigma,Js.prototype.getSigmaForValue=ds.prototype.getSigmaForValue,Js.prototype.getDataAtomindex=ds.prototype.getDataAtomindex,Js.prototype.getDataPosition=ds.prototype.getDataPosition,Js.prototype.getDataColor=ds.prototype.getDataColor,Js.prototype.getDataPicking=ds.prototype.getDataPicking,Js.prototype.getDataSize=ds.prototype.getDataSize;var ec=function(t,e){var r=un({nodeArray1:t.atomIndex1,nodeArray2:t.atomIndex2,edgeCount:t.count,nodeCount:e});this.countArray=r.countArray,this.offsetArray=r.offsetArray,this.indexArray=r.indexArray},rc=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_defaultFields:{configurable:!0}};return r._defaultFields.get=function(){return[["atomIndex1",1,"int32"],["atomIndex2",1,"int32"],["bondOrder",1,"int8"]]},e.prototype.addBond=function(t,e,r){this.growIfFull();var i=this.count,o=t.index,n=e.index;o0&&(s[k]=x.angleTo(_));var T=Math.cos(m.angleTo(g));h[k]=180/Math.PI*Math.acos(T);var B=m.length(),D=g.length();c[k]=Math.sqrt(D*B)/Math.max(2,2*(1-T)),u[k]=Math.abs(d.dot(x)),y.copy(m).multiplyScalar(c[k]/B),v.copy(g).multiplyScalar(c[k]/D),y.subVectors(P,y),v.subVectors(I,v),y.toArray(n,M+3),v.toArray(n,M+6),w.subVectors(C,A),w.toArray(l,M),_.copy(x),A.copy(y)}y.fromArray(n,3),v.fromArray(n,6),x.subVectors(y,v).normalize(),C.index=t.getAtomIndexByType(0,S),A.copy(C),b.copy(C),go(b,x,y),b.toArray(n,0),w.subVectors(A,y),w.toArray(l,0),y.fromArray(n,3*i-6),v.fromArray(n,3*i-9),x.subVectors(y,v).normalize(),C.index=t.getAtomIndexByType(i-1,S),A.copy(C),b.copy(C),go(b,x,y),b.toArray(n,3*i-3);for(var E=i-3;Ee||h.bending[$]>t)&&(R=!0)),R){if($-g<4){g=$,R=!1;continue}D.index=T.traceAtomIndex,I=h.axis.subarray(3*g+3,3*$),O=h.center.subarray(3*g,3*$+3),p=mo(I).normalize(),d=mo(O),k.fromArray(O),go(k,p,d),M.fromArray(O,O.length-3),go(M,p,d),p.subVectors(M,k),p.toArray(v,y),d.toArray(b,y),k.toArray(x,y),M.toArray(_,y),f.atomColorToArray(D,w,y),A.push(D.index),S.push(m.atomRadius(D)),C.push(u+g),P.push(u+$+1-g),y+=3,g=$,R=!1}var L=new Float32Array(A);return{axis:new Float32Array(v),center:new Float32Array(b),begin:new Float32Array(x),end:new Float32Array(_),color:new Float32Array(w),picking:new ba(L,s),size:new Float32Array(S),residueOffset:C,residueCount:P}};var uc=function(t){this.scoreFunction=t,this.content=[],this.scoreFunction=t};uc.prototype.push=function(t){this.content.push(t),this.bubbleUp(this.content.length-1)},uc.prototype.pop=function(){var t=this.content[0],e=this.content.pop();return e&&this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t},uc.prototype.peek=function(){return this.content[0]},uc.prototype.remove=function(t){for(var e=this.content.length,r=0;r0;){var r=Math.floor((t+1)/2)-1,i=this.content[r];if(!(this.scoreFunction(e)this.maxDepth&&(this.maxDepth=t);const s=r-i;if(0===s)return-1;const n=4*this.currentNode,o=this.nodes;if(this.currentNode+=1,1===s)return o[n]=i,o[n+1]=-1,o[n+2]=-1,o[n+3]=e,n;const a=this.indices,c=this.points,l=i+Math.floor(s/2),h=t%3;let d,u,m,p,f,g=i,y=r-1;for(;y>g;){for(m=g+y>>1,p=c[3*a[m]+h],u=a[m],a[m]=a[y],a[y]=u,f=g,d=g;d-t[1])),s=this.nodes,n=this.points,o=this.indices,a=c=>{let l,h;const d=this.getNodeDepth(c)%3,u=3*o[s[c]],m=[n[u+0],n[u+1],n[u+2]],p=this.metric(t,m);function f(t,i){r.push([t,i]),r.size()>e&&r.pop()}const g=s[c+1],y=s[c+2];if(-1===y&&-1===g)return void((r.size()n[3*o[s[t]]+r])throw new Error("left child is > parent!");i+=this.verify(a,e+1)}if(-1!==c){if(n[3*o[s[c]]+r]0}isBackbone(){const t=this.residueType.backboneIndexList;return t.length>0&&t.includes(this.index-this.residueAtomOffset)}isPolymer(){if(this.structure.entityList.length>0)return this.entity.isPolymer();{const t=this.residueType.moleculeType;return 3===t||4===t||5===t}}isSidechain(){return this.isPolymer()&&!this.isBackbone()}isCg(){const t=this.residueType.backboneType;return 4===t||5===t||6===t}isTrace(){return this.index===this.residueType.traceAtomIndex+this.residueAtomOffset}isHetero(){return 1===this.residueType.hetero}isProtein(){return 3===this.residueType.moleculeType}isNucleic(){const t=this.residueType.moleculeType;return 4===t||5===t}isRna(){return 4===this.residueType.moleculeType}isDna(){return 5===this.residueType.moleculeType}isWater(){return 1===this.residueType.moleculeType}isIon(){return 2===this.residueType.moleculeType}isSaccharide(){return 6===this.residueType.moleculeType}isHelix(){return Hs.includes(this.sstruc)}isSheet(){return Ws.includes(this.sstruc)}isTurn(){return qs.includes(this.sstruc)&&this.isProtein()}isBonded(){return 0!==this.bondHash.countArray[this.index]}isRing(){return void 0!==this.residueType.getRings().atomRings[this.index-this.residueAtomOffset]}isAromatic(){return 1===this.aromatic}isPolarHydrogen(){let t=!1;return 1!==this.number||(t=!this.hasBondToElement(6)),t}isMetal(){return this.atomType.isMetal()}isNonmetal(){return this.atomType.isNonmetal()}isMetalloid(){return this.atomType.isMetalloid()}isHalogen(){return this.atomType.isHalogen()}isDiatomicNonmetal(){return this.atomType.isDiatomicNonmetal()}isPolyatomicNonmetal(){return this.atomType.isPolyatomicNonmetal()}isAlkaliMetal(){return this.atomType.isAlkaliMetal()}isAlkalineEarthMetal(){return this.atomType.isAlkalineEarthMetal()}isNobleGas(){return this.atomType.isNobleGas()}isTransitionMetal(){return this.atomType.isTransitionMetal()}isPostTransitionMetal(){return this.atomType.isPostTransitionMetal()}isLanthanide(){return this.atomType.isLanthanide()}isActinide(){return this.atomType.isActinide()}getDefaultValence(){return this.atomType.getDefaultValence()}getValenceList(){return this.atomType.getValenceList()}getOuterShellElectronCount(){return this.atomType.getOuterShellElectronCount()}distanceTo(t){const e=this.atomStore,i=t.atomStore,r=this.index,s=t.index,n=e.x[r]-i.x[s],o=e.y[r]-i.y[s],a=e.z[r]-i.z[s],c=n*n+o*o+a*a;return Math.sqrt(c)}connectedTo(t){const e=this.atomStore,i=t.atomStore,r=this.index,s=t.index;if(e.altloc&&i.altloc){const t=e.altloc[r],n=i.altloc[s];if(0!==t&&0!==n&&32!==t&&32!==n&&t!==n)return!1}const n=e.x[r]-i.x[s],o=e.y[r]-i.y[s],a=e.z[r]-i.z[s],c=n*n+o*o+a*a;if(c<48&&this.isCg())return!0;if(isNaN(c))return!1;const l=this.covalent+t.covalent,h=l+.3,d=l-.5;return cd*d}positionFromArray(t,e=0){return this.x=t[e+0],this.y=t[e+1],this.z=t[e+2],this}positionToArray(t=[],e=0){const i=this.index,r=this.atomStore;return t[e+0]=r.x[i],t[e+1]=r.y[i],t[e+2]=r.z[i],t}positionToVector3(t){return void 0===t&&(t=new e),t.x=this.x,t.y=this.y,t.z=this.z,t}positionFromVector3(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}positionAdd(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}positionSub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}getResidueBonds(t=!1){const e=this.residueAtomOffset,i=this.index-this.residueAtomOffset,r=this.residueType.getBonds(),s=r.atomIndices1,n=r.atomIndices2;let o,a,c,l;for(t||(l=[]),o=s.indexOf(i);-1!==o;){if(c=n[o]+e,!l)return c;l.push(c),o=s.indexOf(i,o+1)}for(a=n.indexOf(i);-1!==a;){if(c=s[a]+e,!l)return c;l.push(c),a=n.indexOf(i,a+1)}return l}qualifiedName(t=!1){var e="";return this.resname&&!t&&(e+="["+this.resname+"]"),void 0!==this.resno&&(e+=this.resno),this.inscode&&(e+="^"+this.inscode),this.chainname&&(e+=":"+this.chainname),this.atomname&&(e+="."+this.atomname),this.altloc&&(e+="%"+this.altloc),this.structure.modelStore.count>1&&(e+="/"+this.modelIndex),e}clone(){return new Ma(this.structure,this.index)}toObject(){return{index:this.index,residueIndex:this.residueIndex,resname:this.resname,x:this.x,y:this.y,z:this.z,element:this.element,chainname:this.chainname,resno:this.resno,serial:this.serial,vdw:this.vdw,covalent:this.covalent,hetero:this.hetero,bfactor:this.bfactor,altloc:this.altloc,atomname:this.atomname,modelIndex:this.modelIndex}}}function Ta(t,e){const i=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return i*i+r*r+s*s}function Ba(t,e){return Math.sqrt(Ta(t,e))}const Da=new Float32Array(3);class $a{constructor(t,e=!1){De&&Me.time("Kdtree build");const i=e?Ta:Ba,r=new Float32Array(3*t.atomCount),s=new Uint32Array(t.atomCount);let n=0;t.eachAtom((function(t){r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z,s[n/3]=t.index,n+=3})),this.atomIndices=s,this.points=r,this.kdtree=new ka(r,i),De&&Me.timeEnd("Kdtree build")}nearest(t,i,r){t instanceof e?t.toArray(Da):t instanceof Ma&&t.positionToArray(Da);const s=this.kdtree.nearest(Da,i,r),n=this.kdtree.indices,o=this.kdtree.nodes,a=this.atomIndices,c=[];for(let t=0,e=s.length;t":"3/4-Z","?":"X-Y","@":"Y-X",A:"Z+1/3",B:"Z+2/3",C:"X+2/3",D:"Y+1/3",E:"-Y+2/3",F:"X-Y+1/3",G:"Y-X+2/3",H:"-X+1/3",I:"X+1/3",J:"Y+2/3",K:"-Y+1/3",L:"X-Y+2/3",M:"Y-X+1/3",N:"-X+2/3",O:"2/3+X",P:"1/3+Y",Q:"1/3+Z",R:"2/3-Y",S:"1/3+X-Y",T:"2/3+Y-X",U:"1/3-X",V:"2/3-X",W:"1/3-Y",X:"1/3-Z",Y:"2/3+Y",Z:"1/3+Y-X","[":"2/3+X-Y","]":"1/3+X","^":"2/3+Z",_:"2/3-Z","`":"5/6+Z",a:"1/6+Z",b:"5/6-Z",c:"1/6-Z",d:"Z+5/6",e:"Z+1/6",f:"Z+1/4",g:"+Y"},Ra={"P 1":" !#","P -1":" !#$%&","P 1 2 1":" !#$!&","P 1 21 1":" !#$'&","C 1 2 1":" !#$!&()#*)&","P 1 m 1":" !# %#","P 1 c 1":" !# %+","C 1 m 1":" !# %#()#(,#","C 1 c 1":" !# %+()#(,+","P 1 2/m 1":" !# %#$!&$%&","P 1 21/m 1":" !#$)&$%& ,#","C 1 2/m 1":" !# %#$!&$%&()#(,#*)&*,&","P 1 2/c 1":" !#$!-$%& %+","P 1 21/c 1":" !#$%&$)- ,+","C 1 2/c 1":" !#$!-$%& %+()#*)-*,&(,+","P 2 2 2":" !#$%#$!& %&","P 2 2 21":" !#$%+$!- %&","P 21 21 2":" !#$%#*)&(,&","P 21 21 21":" !#*%+$)-(,&","C 2 2 21":" !#$%+$!- %&()#*,+*)-(,&","C 2 2 2":" !#$%#$!& %&()#*,#*)&(,&","F 2 2 2":" !#$%#$!& %& )+$,+$)- ,-(!+*%+*!-(%-()#*,#*)&(,&","I 2 2 2":" !#$%# %&$!&.'/01/.120'2","I 21 21 21":" !#*%+$)-(,&()+$,#*!& %-","P m m 2":" !#$%# %#$!#","P m c 21":" !#$%+ %+$!#","P c c 2":" !#$%# %+$!+","P m a 2":" !#$%#(%#*!#","P c a 21":" !#$%+(%#*!+","P n c 2":" !#$%# ,+$)+","P m n 21":" !#*%+(%+$!#","P b a 2":" !#$%#(,#*)#","P n a 21":" !#$%+(,#*)+","P n n 2":" !#$%#(,+*)+","C m m 2":" !#$%# %#$!#()#*,#(,#*)#","C m c 21":" !#$%+ %+$!#()#*,+(,+*)#","C c c 2":" !#$%# %+$!+()#*,#(,+*)+","A m m 2":" !#$%# %#$!# )+$,+ ,+$)+","A b m 2":" !#$%# ,#$)# )+$,+ %+$!+","A m a 2":" !#$%#(%#*!# )+$,+(,+*)+","A b a 2":" !#$%#(,#*)# )+$,+(%+*!+","F m m 2":" !#$%# %#$!# )+$,+ ,+$)+(!+*%+(%+*!+()#*,#(,#*)#","F d d 2":" !#$%#345675 )+$,+3896:9(!+*%+;49<79()#*,#;85<:5","I m m 2":" !#$%# %#$!#()+*,+(,+*)+","I b a 2":" !#$%#(,#*)#()+*,+ %+$!+","I m a 2":" !#$%#(%#*!#()+*,+ ,+$)+","P 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#","P 2/n 2/n 2/n":" !#$%#$!& %&*,-()-(,+*)+","P 2/c 2/c 2/m":" !#$%#$!- %-$%& !& %+$!+","P 2/b 2/a 2/n":" !#$%#$!& %&*,&()&(,#*)#","P 21/m 2/m 2/a":" !#*%#$!&(%&$%&(!& %#*!#","P 2/n 21/n 2/a":" !#*%#*)- ,-$%&(!&(,+$)+","P 2/m 2/n 21/a":" !#*%+*!- %&$%&(!-(%+$!#","P 21/c 2/c 2/a":" !#*%#$!-(%-$%&(!& %+*!+","P 21/b 21/a 2/m":" !#$%#*)&(,&$%& !&(,#*)#","P 21/c 21/c 2/n":" !#*,#$)-(%-$%&()& ,+*!+","P 2/b 21/c 21/m":" !#$%+$)- ,&$%& !- ,+$)#","P 21/n 21/n 2/m":" !#$%#*)-(,-$%& !&(,+*)+","P 21/m 21/m 2/n":" !#$%#*'&.,&*,&.'& %#$!#","P 21/b 2/c 21/n":" !#*,+$!-(,&$%&()- %+*)#","P 21/b 21/c 21/a":" !#*%+$)-(,&$%&(!- ,+*)#","P 21/n 21/m 21/a":" !#0%/$'&.12$%&.!2 1#0'/","C 2/m 2/c 21/m":" !#$%+$!- %&$%& !- %+$!#()#*,+*)-(,&*,&()-(,+*)#","C 2/m 2/c 21/a":" !#$,+$)- %&$%& )- ,+$!#()#*%+*!-(,&*,&(!-(%+*)#","C 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#()#*,#*)&(,&*,&()&(,#*)#","C 2/c 2/c 2/m":" !#$%#$!- %-$%& !& %+$!+()#*,#*)-(,-*,&()&(,+*)+","C 2/m 2/m 2/a":" !#$,#$)& %&$%& )& ,#$!#()#*%#*!&(,&*,&(!&(%#*)#","C 2/c 2/c 2/a":" !#*,#$!&(,&$,-(!- ,+*!+()#$%#*)& %&*%- )-(%+$)+","F 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!# )+$,+$)- ,-$,- )- ,+$)+(!+*%+*!-(%-*%-(!-(%+*!+()#*,#*)&(,&*,&()&(,#*)#","F 2/d 2/d 2/d":" !#$%#$!& %&64=37=345675 )+$,+$)- ,-68>3:>3896:9(!+*%+*!-(%-<4>;7>;49<79()#*,#*)&(,&<8=;:=;85<:5","I 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#()+*,+*)-(,-*,-()-(,+*)+","I 2/b 2/a 2/m":" !#$%#*)&(,&$%& !&(,#*)#()+*,+$!- %-*,-()- %+$!+","I 21/b 21/c 21/a":" !#*%+$)-(,&$%&(!- ,+*)#()+$,#*!& %-*,- )&(%#$!+","I 21/m 21/m 21/a":" !#$,#$)& %&$%& )& ,#$!#()+*%+*!-(,-*,-(!-(%+*)+","P 4":" !#$%#% #!$#","P 41":" !#$%+% 5!$9","P 42":" !#$%#% +!$+","P 43":" !#$%+% 9!$5","I 4":" !#$%#% #!$#()+*,+,(+)*+","I 41":" !#*,+%(5)$9()+$%#, 9!*5","P -4":" !#$%#!$&% &","I -4":" !#$%#!$&% &()+*,+)*-,(-","P 4/m":" !#$%#% #!$#$%& !&!$&% &","P 42/m":" !#$%#% +!$+$%& !&!$-% -","P 4/n":" !#$%#,(#)*#*,&()&!$&% &","P 42/n":" !#$%#,(+)*+*,-()-!$&% &","I 4/m":" !#$%#% #!$#$%& !&!$&% &()+*,+,(+)*+*,-()-)*-,(-","I 41/a":" !#*,+%(5)$9$,=(!>!$&,(-()+$%#, 9!*5*%> )=)*-% &","P 4 2 2":" !#$%#% #!$#$!& %&! &%$&","P 4 21 2":" !#$%#,(#)*#*)&(,&! &%$&","P 41 2 2":" !#$%+% 5!$9$!& %-! >%$=","P 41 21 2":" !#$%+,(5)*9*)=(,>! &%$-","P 42 2 2":" !#$%#% +!$+$!& %&! -%$-","P 42 21 2":" !#$%#,(+)*+*)-(,-! &%$&","P 43 2 2":" !#$%+% 9!$5$!& %-! =%$>","P 43 21 2":" !#$%+,(9)*5*)>(,=! &%$-","I 4 2 2":" !#$%#% #!$#$!& %&! &%$&()+*,+,(+)*+*)-(,-)(-,*-","I 41 2 2":" !#*,+%(5)$9*!> ,=)(-%$&()+$%#, 9!*5$)=(%>! &,*-","P 4 m m":" !#$%#% #!$# %#$!#%$#! #","P 4 b m":" !#$%#% #!$#(,#*)#,*#)(#","P 42 c m":" !#$%#% +!$+ %+$!+%$#! #","P 42 n m":" !#$%#,(+)*+(,+*)+%$#! #","P 4 c c":" !#$%#% #!$# %+$!+%$+! +","P 4 n c":" !#$%#% #!$#(,+*)+,*+)(+","P 42 m c":" !#$%#% +!$+ %#$!#%$+! +","P 42 b c":" !#$%#% +!$+(,#*)#,*+)(+","I 4 m m":" !#$%#% #!$# %#$!#%$#! #()+*,+,(+)*+(,+*)+,*+)(+","I 4 c m":" !#$%#% #!$# %+$!+%$+! +()+*,+,(+)*+(,#*)#,*#)(#","I 41 m d":" !#*,+%(5)$9 %#*)+%*5) 9()+$%#, 9!*5(,+$!#,$9!(5","I 41 c d":" !#*,+%(5)$9 %+*)#%*9) 5()+$%#, 9!*5(,#$!+,$5!(9","P -4 2 m":" !#$%#% &!$&$!& %&%$#! #","P -4 2 c":" !#$%#% &!$&$!- %-%$+! +","P -4 21 m":" !#$%#% &!$&*)&(,&,*#)(#","P -4 21 c":" !#$%#% &!$&*)-(,-,*+)(+","P -4 m 2":" !#$%#!$&% & %#$!#! &%$&","P -4 c 2":" !#$%#% &!$& %+$!+! -%$-","P -4 b 2":" !#$%#% &!$&(,#*)#)(&,*&","P -4 n 2":" !#$%#% &!$&(,+*)+)(-,*-","I -4 m 2":" !#$%#% &!$& %#$!#! &%$&()+*,+,(-)*-(,+*)+)(-,*-","I -4 c 2":" !#$%#% &!$& %+$!+! -%$-()+*,+,(-)*-(,#*)#)(&,*&","I -4 2 m":" !#$%#% &!$&$!& %&%$#! #()+*,+,(-)*-*)-(,-,*+)(+","I -4 2 d":" !#$%#% &!$&*!>(%>,$9) 9()+*,+,(-)*-$)= ,=%*5!(5","P 4/m 2/m 2/m":" !#$%#% #!$#$!& %&! &%$&$%& !&!$&% & %#$!#%$#! #","P 4/m 2/c 2/c":" !#$%#% #!$#$!- %-! -%$-$%& !&!$&% & %+$!+%$+! +","P 4/n 2/b 2/m":" !#$%#% #!$#$!& %&! &%$&*,&()&)*&,(&(,#*)#,*#)(#","P 4/n 2/n 2/c":" !#$%#% #!$#$!& %&! &%$&*,-()-)*-,(-(,+*)+,*+)(+","P 4/m 21/b 2/m":" !#$%#% #!$#*)&(,&)(&,*&$%& !&!$&% &(,#*)#,*#)(#","P 4/m 21/n 2/c":" !#$%#% #!$#*)-(,-)(-,*-$%& !&!$&% &(,+*)+,*+)(+","P 4/n 21/m 2/m":" !#$%#,(#)*#*)&(,&! &%$&*,&()&!$&% & %#$!#,*#)(#","P 4/n 2/c 2/c":" !#$%#,(#)*#*)-(,-! -%$-*,&()&!$&% & %+$!+,*+)(+","P 42/m 2/m 2/c":" !#$%#% +!$+$!& %&! -%$-$%& !&!$-% - %#$!#%$+! +","P 42/m 2/c 2/m":" !#$%#% +!$+$!- %-! &%$&$%& !&!$-% - %+$!+%$#! #","P 42/n 2/b 2/c":" !#$%#,(+)*+$!- %-)(&,*&*,-()-!$&% &(,#*)#%$+! +","P 42/n 2/n 2/m":" !#$%#,(+)*+$!& %&)(-,*-*,-()-!$&% &(,+*)+%$#! #","P 42/m 21/b 2/c":" !#$%#% +!$+*)&(,&)(-,*-$%& !&!$-% -(,#*)#,*+)(+","P 42/m 21/n 2/m":" !#$%#,./'*/*'-.,-! &%$&$%& !&'*-,.-.,/*'/%$#! #","P 42/n 21/m 2/c":" !#$%#,(+)*+*)-(,-! &%$&*,-()-!$&% & %#$!#,*+)(+","P 42/n 21/c 2/m":" !#$%#,(+)*+*)&(,&! -%$-*,-()-!$&% & %+$!+,*#)(#","I 4/m 2/m 2/m":" !#$%#% #!$#$!& %&! &%$&$%& !&!$&% & %#$!#%$#! #()+*,+,(+)*+*)-(,-)(-,*-*,-()-)*-,(-(,+*)+,*+)(+","I 4/m 2/c 2/m":" !#$%#% #!$#$!- %-! -%$-$%& !&!$&% & %+$!+%$+! +()+*,+,(+)*+*)&(,&)(&,*&*,-()-)*-,(-(,#*)#,*#)(#","I 41/a 2/m 2/d":" !#*,+%(5)$9*!> ,=)(-%$&$,=(!>!$&,(-(,+$!#,$9!(5()+$%#, 9!*5$)=(%>! &,*-*%> )=)*-% & %#*)+%*5) 9","I 41/a 2/c 2/d":" !#*,+%(5)$9*!= ,>)(&%$-$,=(!>!$&,(-(,#$!+,$5!(9()+$%#, 9!*5$)>(%=! -,*&*%> )=)*-% & %+*)#%*9) 5","P 3":" !#%?#@$#","P 31":" !#%?A@$B","P 32":" !#%?B@$A","H 3":" !#%?#@$#CDAEFAGHAIJBKLBMNB","R 3":" !## !!# ","P -3":" !#%?#@$#$%&!@&? &","H -3":" !#%?#@$#$%&!@&? &OPQRSQTUQVWXYZX[]X]Y^W[^ZV^UR_PT_SO_","R -3":" !## !!# $%&&$%%&$","P 3 1 2":" !#%?#@$#%$&@!& ?&","P 3 2 1":" !#%?#@$#! &?%&$@&","P 31 1 2":" !#%?Q@$^%$_@!X ?&","P 31 2 1":" !#%?A@$B! &?%_$@X","P 32 1 2":" !#%?^@$Q%$X@!_ ?&","P 32 2 1":" !#%?B@$A! &?%X$@_","H 3 2":" !#%?#@$#! &?%&$@&OPQRSQTUQY]X[WXVZX]Y^W[^ZV^PO_SR_UT_","R 3 2":" !## !!# %$&$&%&%$","P 3 m 1":" !#%?#@$#%$#@!# ?#","P 3 1 m":" !#%?#@$#! #?%#$@#","P 3 c 1":" !#%?#@$#%$+@!+ ?+","P 3 1 c":" !#%?#@$#! +?%+$@+","H 3 m":" !#%?#@$#%$#@!# ?#OPQRSQTUQRUQTPQOSQ]Y^W[^ZV^WV^ZY^][^","R 3 m":" !## !!# ! # #!#! ","H 3 c":" !#%?#@$#%$+@!+ ?+OPQRSQTUQRU`TP`OS`]Y^W[^ZV^WVaZYa][a","R 3 c":" !## !!# '././'/'.","P -3 1 2/m":" !#%?#@$#%$&@!& ?&$%&!@&? &! #?%#$@#","P -3 1 2/c":" !#%?#@$#%$-@!- ?-$%&!@&? &! +?%+$@+","P -3 2/m 1":" !#%?#@$#! &?%&$@&$%&!@&? &%$#@!# ?#","P -3 2/c 1":" !#%?#@$#! -?%-$@-$%&!@&? &%$+@!+ ?+","H -3 2/m":" !#%?#@$#! &?%&$@&$%&!@&? &%$#@!# ?#OPQRSQTUQY]X[WXVZXVWXYZX[]XRUQTPQOSQ]Y^W[^ZV^PO_SR_UT_UR_PT_SO_WV^ZY^][^","R -3 2/m":" !## !!# %$&$&%&%$$%&&$%%&$! # #!#! ","H -3 2/c":" !#%?#@$#! -?%-$@-$%&!@&? &%$+@!+ ?+OPQRSQTUQY]b[WbVZbVWXYZX[]XRU`TP`OS`]Y^W[^ZV^POcSRcUTcUR_PT_SO_WVaZYa][a","R -3 2/c":" !## !!# 102021210$%&&$%%&$'././'/'.","P 6":" !#%?#@$#$%#!@#? #","P 61":" !#%?A@$B$%/!@d? e","P 65":" !#%?B@$A$%/!@e? d","P 62":" !#%?^@$Q$%#!@^? Q","P 64":" !#%?Q@$^$%#!@Q? ^","P 63":" !#%?#@$#$%+!@+? +","P -6":" !#%?#@$# !&%?&@$&","P 6/m":" !#%?#@$#$%#!@#? #$%&!@&? & !&%?&@$&","P 63/m":" !#%?#@$#$%+!@+? +$%&!@&? & !-%?-@$-","P 6 2 2":" !#%?#@$#$%#!@#? #! &?%&$@&%$&@!& ?&","P 61 2 2":" !#%?Q@$^$%+!@`? a! X?%&$@_%$b@!- ?c","P 65 2 2":" !#%?^@$Q$%+!@a? `! _?%&$@X%$c@!- ?b","P 62 2 2":" !#%?^@$Q$%#!@^? Q! _?%&$@X%$_@!& ?X","P 64 2 2":" !#%?Q@$^$%#!@Q? ^! X?%&$@_%$X@!& ?_","P 63 2 2":" !#%?#@$#$%+!@+? +! &?%&$@&%$-@!- ?-","P 6 m m":" !#%?#@$#$%#!@#? #%$#@!# ?#! #?%#$@#","P 6 c c":" !#%?#@$#$%#!@#? #%$+@!+ ?+! +?%+$@+","P 63 c m":" !#%?#@$#$%+!@+? +%$+@!+ ?+! #?%#$@#","P 63 m c":" !#%?#@$#$%+!@+? +%$#@!# ?#! +?%+$@+","P -6 m 2":" !#%?#@$# !&%?&@$&%$#@!# ?#%$&@!& ?&","P -6 c 2":" !#%?#@$# !-%?-@$-%$+@!+ ?+%$&@!& ?&","P -6 2 m":" !#%?#@$# !&%?&@$&! &?%&$@&! #?%#$@#","P -6 2 c":" !#%?#@$# !-%?-@$-! &?%&$@&! +?%+$@+","P 6/m 2/m 2/m":" !#%?#@$#$%#!@#? #! &?%&$@&%$&@!& ?&$%&!@&? & !&@$&%?&%$#@!# ?#! #?%#$@#","P 6/m 2/c 2/c":" !#%?#@$#$%#!@#? #! -?%-$@-%$-@!- ?-$%&!@&? & !&@$&%?&%$+@!+ ?+! +?%+$@+","P 63/m 2/c 2/m":" !#%?#@$#$%+!@+? +! -?%-$@-%$&@!& ?&$%&!@&? & !-@$-%?-%$+@!+ ?+! #?%#$@#","P 63/m 2/m 2/c":" !#%?#@$#$%+!@+? +! &?%&$@&%$-@!- ?-$%&!@&? & !-@$-%?-%$#@!# ?#! +?%+$@+","P 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ","F 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-((!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ","I 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-(","P 21 3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(","I 21 3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- ","P 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$","P 2/n -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& *,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*","F 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$ )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-($,- )- ,+$)+&*,&()#(,#*)%-*!-(%+(!+*(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(*%-(!-(%+*!+-$,- )+ ,+$),&*)&(,#()#*()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- *,&()&(,#*)#-*%-(!+(%+*!,-$)- ,+ )+$","F 2/d -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& 64=37=345675=64=375345674=67=3453756 )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(68>3:>3896:9=<8=;:5;85<:4><7>;49;79<(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(<4>;7>;49<79>68>3:93896:8=<:=;85;:5<()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- <8=;:=;8f<:f><4>;79;49<78>6:>3893:96","I 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-(*,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*","P 21/a -3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&($%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*","I 21/a -3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&($%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*()+$,#*g& %-+()#$,&*!- %)+(,#$!&*%- *,- )&(%#$!+-*,& )#(%+$!,-*)& %#(!+$","P 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$","P 42 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*","F 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$ )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(-%*-!*+%(+ +,$+)$-, -)#)*#,(&)(&,*(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&() -,$-)$+, +(#,*#)*&,(&)+!*+%(-!(-%*()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- )(&,*&)*#,(#(+%*+!*-%(-!+)$+, -) -,$","F 41 3 2":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=46 )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<(!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>86","I 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*","P 43 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(7;>46=:<5839398<5:6=4;>75:<983>7;=46","P 41 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<","I 41 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- 7;>46=:<5839398<5:6=4;>75:<983>7;=46","P -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% ","F -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(+%*+!*-%(- +)$+,$-) -,#)(#,*&)*&,((!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&() +,$+)$-, -(#)*#,*&)(&,+!(+%*-!*-%(()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- )(#,*#)*&,(&(+!*+%*-!(-%+) +,$-)$-, ","I -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,(","P -4 3 n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,(","F -4 3 c":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,( )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-() #,$#)$&, &(#!*#%*&!(&%+! +%$-!$-% (!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(!(#%*#!*&%(& +!$+%$-! -%#) #,$&)$&, ()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ! +%$+!$-% - #)$#,$&) &,#!(#%*&!*&%(","I -4 3 d":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(7354<9:6>8;=357<946>:;=857394<>:6=8;()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- :;98657<=43>;9:658<=73>49:;586=7<>43","P 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ","P 4/n -3 2/n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$*,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","P 42/m -3 2/n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","P 42/n -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,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% +!$+%&, &)$#,$#) ()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ! -%$-!$+% + #,$#)$&, &)#!*#%(&!(&%**,&()&(,#*)#-*%-(!+(%+*!,-$)- ,+ )+$%$+! +% -!$-$&) &, #)$#,&%(&!*#%*#!(","F 41/d -3 2/m":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=4664=3:>;85<79=64>3:5;89<74=6:>385;79<,$+! #%(-)*&*&)(-% #!$+,-%(&)*+,$#! )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<68>37=;49<:5=<8>;753496:4><:=;893756,*#!(+% &)$-*-!(&, +)$#%-, &!$+%*#)((!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<<4>;:=389675>68=379;45<:8=<7>;453:96%$#) +,(&!*-$&! -,(#)*+%&% -)$#,*+!(()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>86<8=;7>3456:9><4=;:9385678>67=349;:5<%*+)(#, -!$&$-) &%(+!*#,&,(-!*#%$+) ","F 41/d -3 2/c":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=46<8>;7=3496:5><8=;793456:8><7=;493:56%*#)(+, &!$-$-! &,(+)*#%&, -!$#%*+)( )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<<4=;:>385679>64=3:9;85<78=67>345;:9<%$+) #,(-!*&$&) -%(#!*+,&%(-)*#,$+! (!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<68=37>;45<:9=<4>;:5389674>6:=389;75<,*+!(#% -)$&*-)(&% +!$#,-,(&!*+%$#) ()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>8664>3:=;89<75=68>375;49<:4=<:>;853796,$#! +%(&)*-*&!(-, #)$+%-% &)$+,*#!(","I 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,**,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","I 41/a -3 2/d":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<$%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*4<97358;=:6>6>:;=8357<94=8;>:694<573()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- 7;>46=:<5839398<5:6=4;>75:<983>7;=46*,- )&(%#$!+-*,& )#(%+$!,-*)& %#(!+$865:;943>7<=<=73>4;9:658>43=7<5869:;","P 1 1 2":" !#$%#","P 1 1 21":" !#$%+","B 1 1 2":" !#$%#(g+*%+","A 1 2 1":" !#$!& )+$)-","C 1 21 1":" !#$)&()#*!&","I 1 2 1":" !#$!&.'/0'2","I 1 21 1":" !#$)&.'/0!-","P 1 1 m":" !# !&","P 1 1 b":" !# )&","B 1 1 m":" !# !&(!+(!-","B 1 1 b":" !# )&(!+()-","P 1 1 2/m":" !# !&$%#$%&","P 1 1 21/m":" !#$%+$%& !-","B 1 1 2/m":" !# !&$%#$%&(!+(!-*%+*%-","P 1 1 2/b":" !#$,#$%& )&","P 1 1 21/b":" !#$%&$,+ )-","B 1 1 2/b":" !#$,#$%& )&(!+*,+*%-()-","P 21 2 2":" !#$!&(%&*%#","P 2 21 2":" !# ,&$)&$%#","P 21 21 2 (a)":" !#*,#.%&$'&","P 21 2 21":" !#$!&(%-*%+","P 2 21 21":" !# %&$)-$,+","C 2 2 21a)":" !#*%+(,&$)-()#$,+ %&*!-","C 2 2 2a":" !#*,#.%&$'&()#$%# ,&*!&","F 2 2 2a":" !#*,#.%&$'& '/*%/.12$!2.!/$,/ %20'2.'#$%# 1&0!&","I 2 2 2a":" !#*,#.%&$'&()+$%+*!- ,-","P 21/m 21/m 2/n a":" !#*,#$)&(%&$%&.'& ,#*!#","P 42 21 2a":" !#*,#%.+'$+$'&.%&! -,*-","I 2 3a":" !#*,#.%&$'&!# ,- '&$%/$# !-*!/$%&.%()+$%+ ,-*!-)+(%&(!-*,#*+()&$)#*,- ,"},Ea=/^[1-9]$/;function Fa(t){let e="";return t.length>0&&(e=":"+gt(t).join(" OR :")),new pe(e)}class La{constructor(t=""){this.name=t,this.partList=[]}get type(){return"Assembly"}addPart(t,e){const i=new Na(t,e);return this.partList.push(i),i}getAtomCount(t){return this.partList.reduce(((e,i)=>e+i.getAtomCount(t)),0)}getResidueCount(t){return this.partList.reduce(((e,i)=>e+i.getResidueCount(t)),0)}getInstanceCount(){let t=0;return this.partList.forEach((function(e){t+=e.matrixList.length})),t}isIdentity(t){if(1!==this.partList.length)return!1;const e=this.partList[0];if(1!==e.matrixList.length)return!1;if(!(new i).equals(e.matrixList[0]))return!1;let r=[];return t.eachChain((function(t){r.push(t.chainname)})),r=gt(r),e.chainList.length===r.length}getBoundingBox(t){const e=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */];return this.partList.forEach((function(i){const r=i.getBoundingBox(t);e.expandByPoint(r.min),e.expandByPoint(r.max)})),e}getCenter(t){return this.getBoundingBox(t).getCenter(new e)}getSelection(){let t=[];return this.partList.forEach((function(e){t=t.concat(e.chainList)})),Fa(t)}}class Na{constructor(t=[],e=[]){this.matrixList=t,this.chainList=e}get type(){return"AssemblyPart"}_getCount(t,e){let i=0;return t.eachChain((t=>{(0===this.chainList.length||this.chainList.includes(t.chainname))&&(i+=t[e])})),this.matrixList.length*i}getAtomCount(t){return this._getCount(t,"atomCount")}getResidueCount(t){return this._getCount(t,"residueCount")}getBoundingBox(t){const e=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],i=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],r=this.getSelection(),s=t.getBoundingBox(r);return this.matrixList.forEach((function(t){i.copy(s).applyMatrix4(t),e.expandByPoint(i.min),e.expandByPoint(i.max)})),e}getSelection(){return Fa(this.chainList)}getView(t){const e=this.getSelection();return e?t.getView(e):t}getInstanceList(){const t=[];for(let e=0,i=this.matrixList.length;e0&&this.addResidueType(this.ri-1),l.growIfFull(),l.resno[this.ri]=s,void 0!==o&&(l.sstruc[this.ri]=o.charCodeAt(0)),void 0!==a&&(l.inscode[this.ri]=a.charCodeAt(0)),l.atomOffset[this.ri]=this.ai,l.atomCount[this.ri]=0,l.count+=1,l.chainIndex[this.ri]=this.ci,h.residueCount[this.ci]+=1),c.count+=1,c.residueIndex[this.ai]=this.ri,l.atomCount[this.ri]+=1,this.currentModelindex=t,this.currentChainid=i,this.currentResname=r,this.currentResno=s,this.currentInscode=a,this.currentHetero=n}finalize(){this.previousResname=this.currentResname,this.previousHetero=this.currentHetero,this.ri>-1&&this.addResidueType(this.ri)}}function Va(t,e){if(!e)return;De&&Me.time("assignSecondaryStructure");const i=[];t.eachModel((function(t){t.eachChain((function(t){i.push(t.chainname)}))}));const r=i.slice().sort(),s=[];r.forEach((function(t){s.push(i.indexOf(t))}));const n=e.helices.filter((function(t){return pt(r,t[0])>=0}));n.sort((function(t,e){const i=t[0],n=e[0],o=t[1],a=e[1];if(i===n)return o===a?0:o=0}));a.sort((function(t,e){const i=t[0],n=e[0];if(i===n)return 0;const o=pt(r,i),a=pt(r,n);return s[o]=t.residueCount)continue;o.index=n+s,a.index=n+s+e,c.index=o.traceAtomIndex,l.index=a.traceAtomIndex;const h=c.distanceTo(l);if(Math.abs(h-i[e-2])>r)return!1}return!0},i=function(e,i){return t(e,i,[5.45,5.18,6.37],2.1)},r=function(e,i){return t(e,i,[6.1,10.4,13],1.42)};return function(t){De&&Me.time("calculateSecondaryStructure"),t.eachPolymer((function(t){if(t.residueCount<4)return;if(t.isCg())!function(t){const i=t.residueStore,r=t.residueIndexStart,s=new Pa(t).position,n=new e,o=new e;for(let e=0,a=t.residueCount;e1&&s.bending[e]<20&&(i.sstruc[r+e]="h".charCodeAt(0),i.sstruc[r+e+1]="h".charCodeAt(0))}}(t);else{if(!t.isProtein())return;!function(t){const e=t.residueStore,s=t.residueIndexStart;for(let n=0,o=t.residueCount;n=e;)i=Math.floor(i/e),s+=Ua[i%e],r+=1;return r>=5&&Me.warn("chainname overflow"),s}function Ha(t,e=!1){De&&Me.time("calculateChainnames");let i=!0;if(t.eachChain((function(t){t.chainname&&(i=!1)})),i){const i=t.modelStore,r=t.chainStore,s=t.residueStore,n=function(t,e,n,o){const a=r.count;for(let t=0;t{h.add(e),t.forEach((t=>{h.add(t)}))}))),t.eachResidue((function(t){if(!e&&l){const e=t.atomCount,s=t.atomOffset;if(e>500)return void Me.warn("more than 500 atoms, skip residue for auto-bonding",t.qualifiedName());if("auto"===i&&t.hetero)for(let e=t.atomOffset;e{u.forEach((i=>{e.push(t.clone().multiply(i))}))})),h.addPart(e)}else h.addPart(d);const m=new e,p=new La("SUPERCELL"),f=Array.prototype.concat.call(l(m.set(1,0,0)),l(m.set(0,1,0)),l(m.set(0,0,1)),l(m.set(-1,0,0)),l(m.set(0,-1,0)),l(m.set(0,0,-1)),l(m.set(1,1,0)),l(m.set(1,0,1)),l(m.set(0,1,1)),l(m.set(-1,-1,0)),l(m.set(-1,0,-1)),l(m.set(0,-1,-1)),l(m.set(1,-1,-1)),l(m.set(1,1,-1)),l(m.set(1,-1,1)),l(m.set(-1,1,1)),l(m.set(-1,-1,1)),l(m.set(-1,1,-1)),l(m.set(0,1,-1)),l(m.set(0,-1,1)),l(m.set(1,0,-1)),l(m.set(-1,0,1)),l(m.set(1,-1,0)),l(m.set(-1,1,0)),l(),l(m.set(1,1,1)),l(m.set(-1,-1,-1)));if(t.biomolDict.NCS){const t=[];f.forEach((function(e){u.forEach((function(i){t.push(e.clone().multiply(i))}))})),p.addPart(t)}else p.addPart(f);t.biomolDict.UNITCELL=h,t.biomolDict.SUPERCELL=p,De&&Me.timeEnd("buildUnitcellAssembly")}const Qa=["H","C","O","N","S","P"],Ja=["NA","CL","FE"];function tc(t){let e=t.toUpperCase(),i=0,r=0;for(let t=0;t0)break;++i}else r=t+1;(i>0||r=3&&-1!==Qa.indexOf(e[0])?e[0]:""}function ec(t){const e=t.bondHash,i=e.countArray,r=e.offsetArray,s=e.indexArray,n=t.getBondProxy();t.eachResidue((function(t){const e=t.residueType;if(void 0!==e.bonds)return;var o=t.atomOffset,a=[],c=[],l=[],h={};const d=o+t.atomCount;t.eachAtom((function(t){const e=t.index,u=r[e];for(let t=0,r=i[e];t=d)continue;let i=n.atomIndex2;if(i=d)continue;if(e>i){const t=i;i=e,e=t}const r=e+"|"+i;void 0===h[r]&&(h[r]=!0,a.push(e-o),c.push(i-o),l.push(n.bondOrder))}})),e.bonds={atomIndices1:a,atomIndices2:c,bondOrders:l}}))}function ic(t,...e){De&&Me.time("concatStructures");const i=new Cc(t,""),r=new za(i),s=i.atomStore,n=i.atomMap;s.addField("formalCharge",1,"int8"),s.addField("partialCharge",1,"float32");const o={};let a=0,c=0,l=0;e.forEach((t=>{t.eachAtom((t=>{s.growIfFull(),s.atomTypeId[a]=n.add(t.atomname,t.element),s.x[a]=t.x,s.y[a]=t.y,s.z[a]=t.z,s.serial[a]=t.serial,s.formalCharge[a]=t.formalCharge,s.partialCharge[a]=t.partialCharge,s.altloc[a]=t.altloc,s.occupancy[a]=t.occupancy,s.bfactor[a]=t.bfactor,r.addAtom(t.modelIndex+l,t.chainname,t.chainid,t.resname,t.resno,1===t.hetero,t.sstruc,t.inscode),o[t.index+c]=a,a+=1})),c+=t.atomStore.count,l+=t.modelStore.count}));const h=i.bondStore,d=i.getAtomProxy(),u=i.getAtomProxy();return c=0,e.forEach((t=>{t.eachBond((t=>{d.index=o[t.atomIndex1+c],u.index=o[t.atomIndex2+c],h.addBond(d,u,t.bondOrder)})),c+=t.atomStore.count})),r.finalize(),Ka(i,!0),Ya(i,!0),i.finalizeAtoms(),i.finalizeBonds(),ec(i),De&&Me.timeEnd("concatStructures"),i}const rc=[3,11,19,37,55,87],sc=[4,12,20,38,56,88],nc=[6,15,16,34],oc=[1,7,8,9,17,35,53],ac=[2,10,18,36,54,86],cc=[13,30,31,48,49,50,80,81,82,83,84,85,112],lc=[5,14,32,33,51,52,85],hc=[9,17,35,53,85];class dc{constructor(t,e,i){this.structure=t,this.atomname=e,i=i||tc(e),this.element=i,this.number=Xs[i]||0,this.vdw=Ys[this.number]||2,this.covalent=Ks[this.number]||1.6}getDefaultValence(){const t=Zs[this.number];return t?t[0]:-1}getValenceList(){return Zs[this.number]||[]}getOuterShellElectronCount(){return Qs[this.number]||2}isMetal(){return this.isAlkaliMetal()||this.isAlkalineEarthMetal()||this.isLanthanide()||this.isActinide()||this.isTransitionMetal()||this.isPostTransitionMetal()}isNonmetal(){return this.isDiatomicNonmetal()||this.isPolyatomicNonmetal()||this.isNobleGas()}isMetalloid(){return lc.includes(this.number)}isHalogen(){return hc.includes(this.number)}isDiatomicNonmetal(){return oc.includes(this.number)}isPolyatomicNonmetal(){return nc.includes(this.number)}isAlkaliMetal(){return rc.includes(this.number)}isAlkalineEarthMetal(){return sc.includes(this.number)}isNobleGas(){return ac.includes(this.number)}isTransitionMetal(){const t=this.number;return t>=21&&t<=29||t>=39&&t<=47||t>=72&&t<=79||t>=104&&t<=108}isPostTransitionMetal(){return cc.includes(this.number)}isLanthanide(){return this.number>=57&&this.number<=71}isActinide(){return this.number>=89&&this.number<=103}}class uc{constructor(t){this.structure=t,this.dict={},this.list=[],this.structure=t}add(t,e){const i=function(t,e){return t+"|"+e}(t=t.toUpperCase(),e=e?e.toUpperCase():tc(t));let r=this.dict[i];if(void 0===r){const s=new dc(this.structure,t,e);r=this.list.length,this.dict[i]=r,this.list.push(s)}return r}get(t){return this.list[t]}}class mc{constructor(t,e,i,r,s,n){this.structure=t,this.bondReferenceAtomIndices=[],this.resname=e,this.atomTypeIdList=i,this.hetero=r?1:0,this.chemCompType=s,this.bonds=n,this.atomCount=i.length,this.moleculeType=this.getMoleculeType(),this.backboneType=this.getBackboneType(0),this.backboneEndType=this.getBackboneType(-1),this.backboneStartType=this.getBackboneType(1),this.backboneIndexList=this.getBackboneIndexList();const o=mn[this.backboneType],a=mn[this.backboneStartType],c=mn[this.backboneEndType],l=this.getAtomIndexByName(o.trace);this.traceAtomIndex=st(l,-1);const h=this.getAtomIndexByName(o.direction1);this.direction1AtomIndex=st(h,-1);const d=this.getAtomIndexByName(o.direction2);this.direction2AtomIndex=st(d,-1);const u=this.getAtomIndexByName(a.backboneStart);this.backboneStartAtomIndex=st(u,-1);const m=this.getAtomIndexByName(c.backboneEnd);let p;this.backboneEndAtomIndex=st(m,-1),p=on.includes(e)?this.getAtomIndexByName("N1"):this.getAtomIndexByName("N3"),this.rungEndAtomIndex=st(p,-1)}getBackboneIndexList(){const t=[];let e;switch(this.moleculeType){case 3:e=dn;break;case 4:case 5:e=un;break;default:return t}const i=this.structure.atomMap,r=this.atomTypeIdList;for(let s=0,n=this.atomCount;s500)De&&Me.warn("more than 500 atoms, skip residue for auto-bonding",t.qualifiedName());else if(s>50){const e=new $a(t,!0),s=t.isCg()?1.2:2.3;for(let t=n;t=0||yc(t,e);this.rings={atomRings:t.atomRings,rings:t.rings}}isAromatic(t){return this.aromaticAtoms=this.getAromatic(t),1===this.aromaticAtoms[t.index-t.residueAtomOffset]}calculateAromatic(t){const e=this.aromaticAtoms=new Uint8Array(this.atomCount),i=this.getRings().rings,r=i.map((e=>function(t){if(t.some((t=>!pc.includes(t.number))))return!1;let e=0;const i=new ho(3,t.length),r=i.data;t.forEach((t=>{r[e+0]=t.x,r[e+1]=t.y,r[e+2]=t.z,e+=3}));return new ya(i).vecC.length()this.structure.getAtomProxy(e+t.atomOffset)))))),s=this.aromaticRings=[];i.forEach(((t,i)=>{r[i]&&(s.push(t),t.forEach((t=>e[t]=1)))}))}assignBondReferenceAtomIndices(){const t=this.getBondGraph(),e=this.getRings(),i=e.atomRings,r=e.rings,s=this.bonds,n=s.atomIndices1,o=s.atomIndices2,a=s.bondOrders,c=this.bondReferenceAtomIndices,l=s.atomIndices1.length;c.length=0;for(let e=0;e1)for(let i=0;i1)for(let i=0;i=0;t--)p[f++]=o[t];const g=t.rings.length;for(let e=0;e0?n[c]!==e&&n[e]!==c&&gc(t,e,c):(r[c]=1,s[a++]=c,n[c]=e)}}}const bc=4;class xc{constructor(t){this.structure=t,this.dict={},this.list=[]}add(t,e,i,r="",s){const n=function(t,e,i,r=""){return t+"|"+e.join(",")+"|"+(i?1:0)+"|"+r}(t=t.toUpperCase(),e,i,r);let o=this.dict[n];if(void 0===o){const a=new mc(this.structure,t,e,i,r,s);o=this.list.length,this.dict[n]=o,this.list.push(a)}return o}get(t){return this.list[t]}}class vc{constructor(t,i=0){this.structure=t,this.index=i,this.bondStore=t.bondStore,this._v12=new e,this._v13=new e,this._ap1=this.structure.getAtomProxy(),this._ap2=this.structure.getAtomProxy(),this._ap3=this.structure.getAtomProxy()}get atom1(){return this.structure.getAtomProxy(this.atomIndex1)}get atom2(){return this.structure.getAtomProxy(this.atomIndex2)}get atomIndex1(){return this.bondStore.atomIndex1[this.index]}set atomIndex1(t){this.bondStore.atomIndex1[this.index]=t}get atomIndex2(){return this.bondStore.atomIndex2[this.index]}set atomIndex2(t){this.bondStore.atomIndex2[this.index]=t}get bondOrder(){return this.bondStore.bondOrder[this.index]}set bondOrder(t){this.bondStore.bondOrder[this.index]=t}getOtherAtomIndex(t){return t===this.atomIndex1?this.atomIndex2:this.atomIndex1}getOtherAtom(t){return this.structure.getAtomProxy(this.getOtherAtomIndex(t.index))}getReferenceAtomIndex(){const t=this._ap1,e=this._ap2;if(t.index=this.atomIndex1,e.index=this.atomIndex2,t.residueIndex!==e.residueIndex)return;const i=t.index-t.residueAtomOffset,r=e.index-e.residueAtomOffset,s=t.residueType.getBondReferenceAtomIndex(i,r);if(void 0!==s)return s+t.residueAtomOffset;console.warn("No reference atom found",t.index,e.index)}calculateShiftDir(t=new e){const i=this._ap1,r=this._ap2,s=this._ap3,n=this._v12,o=this._v13;i.index=this.atomIndex1,r.index=this.atomIndex2;const a=this.getReferenceAtomIndex();n.subVectors(i,r).normalize(),void 0!==a?(s.index=a,o.subVectors(i,s)):o.copy(i),o.normalize();let c=n.dot(o);return 1-Math.abs(c)<1e-5&&(o.set(1,0,0),c=n.dot(o),1-Math.abs(c)<1e-5&&(o.set(0,1,0),c=n.dot(o))),t.copy(o.sub(n.multiplyScalar(c))).normalize()}qualifiedName(){return this.atomIndex1+"="+this.atomIndex2}clone(){return new vc(this.structure,this.index)}toObject(){return{atomIndex1:this.atomIndex1,atomIndex2:this.atomIndex2,bondOrder:this.bondOrder}}}class wc{constructor(t,e=0){this.structure=t,this.index=e,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.atomStore=t.atomStore,this.residueMap=t.residueMap,this.atomMap=t.atomMap}get entity(){return this.structure.entityList[this.entityIndex]}get entityIndex(){return this.chainStore.entityIndex[this.chainIndex]}get chain(){return this.structure.getChainProxy(this.chainIndex)}get chainIndex(){return this.residueStore.chainIndex[this.index]}set chainIndex(t){this.residueStore.chainIndex[this.index]=t}get atomOffset(){return this.residueStore.atomOffset[this.index]}set atomOffset(t){this.residueStore.atomOffset[this.index]=t}get atomCount(){return this.residueStore.atomCount[this.index]}set atomCount(t){this.residueStore.atomCount[this.index]=t}get atomEnd(){return this.atomOffset+this.atomCount-1}get modelIndex(){return this.chainStore.modelIndex[this.chainIndex]}get chainname(){return this.chainStore.getChainname(this.chainIndex)}get chainid(){return this.chainStore.getChainid(this.chainIndex)}get resno(){return this.residueStore.resno[this.index]}set resno(t){this.residueStore.resno[this.index]=t}get sstruc(){return this.residueStore.getSstruc(this.index)}set sstruc(t){this.residueStore.setSstruc(this.index,t)}get inscode(){return this.residueStore.getInscode(this.index)}set inscode(t){this.residueStore.setInscode(this.index,t)}get residueType(){return this.residueMap.get(this.residueStore.residueTypeId[this.index])}get resname(){return this.residueType.resname}get hetero(){return this.residueType.hetero}get moleculeType(){return this.residueType.moleculeType}get backboneType(){return this.residueType.backboneType}get backboneStartType(){return this.residueType.backboneStartType}get backboneEndType(){return this.residueType.backboneEndType}get traceAtomIndex(){return this.residueType.traceAtomIndex+this.atomOffset}get direction1AtomIndex(){return this.residueType.direction1AtomIndex+this.atomOffset}get direction2AtomIndex(){return this.residueType.direction2AtomIndex+this.atomOffset}get backboneStartAtomIndex(){return this.residueType.backboneStartAtomIndex+this.atomOffset}get backboneEndAtomIndex(){return this.residueType.backboneEndAtomIndex+this.atomOffset}get rungEndAtomIndex(){return this.residueType.rungEndAtomIndex+this.atomOffset}get x(){let t=0;for(let e=this.atomOffset;e<=this.atomEnd;++e)t+=this.atomStore.x[e];return t/this.atomCount}get y(){let t=0;for(let e=this.atomOffset;e<=this.atomEnd;++e)t+=this.atomStore.y[e];return t/this.atomCount}get z(){let t=0;for(let e=this.atomOffset;e<=this.atomEnd;++e)t+=this.atomStore.z[e];return t/this.atomCount}eachAtom(t,e){const i=this.atomCount,r=this.atomOffset,s=this.structure._ap,n=r+i;if(e&&e.atomOnlyTest){const i=e.atomOnlyTest;for(let e=r;e0)return this.entity.isPolymer();{const t=this.residueType.moleculeType;return 3===t||4===t||5===t}}isHetero(){return 1===this.residueType.hetero}isWater(){return 1===this.residueType.moleculeType}isIon(){return 2===this.residueType.moleculeType}isSaccharide(){return 6===this.residueType.moleculeType}isStandardAminoacid(){return this.residueType.isStandardAminoacid()}isStandardBase(){return this.residueType.isStandardBase()}isHelix(){return Hs.includes(this.sstruc)}isSheet(){return Ws.includes(this.sstruc)}isTurn(){return qs.includes(this.sstruc)&&this.isProtein()}getAtomType(t){return this.atomMap.get(this.atomStore.atomTypeId[t])}getResname1(){return en[this.resname.toUpperCase()]||"X"}getBackboneType(t){switch(t){case-1:return this.residueType.backboneStartType;case 1:return this.residueType.backboneEndType;default:return this.residueType.backboneType}}getAtomIndexByName(t){let e=this.residueType.getAtomIndexByName(t);return void 0!==e&&(e+=this.atomOffset),e}hasAtomWithName(t){return this.residueType.hasAtomWithName(t)}getAtomnameList(){console.warn("getAtomnameList - might be expensive");const t=this.atomCount,e=this.atomOffset,i=new Array(t);for(let r=0;r=e){const e=st(t,this.structure.getResidueProxy());if(e.index=i,e.connectedTo(this))return e}else if(i===e-1){const i=this.chainStore.residueCount[this.chainIndex],r=st(t,this.structure.getResidueProxy());if(r.index=e+i-1,r.connectedTo(this))return r}}getBonds(){return this.residueType.getBonds(this)}getRings(){return this.residueType.getRings()}getAromaticRings(){return this.residueType.getAromaticRings(this)}qualifiedName(t=!1){let e="";return this.resname&&!t&&(e+="["+this.resname+"]"),void 0!==this.resno&&(e+=this.resno),this.inscode&&(e+="^"+this.inscode),this.chain&&(e+=":"+this.chainname),e+="/"+this.modelIndex,e}clone(){return new wc(this.structure,this.index)}toObject(){return{index:this.index,chainIndex:this.chainIndex,atomOffset:this.atomOffset,atomCount:this.atomCount,resno:this.resno,resname:this.resname,sstruc:this.sstruc}}}class Ac{constructor(t,e,i){this.structure=t,this.residueIndexStart=e,this.residueIndexEnd=i,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.atomStore=t.atomStore,this.residueCount=i-e+1;const r=this.structure.getResidueProxy(this.residueIndexStart),s=this.structure.getResidueProxy(this.residueIndexEnd);this.isPrevConnected=void 0!==r.getPreviousConnectedResidue();const n=s.getNextConnectedResidue();this.isNextConnected=void 0!==n,this.isNextNextConnected=void 0!==n&&void 0!==n.getNextConnectedResidue(),this.isCyclic=s.connectedTo(r),this.__residueProxy=this.structure.getResidueProxy()}get chainIndex(){return this.residueStore.chainIndex[this.residueIndexStart]}get modelIndex(){return this.chainStore.modelIndex[this.chainIndex]}get chainname(){return this.chainStore.getChainname(this.chainIndex)}isProtein(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isProtein()}isCg(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isCg()}isNucleic(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isNucleic()}getMoleculeType(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.moleculeType}getBackboneType(t){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.getBackboneType(t)}getAtomIndexByType(t,e){this.isCyclic?-1===t?t=this.residueCount-1:t===this.residueCount&&(t=0):(-1!==t||this.isPrevConnected||(t+=1),t!==this.residueCount||this.isNextNextConnected||(t-=1));const i=this.__residueProxy;let r;switch(i.index=this.residueIndexStart+t,e){case"trace":r=i.traceAtomIndex;break;case"direction1":r=i.direction1AtomIndex;break;case"direction2":r=i.direction2AtomIndex;break;default:r=i.getAtomIndexByName(e)}return r}eachAtom(t,e){this.eachResidue((function(i){i.eachAtom(t,e)}))}eachAtomN(t,e,i){const r=this.residueCount,s=new Array(t);for(let e=0;e1&&t(new Ac(n,i,l.index)),i=r)):(o!==Ns&&l.index-i>1&&t(new Ac(n,i,l.index)),i=r)}r-i>1&&this.structure.getResidueProxy(i).backboneEndType&&t(new Ac(n,i,r))}qualifiedName(){return":"+this.chainname+"/"+this.modelIndex}clone(){return new _c(this.structure,this.index)}toObject(){return{index:this.index,residueOffset:this.residueOffset,residueCount:this.residueCount,chainname:this.chainname}}}class Sc{constructor(t,e=0){this.structure=t,this.index=e,this.modelStore=t.modelStore,this.chainStore=t.chainStore,this.residueStore=t.residueStore}get chainOffset(){return this.modelStore.chainOffset[this.index]}set chainOffset(t){this.modelStore.chainOffset[this.index]=t}get chainCount(){return this.modelStore.chainCount[this.index]}set chainCount(t){this.modelStore.chainCount[this.index]=t}get residueOffset(){return this.chainStore.residueOffset[this.chainOffset]}get atomOffset(){return this.residueStore.atomOffset[this.residueOffset]}get chainEnd(){return this.chainOffset+this.chainCount-1}get residueEnd(){return this.chainStore.residueOffset[this.chainEnd]+this.chainStore.residueCount[this.chainEnd]-1}get atomEnd(){return this.residueStore.atomOffset[this.residueEnd]+this.residueStore.atomCount[this.residueEnd]-1}get residueCount(){return 0===this.chainCount?0:this.residueEnd-this.residueOffset+1}get atomCount(){return 0===this.residueCount?0:this.atomEnd-this.atomOffset+1}eachAtom(t,e){this.eachChain((function(i){i.eachAtom(t,e)}),e)}eachResidue(t,e){this.eachChain((function(i){i.eachResidue(t,e)}),e)}eachPolymer(t,e){if(e&&e.chainOnlyTest){const i=e.chainOnlyTest;this.eachChain((function(r){i(r)&&r.eachPolymer(t,e)}))}else this.eachChain((function(i){i.eachPolymer(t,e)}))}eachChain(t,e){const i=this.chainCount,r=this.chainOffset,s=this.structure._cp,n=r+i;if(e&&e.test){const i=e.chainOnlyTest;if(i)for(let e=r;e{const i=3*e;a.index=t,l&&a.positionToArray(l,i),h&&n.atomColorToArray(a,h,i),d&&(d.array[e]=t),u&&(u[e]=s.atomRadius(a)),m&&(m[e]=t)})),o}getBondData(t){const i=Object.assign({},t);i.colorParams&&(i.colorParams.structure=this.getStructure());const r=i.what,s=st(i.bondSet,this.bondSet),n=st(i.multipleBond,"off"),o="off"!==n,a="offset"===n,c=st(i.bondScale,.4),l=st(i.bondSpacing,1);let h,d;const u={},m=this.getBondProxy();i.bondStore&&(m.bondStore=i.bondStore);const p=this.getAtomProxy(),f=this.getAtomProxy();let g;if(o){const t=m.bondStore.bondOrder;g=0,s.forEach((function(e){g+=t[e]}))}else g=s.getSize();r&&!r.position||(u.position1=new Float32Array(3*g),u.position2=new Float32Array(3*g)),r&&!r.color||!i.colorParams||(u.color=new Float32Array(3*g),u.color2=new Float32Array(3*g),d=Fe.getScheme(i.colorParams)),r&&!r.picking||(u.picking=new Zn(new Float32Array(g),this.getStructure(),i.bondStore)),(!r||r.radius||o&&r.position)&&(h=new pa(i.radiusParams)),r&&!r.radius||(u.radius=new Float32Array(g),i.radius2&&(u.radius2=new Float32Array(g)));const{position1:y,position2:b,color:x,color2:v,picking:w,radius:A,radius2:_}=u;let S,C,P,I,k,M,T=0;const B=new e,D=new e,$=new e;return s.forEach((t=>{if(C=3*T,m.index=t,p.index=m.atomIndex1,f.index=m.atomIndex2,I=m.bondOrder,y)if(o&&I>1){const t=h.atomRadius(p);M=t*c/(.5*I),m.calculateShiftDir($),a?(k=2*l*t,$.multiplyScalar(k),$.negate(),D.subVectors(f,p).multiplyScalar(Math.max(.1,k/1.88)),p.positionToArray(y,C),f.positionToArray(b,C),I>=2&&(B.addVectors(p,$).add(D).toArray(y,C+3),B.addVectors(f,$).sub(D).toArray(b,C+3),I>=3&&(B.subVectors(p,$).add(D).toArray(y,C+6),B.subVectors(f,$).sub(D).toArray(b,C+6)))):(k=(l-c)*t,$.multiplyScalar(k),2===I?(B.addVectors(p,$).toArray(y,C),B.subVectors(p,$).toArray(y,C+3),B.addVectors(f,$).toArray(b,C),B.subVectors(f,$).toArray(b,C+3)):3===I?(p.positionToArray(y,C),B.addVectors(p,$).toArray(y,C+3),B.subVectors(p,$).toArray(y,C+6),f.positionToArray(b,C),B.addVectors(f,$).toArray(b,C+3),B.subVectors(f,$).toArray(b,C+6)):(p.positionToArray(y,C),f.positionToArray(b,C)))}else p.positionToArray(y,C),f.positionToArray(b,C);if(x&&v&&(d.bondColorToArray(m,1,x,C),d.bondColorToArray(m,0,v,C),o&&I>1))for(S=1;S1))for(S=1;S1))for(M=A[T]*c/(a?1:.5*I),S=a?1:0;S1))for(M=_[T]*c/(a?1:.5*I),S=a?1:0;S{const e=t.x,a=t.y,l=t.z;en&&(n=e),a>o&&(o=a),l>c&&(c=l)}),t),e.min.set(i,r,s),e.max.set(n,o,c),De&&Me.timeEnd("getBoundingBox"),e}getPrincipalAxes(t){De&&Me.time("getPrincipalAxes");let e=0;const i=new ho(3,this.atomCount),r=i.data;return this.eachAtom((t=>{r[e+0]=t.x,r[e+1]=t.y,r[e+2]=t.z,e+=3}),t),De&&Me.timeEnd("getPrincipalAxes"),new ya(i)}atomCenter(t){return t?this.getBoundingBox(t).getCenter(new e):this.center.clone()}hasCoords(){if(void 0===this._hasCoords){const t=this.atomStore;this._hasCoords=0!==Di(t.x)||0!==Bi(t.x)||0!==Di(t.y)||0!==Bi(t.y)||0!==Di(t.z)||0!==Bi(t.z)||t.count/this.modelStore.count==1}return this._hasCoords}getSequence(t){const e=[],i=this.getResidueProxy();return this.eachAtom((function(t){i.index=t.residueIndex,t.index===i.traceAtomIndex&&e.push(i.getResname1())}),t),e}getAtomIndices(t){if(t&&t.string){const e=[];return this.eachAtom((function(t){e.push(t.index)}),t),new Uint32Array(e)}{const t={what:{index:!0}};return this.getAtomData(t).index}}getChainnameCount(t){const e=new Set;return this.eachChain((function(t){t.residueCount&&e.add(t.chainname)}),t),e.size}updatePosition(t,e=!0){let i=0;this.eachAtom((function(e){e.positionFromArray(t,i),i+=3}),void 0),this._hasCoords=void 0,e&&this.refreshPosition()}refreshPosition(){this.getBoundingBox(void 0,this.boundingBox),this.boundingBox.getCenter(this.center),this.spatialHash=new Ts(this.atomStore,this.boundingBox),this.signals.refreshed.dispatch(this)}dispose(){this.frames&&(this.frames.length=0),this.boxes&&(this.boxes.length=0),this.bondStore.dispose(),this.backboneBondStore.dispose(),this.rungBondStore.dispose(),this.atomStore.dispose(),this.residueStore.dispose(),this.chainStore.dispose(),this.modelStore.dispose(),delete this.bondSet,delete this.atomSet}}const Pc=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],Ic=[_s,xs,Ss,As,Cs,vs,bs,ws,Is,Ps,ks,Ms],kc={aspectRatio:1.5,sphereDetail:2,radialSegments:50,disableImpostor:!1,openEnded:!1,dashedCylinder:!1,labelParams:{},pointSize:2,sizeAttenuation:!1,useTexture:!0,linewidth:2};class Mc{constructor(t="shape",e={}){this.boundingBox=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],this.bufferList=[],this.meshCount=0,this._primitiveData={},this.name=t,this.parameters=nt(e,kc),Ic.forEach((t=>{Object.keys(t.fields).forEach((e=>{this._primitiveData[t.getShapeKey(e)]=[]})),this._primitiveData[t.getShapeKey("name")]=[]}))}addBuffer(t){this.bufferList.push(t);const e=t.geometry;return e.boundingBox||e.computeBoundingBox(),this.boundingBox.union(e.boundingBox),this}addMesh(t,e,i,r,s){let n;t=Ct(t),e=Ct(e),Array.isArray(i)&&(i=xt(i,t.length)),r&&(r=Ct(r)),n=void 0===r||0==r.length?{position:t,color:e,index:i}:{position:t,color:e,index:i,normal:r};const o=new io(this,Object.assign({serial:this.meshCount,name:s},n)),a=new Uo(Object.assign({picking:o},n));return this.bufferList.push(a),Pc.setFromArray(t),this.boundingBox.union(Pc),this.meshCount+=1,this}addSphere(t,e,i,r){return bs.objectToShape(this,{position:t,color:e,radius:i,name:r}),this}addEllipsoid(t,e,i,r,s,n){return Cs.objectToShape(this,{position:t,color:e,radius:i,majorAxis:r,minorAxis:s,name:n}),this}addTorus(t,e,i,r,s,n){return Ps.objectToShape(this,{position:t,color:e,radius:i,majorAxis:r,minorAxis:s,name:n}),this}addCylinder(t,e,i,r,s){return As.objectToShape(this,{position1:t,position2:e,color:i,radius:r,name:s}),this}addCone(t,e,i,r,s){return Ss.objectToShape(this,{position1:t,position2:e,color:i,radius:r,name:s}),this}addArrow(t,e,i,r,s){return _s.objectToShape(this,{position1:t,position2:e,color:i,radius:r,name:s}),this}addBox(t,e,i,r,s,n){return xs.objectToShape(this,{position:t,color:e,size:i,heightAxis:r,depthAxis:s,name:n}),this}addOctahedron(t,e,i,r,s,n){return vs.objectToShape(this,{position:t,color:e,size:i,heightAxis:r,depthAxis:s,name:n}),this}addTetrahedron(t,e,i,r,s,n){return ws.objectToShape(this,{position:t,color:e,size:i,heightAxis:r,depthAxis:s,name:n}),this}addText(t,e,i,r){return Is.objectToShape(this,{position:t,color:e,size:i,text:r}),this}addPoint(t,e,i){return ks.objectToShape(this,{position:t,color:e,name:i}),this}addWideline(t,e,i,r,s){return this.parameters.linewidth=r,Ms.objectToShape(this,{position1:t,position2:e,color:i,name:s}),this}addLabel(t,e,i,r){return console.warn("Shape.addLabel is deprecated, use .addText instead"),this.addText(t,e,i,r)}getBufferList(){const t=[];return Ic.forEach((e=>{this._primitiveData[e.getShapeKey("color")].length&&t.push(e.bufferFromShape(this,this.parameters))})),this.bufferList.concat(t)}dispose(){this.bufferList.forEach((function(t){t.dispose()})),this.bufferList.length=0,Ic.forEach((t=>{Object.keys(t.fields).forEach((e=>{this._primitiveData[t.getShapeKey(e)].length=0})),this._primitiveData[t.getShapeKey("name")].length=0}))}get center(){return this._center||(this._center=this.boundingBox.getCenter(new e)),this._center}get type(){return"Shape"}}class Tc extends zr{constructor(t,e,i){Array.isArray(t)||(t=[t]),super(t,e,i),this.type="buffer",this.parameters=Object.assign({},this.parameters,{colorScheme:null,colorScale:null,colorValue:null,colorDomain:null,colorMode:null}),this.buffer=t,this.init(i)}init(t){super.init(t),this.build()}create(){this.bufferList.push.apply(this.bufferList,this.buffer)}attach(t){this.bufferList.forEach((t=>{this.viewer.add(t),t.setParameters(this.getBufferParams())})),this.setVisibility(this.visible),t()}}const Bc=new i,Dc=new __WEBPACK_IMPORTED_MODULE_0_three__["y" /* Matrix3 */];class $c extends Uo{constructor(t,e={},i){super(function(t,e){const i=e.attributes.position.array,r=e.index?e.index.array:void 0,s=t.position.length/3,n=i.length/3,o=s*n,a=new Float32Array(3*o),c=new Float32Array(3*o),l=new Float32Array(3*o);let h;return r&&(h=xt(s*r.length,o)),{position:a,color:l,index:h,normal:c,primitiveId:t.primitiveId||Ii(s,n),picking:t.picking}}(t,i),e),this.updateNormals=!1;const r=i.attributes.position.array,s=i.attributes.normal.array,n=i.index?i.index.array:void 0;this.geoPosition=r,this.geoNormal=s,this.geoIndex=n,this.positionCount=t.position.length/3,this.geoPositionCount=r.length/3,this.transformedGeoPosition=new Float32Array(3*this.geoPositionCount),this.transformedGeoNormal=new Float32Array(3*this.geoPositionCount);const o=this.geometry.attributes;if(this.meshPosition=o.position.array,this.meshColor=o.color.array,this.meshNormal=o.normal.array,this.setAttributes(t),n){const t=this.geometry.getIndex();if(!t)return void Me.error("Index is null");this.meshIndex=t.array,this.makeIndex()}}setAttributes(t={},e=!1){const i=this.geometry.attributes;let r,s,n,o,a,c,l,h,d;const u=this.updateNormals;t.position&&(r=t.position,n=this.geoPosition,l=this.meshPosition,a=this.transformedGeoPosition,i.position.needsUpdate=!0,(u||e)&&(o=this.geoNormal,d=this.meshNormal,c=this.transformedGeoNormal,i.normal.needsUpdate=!0)),t.color&&(s=t.color,h=this.meshColor,i.color.needsUpdate=!0);const m=this.positionCount,p=this.geoPositionCount;for(let t=0;t 0.0 ){\ncameraPos = rayDirection * posT + rayOrigin;\ninterior = true;\nflag2 = true;\n}\n#else\nif( calcDepth( cameraPos ) <= 0.0 ){\ncameraPos = rayDirection * posT + rayOrigin;\ninterior = true;\n}\n#endif\ncameraNormal = normalize( cameraPos - cameraSpherePos );\ncameraNormal *= float(!interior) * 2.0 - 1.0;\nreturn !interior;\n}\nvoid main(void){\nbool flag = Impostor( cameraPos, cameraNormal );\n#ifdef NEAR_CLIP\nif( calcClip( cameraPos ) > 0.0 )\ndiscard;\n#endif\ngl_FragDepthEXT = calcDepth( cameraPos );\nif( !flag ){\n#ifdef NEAR_CLIP\nif( flag2 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( clipNear - 0.5 ) ) ) + ( 0.0000001 / vRadius ) );\n}else if( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n#else\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n#endif\n}\nif (gl_FragDepthEXT < 0.0)\ndiscard;\nif (gl_FragDepthEXT > 1.0)\ndiscard;\n#ifdef PICKING\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 vNormal = cameraNormal;\nvec3 vViewPosition = -cameraPos;\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\n#include normal_fragment_begin\n#include lights_physical_fragment\n#include lights_fragment_begin\n#include lights_fragment_end\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\nif( interior ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");class Fc extends Go{constructor(t,e,i={}){super(e,i),this.index=xt(this.indexSize,this.attributeSize),this.makeIndex(),this.initIndex(this.index),this.addAttributes({mapping:{type:t,value:null}}),this.setAttributes({primitiveId:Pi(this.size)})}get attributeSize(){return this.size*this.mappingSize}get indexSize(){return this.size*this.mappingIndicesSize}addAttributes(t){const e={};for(const i in t){const r=t[i];e[i]={type:r.type,value:null}}super.addAttributes(e)}getAttributeIndex(t){return 3*t*this.mappingSize}setAttributes(t){t&&!t.position&&t.position1&&t.position2&&(t.position=Ai(t.position1,t.position2));const e=this.size,i=this.mappingSize,r=this.geometry.attributes;let s,n,o,a,c,l,h;for(const d in t)if("index"!==d&&"picking"!==d){n=t[d],s=r[d],o=s.itemSize,a=s.array;for(let t=0;t0&&this.parameters.alphaTest<=1&&(e.ALPHATEST=this.parameters.alphaTest.toPrecision(2)),e}setUniforms(t){t&&void 0!==t.edgeBleach&&(this.makeTexture(),t.map=this.tex),super.setUniforms(t)}dispose(){super.dispose(),this.tex&&this.tex.dispose()}}je.add("point",Wc);class qc extends zr{constructor(t,e,i){super(t,e,i),this.type="dot",this.parameters=Object.assign({thresholdType:{type:"select",rebuild:!0,options:{value:"value",sigma:"sigma"}},thresholdMin:{type:"number",precision:3,max:1/0,min:-1/0,rebuild:!0},thresholdMax:{type:"number",precision:3,max:1/0,min:-1/0,rebuild:!0},thresholdOut:{type:"boolean",rebuild:!0},dotType:{type:"select",rebuild:!0,options:{"":"",sphere:"sphere",point:"point"}},radiusType:{type:"select",options:{"":"",value:"value","abs-value":"abs-value","value-min":"value-min",deviation:"deviation",size:"size"}},radius:{type:"number",precision:3,max:10,min:.001,property:"size"},scale:{type:"number",precision:3,max:10,min:.001},sphereDetail:!0,disableImpostor:!0,pointSize:{type:"number",precision:1,max:100,min:0,buffer:!0},sizeAttenuation:{type:"boolean",buffer:!0},sortParticles:{type:"boolean",rebuild:!0},useTexture:{type:"boolean",buffer:!0},alphaTest:{type:"range",step:.001,max:1,min:0,buffer:!0},forceTransparent:{type:"boolean",buffer:!0},edgeBleach:{type:"range",step:.001,max:1,min:0,buffer:!0}},this.parameters,{colorScheme:{type:"select",update:"color",options:{"":"",value:"value",uniform:"uniform",random:"random"}}}),t instanceof Eo?(this.surface=void 0,this.volume=new ba(t)):(this.surface=t,this.volume=void 0),this.init(i)}init(t){var e=t||{};e.colorScheme=st(e.colorScheme,"uniform"),e.colorValue=st(e.colorValue,14540253),this.thresholdType=st(e.thresholdType,"sigma"),this.thresholdMin=st(e.thresholdMin,2),this.thresholdMax=st(e.thresholdMax,1/0),this.thresholdOut=st(e.thresholdOut,!1),this.dotType=st(e.dotType,"point"),this.radius=st(e.radius,.1),this.scale=st(e.scale,1),this.pointSize=st(e.pointSize,1),this.sizeAttenuation=st(e.sizeAttenuation,!0),this.sortParticles=st(e.sortParticles,!1),this.useTexture=st(e.useTexture,!1),this.alphaTest=st(e.alphaTest,.5),this.forceTransparent=st(e.forceTransparent,!1),this.edgeBleach=st(e.edgeBleach,0),super.init(e),this.build()}attach(t){this.bufferList.forEach((t=>{this.viewer.add(t)})),this.setVisibility(this.visible),t()}create(){var t={};if(this.volume){var e,i,r=this.volume;"sigma"===this.thresholdType?(e=r.getValueForSigma(this.thresholdMin),i=r.getValueForSigma(this.thresholdMax)):(e=this.thresholdMin,i=this.thresholdMax),r.setFilter(e,i,this.thresholdOut),Object.assign(t,{position:r.getDataPosition(),color:r.getDataColor(this.getColorParams())}),"sphere"===this.dotType&&Object.assign(t,{radius:r.getDataSize(this.radius,this.scale),picking:r.getDataPicking()})}else{var s=this.surface;Object.assign(t,{position:s.getPosition(),color:s.getColor(this.getColorParams())}),"sphere"===this.dotType&&Object.assign(t,{radius:s.getSize(this.radius,this.scale),picking:s.getPicking()})}"sphere"===this.dotType?this.dotBuffer=new Gc(t,this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!1})):this.dotBuffer=new Wc(t,this.getBufferParams({pointSize:this.pointSize,sizeAttenuation:this.sizeAttenuation,sortParticles:this.sortParticles,useTexture:this.useTexture,alphaTest:this.alphaTest,forceTransparent:this.forceTransparent,edgeBleach:this.edgeBleach})),this.bufferList.push(this.dotBuffer)}update(t={}){if(0===this.bufferList.length)return;const e={};t.color&&(this.volume?Object.assign(e,{color:this.volume.getDataColor(this.getColorParams())}):Object.assign(e,{color:this.surface.getColor(this.getColorParams())})),"sphere"===this.dotType&&(t.radius||t.scale)&&(this.volume?Object.assign(e,{radius:this.volume.getDataSize(this.radius,this.scale)}):Object.assign(e,{radius:this.surface.getSize(this.radius,this.scale)})),this.dotBuffer.setAttributes(e)}setParameters(t,e={},i){return t&&void 0!==t.thresholdType&&this.volume instanceof Eo&&("value"===this.thresholdType&&"sigma"===t.thresholdType?(this.thresholdMin=this.volume.getSigmaForValue(this.thresholdMin),this.thresholdMax=this.volume.getSigmaForValue(this.thresholdMax)):"sigma"===this.thresholdType&&"value"===t.thresholdType&&(this.thresholdMin=this.volume.getValueForSigma(this.thresholdMin),this.thresholdMax=this.volume.getValueForSigma(this.thresholdMax)),this.thresholdType=t.thresholdType),t&&void 0!==t.radiusType&&("radius"===t.radiusType?this.radius=.1:this.radius=parseFloat(t.radiusType),e.radius=!0,"sphere"!==this.dotType||Ie&&!this.disableImpostor||(i=!0)),t&&void 0!==t.radius&&(e.radius=!0,"sphere"!==this.dotType||Ie&&!this.disableImpostor||(i=!0)),t&&void 0!==t.scale&&(e.scale=!0,"sphere"!==this.dotType||Ie&&!this.disableImpostor||(i=!0)),super.setParameters(t,e,i),this}}Ve.add("shader/Image.vert","uniform float clipRadius;\nuniform vec3 clipCenter;\nvarying vec2 vUv;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\nvoid main() {\n#include begin_vertex\n#include project_vertex\nvUv = uv;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvViewPosition = -mvPosition.xyz;\n#endif\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n}"),Ve.add("shader/Image.frag","uniform sampler2D map;\nuniform float opacity;\nuniform vec2 mapSize;\nuniform float clipNear;\nuniform float clipRadius;\nvarying vec2 vUv;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#if defined( PICKING )\nuniform sampler2D pickingMap;\nuniform float objectId;\n#else\n#include fog_pars_fragment\n#endif\n#if defined( CUBIC_INTERPOLATION )\n#if defined( CATMULROM_FILTER ) || defined( MITCHELL_FILTER )\n#if defined( CATMULROM_FILTER )\nconst float B = 0.0;\nconst float C = 0.5;\n#elif defined( MITCHELL_FILTER )\nconst float B = 0.333;\nconst float C = 0.333;\n#endif\nfloat filter( float x ){\nfloat f = x;\nif( f < 0.0 ){\nf = -f;\n}\nif( f < 1.0 ){\nreturn ( ( 12.0 - 9.0 * B - 6.0 * C ) * ( f * f * f ) +\n( -18.0 + 12.0 * B + 6.0 *C ) * ( f * f ) +\n( 6.0 - 2.0 * B ) ) / 6.0;\n}else if( f >= 1.0 && f < 2.0 ){\nreturn ( ( -B - 6.0 * C ) * ( f * f * f )\n+ ( 6.0 * B + 30.0 * C ) * ( f *f ) +\n( - ( 12.0 * B ) - 48.0 * C ) * f +\n8.0 * B + 24.0 * C ) / 6.0;\n}else{\nreturn 0.0;\n}\n}\n#elif defined( BSPLINE_FILTER )\nfloat filter( float x ){\nfloat f = x;\nif( f < 0.0 ){\nf = -f;\n}\nif( f >= 0.0 && f <= 1.0 ){\nreturn ( 2.0 / 3.0 ) + ( 0.5 ) * ( f * f * f ) - ( f * f );\n}else if( f > 1.0 && f <= 2.0 ){\nreturn 1.0 / 6.0 * pow( ( 2.0 - f ), 3.0 );\n}\nreturn 1.0;\n}\n#else\nfloat filter( float x ){\nreturn 1.0;\n}\n#endif\nvec4 biCubic( sampler2D tex, vec2 texCoord ){\nvec2 texelSize = 1.0 / mapSize;\ntexCoord -= texelSize / 2.0;\nvec4 nSum = vec4( 0.0 );\nfloat nDenom = 0.0;\nvec2 cell = fract( texCoord * mapSize );\nfor( float m = -1.0; m <= 2.0; ++m ){\nfor( float n = -1.0; n <= 2.0; ++n ){\nvec4 vecData = texture2D(\ntex, texCoord + texelSize * vec2( m, n )\n);\nfloat c = filter( m - cell.x ) * filter( -n + cell.y );\nnSum += vecData * c;\nnDenom += c;\n}\n}\nreturn nSum / nDenom;\n}\n#endif\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\n#if defined( CUBIC_INTERPOLATION )\ngl_FragColor = biCubic( map, vUv );\n#else\ngl_FragColor = texture2D( map, vUv );\n#endif\n#if defined( PICKING )\nif( gl_FragColor.a < 0.3 )\ndiscard;\ngl_FragColor = vec4( texture2D( pickingMap, vUv ).xyz, objectId );\n#else\nif( gl_FragColor.a < 0.01 )\ndiscard;\ngl_FragColor.a *= opacity;\n#include fog_fragment\n#endif\n}");const Xc=new Uint16Array([0,1,2,1,3,2]),Yc=new Float32Array([0,1,0,0,1,1,1,0]),Kc=Object.assign({filter:"nearest",forceTransparent:!0},zo),Zc=Object.assign({filter:{updateShader:!0,uniform:!0}},Vo);class Qc extends Go{constructor(e,i){super({position:e.position,index:Xc,picking:e.picking},i),this.parameterTypes=Zc,this.alwaysTransparent=!0,this.hasWireframe=!1,this.vertexShader="Image.vert",this.fragmentShader="Image.frag";const{imageData:r,width:s,height:n}=e,o=new __WEBPACK_IMPORTED_MODULE_0_three__["l" /* DataTexture */](r,s,n);o.flipY=!0,this.tex=o;const a=r.length,c=new Uint8Array(a);for(let t=0;t>16&255,c[t+1]=e>>8&255,c[t+2]=255&e}const l=new __WEBPACK_IMPORTED_MODULE_0_three__["l" /* DataTexture */](c,s,n);l.flipY=!0,l.minFilter=__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],l.magFilter=__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],this.pickingTex=l,this.addUniforms({map:{value:o},pickingMap:{value:l},mapSize:{value:new t(s,n)}}),this.geometry.setAttribute("uv",new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](Yc,2))}get defaultParameters(){return Kc}getDefines(t){const e=super.getDefines(t),i=this.parameters.filter;return i.startsWith("cubic")&&(e.CUBIC_INTERPOLATION=1,i.endsWith("bspline")?e.BSPLINE_FILTER=1:i.endsWith("catmulrom")?e.CATMULROM_FILTER=1:i.endsWith("mitchell")&&(e.MITCHELL_FILTER=1)),e}updateTexture(){const t=this.tex,e=this.parameters.filter;e.startsWith("cubic")?(t.minFilter=__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],t.magFilter=__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */]):"linear"===e?(t.minFilter=__WEBPACK_IMPORTED_MODULE_0_three__["x" /* LinearFilter */],t.magFilter=__WEBPACK_IMPORTED_MODULE_0_three__["x" /* LinearFilter */]):(t.minFilter=__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */],t.magFilter=__WEBPACK_IMPORTED_MODULE_0_three__["B" /* NearestFilter */]),t.needsUpdate=!0,this.pickingTex.needsUpdate=!0}makeMaterial(){super.makeMaterial(),this.updateTexture();const t=this.material;t.uniforms.map.value=this.tex,t.blending=__WEBPACK_IMPORTED_MODULE_0_three__["D" /* NormalBlending */],t.needsUpdate=!0;const e=this.wireframeMaterial;e.uniforms.map.value=this.tex,e.blending=__WEBPACK_IMPORTED_MODULE_0_three__["D" /* NormalBlending */],e.needsUpdate=!0;const i=this.pickingMaterial;i.uniforms.map.value=this.tex,i.uniforms.pickingMap.value=this.pickingTex,i.blending=__WEBPACK_IMPORTED_MODULE_0_three__["D" /* NormalBlending */],i.needsUpdate=!0}setUniforms(t){t&&void 0!==t.filter&&(this.updateTexture(),t.map=this.tex),super.setUniforms(t)}}class Jc{constructor(t,e){const i=e||{};this.dimension=st(i.dimension,"x"),this.positionType=st(i.positionType,"percent"),this.position=st(i.position,30),this.thresholdType=st(i.thresholdType,"sigma"),this.thresholdMin=st(i.thresholdMin,-1/0),this.thresholdMax=st(i.thresholdMax,1/0),this.normalize=st(i.normalize,!1),this.volume=t}getPositionFromCoordinate(t){const i=this.dimension,r=this.volume,s=r.matrix,n=(new e).setFromMatrixPosition(s)[i],o=(new e).setFromMatrixScale(s)[i];let a;return a="x"===i?r.nx:"y"===i?r.ny:r.nz,Math.round(((t-n)/(a/100)+1)/o)}getData(t){t=t||{};const i=this.volume,r=i.data,s=i.matrix;let n;function o(t){return Math.round(t/100*(n-1))}function a(t,e,r,s){return 3*(r*i.ny*i.nx+e*i.nx+t)+s}n="coordinate"===this.positionType?this.getPositionFromCoordinate(this.position):this.position;const c=new Float32Array(12),l=new e;let h,d,u,m,p,f=0,g=0,y=0,b=i.nx,x=i.ny,v=i.nz;function w(t,e,i,r){l.set(t,e,i).applyMatrix4(s).toArray(c,r)}"x"===this.dimension?(u=o(i.nx),m=i.ny-1,p=i.nz-1,h=i.nz,d=i.ny,f=u,b=f+1,w(u,0,0,0),w(u,m,0,3),w(u,0,p,6),w(u,m,p,9)):"y"===this.dimension?(u=i.nx-1,m=o(i.ny),p=i.nz-1,h=i.nz,d=i.nx,g=m,x=g+1,w(0,m,0,0),w(u,m,0,3),w(0,m,p,6),w(u,m,p,9)):"z"===this.dimension&&(u=i.nx-1,m=i.ny-1,p=o(i.nz),h=i.nx,d=i.ny,y=p,v=y+1,w(0,0,p,0),w(0,m,p,3),w(u,0,p,6),w(u,m,p,9));let A=0,_=0;const S=new Uint8Array(h*d*4),C=new Float32Array(h*d);let P,I;"sigma"===this.thresholdType?(P=i.getValueForSigma(this.thresholdMin),I=i.getValueForSigma(this.thresholdMax)):(P=this.thresholdMin,I=this.thresholdMax);const k=Object.assign({},t.colorParams,{volume:i});this.normalize&&(k.domain=[0,1]);const M=Fe.getScheme(k),T=new Float32Array(3),B=M.getScale();let D,$=0,O=0;if(this.normalize){$=1/0,D=-1/0;for(let t=g;tD&&(D=s)}O=D-$}for(let t=g;tP&&n{this.viewer.add(t)})),this.setVisibility(this.visible),t()}create(){const t=new Jc(this.volume,{positionType:this.positionType,position:this.position,dimension:this.dimension,thresholdType:this.thresholdType,thresholdMin:this.thresholdMin,thresholdMax:this.thresholdMax,normalize:this.normalize}),e=new Qc(t.getData({colorParams:this.getColorParams()}),this.getBufferParams({filter:this.filter}));this.bufferList.push(e)}}function el(t){Me.error(`makeRepresentation: representation type ${t} unknown`)}const il={name:"some element",status:""};class rl{constructor(t,e={}){this.stage=t,this.signals={statusChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],nameChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],disposed:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.parameters=nt(e,this.defaultParameters),this.uuid=Bt()}get defaultParameters(){return il}get name(){return this.parameters.name}setStatus(t){return this.parameters.status=t,this.signals.statusChanged.dispatch(t),this}setName(t){return this.parameters.name=t,this.signals.nameChanged.dispatch(t),this}dispose(){this.signals.disposed.dispatch()}}const sl=Object.assign({visible:!0},il);class nl extends rl{constructor(t,e,i={},r){super(t,Object.assign({name:e.type},i)),this.parent=r,this.signals=Object.assign({visibilityChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],parametersChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.signals),this.setRepresentation(e)}get defaultParameters(){return sl}get visible(){return this.parameters.visible}get type(){return"representation"}getType(){return this.repr.type}setRepresentation(t){this._disposeRepresentation(),this.repr=t,this.stage.tasks.listen(this.repr.tasks),this.updateVisibility()}_disposeRepresentation(){this.repr&&(this.stage.tasks.unlisten(this.repr.tasks),this.repr.dispose())}dispose(){this.parent&&this.parent.hasRepresentation(this)?this.parent.removeRepresentation(this):(this._disposeRepresentation(),this.signals.disposed.dispatch())}setVisibility(t){return this.parameters.visible=t,this.updateVisibility(),this.signals.visibilityChanged.dispatch(this.parameters.visible),this}getVisibility(){return this.parent?this.parent.parameters.visible&&this.parameters.visible:this.parameters.visible}toggleVisibility(){return this.setVisibility(!this.parameters.visible)}updateVisibility(){this.repr.setVisibility(this.getVisibility())}update(t){return this.repr.update(t),this}build(t){return this.repr.build(t),this}setSelection(t){const e=this.repr;return e.setSelection&&e.setSelection(t),this}setParameters(t){return this.repr.setParameters(t),this.signals.parametersChanged.dispatch(this.repr.getParameters()),this}getParameters(){return this.repr.getParameters()}setColor(t){return this.repr.setColor(t),this}}const ol=new i,al=new e,cl={name:"",status:"",visible:!0};class ll{constructor(t,s,n={}){this.stage=t,this.object=s,this.signals={representationAdded:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],representationRemoved:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],visibilityChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],matrixChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],statusChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],nameChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],disposed:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.reprList=[],this.annotationList=[],this.matrix=new i,this.position=new e,this.quaternion=new r,this.scale=new e(1,1,1),this.transform=new i,this.parameters=nt(n,this.defaultParameters),this.uuid=Bt(),this.viewer=t.viewer,this.controls=new ua(this)}get defaultParameters(){return cl}get name(){return this.parameters.name}get status(){return this.parameters.status}get visible(){return this.parameters.visible}setPosition(t){return Array.isArray(t)?this.position.fromArray(t):this.position.copy(t),this.updateMatrix(),this}setRotation(t){if(Array.isArray(t))if(3===t.length){const e=(new __WEBPACK_IMPORTED_MODULE_0_three__["n" /* Euler */]).fromArray(t);this.quaternion.setFromEuler(e)}else this.quaternion.fromArray(t);else t instanceof __WEBPACK_IMPORTED_MODULE_0_three__["n" /* Euler */]?this.quaternion.setFromEuler(t):this.quaternion.copy(t);return this.updateMatrix(),this}setScale(t){return this.scale.set(t,t,t),this.updateMatrix(),this}setTransform(t){return this.transform.copy(t),this.updateMatrix(),this}updateMatrix(){const t=this.getCenterUntransformed(al);this.matrix.makeTranslation(-t.x,-t.y,-t.z),ol.makeRotationFromQuaternion(this.quaternion),this.matrix.premultiply(ol),ol.makeScale(this.scale.x,this.scale.y,this.scale.z),this.matrix.premultiply(ol);const e=this.position;ol.makeTranslation(e.x+t.x,e.y+t.y,e.z+t.z),this.matrix.premultiply(ol),this.matrix.premultiply(this.transform),this.updateRepresentationMatrices(),this.stage.viewer.updateBoundingBox(),this.signals.matrixChanged.dispatch(this.matrix)}updateRepresentationMatrices(){this.reprList.forEach((t=>{t.setParameters({matrix:this.matrix})}))}addAnnotation(t,e,i){const r=new ca(this,t,e,i);return this.annotationList.push(r),r}eachAnnotation(t){this.annotationList.slice().forEach(t)}removeAnnotation(t){const e=this.annotationList.indexOf(t);-1!==e&&(this.annotationList.splice(e,1),t.dispose())}removeAllAnnotations(){this.eachAnnotation((t=>t.dispose())),this.annotationList.length=0}_addRepresentation(t,e,i,r=!1){const s=i||{},n=this.stage.getParameters();s.matrix=this.matrix.clone(),s.quality=s.quality||n.quality,s.disableImpostor=st(s.disableImpostor,!n.impostor),s.useWorker=st(s.useWorker,n.workerDefault),s.visible=st(s.visible,!0);const o=Object.assign({},s,{visible:this.parameters.visible&&s.visible}),a=function(t,e,i,r){var s;if(De&&Me.time("makeRepresentation "+t),e instanceof Cc){if(!(s=Ne.get(t)))return void el(t)}else if(e instanceof Oo)if("surface"===t)s=Yo;else{if("dot"!==t)return void el(t);s=qc}else if(e instanceof Eo)if("surface"===t)s=Yo;else if("dot"===t)s=qc;else{if("slice"!==t)return void el(t);s=tl}else if(e instanceof Mc)s=Tc,e=e.getBufferList();else{if("buffer"!==t)return void Me.error("makeRepresentation: object "+e+" unknown");s=Tc}const n=new s(e,i,r);return De&&Me.timeEnd("makeRepresentation "+t),n}(t,e,this.viewer,o),c=new nl(this.stage,a,s,this);return r||(this.reprList.push(c),this.signals.representationAdded.dispatch(c)),c}addBufferRepresentation(t,e){return this._addRepresentation.call(this,"buffer",t,e)}hasRepresentation(t){return-1!==this.reprList.indexOf(t)}eachRepresentation(t){this.reprList.slice().forEach(t)}removeRepresentation(t){const e=this.reprList.indexOf(t);-1!==e&&(this.reprList.splice(e,1),t.dispose(),this.signals.representationRemoved.dispatch(t))}updateRepresentations(t){this.reprList.forEach((e=>e.update(t))),this.stage.viewer.requestRender()}removeAllRepresentations(){this.eachRepresentation((t=>t.dispose()))}dispose(){this.removeAllAnnotations(),this.removeAllRepresentations(),this.reprList.length=0,this.signals.disposed.dispatch()}setVisibility(t){return this.parameters.visible=t,this.eachRepresentation((t=>t.updateVisibility())),this.eachAnnotation((t=>t.updateVisibility())),this.signals.visibilityChanged.dispatch(t),this}setStatus(t){return this.parameters.status=t,this.signals.statusChanged.dispatch(t),this}setName(t){return this.parameters.name=t,this.signals.nameChanged.dispatch(t),this}getBox(...t){return this.getBoxUntransformed(...t).clone().applyMatrix4(this.matrix)}getCenter(...t){return this.getCenterUntransformed(...t).clone().applyMatrix4(this.matrix)}getZoom(...t){return this.stage.getZoomForBox(this.getBox(...t))}getBoxUntransformed(...t){return new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */]}getCenterUntransformed(...t){return this.getBoxUntransformed().getCenter(new e)}autoView(t){this.stage.animationControls.zoomMove(this.getCenter(),this.getZoom(),st(t,0))}}class hl{constructor(t=[]){this.list=t;const e=t.length;for(let i=0;i0?this.list[0]:void 0}forEach(t){return this.list.forEach(t),this}dispose(){return this.forEach((t=>t.dispose()))}}class dl extends hl{setParameters(t){return this.forEach((e=>e.setParameters(t)))}setVisibility(t){return this.forEach((e=>e.setVisibility(t)))}setSelection(t){return this.forEach((e=>e.setSelection(t)))}setColor(t){return this.forEach((e=>e.setColor(t)))}update(t){return this.forEach((e=>e.update(t)))}build(t){return this.forEach((e=>e.build(t)))}dispose(t){return this.forEach((t=>t.dispose()))}}const ul=Object.assign({defaultStep:1,defaultTimeout:50,defaultInterpolateType:"",defaultInterpolateStep:5,defaultMode:"loop",defaultDirection:"forward",initialFrame:0},il);class ml extends rl{constructor(t,e,i={}){super(t,Object.assign({name:e.name},i)),this.trajectory=e,this.signals=Object.assign(this.signals,{frameChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],playerChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],countChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],parametersChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]}),e.signals.frameChanged.add((t=>{this.signals.frameChanged.dispatch(t)})),e.signals.playerChanged.add((t=>{this.signals.playerChanged.dispatch(t)})),e.signals.countChanged.add((t=>{this.signals.countChanged.dispatch(t)})),void 0!==i.initialFrame&&this.setFrame(i.initialFrame)}get defaultParameters(){return ul}get type(){return"trajectory"}setFrame(t){this.trajectory.setFrame(t)}setParameters(t={}){this.trajectory.setParameters(t),this.signals.parametersChanged.dispatch(t)}dispose(){this.trajectory.dispose(),super.dispose()}}class pl{constructor(t,e){this.name=t,this.path=e,this.coordinates=[],this.boxes=[],this.times=[],this.timeOffset=0,this.deltaTime=1}get type(){return"Frames"}}class fl{constructor(t,e){let r,s;if(this.A=new ho(3,3),this.W=new ho(1,3),this.U=new ho(3,3),this.V=new ho(3,3),this.VH=new ho(3,3),this.R=new ho(3,3),this.tmp=new ho(3,3),this.c=new ho(3,3),t instanceof Cc)r=t.atomCount;else{if(!(t instanceof Float32Array))return;r=t.length/3}if(e instanceof Cc)s=e.atomCount;else{if(!(e instanceof Float32Array))return;s=e.length/3}const n=Math.min(r,s),o=new ho(3,n),a=new ho(3,n);this.coords1t=new ho(n,3),this.coords2t=new ho(n,3),this.transformationMatrix=new i,this.c.data.set([1,0,0,0,1,0,0,0,-1]),this.prepCoords(t,o,n,!1),this.prepCoords(e,a,n,!1),this._superpose(o,a)}_superpose(t,e){this.mean1=fo(t),this.mean2=fo(e),go(t,this.mean1),go(e,this.mean2),uo(this.coords1t,t),uo(this.coords2t,e),mo(this.A,this.coords2t,this.coords1t),wo(this.A,this.W,this.U,this.V),function(t,e){const i=t.data,r=e.data,s=i[4],n=i[8],o=i[5],a=i[7],c=i[0],l=c*s,h=c*o,d=i[3],u=i[1],m=d*u,p=i[2],f=d*p,g=i[6],y=g*u,b=g*p,x=1/(l*n-h*a-m*n+f*a+y*o-b*s);r[0]=(s*n-o*a)*x,r[1]=-(u*n-p*a)*x,r[2]=-(-u*o+p*s)*x,r[3]=-(d*n-o*g)*x,r[4]=(c*n-b)*x,r[5]=-(h-f)*x,r[6]=-(-d*a+s*g)*x,r[7]=-(c*a-y)*x,r[8]=(l-m)*x}(this.V,this.VH),po(this.R,this.U,this.VH),function(t){const e=t.data;return e[0]*e[4]*e[8]-e[0]*e[5]*e[7]-e[3]*e[1]*e[8]+e[3]*e[2]*e[7]+e[6]*e[1]*e[5]-e[6]*e[2]*e[4]}(this.R)<0&&(De&&Me.log("R not a right handed system"),po(this.tmp,this.c,this.VH),po(this.R,this.U,this.tmp));const i=new ho(4,4),r=new ho(4,4),s=new ho(4,4),n=new ho(4,4),o=new ho(4,4),a=new ho(4,4),c=this.R.data,l=this.mean1,h=this.mean2;n.data.set([1,0,0,-l[0],0,1,0,-l[1],0,0,1,-l[2],0,0,0,1]),o.data.set([c[0],c[1],c[2],0,c[3],c[4],c[5],0,c[6],c[7],c[8],0,0,0,0,1]),a.data.set([1,0,0,h[0],0,1,0,h[1],0,0,1,h[2],0,0,0,1]),uo(r,n),mo(i,o,r),uo(s,i),mo(r,a,s),uo(i,r),this.transformationMatrix.elements=i.data}prepCoords(t,e,i,r){let s=0;const n=e.data;let o=3,a=3*i;if(r&&(a=4*i,o=4),t instanceof Cc)t.eachAtom((function(t){s{t!==this&&this.pause()}),this);const i=st(t.frameCount,1);this.traj=t,this.parameters=nt(e,gl),this.parameters.end=Math.min(st(e.end,i-1),i-1),this.parameters.step=st(e.step,Math.ceil((i+1)/100)),this._currentFrame=this.parameters.start,this._direction="bounce"===this.parameters.direction?"forward":this.parameters.direction,t.signals.countChanged.add((t=>{this.parameters.end=Math.min(st(this.parameters.end,t-1),t-1)}),this),this._animate=this._animate.bind(this)}get isRunning(){return this._run}setParameters(t={}){ot(this.parameters,t),void 0!==t.direction&&"bounce"!==this.parameters.direction&&(this._direction=this.parameters.direction)}_animate(){if(!this._run)return;this._currentTime=window.performance.now();const t=this._currentTime-this._previousTime,e=this.parameters.interpolateType?this.parameters.interpolateStep:1,i=this.parameters.timeout/e,r=this.traj;if(r&&r.frameCount&&!r.inProgress&&t>=i)if(this.parameters.interpolateType)if(this._currentStep>this.parameters.interpolateStep&&(this._currentStep=1),1===this._currentStep&&(this._currentFrame=this._nextInterpolated()),r.hasFrame(this._currentFrame)){this._currentStep+=1;const t=this._currentStep/(this.parameters.interpolateStep+1),[e,i,s,n]=this._currentFrame;r.setFrameInterpolated(e,i,s,n,t,this.parameters.interpolateType),this._previousTime=this._currentTime}else r.loadFrame(this._currentFrame);else{const t=this._next();r.hasFrame(t)?(r.setFrame(t),this._previousTime=this._currentTime):r.loadFrame(t)}window.requestAnimationFrame(this._animate)}_next(){const t=this.parameters;let e;return e="forward"===this._direction?this.traj.currentFrame+t.step:this.traj.currentFrame-t.step,(e>t.end||e=t.end?i=t.start:"backward"===t.direction&&e<=t.start&&(i=t.end),this.traj.setFrame(i),this._run=!0,this._animate(),this.signals.startedRunning.dispatch()}}pause(){this._run=!1,this.signals.haltedRunning.dispatch()}stop(){this.pause(),this.traj.setFrame(this.parameters.start)}}class bl{constructor(t,e,i={}){this.signals={countChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],frameChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],playerChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.frameCache={},this.loadQueue={},this.boxCache={},this.pathCache={},this.frameCacheSize=0,this._frameCount=0,this._currentFrame=-1,this._disposed=!1,this.deltaTime=st(i.deltaTime,0),this.timeOffset=st(i.timeOffset,0),this.centerPbc=st(i.centerPbc,!1),this.removePbc=st(i.removePbc,!1),this.removePeriodicity=st(i.removePeriodicity,!1),this.superpose=st(i.superpose,!1),this.name=t.replace(/^.*[\\/]/,""),this.trajPath=t,this.selection=new pe(st(i.sele,"backbone and not hydrogen")),this.selection.signals.stringChanged.add((()=>{this.selectionIndices=this.structure.getAtomIndices(this.selection),this._resetCache(),this._saveInitialCoords(),this.setFrame(this._currentFrame)}))}get frameCount(){return this._frameCount}get currentFrame(){return this._currentFrame}_init(t){this.setStructure(t),this._loadFrameCount(),this.setPlayer(new yl(this))}_loadFrameCount(){}setStructure(t){this.structure=t,this.atomCount=t.atomCount,this.backboneIndices=this._getIndices(new pe("backbone and not hydrogen")),this._makeAtomIndices(),this._saveStructureCoords(),this.selectionIndices=this._getIndices(this.selection),this._resetCache(),this._saveInitialCoords(),this.setFrame(this._currentFrame)}_saveInitialCoords(){this.structure.hasCoords()?(this.initialCoords=new Float32Array(this.structureCoords),this._makeSuperposeCoords()):this.frameCache[0]?(this.initialCoords=new Float32Array(this.frameCache[0]),this._makeSuperposeCoords()):this.loadFrame(0,(()=>this._saveInitialCoords()))}_saveStructureCoords(){this.structureCoords=this.structure.getAtomData({what:{position:!0}}).position}setSelection(t){return this.selection.setString(t),this}_getIndices(t){let e=0;const i=t.test,r=[];return i&&this.structure.eachAtom((t=>{i(t)&&r.push(e),e+=1})),r}_makeSuperposeCoords(){const t=3*this.selectionIndices.length;this.coords1=new Float32Array(t),this.coords2=new Float32Array(t);const e=this.initialCoords,i=this.coords2;for(let r=0;r!!this.frameCache[t])):!!this.frameCache[t]}setFrame(t,e){return void 0===t||(this.inProgress=!0,-1===t||this.frameCache[t]?(this._updateStructure(t),e&&e()):this.loadFrame(t,(()=>{this._updateStructure(t),e&&e()}))),this}_interpolate(t,e,i,r,s,n){const o=this.frameCache;let a;a="spline"===n?function(t,e,i,r,s){const n=t.length,o=new Float32Array(n);for(let a=0;a{this._interpolate(t,e,i,r,s,n),o&&o()})):(this._interpolate(t,e,i,r,s,n),o&&o()),this}loadFrame(t,e){Array.isArray(t)?t.forEach((t=>{this.loadQueue[t]||this.frameCache[t]||(this.loadQueue[t]=!0,this._loadFrame(t,(()=>{delete this.loadQueue[t]})))})):this.loadQueue[t]||this.frameCache[t]||(this.loadQueue[t]=!0,this._loadFrame(t,(()=>{delete this.loadQueue[t],e&&e()})))}_loadFrame(t,e){Me.error("Trajectory._loadFrame not implemented",t,e)}_updateStructure(t){this._disposed?console.error("updateStructure: traj disposed"):(-1===t?this.structureCoords&&this.structure.updatePosition(this.structureCoords):this.structure.updatePosition(this.frameCache[t]),this.structure.trajectory={name:this.trajPath,frame:t},this._currentFrame=t,this.inProgress=!1,this.signals.frameChanged.dispatch(t))}_doSuperpose(t){const e=3*this.selectionIndices.length,i=this.coords1,r=this.coords2;for(let r=0;r0&&this.centerPbc){const t=[e[0],e[4],e[8]],r=function(t,e,i){return[wi(e,i[0],3,0,t),wi(e,i[1],3,1,t),wi(e,i[2],3,2,t)]}(this.backboneIndices,i,t);!function(t,e,i){if(0===i[0]||0===i[8]||0===i[4])return;const r=t.length,s=i[0],n=i[1],o=i[2],a=-e[0]+s+s/2,c=-e[1]+n+n/2,l=-e[2]+o+o/2;for(let e=0;e.5&&(t[s+r]-=e[3*r+r]*Math.round(n))}}(i,e,t)}this.removePbc&&function(t,e){if(0===e[0]||0===e[8]||0===e[4])return;const i=t.length;for(let r=3;r.9*e[3*i+i])if(s>0)for(let s=0;s<3;++s)t[r+s]-=e[3*i+s];else for(let s=0;s<3;++s)t[r+s]+=e[3*i+s]}}(i,e)}this.selectionIndices.length>0&&this.coords1&&this.superpose&&this._doSuperpose(i),this.frameCache[t]=i,this.boxCache[t]=e,this.frameCacheSize+=1}_setFrameCount(t){t!==this._frameCount&&(this._frameCount=t,this.signals.countChanged.dispatch(t))}dispose(){this._resetCache(),this._disposed=!0,this.player&&this.player.stop()}setPlayer(t){this.player=t,this.signals.playerChanged.dispatch(t)}getFrameTime(t){return this.timeOffset+t*this.deltaTime}}class xl extends bl{constructor(t,e,i){const r=i||{};r.timeOffset=st(r.timeOffset,t.timeOffset),r.deltaTime=st(r.deltaTime,t.deltaTime),super("",e,r),this.name=t.name,this.path=t.path,this.frames=t.coordinates,this.boxes=t.boxes,this._init(e)}get type(){return"frames"}_makeAtomIndices(){"StructureView"===this.structure.type?this.atomIndices=this.structure.getAtomIndices():this.atomIndices=void 0}_loadFrame(t,e){let i;const r=this.frames[t];if(this.atomIndices){const t=this.atomIndices,e=t.length;i=new Float32Array(3*e);for(let s=0;s{const s=i.response;if(!s)return void Me.error(`empty arrayBuffer for '${r}'`);const n=new Int32Array(s,0,1)[0],o=new Float32Array(s,8,9),a=new Float32Array(s,44);this._process(t,o,a,n),"function"==typeof e&&e()}),!1),i.send(s)}_loadFrameCount(){const t=new XMLHttpRequest,e=qe.getCountUrl(this.trajPath);t.open("GET",e,!0),t.addEventListener("load",(()=>{this._setFrameCount(parseInt(t.response))}),!1),t.send()}}class Al extends bl{constructor(t,e,i){super("",e,i),this.requestCallback=t,this._init(e)}get type(){return"callback"}_makeAtomIndices(){const t=[];if("StructureView"===this.structure.type){const e=this.structure.getAtomIndices(),i=e.length;let r=e[0],s=e[0];for(let n=1;n{this._process(t,i,r,s),"function"==typeof e&&e()}),t,this.atomIndices)}_loadFrameCount(){this.requestCallback((t=>this._setFrameCount(t)))}}Cc.prototype.getView=function(t){return new _l(this,t)};class _l extends Cc{constructor(t,i){super(),this.structure=t,this.selection=i,this.center=new e,this.boundingBox=new __WEBPACK_IMPORTED_MODULE_0_three__["d" /* Box3 */],this._bp=this.getBondProxy(),this._ap=this.getAtomProxy(),this._rp=this.getResidueProxy(),this._cp=this.getChainProxy(),this.selection&&this.selection.signals.stringChanged.add(this.refresh,this),this.structure.signals.refreshed.add(this.refresh,this),this.refresh()}init(){}get type(){return"StructureView"}get name(){return this.structure.name}get path(){return this.structure.path}get title(){return this.structure.title}get id(){return this.structure.id}get data(){return this.structure.data}get atomSetDict(){return this.structure.atomSetDict}get biomolDict(){return this.structure.biomolDict}get entityList(){return this.structure.entityList}get unitcell(){return this.structure.unitcell}get frames(){return this.structure.frames}get boxes(){return this.structure.boxes}get validation(){return this.structure.validation}get bondStore(){return this.structure.bondStore}get backboneBondStore(){return this.structure.backboneBondStore}get rungBondStore(){return this.structure.rungBondStore}get atomStore(){return this.structure.atomStore}get residueStore(){return this.structure.residueStore}get chainStore(){return this.structure.chainStore}get modelStore(){return this.structure.modelStore}get atomMap(){return this.structure.atomMap}get residueMap(){return this.structure.residueMap}get bondHash(){return this.structure.bondHash}get spatialHash(){return this.structure.spatialHash}get _hasCoords(){return this.structure._hasCoords}set _hasCoords(t){this.structure._hasCoords=t}refresh(){De&&Me.time("StructureView.refresh"),this.atomSetCache={};const t=this.structure;if(this.selection.isAllSelection()&&t!==this&&t.atomSet&&t.bondSet){this.atomSet=t.atomSet.clone(),this.bondSet=t.bondSet.clone();for(let t in this.atomSetDict){const e=this.atomSetDict[t];this.atomSetCache["__"+t]=e.clone()}this.atomCount=t.atomCount,this.bondCount=t.bondCount,this.boundingBox.copy(t.boundingBox),this.center.copy(t.center)}else if(this.selection.isNoneSelection()&&t!==this&&t.atomSet&&t.bondSet){this.atomSet=new Os(t.atomCount),this.bondSet=new Os(t.bondCount);for(let e in this.atomSetDict)this.atomSetCache["__"+e]=new Os(t.atomCount);this.atomCount=0,this.bondCount=0,this.boundingBox.makeEmpty(),this.center.set(0,0,0)}else{this.atomSet=this.getAtomSet(this.selection,!0),t.atomSet&&(this.atomSet=this.atomSet.intersection(t.atomSet)),this.bondSet=this.getBondSet();for(let t in this.atomSetDict){const e=this.atomSetDict[t];this.atomSetCache["__"+t]=e.makeIntersection(this.atomSet)}this.atomCount=this.atomSet.getSize(),this.bondCount=this.bondSet.getSize(),this.boundingBox=this.getBoundingBox(),this.center=this.boundingBox.getCenter(new e)}De&&Me.timeEnd("StructureView.refresh"),this.signals.refreshed.dispatch()}setSelection(t){this.selection=t,this.refresh()}getSelection(t){const e=[];t&&t.string&&e.push(t.string);const i=this.structure.getSelection();i&&i.string&&e.push(i.string),this.selection&&this.selection.string&&e.push(this.selection.string);let r="";return e.length>0&&(r=`( ${e.join(" ) AND ( ")} )`),new pe(r)}getStructure(){return this.structure.getStructure()}eachBond(t,e){this.structure.eachBond(t,this.getSelection(e))}eachAtom(t,e){const i=this.getAtomProxy(),r=this.getAtomSet(e),s=this.atomStore.count;if(r.getSize()=this.V[i][r]?(e="S",this.score=this.S[i][r]):this.V[i][r]>=this.H[i][r]?(e="V",this.score=this.V[i][r]):(e="H",this.score=this.H[i][r]),De&&Me.log("Alignment: SCORE",this.score),De&&Me.log("Alignment: S, V, H",this.S[i][r],this.V[i][r],this.H[i][r]);i>0&&r>0;)"S"===e?this.S[i][r]===this.S[i-1][r-1]+t(i-1,r-1)?(this.ali1=this.seq1[i-1]+this.ali1,this.ali2=this.seq2[r-1]+this.ali2,--i,--r,e="S"):this.S[i][r]===this.V[i][r]?e="V":this.S[i][r]===this.H[i][r]?e="H":(--i,--r):"V"===e?this.V[i][r]===this.V[i-1][r]+this.gapExtensionPenalty?(this.ali1=this.seq1[i-1]+this.ali1,this.ali2="-"+this.ali2,--i,e="V"):this.V[i][r]===this.S[i-1][r]+this.gap(0)?(this.ali1=this.seq1[i-1]+this.ali1,this.ali2="-"+this.ali2,--i,e="S"):--i:"H"===e?this.H[i][r]===this.H[i][r-1]+this.gapExtensionPenalty?(this.ali1="-"+this.ali1,this.ali2=this.seq2[r-1]+this.ali2,--r,e="H"):this.H[i][r]===this.S[i][r-1]+this.gap(0)?(this.ali1="-"+this.ali1,this.ali2=this.seq2[r-1]+this.ali2,--r,e="S"):--r:Me.error("Alignment: no matrix");for(;i>0;)this.ali1=this.seq1[i-1]+this.ali1,this.ali2="-"+this.ali2,--i;for(;r>0;)this.ali1="-"+this.ali1,this.ali2=this.seq2[r-1]+this.ali2,--r;De&&Me.timeEnd("Alignment.trace"),De&&Me.log([this.ali1,this.ali2])}}function kl(t,e,i=!1,r="",s=""){let n,o,a,c,l;if(i){let i=t,h=e;r&&s&&(i=t.getView(new pe(r)),h=e.getView(new pe(s)));const d=i.getSequence(),u=h.getSequence(),m=new Il(d.join(""),u.join(""));let p,f;m.calc(),m.trace(),n=0,o=0,a=m.ali1.length;const g=[],y=[];for(let t=0;tt[e]))}}}(),this.spacefillRepresentation=this.addRepresentation("spacefill",{sele:"none",opacity:Te.opacity,color:Te.color,disablePicking:!0,radiusType:"data"},!0),this.distanceRepresentation=this.addRepresentation("distance",Te,!0),this.angleRepresentation=this.addRepresentation("angle",Te,!0),this.dihedralRepresentation=this.addRepresentation("dihedral",Te,!0),this.measureRepresentations=new dl([this.spacefillRepresentation,this.distanceRepresentation,this.angleRepresentation,this.dihedralRepresentation]),this.setDefaultAssembly(this.parameters.defaultAssembly),this.structure.signals.refreshed.add((()=>{this.updateRepresentations({position:!0})}))}get defaultParameters(){return Ml}get type(){return"structure"}initSelection(t){this.selection=new pe(t),this.structureView=new _l(this.structure,this.selection),this.selection.signals.stringChanged.add((()=>{this.structureView.setSelection(this.selection),this.rebuildRepresentations(),this.rebuildTrajectories()}))}setSelection(t){return this.parameters.sele=t,this.selection.setString(t),this}setDefaultAssembly(t){if(void 0===this.structure.biomolDict[t]&&(t=""),this.parameters.defaultAssembly!==t){const e={defaultAssembly:t};this.reprList.forEach((t=>t.setParameters(e))),this.measureRepresentations.setParameters(e),this.parameters.defaultAssembly=t,this.signals.defaultAssemblyChanged.dispatch(t)}return this}rebuildRepresentations(){this.reprList.forEach((t=>{t.build()})),this.measureRepresentations.build()}rebuildTrajectories(){this.trajList.forEach((t=>{t.trajectory.setStructure(this.structureView)}))}updateRepresentations(t){super.updateRepresentations(t),this.measureRepresentations.update(t)}updateRepresentationMatrices(){super.updateRepresentationMatrices(),this.measureRepresentations.setParameters({matrix:this.matrix})}addRepresentation(t,e={},i=!1){e.defaultAssembly=this.parameters.defaultAssembly;const r=this._addRepresentation(t,this.structureView,e,i);return i||r.signals.parametersChanged.add((()=>this.measureUpdate())),r}addTrajectory(t="",e={}){const i=function(t,e,i){let r;return r=t&&t instanceof pl?new xl(t,e,i):!t&&e.frames?new vl(t,e,i):t&&"function"==typeof t?new Al(t,e,i):new wl(t,e,i),r}(t,this.structureView,e),r=new ml(this.stage,i,e);return this.trajList.push(r),this.signals.trajectoryAdded.dispatch(r),r}removeTrajectory(t){const e=this.trajList.indexOf(t);-1!==e&&this.trajList.splice(e,1),t.dispose(),this.signals.trajectoryRemoved.dispatch(t)}dispose(){this.trajList.slice().forEach((t=>t.dispose())),this.trajList.length=0,this.structure.dispose(),this.measureRepresentations.dispose(),super.dispose()}autoView(t,e){"number"==typeof t&&(e=t,t=""),this.stage.animationControls.zoomMove(this.getCenter(t),this.getZoom(t),st(e,0))}getBoxUntransformed(t){let e;return e=t?this.structureView.getBoundingBox(new pe(t)):this.structureView.boundingBox,e}getCenterUntransformed(t){return t&&"string"==typeof t?this.structure.atomCenter(new pe(t)):this.structure.center}superpose(t,e,i,r){return kl(this.structureView,t.structureView,e,i,r),this.updateRepresentations({position:!0}),this}getMaxRepresentationRadius(t){let e=0;const i=this.structure.getAtomProxy(t);return this.eachRepresentation((t=>{if(t.getVisibility()){const r=t.repr;e=Math.max(r.getAtomRadius(i),e)}})),e}measurePick(t){const e=this.pickBuffer.count;if(this.lastPick===t.index&&e>=1){if(e>1){const t=this.pickBuffer.data,i=this.pickBuffer.data.sort();this.pickDict.has(i)?this.pickDict.del(i):this.pickDict.add(i,t),2===e?this.distanceRepresentation.setParameters({atomPair:this.pickDict.values.filter((t=>2===t.length))}):3===e?this.angleRepresentation.setParameters({atomTriple:this.pickDict.values.filter((t=>3===t.length))}):4===e&&this.dihedralRepresentation.setParameters({atomQuad:this.pickDict.values.filter((t=>4===t.length))})}this.pickBuffer.clear(),this.lastPick=void 0}else this.pickBuffer.has(t.index)||this.pickBuffer.push(t.index),this.lastPick=t.index;this.measureUpdate()}measureClear(){this.pickBuffer.clear(),this.lastPick=void 0,this.spacefillRepresentation.setSelection("none")}measureBuild(){const t=this.measureData();this.distanceRepresentation.setParameters({atomPair:t.distance}),this.angleRepresentation.setParameters({atomTriple:t.angle}),this.dihedralRepresentation.setParameters({atomQuad:t.dihedral})}measureUpdate(){const t=this.pickBuffer.data,e={};t.forEach((t=>{const i=Math.max(.1,this.getMaxRepresentationRadius(t));e[t]=i*(2.3-Rt(.1,2,i))})),this.spacefillRepresentation.setSelection(t.length?"@"+t.join(","):"none"),t.length&&this.spacefillRepresentation.setParameters({radiusData:e})}measureData(){const t=this.pickDict.values;return{distance:t.filter((t=>2===t.length)),angle:t.filter((t=>3===t.length)),dihedral:t.filter((t=>4===t.length))}}removeAllMeasurements(t){const e=this.pickDict,i=e.values,r=function(t){i.filter((e=>e.length===t)).forEach((t=>e.del(t.slice().sort())))};(!t||1&t)&&r(2),(!t||2&t)&&r(3),(!t||4&t)&&r(4),this.measureBuild()}removeMeasurement(t){this.pickDict.del(t.slice().sort()),this.measureBuild()}addMeasurement(t){if(t.length<2||t.length>4)return;const e=t.slice().sort();this.pickDict.has(e)||this.pickDict.add(e,t),this.measureBuild()}}Ue.add("structure",Tl),Ue.add("structureview",Tl);class Bl extends ll{constructor(t,e,i={}){super(t,e,Object.assign({name:e.name},i)),this.surface=e}get type(){return"surface"}addRepresentation(t,e={}){return this._addRepresentation(t,this.surface,e)}getBoxUntransformed(){return this.surface.boundingBox}getCenterUntransformed(){return this.surface.center}dispose(){this.surface.dispose(),super.dispose()}}Ue.add("surface",Bl);class Dl extends ll{constructor(t,e,i={}){super(t,e,Object.assign({name:e.name},i)),this.volume=e}get type(){return"volume"}addRepresentation(t,e={}){return this._addRepresentation(t,this.volume,e)}getBoxUntransformed(){return this.volume.boundingBox}getCenterUntransformed(){return this.volume.center}dispose(){this.volume.dispose(),super.dispose()}}Ue.add("volume",Dl);class $l extends hl{addRepresentation(t,e){return this.forEach((i=>i.addRepresentation(t,e)))}autoView(t){return this.forEach((e=>e.autoView(t)))}}function Ol(t,e){return t instanceof RegExp?null!==e.name.match(t):e.name===t}const Rl=new e,El={impostor:!0,quality:"medium",workerDefault:!0,sampleLevel:0,backgroundColor:"black",rotateSpeed:2,zoomSpeed:1.2,panSpeed:1,clipNear:0,clipFar:100,clipDist:10,clipMode:"scene",clipScale:"relative",fogNear:50,fogFar:100,cameraFov:40,cameraEyeSep:.3,cameraType:"perspective",lightColor:14540253,lightIntensity:1,ambientColor:14540253,ambientIntensity:.2,hoverTimeout:0,tooltip:!0,mousePreset:"default"};class Fl{constructor(t,e={}){this.signals={parametersChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],fullscreenChanged:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],componentAdded:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],componentRemoved:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],clicked:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"],hovered:new __WEBPACK_IMPORTED_MODULE_2_signals__["Signal"]},this.tasks=new ui,this.compList=[],this.defaultFileParams={},this.logList=[],this.viewer=new Ji(t),this.viewer.renderer&&(this.tooltip=document.createElement("div"),Object.assign(this.tooltip.style,{display:"none",position:"fixed",zIndex:"1000000",pointerEvents:"none",backgroundColor:"rgba( 0, 0, 0, 0.6 )",color:"lightgrey",padding:"8px",fontFamily:"sans-serif"}),this.viewer.container.appendChild(this.tooltip),this.mouseObserver=new sr(this.viewer.renderer.domElement),this.viewerControls=new kr(this),this.trackballControls=new gr(this),this.pickingControls=new xr(this),this.animationControls=new Lr(this),this.mouseControls=new Jo(this),this.keyControls=new ia(this),this.pickingBehavior=new ra(this),this.mouseBehavior=new sa(this),this.animationBehavior=new na(this),this.keyBehavior=new aa(this),this.spinAnimation=this.animationControls.spin([0,1,0],.005),this.spinAnimation.pause(!0),this.rockAnimation=this.animationControls.rock([0,1,0],.005),this.rockAnimation.pause(!0),this.parameters=nt(e,El),this.setParameters(this.parameters),this.viewer.animate())}setParameters(t={}){ot(this.parameters,t);const e=t,i=this.parameters,r=this.viewer,s=this.trackballControls;return void 0!==e.quality&&this.setQuality(i.quality),void 0!==e.impostor&&this.setImpostor(i.impostor),void 0!==e.rotateSpeed&&(s.rotateSpeed=i.rotateSpeed),void 0!==e.zoomSpeed&&(s.zoomSpeed=i.zoomSpeed),void 0!==e.panSpeed&&(s.panSpeed=i.panSpeed),void 0!==e.mousePreset&&this.mouseControls.preset(i.mousePreset),this.mouseObserver.setParameters({hoverTimeout:i.hoverTimeout}),r.setClip(i.clipNear,i.clipFar,i.clipDist,i.clipMode,i.clipScale),r.setFog(void 0,i.fogNear,i.fogFar),r.setCamera(i.cameraType,i.cameraFov,i.cameraEyeSep),r.setSampling(i.sampleLevel),r.setBackground(i.backgroundColor),r.setLight(i.lightColor,i.lightIntensity,i.ambientColor,i.ambientIntensity),this.signals.parametersChanged.dispatch(this.getParameters()),this}log(t){console.log("STAGE LOG",t),this.logList.push(t)}getParameters(){return Object.assign({},this.parameters)}defaultFileRepresentation(t){if(t instanceof Tl){let e,i,r;t.setSelection("/0");const s=t.structure;if(s.biomolDict.BU1){const n=s.biomolDict.BU1;e=n.getAtomCount(s),i=n.getResidueCount(s),r=n.getInstanceCount(),t.setDefaultAssembly("BU1")}else e=s.getModelProxy(0).atomCount,i=s.getModelProxy(0).residueCount,r=1;let n=e;Se&&(n*=4);const o=s.atomStore.count/s.residueStore.count<2;o&&(n*=10);let a="chainname",c="RdYlBu",l=!1;if(1===s.getChainnameCount(new pe("polymer and /0"))&&(a="residueindex",c="Spectral",l=!0),De&&console.log(n,e,r,o),i/r<4)t.addRepresentation("ball+stick",{colorScheme:"element",radiusScale:2,aspectRatio:1.5,bondScale:.3,bondSpacing:.75,quality:"auto"});else if(r>5&&n>15e3||n>7e5){let e=Math.min(2,Math.max(.1,6e3/(n/r)));o&&(e=Math.min(e,.5)),t.addRepresentation("surface",{colorScheme:a,colorScale:c,colorReverse:l,sele:"polymer",surfaceType:"av",probeRadius:1.4,scaleFactor:e,useWorker:!1})}else n>25e4?t.addRepresentation("backbone",{colorScheme:a,colorScale:c,colorReverse:l,lineOnly:!0}):n>1e5?t.addRepresentation("backbone",{colorScheme:a,colorScale:c,colorReverse:l,quality:"low",disableImpostor:!0,radiusScale:2}):n>8e4?t.addRepresentation("backbone",{colorScheme:a,colorScale:c,colorReverse:l,radiusScale:2}):(t.addRepresentation("cartoon",{colorScheme:a,colorScale:c,colorReverse:l,radiusScale:.7,aspectRatio:5,quality:"auto"}),n<5e4&&t.addRepresentation("base",{colorScheme:a,colorScale:c,colorReverse:l,quality:"auto"}),t.addRepresentation("ball+stick",{sele:"ligand",colorScheme:"element",radiusScale:2,aspectRatio:1.5,bondScale:.3,bondSpacing:.75,quality:"auto"}));t.structure.frames.length&&t.addTrajectory()}else(t instanceof Bl||t instanceof Dl)&&t.addRepresentation("surface");this.tasks.onZeroOnce(this.autoView,this)}loadFile(t,e={}){const i=Object.assign({},this.defaultFileParams,e),r=ri(t).name;this.tasks.increment(),this.log(`loading file '${r}'`);const s=st(i.ext,ri(t).ext);let n;return n=ze.isTrajectory(s)?Promise.reject(new Error(`loadFile: ext '${s}' is a trajectory and must be loaded into a structure component`)):ni(t,i),n.then((t=>{this.log(`loaded '${r}'`);const e=this.addComponentFromObject(t,i);return i.defaultRepresentation&&this.defaultFileRepresentation(e),this.tasks.decrement(),e}),(t=>{this.tasks.decrement();const e=`error loading file: '${t}'`;throw this.log(e),e}))}loadScript(t){const e=ri(t).name;return this.log(`loading script '${e}'`),ni(t).then((t=>{this.tasks.increment(),this.log(`running script '${e}'`),t.run(this).then((()=>{this.tasks.decrement(),this.log(`finished script '${e}'`)})),this.log(`called script '${e}'`)}),(t=>{this.tasks.decrement();const i=`errored script '${e}' "${t}"`;throw this.log(i),i}))}addComponent(t){t?(this.compList.push(t),this.signals.componentAdded.dispatch(t)):Me.warn("Stage.addComponent: no component given")}addComponentFromObject(t,e={}){const i=Ue.get(t.type);if(i){const r=new i(this,t,e);return this.addComponent(r),r}Me.warn("no component for object type",t.type)}removeComponent(t){const e=this.compList.indexOf(t);-1!==e&&(this.compList.splice(e,1),t.dispose(),this.signals.componentRemoved.dispatch(t))}removeAllComponents(){this.compList.slice().forEach((t=>this.removeComponent(t)))}handleResize(){this.viewer.handleResize()}setSize(t,e){const i=this.viewer.container;i!==document.body&&(void 0!==t&&(i.style.width=t),void 0!==e&&(i.style.height=e),this.handleResize())}toggleFullscreen(t){if(!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled))return void Me.log("fullscreen mode (currently) not possible");const e=this;function i(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement}function r(){if(!i()&&e.lastFullscreenElement){const t=e.lastFullscreenElement;t.style.width=t.dataset.normalWidth||"",t.style.height=t.dataset.normalHeight||"",document.removeEventListener("fullscreenchange",r),document.removeEventListener("mozfullscreenchange",r),document.removeEventListener("webkitfullscreenchange",r),document.removeEventListener("MSFullscreenChange",r),e.handleResize(),e.signals.fullscreenChanged.dispatch(!1)}}t=t||this.viewer.container,this.lastFullscreenElement=t,i()?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():(t.dataset.normalWidth=t.style.width||"",t.dataset.normalHeight=t.style.height||"",t.style.width=window.screen.width+"px",t.style.height=window.screen.height+"px",t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen(),document.addEventListener("fullscreenchange",r),document.addEventListener("mozfullscreenchange",r),document.addEventListener("webkitfullscreenchange",r),document.addEventListener("MSFullscreenChange",r),this.handleResize(),this.signals.fullscreenChanged.dispatch(!0),setTimeout((function(){e.handleResize()}),100))}setSpin(t){t?(this.spinAnimation.resume(!0),this.rockAnimation.pause(!0)):this.spinAnimation.pause(!0)}setRock(t){t?(this.rockAnimation.resume(!0),this.spinAnimation.pause(!0)):this.rockAnimation.pause(!0)}toggleSpin(){this.setSpin(this.spinAnimation.paused)}toggleRock(){this.setRock(this.rockAnimation.paused)}getFocus(){const t=this.parameters;if("scene"!==t.clipMode)return 0;let e=t.clipNear;return"absolute"===t.clipScale&&(e=this.viewer.absoluteToRelative(e)),2*e}setFocus(t){if("scene"!==this.parameters.clipMode)return;let e,i,r,s;"relative"===this.parameters.clipScale?(e=Dt(t/2,0,49.9),i=100-e,r=50,s=function(t){return Dt(t,0,100)}(2*i-50)):(e=this.viewer.relativeToAbsolute(t/2),i=e,r=0,s=2*i),this.setParameters({clipNear:e,clipFar:i,fogNear:r,fogFar:s})}getZoomForBox(t){const e=t.getSize(Rl),i=Math.max(e.x,e.y,e.z),r=Math.min(e.x,e.y,e.z);let s=i+Math.sqrt(r);const n=kt(this.viewer.perspectiveCamera.fov),o=this.viewer.width,a=this.viewer.height,c=a{this.tasks.onZeroOnce((()=>{this.tasks.increment(),this.viewer.makeImage(t).then((t=>{this.tasks.decrement(),e(t)})).catch((t=>{this.tasks.decrement(),i(t)}))}))}))}setImpostor(t){this.parameters.impostor=t;const e=["spacefill","ball+stick","licorice","hyperball","backbone","rocket","helixorient","contact","distance","dot"];this.eachRepresentation((function(i){if(!e.includes(i.getType()))return;const r=i.getParameters();r.disableImpostor=!t,i.build(r)}))}setQuality(t){this.parameters.quality=t;const e=["tube","cartoon","ribbon","trace","rope"],i=["spacefill","ball+stick","licorice","hyperball","backbone","rocket","helixorient","contact","distance","dot"];this.eachRepresentation((function(r){const s=r.getParameters();if(!e.includes(r.getType())){if(!i.includes(r.getType()))return;if(!s.disableImpostor)return void(r.repr.quality=t)}s.quality=t,r.build(s)}))}eachComponent(t,e){this.compList.slice().forEach((i=>{void 0!==e&&e!==i.type||t(i)}))}eachRepresentation(t,e){this.eachComponent((i=>{i.reprList.slice().forEach((r=>{void 0!==e&&e!==r.getType()||t(r,i)}))}))}getComponentsByName(t){const e=[];return this.eachComponent((i=>{(void 0===t||Ol(t,i))&&e.push(i)})),new $l(e)}getComponentsByObject(t){const e=[];return this.eachComponent((i=>{i.object===t&&e.push(i)})),new $l(e)}getRepresentationsByName(t){const e=[];return this.eachRepresentation(((i,r)=>{(void 0===t||Ol(t,i))&&e.push(i)})),new dl(e)}measureClear(){this.eachComponent((t=>t.measureClear()),"structure")}measureUpdate(){this.eachComponent((t=>t.measureUpdate()),"structure")}dispose(){this.tasks.dispose(),this.viewer.dispose(),this.mouseObserver.dispose()}}class Ll extends ll{constructor(t,e,i={}){super(t,e,Object.assign({name:e.name},i)),this.shape=e}get type(){return"shape"}addRepresentation(t,e={}){return this._addRepresentation(t,this.shape,e)}getBoxUntransformed(){return this.shape.boundingBox}getCenterUntransformed(){return this.shape.center}dispose(){this.shape.dispose(),super.dispose()}}function Nl(t,e,i,r){var s,n=arguments.length,o=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o}Ue.add("shape",Ll);class zl extends zt{constructor(t){super(t),t.scale||(this.parameters.scale="rainbow",this.parameters.reverse=st(t.reverse,!0)),this.scalePerModel={},t.structure.eachModel((t=>{this.parameters.domain=[t.atomOffset,t.atomEnd],this.scalePerModel[t.index]=this.getScale()}))}atomColor(t){return this.scalePerModel[t.modelIndex](t.index)}}Nl([Nt],zl.prototype,"atomColor",null),Fe.add("atomindex",zl);class Vl extends zt{constructor(t){if(super(t),t.scale||(this.parameters.scale="OrRd"),!t.domain){let e,i=1/0,r=-1/0;t.sele&&(e=new pe(t.sele)),t.structure.eachAtom((function(t){const e=t.bfactor;i=Math.min(i,e),r=Math.max(r,e)}),e),this.parameters.domain=[i,r]}this.bfactorScale=this.getScale()}atomColor(t){return this.bfactorScale(t.bfactor)}}Nl([Nt],Vl.prototype,"atomColor",null),Fe.add("bfactor",Vl);class Gl extends zt{constructor(t){super(t),this.chainidDictPerModel={},this.scalePerModel={},t.scale||(this.parameters.scale="Spectral"),t.structure.eachModel((t=>{let e=0;const i={};t.eachChain((function(t){void 0===i[t.chainid]&&(i[t.chainid]=e,e+=1)})),this.parameters.domain=[0,e-1],this.chainidDictPerModel[t.index]=i,this.scalePerModel[t.index]=this.getScale()}))}atomColor(t){const e=this.chainidDictPerModel[t.modelIndex];return this.scalePerModel[t.modelIndex](e[t.chainid])}}Nl([Nt],Gl.prototype,"atomColor",null),Fe.add("chainid",Gl);class Ul extends zt{constructor(t){super(t),this.scalePerModel={},t.scale||(this.parameters.scale="Spectral"),t.structure.eachModel((t=>{this.parameters.domain=[t.chainOffset,t.chainEnd],this.scalePerModel[t.index]=this.getScale()}))}atomColor(t){return this.scalePerModel[t.modelIndex](t.chainIndex)}}Nl([Nt],Ul.prototype,"atomColor",null),Fe.add("chainindex",Ul);class jl extends zt{constructor(t){super(t),this.chainnameDictPerModel={},this.scalePerModel={},t.scale||(this.parameters.scale="Spectral"),t.structure.eachModel((t=>{let e=0;const i={};t.eachChain((function(t){void 0===i[t.chainname]&&(i[t.chainname]=e,e+=1)})),this.parameters.domain=[0,e-1],this.chainnameDictPerModel[t.index]=i,this.scalePerModel[t.index]=this.getScale()}))}atomColor(t){const e=this.chainnameDictPerModel[t.modelIndex];return this.scalePerModel[t.modelIndex](e[t.chainname])}}Nl([Nt],jl.prototype,"atomColor",null),Fe.add("chainname",jl);class Hl extends zt{constructor(t){super(t),this.rsrzDict={},this.rsccDict={},t.scale||(this.parameters.scale="RdYlBu"),this.rsrzScale=this.getScale({domain:[2,0]}),this.rsccScale=this.getScale({domain:[.678,1]});const e=t.structure.validation;e&&(this.rsrzDict=e.rsrzDict,this.rsccDict=e.rsccDict)}atomColor(t){let e=t.resno+"";t.inscode&&(e+="^"+t.inscode),t.chainname&&(e+=":"+t.chainname),e+="/"+t.modelIndex;const i=this.rsrzDict[e];if(void 0!==i)return this.rsrzScale(i);const r=this.rsccDict[e];return void 0!==r?this.rsccScale(r):9474192}}Nl([Nt],Hl.prototype,"atomColor",null),Fe.add("densityfit",Hl);const Wl={ARG:{CD:.1,CZ:.5,NE:-.1},ASN:{CG:.55,OD1:-.55},ASP:{CB:-.16,CG:.36,OD1:-.6,OD2:-.6},CYS:{CB:.19,SG:-.19},GLN:{CD:.55,OE1:-.55},GLU:{CD:.36,CG:-.16,OE1:-.6,OE2:-.6},HIS:{CB:.1,CD2:.2,CE1:.45,CG:.15,ND1:.05,NE2:.05},LYS:{CE:.25,NZ:.75},MET:{CE:.06,CG:.06,SD:-.12},PTR:{C:.55,CA:.1,CZ:.25,N:-.35,O:-.55,O1P:-.85,O2P:-.85,O3P:-.85,OG1:-1.1,P:1.4},SEP:{C:.55,CA:.1,CB:.25,N:-.35,O:-.55,O1P:-.85,O2P:-.85,O3P:-.85,OG1:-1.1,P:1.4},SER:{CB:.25,OG:-.25},THR:{CB:.25,OG1:-.25},TPO:{C:.55,CA:.1,CB:.25,N:-.35,O:-.55,OG1:-1.1,O1P:-.85,O2P:-.85,O3P:-.85,P:1.4},TRP:{CD1:.06,CD2:.1,CE2:-.04,CE3:-.03,CG:-.03,NE1:-.06},TYR:{CZ:.25,OH:-.25},backbone:{C:.55,O:-.55,N:-.35,CA:.1}};class ql extends zt{constructor(t){super(t),this.delta=new e,this.hCharges=[],t.scale||(this.parameters.scale="rwb"),t.domain||(this.parameters.domain=[-50,50]),this.scale=this.getScale(),this.charges=new Float32Array(t.structure.atomCount);const i=[];t.structure.eachAtom((t=>{var r;if(this.charges[t.index]=(null!==(r=t).partialCharge?r.partialCharge:r.isProtein()&&(Wl[r.resname]&&Wl[r.resname][r.atomname]||Wl.backbone[r.atomname])||0)*t.occupancy,"N"===t.atomname){if(t.bondCount>=3)return;if(t.bondToElementCount(1))return;const r=function(t,i=new e){let r=!1,s=!1,n=!1;return i.set(2*t.x,2*t.y,2*t.z),t.eachBondedAtom((function(t){if(!r)return"H"===t.atomname?(i.set(t.x,t.y,t.z),void(r=!0)):void(s||"CA"!==t.atomname?n||"C"!==t.atomname||(n=!0,i.sub(t)):(i.sub(t),s=!0))})),r?i:s&&n?(i.normalize(),i.multiplyScalar(1.04),i.add(t),i):void 0}(t);void 0!==r&&(i.push(r),this.hCharges.push(.25*t.occupancy))}}));const r=t.structure.getBoundingBox();r.expandByScalar(1.04),this.hStore=function(t){const e=t.length,i=new Float32Array(e),r=new Float32Array(e),s=new Float32Array(e);for(let e=0;e{const s=e[t];0!==s&&(r+=s/i)})),this.hHash.eachWithin(t.x,t.y,t.z,12,((t,e)=>{const s=i[t];0!==s&&(r+=s/e)})),this.scale(332*r)}}Nl([Nt],ql.prototype,"positionColor",null),Fe.add("electrostatic",ql);const Xl={H:16777215,HE:14286847,LI:13402367,BE:12779264,B:16758197,C:9474192,N:3166456,O:16715021,F:9494608,NE:11789301,NA:11230450,MG:9109248,AL:12560038,SI:1578e4,P:16744448,S:16777008,CL:2093087,AR:8442339,K:9388244,CA:4062976,SC:15132390,TI:12567239,V:10921643,CR:9083335,MN:10255047,FE:14706227,CO:15765664,NI:5296208,CU:13140019,ZN:8224944,GA:12750735,GE:6721423,AS:12419299,SE:16752896,BR:10889513,KR:6076625,RB:7351984,SR:65280,Y:9764863,ZR:9756896,NB:7586505,MO:5551541,TC:3907230,RU:2396047,RH:687500,PD:27013,AG:12632256,CD:16767375,IN:10909043,SN:6717568,SB:10380213,TE:13924864,I:9699476,XE:9699476,CS:5707663,BA:51456,LA:7394559,CE:16777159,PR:14286791,ND:13107143,PM:10747847,SM:9437127,EU:6422471,GD:4587463,TB:3211207,DY:2097095,HO:65436,ER:58997,TM:54354,YB:48952,LU:43812,HF:5096191,TA:5089023,W:2200790,RE:2522539,OS:2516630,IR:1528967,PT:13684960,AU:16765219,HG:12105936,TL:10900557,PB:5724513,BI:10375093,PO:11230208,AT:7688005,RN:4358806,FR:4325478,RA:32e3,AC:7384058,TH:47871,PA:41471,U:36863,NP:33023,PU:27647,AM:5528818,CM:7888099,BK:9064419,CF:10565332,ES:11739092,FM:11739066,MD:11734438,NO:12389767,LR:13041766,RF:13369433,DB:13697103,SG:14221381,BH:14680120,HS:15073326,MT:15400998,DS:16777215,RG:16777215,CN:16777215,UUT:16777215,FL:16777215,UUP:16777215,LV:16777215,UUH:16777215,D:16777152,T:16777120};class Yl extends zt{constructor(t){t.value=st(t.value,Xl.C),super(t)}atomColor(t){const e=t.element;return"C"===e?this.parameters.value:Xl[e]||16777215}}Nl([Nt],Yl.prototype,"atomColor",null),Fe.add("element",Yl);class Kl extends zt{constructor(t){super(t),t.scale||(this.parameters.scale="Spectral"),t.domain||(this.parameters.domain=[0,t.structure.entityList.length-1]),this.entityindexScale=this.getScale()}atomColor(t){return this.entityindexScale(t.entityIndex)}}Nl([Nt],Kl.prototype,"atomColor",null),Fe.add("entityindex",Kl);class Zl extends zt{atomColor(t){const e=t.entity;switch(e?e.entityType:void 0){case 1:return 8374655;case 2:return 16629894;case 3:return 12496596;case 4:return 3697840;default:return 16777113}}}Nl([Nt],Zl.prototype,"atomColor",null),Fe.add("entitytype",Zl);class Ql extends zt{constructor(t){super(t),this.geoAtomDict={},this.geoDict={};const e=t.structure.validation;e&&(this.geoAtomDict=e.geoAtomDict,this.geoDict=e.geoDict)}atomColor(t){let e,i=t.resno+"";t.inscode&&(i+="^"+t.inscode),t.chainname&&(i+=":"+t.chainname),i+="/"+t.modelIndex;const r=this.geoAtomDict[i];if(void 0!==r){const i=r[t.atomname]||0;s=i,e=16843009*((s=(858993459&(s-=s>>1&1431655765))+(s>>2&858993459))+(s>>4)&252645135)>>24}else e=this.geoDict[i]||0;var s;return 0===e?2188972:1===e?16703627:2===e?16018755:e>=3?10813478:9474192}}Nl([Nt],Ql.prototype,"atomColor",null),Fe.add("geoquality",Ql);class Jl extends zt{constructor(t){super(t),this.resHF={},t.scale||(this.parameters.scale="RdYlGn");for(const t in Js)this.resHF[t]=Js[t][0];if(this.defaultResidueHydrophobicity=tn[0],!t.domain){let t=1/0,e=-1/0;for(const i in this.resHF){const r=this.resHF[i];t=Math.min(t,r),e=Math.max(e,r)}this.parameters.domain=[t,0,e]}this.hfScale=this.getScale()}atomColor(t){return this.hfScale(this.resHF[t.resname]||this.defaultResidueHydrophobicity)}}Nl([Nt],Jl.prototype,"atomColor",null),Fe.add("hydrophobicity",Jl);class th extends zt{constructor(t){super(t),t.scale||(this.parameters.scale="rainbow"),t.domain||(this.parameters.domain=[0,t.structure.modelStore.count]),this.modelindexScale=this.getScale()}atomColor(t){return this.modelindexScale(t.modelIndex)}}Nl([Nt],th.prototype,"atomColor",null),Fe.add("modelindex",th);class eh extends zt{atomColor(t){switch(t.residueType.moleculeType){case 1:return 3697840;case 2:return 15729279;case 3:return 12496596;case 4:return 16629894;case 5:return 12540695;case 6:return 8374655;default:return 16777113}}}Nl([Nt],eh.prototype,"atomColor",null),Fe.add("moleculetype",eh);class ih extends zt{constructor(t){super(t),t.scale||(this.parameters.scale="PuBu"),t.domain||(this.parameters.domain=[0,1]),this.occupancyScale=this.getScale()}atomColor(t){return this.occupancyScale(t.occupancy)}}Nl([Nt],ih.prototype,"atomColor",null),Fe.add("occupancy",ih);class rh extends zt{constructor(t){super(t),t.scale||(this.parameters.scale="rwb"),t.domain||(this.parameters.domain=[-1,1]),this.partialchargeScale=this.getScale()}atomColor(t){return this.partialchargeScale(t.partialCharge||0)}}function sh(){return 16777215*Math.random()}Nl([Nt],rh.prototype,"atomColor",null),Fe.add("partialcharge",rh);class nh extends zt{atomColor(){return sh()}volumeColor(){return sh()}positionColor(){return sh()}}Nl([Nt],nh.prototype,"atomColor",null),Nl([Nt],nh.prototype,"volumeColor",null),Nl([Nt],nh.prototype,"positionColor",null),Fe.add("random",nh);class oh extends zt{constructor(t){super(t),this.rciDict={},t.scale||(this.parameters.scale="RdYlBu"),this.rciScale=this.getScale({domain:[.6,0]});const e=t.structure.validation;e&&(this.rciDict=e.rciDict)}atomColor(t){let e=`[${t.resname}]${t.resno}`;t.chainname&&(e+=":"+t.chainname);const i=this.rciDict[e];return void 0!==i?this.rciScale(i):9474192}}Nl([Nt],oh.prototype,"atomColor",null),Fe.add("randomcoilindex",oh);class ah extends zt{constructor(t){super(t),this.scalePerChain={},t.scale||(this.parameters.scale="rainbow",this.parameters.reverse=st(t.reverse,!0)),t.structure.eachChain((t=>{this.parameters.domain=[t.residueOffset,t.residueEnd],this.scalePerChain[t.index]=this.getScale()}))}atomColor(t){return this.scalePerChain[t.chainIndex](t.residueIndex)}}Nl([Nt],ah.prototype,"atomColor",null),Fe.add("residueindex",ah);const ch={ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:16777215,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,ASX:16711935,GLX:16711935,ASH:16711935,GLH:16711935,A:14423100,G:3329330,I:10145074,X:8190976,C:16766720,T:4286945,U:4251856,D:35723,DA:14423100,DG:3329330,DI:10145074,DX:8190976,DC:16766720,DT:4286945,DU:4251856,DD:35723};class lh extends zt{atomColor(t){return ch[t.resname]||16711935}}Nl([Nt],lh.prototype,"atomColor",null),Fe.add("resname",lh);const hh=16711808,dh=10485888,uh=6291584,mh=16762880,ph=6324479,fh=16777215,gh=11403518,yh=16580962,bh=10921722;class xh extends zt{constructor(t){super(t),this.residueProxy=t.structure.getResidueProxy()}atomColor(t){const e=t.sstruc,i=this.residueProxy;return"h"===e?hh:"g"===e?dh:"i"===e?uh:"e"===e||"b"===e?mh:"t"===e?ph:(i.index=t.residueIndex,i.isDna()?gh:i.isRna()?yh:i.isSaccharide()?bh:i.isProtein()||"s"===e||"l"===e?fh:8421504)}}Nl([Nt],xh.prototype,"atomColor",null),Fe.add("sstruc",xh);class vh extends zt{constructor(t){var e,i;super(t),t.scale||(this.parameters.scale="rwb"),this.atomData=null===(e=this.parameters.data)||void 0===e?void 0:e.atomData,this.bondData=null===(i=this.parameters.data)||void 0===i?void 0:i.bondData,this.scale=this.getScale(this.parameters)}atomColor(t){var e;const i=null===(e=this.atomData)||void 0===e?void 0:e[t.index];return void 0!==i?this.scale(i):this.parameters.value}bondColor(t,e){var i;const r=null===(i=this.bondData)||void 0===i?void 0:i[t.index];return void 0!==r?this.scale(r):this.atomProxy?(this.atomProxy.index=e?t.atomIndex1:t.atomIndex2,this.atomColor(this.atomProxy)):this.parameters.value}}Nl([Nt],vh.prototype,"atomColor",null),Nl([Nt],vh.prototype,"bondColor",null),Fe.add("structuredata",vh);class wh extends zt{atomColor(){return this.parameters.value}bondColor(){return this.parameters.value}valueColor(){return this.parameters.value}volumeColor(){return this.parameters.value}}Nl([Nt],wh.prototype,"atomColor",null),Nl([Nt],wh.prototype,"bondColor",null),Nl([Nt],wh.prototype,"valueColor",null),Nl([Nt],wh.prototype,"volumeColor",null),Fe.add("uniform",wh);class Ah extends zt{constructor(t){super(t),this.valueScale=this.getScale()}volumeColor(t){return this.valueScale(this.parameters.volume.data[t])}}Nl([Nt],Ah.prototype,"volumeColor",null),Fe.add("value",Ah);class _h extends zt{constructor(t){super(t),this.vec=new e,this.valueScale=this.getScale()}positionColor(t){const e=this.parameters.volume;if(!e||!e.inverseMatrix)return this.parameters.value;const i=this.vec,r=e.data,s=e.nx,n=e.ny,o=s*n;i.copy(t),i.applyMatrix4(e.inverseMatrix);const a=Math.floor(i.x),c=Math.floor(i.y),l=Math.floor(i.z),h=(l*n+c)*s+a,d=h+1,u=h+s,m=h+o,p=u+1,f=m+1,g=u+o,y=g+1,b=r[h],x=r[d],v=r[u],w=r[m],A=r[p],_=r[f],S=r[g],C=r[y],P=i.x-a,I=i.y-c,k=i.z-l,M=$t(b,x,P),T=$t(w,_,P),B=$t(v,A,P),D=$t(S,C,P),$=$t(M,B,I),O=$t(T,D,I),R=$t($,O,k);return this.valueScale(R)}}Nl([Nt],_h.prototype,"positionColor",null),Fe.add("volume",_h);class Sh extends zr{constructor(t,e,i){const r=i||{};if(super(t,e,r),this.type="structure",this.parameters=Object.assign({radiusType:{type:"select",options:pa.types},radiusData:{type:"hidden"},radiusSize:{type:"number",precision:3,max:10,min:.001},radiusScale:{type:"number",precision:3,max:10,min:.001},assembly:null,defaultAssembly:{type:"hidden"}},this.parameters),this.selection=new pe(r.sele),this.dataList=[],this.structure=t,this.structureView=this.structure.getView(this.selection),t.biomolDict){const e={default:"default","":t.unitcell?"AU":"FULL"};Object.keys(t.biomolDict).forEach((function(t){e[t]=t})),this.parameters.assembly={type:"select",options:e,rebuild:!0}}else this.parameters.assembly=null}get defaultScale(){return{vdw:1,covalent:1,bfactor:.01,sstruc:1}}init(t){const e=t||{};e.colorScheme=st(e.colorScheme,"element"),this.setRadius(e.radius,e),this.radiusType=st(e.radiusType,"vdw"),this.radiusData=st(e.radiusData,{}),this.radiusSize=st(e.radiusSize,1),this.radiusScale=st(e.radiusScale,1),this.assembly=st(e.assembly,"default"),this.defaultAssembly=st(e.defaultAssembly,""),"auto"===e.quality&&(e.quality=this.getQuality()),super.init(e),this.selection.signals.stringChanged.add((()=>{this.build()})),this.build()}setRadius(t,e){const i=Object.keys(ma);return"string"==typeof t&&i.includes(t.toLowerCase())?e.radiusType=t:void 0!==t&&(e.radiusType="size",e.radiusSize=t),this}getAssembly(){const t="default"===this.assembly?this.defaultAssembly:this.assembly;return this.structure.biomolDict[t]}getQuality(){let t;const e=this.structureView,i=this.getAssembly();t=i?i.getAtomCount(e):e.atomCount,Se&&(t*=4);return e.atomStore.count/e.residueStore.count<2&&(t*=10),t<15e3?"high":t<8e4?"medium":"low"}create(){if(0===this.structureView.atomCount)return;if(!this.structureView.hasCoords())return void(this.needsBuild=!0);this.needsBuild=!1;const t=this.getAssembly();if(t)t.partList.forEach(((t,e)=>{const i=t.getView(this.structureView);if(0===i.atomCount)return;const r=this.createData(i,e);r&&(r.sview=i,r.instanceList=t.getInstanceList(),this.dataList.push(r))}));else{const t=this.createData(this.structureView,0);t&&(t.sview=this.structureView,this.dataList.push(t))}}update(t){!this.lazy||this.visible?this.needsBuild?this.build():this.dataList.forEach((e=>{e.bufferList.length>0&&this.updateData(t,e)}),this):Object.assign(this.lazyProps.what,t)}updateData(t,e){this.build()}getColorParams(){return Object.assign(Object.assign({},super.getColorParams()),{structure:this.structure})}getRadiusParams(t){return{type:this.radiusType,scale:this.radiusScale,size:this.radiusSize,data:this.radiusData}}getAtomParams(t,e){return Object.assign({what:t,colorParams:this.getColorParams(),radiusParams:this.getRadiusParams()},e)}getBondParams(t,e){return Object.assign({what:t,colorParams:this.getColorParams(),radiusParams:this.getRadiusParams()},e)}getAtomRadius(t){if(this.structureView.atomSet.isSet(t.index)){return new pa(this.getRadiusParams()).atomRadius(t)}return 0}setSelection(t,e){return this.selection.setString(t,e),this}setParameters(t,e={},i=!1){const r=t||{};return this.setRadius(r.radius,r),void 0===r.radiusType&&void 0===r.radiusData&&void 0===r.radiusSize&&void 0===r.radiusScale||(e.radius=!0,Ie&&!this.disableImpostor||(i=!0)),void 0!==r.defaultAssembly&&r.defaultAssembly!==this.defaultAssembly&&("default"===this.assembly&&void 0===r.assembly||"default"===r.assembly)&&(i=!0),super.setParameters(r,e,i),this}getParameters(){return Object.assign(super.getParameters(),{sele:this.selection?this.selection.string:void 0,defaultAssembly:this.defaultAssembly})}attach(t){const e=this.viewer,i=this.bufferList;this.dataList.forEach((function(t){t.bufferList.forEach((function(r){i.push(r),e.add(r,t.instanceList)}))})),this.setVisibility(this.visible),t()}clear(){this.dataList.length=0,super.clear()}dispose(){this.structureView.dispose(),super.dispose()}}class Ch extends Sh{constructor(t,e,i){super(t,e,i),this.n=0,this.parameters=Object.assign({labelVisible:{type:"boolean"},labelSize:{type:"number",precision:3,max:10,min:.001},labelColor:{type:"color"},labelFontFamily:{type:"select",options:{"sans-serif":"sans-serif",monospace:"monospace",serif:"serif"},buffer:"fontFamily"},labelFontStyle:{type:"select",options:{normal:"normal",italic:"italic"},buffer:"fontStyle"},labelFontWeight:{type:"select",options:{normal:"normal",bold:"bold"},buffer:"fontWeight"},labelsdf:{type:"boolean",buffer:"sdf"},labelXOffset:{type:"number",precision:1,max:20,min:-20,buffer:"xOffset"},labelYOffset:{type:"number",precision:1,max:20,min:-20,buffer:"yOffset"},labelZOffset:{type:"number",precision:1,max:20,min:-20,buffer:"zOffset"},labelAttachment:{type:"select",options:{"bottom-left":"bottom-left","bottom-center":"bottom-center","bottom-right":"bottom-right","middle-left":"middle-left","middle-center":"middle-center","middle-right":"middle-right","top-left":"top-left","top-center":"top-center","top-right":"top-right"},rebuild:!0},labelBorder:{type:"boolean",buffer:"showBorder"},labelBorderColor:{type:"color",buffer:"borderColor"},labelBorderWidth:{type:"number",precision:2,max:.3,min:0,buffer:"borderWidth"},labelBackground:{type:"boolean",rebuild:!0},labelBackgroundColor:{type:"color",buffer:"backgroundColor"},labelBackgroundMargin:{type:"number",precision:2,max:2,min:0,rebuild:!0},labelBackgroundOpacity:{type:"range",step:.01,max:1,min:0,buffer:"backgroundOpacity"},labelFixedSize:{type:"boolean",buffer:"fixedSize"},lineOpacity:{type:"range",min:0,max:1,step:.01},linewidth:{type:"integer",max:50,min:1,buffer:!0}},this.parameters,{flatShaded:null})}init(t){const e=t||{};this.labelVisible=st(e.labelVisible,!0),this.labelSize=st(e.labelSize,2),this.labelColor=st(e.labelColor,16777215),this.labelFontFamily=st(e.labelFontFamily,"sans-serif"),this.labelFontStyle=st(e.labelFontstyle,"normal"),this.labelFontWeight=st(e.labelFontWeight,"bold"),this.labelsdf=st(e.labelsdf,"Chrome"===Ae),this.labelXOffset=st(e.labelXOffset,0),this.labelYOffset=st(e.labelYOffset,0),this.labelZOffset=st(e.labelZOffset,.5),this.labelAttachment=st(e.labelAttachment,"bottom-left"),this.labelBorder=st(e.labelBorder,!1),this.labelBorderColor=st(e.labelBorderColor,"lightgrey"),this.labelBorderWidth=st(e.labelBorderWidth,.15),this.labelBackground=st(e.labelBackground,!1),this.labelBackgroundColor=st(e.labelBackgroundColor,"lightgrey"),this.labelBackgroundMargin=st(e.labelBackgroundMargin,.5),this.labelBackgroundOpacity=st(e.labelBackgroundOpacity,1),this.labelFixedSize=st(e.labelFixedSize,!1),this.lineOpacity=st(e.lineOpacity,1),this.linewidth=st(e.linewidth,2),super.init(e)}update(t){t.position?this.build():super.update(t)}updateData(t,e){const i={};if(t&&!t.labelSize||Object.assign(i,{size:Si(this.n,this.labelSize)}),!t||t.labelColor){const t=new s(this.labelColor);Object.assign(i,{color:Ci(this.n,t.r,t.g,t.b)})}this.textBuffer.setAttributes(i)}setParameters(t,e={},i=!1){return t&&t.labelSize&&(e.labelSize=!0),t&&(t.labelColor||0===t.labelColor)&&(e.labelColor=!0,i=!0),super.setParameters(t,e,i),t&&void 0!==t.opacity&&this.textBuffer.setParameters({opacity:1}),t&&void 0!==t.labelVisible&&this.setVisibility(this.visible),this}setVisibility(t,e){return super.setVisibility(t,!0),this.textBuffer&&this.textBuffer.setVisibility(this.labelVisible&&this.visible),e||this.viewer.requestRender(),this}getLabelBufferParams(t={}){return super.getBufferParams(Object.assign({fontFamily:this.labelFontFamily,fontStyle:this.labelFontStyle,fontWeight:this.labelFontWeight,sdf:this.labelsdf,xOffset:this.labelXOffset,yOffset:this.labelYOffset,zOffset:this.labelZOffset,attachment:this.labelAttachment,showBorder:this.labelBorder,borderColor:this.labelBorderColor,borderWidth:this.labelBorderWidth,showBackground:this.labelBackground,backgroundColor:this.labelBackgroundColor,backgroundMargin:this.labelBackgroundMargin,backgroundOpacity:this.labelBackgroundOpacity,fixedSize:this.labelFixedSize,disablePicking:!0,visible:this.labelVisible},t,{opacity:1}))}getAtomRadius(){return 0}}function Ph(t,e){const i=t.getAtomProxy(),r=new pe,s=e.length;if(0===s)return new Float32Array(0);const n=e[0].length,o=t.getAtomSet(),a=new Float32Array(s*n*3);let c=0;return e.forEach((function(e){let s=!1;for(let l=0;l 1.0 ){\ngl_FragColor = vec4( backgroundColor, backgroundOpacity );\n}else{\nfloat sdf = texture2D( fontTexture, texCoord ).a;\nif( showBorder ) sdf += borderWidth;\nfloat a = smoothstep(padding - gamma, padding + gamma, sdf);\nif( a < 0.2 ) discard;\na *= opacity;\nvec3 outgoingLight = vColor;\nif( showBorder && sdf < ( padding + borderWidth ) ){\noutgoingLight = borderColor;\n}\ngl_FragColor = vec4( outgoingLight, a );\n}\n#if defined( PICKING )\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");const Th={};const Bh={font:"sans-serif",size:36,style:"normal",variant:"normal",weight:"normal",outline:3,width:1024,height:1024};class Dh{constructor(t={}){this.gamma=1,this.mapped={},this.scratchW=0,this.scratchH=0,this.currentX=0,this.currentY=0,this.cutoff=.25,this.parameters=nt(t,Bh);const e=this.parameters;this.radius=e.size/8,this.padding=e.size/3;const i=this.lineHeight=e.size+2*e.outline+Math.round(e.size/4),r=this.maxWidth=e.width/4,s=this.canvas=document.createElement("canvas");s.width=r,s.height=i;const n=this.context=this.canvas.getContext("2d");n.font=`${e.style} ${e.variant} ${e.weight} ${e.size}px ${e.font}`,n.fillStyle="black",n.textAlign="left",n.textBaseline="bottom",n.lineJoin="round",this.gridOuter=new Float64Array(i*r),this.gridInner=new Float64Array(i*r),this.f=new Float64Array(Math.max(i,r)),this.d=new Float64Array(Math.max(i,r)),this.z=new Float64Array(Math.max(i,r)+1),this.v=new Int16Array(Math.max(i,r)),this.data=new Uint8Array(e.width*e.height*4),this.canvas2=document.createElement("canvas"),this.canvas2.width=e.width,this.canvas2.height=e.height,this.context2=this.canvas2.getContext("2d"),this.placeholder=this.map(String.fromCharCode(65533));for(let t=32;t<=126;++t)this.map(String.fromCharCode(t));this.map(String.fromCharCode(176)),this.map(String.fromCharCode(8491)),this.texture=new __WEBPACK_IMPORTED_MODULE_0_three__["h" /* CanvasTexture */](this.canvas2),this.texture.flipY=!1,this.texture.needsUpdate=!0}map(t){const e=this.parameters;return void 0===this.mapped[t]&&(this.draw(t),this.currentX+this.scratchW>e.width&&(this.currentX=0,this.currentY+=this.scratchH),this.currentY+this.scratchH>e.height&&console.warn("canvas to small"),this.mapped[t]={x:this.currentX,y:this.currentY,w:this.scratchW,h:this.scratchH},this.context2.drawImage(this.canvas,0,0,this.scratchW,this.scratchH,this.currentX,this.currentY,this.scratchW,this.scratchH),this.currentX+=this.scratchW),this.mapped[t]}get(t){return this.mapped[t]||this.placeholder}draw(t){const e=this.parameters,i=this.lineHeight,r=e.outline,s=this.context,n=this.maxWidth,o=r,a=i-e.outline,c=s.measureText(t),l=Math.min(n,Math.ceil(c.width+2*o+1)),h=l*i;s.clearRect(0,0,l,i),s.fillText(t,o,a);const d=s.getImageData(0,0,l,i),u=d.data;for(let t=0;t= 0.0 ) {\ntrimSegment( start, end );\n} else if ( end.z < 0.0 && start.z >= 0.0 ) {\ntrimSegment( end, start );\n}\n}\nvec4 clipStart = projectionMatrix * start;\nvec4 clipEnd = projectionMatrix * end;\nvec2 ndcStart = clipStart.xy / clipStart.w;\nvec2 ndcEnd = clipEnd.xy / clipEnd.w;\nvec2 dir = ndcEnd - ndcStart;\ndir.x *= aspect;\ndir = normalize( dir );\nvec2 offset = vec2( dir.y, - dir.x );\ndir.x /= aspect;\noffset.x /= aspect;\nif ( mapping.x < 0.0 ) offset *= - 1.0;\noffset *= linewidth;\noffset /= resolution.y;\nvec4 clip = ( mapping.y < 0.5 ) ? clipStart : clipEnd;\noffset *= clip.w;\nclip.xy += offset;\ngl_Position = clip;\n#ifndef PICKING\nvViewPosition = ( projectionMatrixInverse * clip ).xyz;\n#endif\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}"),Ve.add("shader/WideLine.frag","uniform vec3 diffuse;\nuniform float opacity;\nuniform float clipNear;\nuniform float clipRadius;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#ifdef PICKING\nuniform float objectId;\nvarying vec3 vPickingColor;\n#else\n#include common\n#include fog_pars_fragment\nvarying vec3 vViewPosition;\nvarying vec3 vColor;\nvarying vec3 vColor2;\nvarying float flag;\n#endif\nvoid main() {\n#include nearclip_fragment\n#include radiusclip_fragment\n#if defined( PICKING )\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 outgoingLight = vec3( 0.0 );\nvec4 diffuseColor = vec4( diffuse, 1.0 );\nif ( flag < 0.0 ) {\ndiffuseColor.rgb *= vColor;\n} else {\ndiffuseColor.rgb *= vColor2;\n}\n#include alphatest_fragment\noutgoingLight = diffuseColor.rgb;\ngl_FragColor = vec4( outgoingLight, diffuseColor.a * opacity );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");const Fh=Object.assign({linewidth:2},zo),Lh=Object.assign({linewidth:{uniform:!0}},Vo);class Nh extends zc{constructor(e,r={}){super(e,r),this.parameterTypes=Lh,this.vertexShader="WideLine.vert",this.fragmentShader="WideLine.frag",!e.color2&&e.color&&(e.color2=e.color),this.addUniforms({linewidth:{value:this.parameters.linewidth},resolution:{value:new t},projectionMatrixInverse:{value:new i}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null}}),this.setAttributes(e),this.makeMapping()}get defaultParameters(){return Fh}setParameters(t){super.setParameters(t)}}je.add("wideline",Nh);class zh extends Ch{constructor(t,e,i){super(t,e,i),this.type="angle",this.parameters=Object.assign({atomTriple:{type:"hidden",rebuild:!0},vectorVisible:{type:"boolean",default:!0},arcVisible:{type:"boolean",default:!0},sectorVisible:{type:"boolean",default:!0}},this.parameters),this.init(i)}init(t){const e=t||{};e.side=st(e.side,"double"),e.opacity=st(e.opacity,.5),this.atomTriple=st(e.atomTriple,[]),this.arcVisible=st(e.arcVisible,!0),this.sectorVisible=st(e.sectorVisible,!0),this.vectorVisible=st(e.vectorVisible,!0),super.init(e)}createData(t){if(!t.atomCount||!this.atomTriple.length)return;const e=function(t,e){return function(t){const e=[],i=t.length/9;for(let r=0;r radius2) {\ndiscard;\n}\n#ifdef CAP\nsurface_point = front_point;\n_normal = axis;\n#else\nsurface_point = ray_target + ( (-a1 - sqrt(d)) / a2 ) * ray_direction;\ndNV = dot(-axis, ray_direction);\nnear = dot(axis, end) / dNV;\nnew_point2 = ray_direction * near + ray_origin;\nif (dot(new_point2 - end, new_point2-base) < radius2) {\ndiscard;\n}\ninterior = true;\n#endif\n}\nif( end_cap_test > 0.0 )\n{\nfloat dNV;\nfloat near;\nvec3 end_point;\nif ( ortho == 1.0 ) {\nend_point = ray_target;\n} else {\ndNV = dot(axis, ray_direction);\nif (dNV < 0.0) {\ndiscard;\n}\nnear = dot(axis, end) / dNV;\nend_point = ray_direction * near + ray_origin;\n}\n\nif( dot(end_point - end, end_point-base) > radius2 ) {\ndiscard;\n}\n#ifdef CAP\nsurface_point = end_point;\n_normal = axis;\n#else\nsurface_point = ray_target + ( (-a1 - sqrt(d)) / a2 ) * ray_direction;\ndNV = dot(-axis, ray_direction);\nnear = dot(-axis, (base)) / dNV;\nnew_point2 = ray_direction * near + ray_origin;\nif (dot(new_point2 - base, new_point2-base) < radius2) {\ndiscard;\n}\ninterior = true;\n#endif\n}\ngl_FragDepthEXT = calcDepth( surface_point );\n\n#ifdef NEAR_CLIP\nif( calcClip( surface_point ) > 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nsurface_point = ray_target + dist * ray_direction;\nif( calcClip( surface_point ) > 0.0 ) {\ndiscard;\n}\ninterior = true;\ngl_FragDepthEXT = calcDepth( surface_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( clipNear - 0.5 ) ) ) + ( 0.0000001 / vRadius ) );\n}\n}else if( gl_FragDepthEXT <= 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nsurface_point = ray_target + dist * ray_direction;\ninterior = true;\ngl_FragDepthEXT = calcDepth( surface_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n}\n#else\nif( gl_FragDepthEXT <= 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nsurface_point = ray_target + dist * ray_direction;\ninterior = true;\ngl_FragDepthEXT = calcDepth( surface_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n}\n#endif\nif (gl_FragDepthEXT < 0.0) {\ndiscard;\n}\nif (gl_FragDepthEXT > 1.0) {\ndiscard;\n}\n#ifdef PICKING\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 vViewPosition = -surface_point;\nvec3 vNormal = _normal;\nvec3 vColor;\nif( distSq3( surface_point, end ) < distSq3( surface_point, base ) ){\nif( b < 0.0 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\n}else{\nif( b > 0.0 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\n}\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\nvec3 normal = normalize( vNormal );\nvec3 geometryNormal = normal;\n#include lights_physical_fragment\n#include lights_fragment_begin\n#include lights_fragment_end\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\nif( interior ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");const Xh=new Float32Array([-1,1,-1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1]),Yh=new Uint16Array([0,1,2,1,4,2,2,4,3,4,5,3]);class Kh extends Fc{constructor(t,e={}){super("v3",t,e)}get mapping(){return Xh}get mappingIndices(){return Yh}get mappingIndicesSize(){return 12}get mappingSize(){return 6}get mappingItemSize(){return 3}}const Zh=Object.assign({openEnded:!1},zo),Qh=Object.assign({openEnded:{updateShader:!0}},Vo);class Jh extends Kh{constructor(t,e={}){super(t,e),this.parameterTypes=Qh,this.isImpostor=!0,this.vertexShader="CylinderImpostor.vert",this.fragmentShader="CylinderImpostor.frag",this.addUniforms({modelViewMatrixInverse:{value:new i},ortho:{value:0}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null},radius:{type:"f",value:null}}),this.setAttributes(t),this.makeMapping()}get defaultParameters(){return Zh}getDefines(t){const e=Kh.prototype.getDefines.call(this,t);return this.parameters.openEnded||(e.CAP=1),e}}Object.assign({disableImpostor:!1},Hh,Zh);const td=class{constructor(t,e={}){return!t.color2&&t.color&&(t.color2=t.color),!Ie||e&&e.disableImpostor?new qh(t,e):new Jh(t,e)}};je.add("cylinder",td);class ed extends Sh{constructor(t,e,i){super(t,e,i),this.type="axes",this.parameters=Object.assign({radiusSize:{type:"number",precision:3,max:10,min:.001},sphereDetail:!0,radialSegments:!0,disableImpostor:!0,showAxes:{type:"boolean",rebuild:!0},showBox:{type:"boolean",rebuild:!0}},this.parameters,{assembly:null}),this.init(i)}init(t){const e=t||{};e.radiusSize=st(e.radiusSize,.5),e.colorValue=st(e.colorValue,"lightgreen"),e.useInteriorColor=st(e.useInteriorColor,!0),this.showAxes=st(e.showAxes,!0),this.showBox=st(e.showBox,!1),super.init(e)}getPrincipalAxes(){let t;const e=this.getAssembly();return e&&(t=e.partList[0].getSelection()),this.structureView.getPrincipalAxes(t)}getAxesData(t){const i=this.getPrincipalAxes(),r=new s(this.colorValue);let n=0,o=0;this.showAxes&&(n+=6,o+=3),this.showBox&&(n+=8,o+=12);const a=new Float32Array(3*n),c=Ci(n,r.r,r.g,r.b),l=Si(n,this.radiusSize),h=new Float32Array(3*o),d=new Float32Array(3*o),u=Ci(o,r.r,r.g,r.b),m=Si(o,this.radiusSize);let p=0;if(this.showAxes){const t=function(t,e){t.toArray(a,2*p),e.toArray(a,2*p+3),t.toArray(h,p),e.toArray(d,p),p+=3};t(i.begA,i.endA),t(i.begB,i.endB),t(i.begC,i.endC)}if(this.showBox){const r=new e,{d1a:s,d2a:n,d3a:o,d1b:c,d2b:l,d3b:u}=i.getProjectedScaleForAtoms(t);let m=2*p;const f=function(t,e,s){r.copy(i.center).addScaledVector(i.normVecA,t).addScaledVector(i.normVecB,e).addScaledVector(i.normVecC,s),r.toArray(a,m),m+=3};f(s,n,o),f(s,n,u),f(s,l,u),f(s,l,o),f(c,l,u),f(c,l,o),f(c,n,o),f(c,n,u);let g=p;const y=function(t,e){r.fromArray(a,2*p+3*t).toArray(h,g),r.fromArray(a,2*p+3*e).toArray(d,g),g+=3};y(0,1),y(0,3),y(0,6),y(1,2),y(1,7),y(2,3),y(2,4),y(3,5),y(4,5),y(4,7),y(5,6),y(6,7)}const f=new Kn(i);return{vertex:{position:a,color:c,radius:l,picking:f},edge:{position1:h,position2:d,color:u,color2:u,radius:m,picking:f}}}create(){const t=this.getAxesData(this.structureView);this.sphereBuffer=new Gc(t.vertex,this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0})),this.cylinderBuffer=new td(t.edge,this.getBufferParams({openEnded:!0,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0})),this.dataList.push({sview:this.structureView,bufferList:[this.sphereBuffer,this.cylinderBuffer]})}createData(t){}updateData(t,e){const i=this.getAxesData(e.sview),r={},s={};t&&!t.position||(Object.assign(r,{position:i.vertex.position}),Object.assign(s,{position1:i.edge.position1,position2:i.edge.position2})),t&&!t.color||(Object.assign(r,{color:i.vertex.color}),Object.assign(s,{color:i.edge.color,color2:i.edge.color})),t&&!t.radius||(Object.assign(r,{radius:i.vertex.radius}),Object.assign(s,{radius:i.edge.radius})),this.sphereBuffer.setAttributes(r),this.cylinderBuffer.setAttributes(s)}}Ne.add("axes",ed);class id extends Sh{constructor(t,e,i){super(t,e,i),this.type="ball+stick",this.parameters=Object.assign({sphereDetail:!0,radialSegments:!0,openEnded:!0,disableImpostor:!0,aspectRatio:{type:"number",precision:1,max:10,min:1},lineOnly:{type:"boolean",rebuild:!0},cylinderOnly:{type:"boolean",rebuild:!0},multipleBond:{type:"select",rebuild:!0,options:{off:"off",symmetric:"symmetric",offset:"offset"}},bondScale:{type:"number",precision:2,max:1,min:.01},bondSpacing:{type:"number",precision:2,max:2,min:.5},linewidth:{type:"integer",max:50,min:1,buffer:!0}},this.parameters),this.init(i)}init(t){var e=t||{};e.radiusType=st(e.radiusType,"size"),e.radiusSize=st(e.radiusSize,.15),e.useInteriorColor=st(e.useInteriorColor,!0),this.aspectRatio=st(e.aspectRatio,2),this.lineOnly=st(e.lineOnly,!1),this.cylinderOnly=st(e.cylinderOnly,!1),this.multipleBond=st(e.multipleBond,"off"),this.bondSpacing=st(e.bondSpacing,1),this.bondScale=st(e.bondScale,.4),this.linewidth=st(e.linewidth,2),super.init(e)}getAtomRadius(t){return this.aspectRatio*super.getAtomRadius(t)}getAtomParams(t,e){var i=super.getAtomParams(t,e);return i.radiusParams.scale*=this.aspectRatio,i}getAtomData(t,e,i){return t.getAtomData(this.getAtomParams(e,i))}getBondParams(t,e){return e=Object.assign({multipleBond:this.multipleBond,bondSpacing:this.bondSpacing,bondScale:this.bondScale},e),super.getBondParams(t,e)}getBondData(t,e,i){return t.getBondData(this.getBondParams(e,i))}createData(t){const e=[];if(this.lineOnly)this.lineBuffer=new Nh(this.getBondData(t,{position:!0,color:!0,picking:!0}),this.getBufferParams({linewidth:this.linewidth})),e.push(this.lineBuffer);else{const i=new td(this.getBondData(t),this.getBufferParams({openEnded:this.openEnded,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0}));if(e.push(i),!this.cylinderOnly){const i=new Gc(this.getAtomData(t),this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0}));e.push(i)}}return{bufferList:e}}updateData(t,e){"off"!==this.multipleBond&&t&&t.radius&&(t.position=!0);const i=this.getBondData(e.sview,t);if(this.lineOnly){const r={};t&&!t.position||Object.assign(r,{position1:i.position1,position2:i.position2}),t&&!t.color||Object.assign(r,{color:i.color,color2:i.color2}),e.bufferList[0].setAttributes(r)}else{var r={};if(t&&!t.position||Object.assign(r,{position1:i.position1,position2:i.position2}),t&&!t.color||Object.assign(r,{color:i.color,color2:i.color2}),t&&!t.radius||Object.assign(r,{radius:i.radius}),e.bufferList[0].setAttributes(r),!this.cylinderOnly){var s=this.getAtomData(e.sview,t),n={};t&&!t.position||Object.assign(n,{position:s.position}),t&&!t.color||Object.assign(n,{color:s.color}),t&&!t.radius||Object.assign(n,{radius:s.radius}),e.bufferList[1].setAttributes(n)}}}setParameters(t={}){let e=!1;const i={};return(t.aspectRatio||t.bondSpacing||t.bondScale)&&(Object.assign(i,{radius:!0}),Ie&&!this.disableImpostor||(e=!0)),super.setParameters(t,i,e),this}}Ne.add("ball+stick",id);class rd extends id{constructor(t,e,i){super(t,e,i),this.type="backbone",this.parameters=Object.assign({},this.parameters,{multipleBond:null,bondSpacing:null}),this.init(i)}init(t){var e=t||{};e.aspectRatio=st(e.aspectRatio,1),e.radiusSize=st(e.radiusSize,.25),super.init(e)}getAtomRadius(t){return t.isTrace()?super.getAtomRadius(t):0}getAtomData(t,e,i){return t.getBackboneAtomData(this.getAtomParams(e,i))}getBondData(t,e,i){return t.getBackboneBondData(this.getBondParams(e,i))}}Ne.add("backbone",rd);class sd extends id{constructor(t,e,i){super(t,e,i),this.type="base",this.parameters=Object.assign({},this.parameters,{multipleBond:null,bondSpacing:null})}init(t){let e=t||{};e.aspectRatio=st(e.aspectRatio,1),e.radiusSize=st(e.radiusSize,.3),super.init(e)}getAtomData(t,e,i){return t.getRungAtomData(this.getAtomParams(e,i))}getBondData(t,e,i){let r=this.getBondParams(e,i);return Object.assign(r.colorParams,{rung:!0}),t.getRungBondData(r)}}Ne.add("base",sd);class nd{constructor(t,i){this.m=t,this.tension=i,this.dt=1/this.m,this.delta=1e-4,this.vec1=new e,this.vec2=new e,this.vDir=new e,this.vTan=new e,this.vNorm=new e,this.vBin=new e,this.m2=Math.ceil(this.m/2)}interpolateToArr(t,e,i,r,s,n,o){n[o+0]=Ot(t.x,e.x,i.x,r.x,s,this.tension),n[o+1]=Ot(t.y,e.y,i.y,r.y,s,this.tension),n[o+2]=Ot(t.z,e.z,i.z,r.z,s,this.tension)}interpolateToVec(t,e,i,r,s,n){n.x=Ot(t.x,e.x,i.x,r.x,s,this.tension),n.y=Ot(t.y,e.y,i.y,r.y,s,this.tension),n.z=Ot(t.z,e.z,i.z,r.z,s,this.tension)}interpolatePosition(t,e,i,r,s,n){for(var o=0;o1&&(l=1),this.interpolateToVec(t,e,i,r,c,this.vec1),this.interpolateToVec(t,e,i,r,l,this.vec2),this.vec2.sub(this.vec1).normalize(),this.vec2.toArray(s,h)}}vectorSubdivide(t,e,i,r,s){let n,o=e.next(),a=e.next(),c=e.next();const l=e.size,h=l-1;let d=r||0;for(let r=0;r0&&e{if(t.residueCount<4)return;i.push(t);const r=this.getSpline(t),s=this.getAspectRatio(t),n=r.getSubdividedPosition(),o=r.getSubdividedOrientation(),a=r.getSubdividedColor(this.getColorParams()),c=r.getSubdividedPicking(),l=r.getSubdividedSize(this.getRadiusParams());e.push(new hd(Object.assign({},n,o,a,c,l),this.getBufferParams({radialSegments:this.radialSegments,aspectRatio:s,capped:this.capped})))}),t.getSelection()),{bufferList:e,polymerList:i}}updateData(t,e){De&&Me.time(this.type+" repr update"),t=t||{};for(var i=0,r=e.polymerList.length;i0;Qr(A,b,_);const s=Zr(A,v)<0;if(ns(A,v,Zr(v,x)),Qr(S,x,A),ns(A,v,Zr(v,w)),Qr(C,w,A),0===rs(S)||0===rs(C))continue;os(S,S),os(C,C);const D=n[T]=us(S,C);a[T]=(vi*D).toFixed(1)+String.fromCharCode(176),Kr(k,S,v),os(k,k),Zr(k,C)<0&&ds(k,k),Ih(A,_,S,k,D/2),es(A,o,3*T);const $=Math.ceil(D/i),O=$+(e.extendLine?4:2),R=e.extendLine?36:0,E=new Float32Array(3*O),F=new Float32Array(3*O),L=new Float32Array(9*$),N=new Float32Array(R);c[T]=E,l[T]=F,h[T]=L,d[T]=N,e.extendLine&&(r?(Qr(A,f,y),os(A,A),ns(P,A,1/Zr(S,A)),Jr(P,P,y)):(ns(P,x,1/Zr(S,x)),Jr(P,P,g)),s?(Qr(A,b,g),os(A,A),ns(I,A,1/Zr(C,A)),Jr(I,I,g)):(ns(I,w,1/Zr(C,w)),Jr(I,I,y))),Jr(M,_,S);let z=0;e.extendLine?(es(f,E,z),es(P,F,z),z+=3,es(P,E,z),es(M,F,z),z+=3,es(P,N,0),es(M,N,3),es(r?y:g,N,6),es(r?y:g,N,9),es(M,N,12),es(_,N,15)):(es(_,E,z),es(M,F,z),z+=3);const V=function(t,e){const i=9*e;es(_,L,i),es(M,L,i+3),es(M,E,z),Ih(M,_,S,k,t),es(M,L,i+6),es(M,F,z),z+=3};let G=0;for(let t=i;t{const e=pd(i,t);Object.assign(t,e)})),e.side=st(e.side,"double"),e.opacity=st(e.opacity,.5),e.radiusType=st(e.radiusType,"size"),e.radiusSize=st(e.radiusSize,.15),super.init(e)}getHistogramBinBorderBufferParameters(){return this.getBufferParams({linewidth:this.histogramBinBorderWidth,visible:this.histogramBinBorderVisible,opacity:this.histogramBinBorderOpacity})}getBondArrowsBufferParameters(){return this.getBufferParams({linewidth:this.bondArrowWidth,visible:this.bondArrowVisible,opacity:this.bondArrowOpacity})}getOpaqueMiddleDiscBufferParameters(){return this.getBufferParams({visible:this.opaqueMiddleDiscVisible,opacity:this.opaqueMiddleDiscOpacity})}getHistogramBufferParameters(){return this.getBufferParams({visible:!0,opacity:this.histogramOpacity,side:"double"})}createData(t){if(!t.atomCount||!this.histogramsData.length)return;this.histogramsData.forEach((e=>e.atomPositions=Ph(t,[e.atomQuad])));const e=this.scaleBinToSectorArea?function(t){return Math.sqrt(t)}:function(t){return t};function i(t){const e=t.map((t=>t.length)),i=new Float32Array($i(e));let r=0;for(let e=0;et.startPoints))),position2:i(t.map((t=>t.endPoints))),color:i(t.map((t=>t.startColors))),color2:i(t.map((t=>t.endColors)))},e)}function s(t,e){return new Uo({position:i(t.map((t=>t.triangles))),color:i(t.map((t=>t.triangleColors)))},e)}this.histogramsData.forEach((t=>t.histogram360Scaled=t.histogram360.map(e)));const n=[];for(let t=0;t=3&&(e=yd(i)),void 0!==e&&n.push(e)}return this.frontHistogramBinBordersBuffer=r(n.map((t=>t.frontHistogramBinBorders)),this.getHistogramBinBorderBufferParameters()),this.backHistogramBinBordersBuffer=r(n.map((t=>t.backHistogramBinBorders)),this.getHistogramBinBorderBufferParameters()),this.adjacentBondArrowsBuffer=r(n.map((t=>t.adjacentBondArrows)),this.getBondArrowsBufferParameters()),this.distantBondArrowsBuffer=r(n.map((t=>t.distantBondArrows)),this.getBondArrowsBufferParameters()),this.opaqueMiddleDiscBuffer=s(n.map((t=>t.opaqueMiddleDisc)),this.getOpaqueMiddleDiscBufferParameters()),this.frontHistogramBuffer=s(n.map((t=>t.frontHistogram)),this.getHistogramBufferParameters()),this.backHistogramBuffer=s(n.map((t=>t.backHistogram)),this.getHistogramBufferParameters()),{bufferList:[].concat(this.frontHistogramBinBordersBuffer,this.backHistogramBinBordersBuffer,this.adjacentBondArrowsBuffer,this.distantBondArrowsBuffer,this.opaqueMiddleDiscBuffer,this.frontHistogramBuffer,this.backHistogramBuffer)}}setParameters(t){return super.setParameters(t,{},!1),t&&void 0!==t.histogramBinBorderVisible&&this.setVisibility(this.visible),this}setVisibility(t,e){return super.setVisibility(t,!0),this.frontHistogramBinBordersBuffer&&this.frontHistogramBinBordersBuffer.setVisibility(this.histogramBinBorderVisible),this.backHistogramBinBordersBuffer&&this.backHistogramBinBordersBuffer.setVisibility(this.histogramBinBorderVisible),e||this.viewer.requestRender(),this}}function yd(t){const e=t.atomPositions,i=t.histogram360Scaled,r=i.length<=180?360:2*i.length,s={triangles:new Float32Array(3*r*3),triangleColors:fd(t.opaqueMiddleDiscColor,3*r)},n={triangles:new Float32Array(3*i.length*3),triangleColors:fd(t.frontHistogramColor,3*i.length)},o={triangles:new Float32Array(3*i.length*3),triangleColors:fd(t.backHistogramColor,3*i.length)},a={startPoints:new Float32Array(3*i.length),endPoints:new Float32Array(3*i.length),startColors:fd(t.histogramBinBorderColor,i.length),endColors:fd(t.histogramBinBorderColor,i.length)},c={startPoints:new Float32Array(3*i.length),endPoints:new Float32Array(3*i.length),startColors:fd(t.histogramBinBorderColor,i.length),endColors:fd(t.histogramBinBorderColor,i.length)},l={startPoints:new Float32Array(6),endPoints:new Float32Array(6),startColors:fd(t.adjacentBondArrowColor,i.length),endColors:fd(t.adjacentBondArrowColor,i.length)},h={startPoints:new Float32Array(6),endPoints:new Float32Array(6),startColors:fd(t.distantBondArrowColor,i.length),endColors:fd(t.distantBondArrowColor,i.length)},d=Yr(),u=Yr(),m=Yr(),p=Yr(),f=Yr(),g=Yr(),y=Yr(),b=Yr(),x=Yr(),v=Yr(),w=Yr(),A=Yr(),_=Yr(),S=Yr(),C=Yr(),P=Yr(),I=[d,u,m,p];for(let t=0;t{let u=e[0],m=e[1];if("number"==typeof u&&Number.isInteger(u)&&"number"==typeof m&&Number.isInteger(m)){if(!d.get(u)||!d.get(m))return void(h+=1);c.index=u,l.index=m}else{n.setString(u),o.setString(m);var p=t.getAtomIndices(n),f=t.getAtomIndices(o);if(!p.length||!f.length)return void(h+=1);c.index=p[0],l.index=f[0]}a.addBond(c,l,1),i-=h;var g=c.distanceTo(l);switch(this.labelUnit){case"angstrom":r[i]=g.toFixed(2)+" "+String.fromCharCode(8491);break;case"nm":r[i]=(g/10).toFixed(2)+" nm";break;default:r[i]=g.toFixed(2)}var y=3*i;s[y+0]=(c.x+l.x)/2,s[y+1]=(c.y+l.y)/2,s[y+2]=(c.z+l.z)/2})),h>0&&(i-=h,s=s.subarray(0,3*i));var u=new Os(a.count,!0);return{text:r,position:s,bondSet:u,bondStore:a}}getBondData(t,e,i){const r=t.getBondData(this.getBondParams(e,i));return r.picking&&(r.picking=new to(r.picking.array,r.picking.structure,i.bondStore)),r}createData(t){if(!t.atomCount||!this.atomPair.length)return;const e=this.atomPair.length,i=new s(this.labelColor),r=this.getDistanceData(t,this.atomPair);this.textBuffer=new Eh({position:r.position,size:Si(e,this.labelSize),color:Ci(e,i.r,i.g,i.b),text:r.text},this.getLabelBufferParams());const n={bondSet:r.bondSet,bondStore:r.bondStore},o=this.getBondData(t,{position:!0,color:!0,picking:!0,radius:this.useCylinder},n);return this.useCylinder?this.distanceBuffer=new td(o,this.getBufferParams({openEnded:this.openEnded,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0})):this.distanceBuffer=new Nh(ps(o),this.getBufferParams({linewidth:this.linewidth,visible:this.lineVisible,opacity:this.lineOpacity})),{bondSet:r.bondSet,bondStore:r.bondStore,position:r.position,bufferList:[this.textBuffer,this.distanceBuffer]}}updateData(t,e){super.updateData(t,e);const i={bondSet:e.bondSet,bondStore:e.bondStore},r=this.getBondData(e.sview,t,i),s={};t&&!t.color||Object.assign(s,{color:r.color,color2:r.color2}),t&&!t.radius||Object.assign(s,{radius:r.radius}),this.distanceBuffer.setAttributes(s)}setParameters(t){return super.setParameters(t,{},!1),this.useCylinder||(t&&t.lineOpacity&&this.distanceBuffer.setParameters({opacity:t.lineOpacity}),t&&void 0!==t.opacity&&this.distanceBuffer.setParameters({opacity:this.lineOpacity}),t&&t.linewidth&&this.distanceBuffer.setParameters({linewidth:t.linewidth})),this}}function xd(t){return 2*(t.position.length/3)*3}Ne.add("distance",bd);const vd=Object.assign({scale:1,color:"grey"},zo);class wd extends Go{constructor(t,e={}){super({position:new Float32Array(xd(t)),color:new Float32Array(xd(t))},e),this.isLine=!0,this.vertexShader="Line.vert",this.fragmentShader="Line.frag";const i=new s(this.parameters.color),r=this.geometry.attributes;Ci(xd(t)/3,i.r,i.g,i.b,r.color.array),this.setAttributes(t)}get defaultParameters(){return vd}setAttributes(t={}){const e=this.geometry.attributes;let i,r,s;t.position&&t.vector&&(i=t.position,r=t.vector,s=e.position.array,e.position.needsUpdate=!0);const n=this.size/2,o=this.parameters.scale;if(i&&r)for(let t=0;t{if(t.residueCount<4)return;i.push(t);const r=new Ca(t),s=r.getPosition(),n=r.getColor(this.getColorParams()),o=r.getSize(this.getRadiusParams()),a=r.getPicking();e.push(new Gc({position:s.center,color:n.color,radius:o.size,picking:a.picking},this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0})),new wd({position:s.center,vector:s.axis},this.getBufferParams({color:"skyblue",scale:1})),new wd({position:s.center,vector:s.resdir},this.getBufferParams({color:"lightgreen",scale:1})))}),t.getSelection()),{bufferList:e,polymerList:i}}updateData(t,e){De&&Me.time(this.type+" repr update"),t=t||{};for(let i=0,r=e.polymerList.length;i radius2) {\nspaceposition.y = mapping.y * 1.5 * radius1;\nspaceposition.x = mapping.x * 1.5 * radius1;\n} else {\nspaceposition.y = mapping.y * 1.5 * radius2;\nspaceposition.x = mapping.x * 1.5 * radius2;\n}\nspaceposition.w = 1.0;\nvec4 e3 = vec4( 1.0 );\nvec3 e1, e1_temp, e2, e2_temp;\ne3.xyz = normalize(position_atom1-position_atom2);\nif (e3.z == 0.0) { e3.z = 0.0000000000001;}\nif ( (position_atom1.x - position_atom2.x) == 0.0) { position_atom1.x += 0.001;}\nif ( (position_atom1.y - position_atom2.y) == 0.0) { position_atom1.y += 0.001;}\nif ( (position_atom1.z - position_atom2.z) == 0.0) { position_atom1.z += 0.001;}\nvec4 focus = vec4( 1.0 );\nfocus.x = ( position_atom1.x*position_atom1.x - position_atom2.x*position_atom2.x +\n( radius2*radius2 - radius1*radius1 )*e3.x*e3.x/shrink )/(2.0*(position_atom1.x - position_atom2.x));\nfocus.y = ( position_atom1.y*position_atom1.y - position_atom2.y*position_atom2.y +\n( radius2*radius2 - radius1*radius1 )*e3.y*e3.y/shrink )/(2.0*(position_atom1.y - position_atom2.y));\nfocus.z = ( position_atom1.z*position_atom1.z - position_atom2.z*position_atom2.z +\n( radius2*radius2 - radius1*radius1 )*e3.z*e3.z/shrink )/(2.0*(position_atom1.z - position_atom2.z));\ne1.x = 1.0;\ne1.y = 1.0;\ne1.z = ( (e3.x*focus.x + e3.y*focus.y + e3.z*focus.z) - e1.x*e3.x - e1.y*e3.y)/e3.z;\ne1_temp = e1 - focus.xyz;\ne1 = normalize(e1_temp);\ne2_temp = e1.yzx * e3.zxy - e1.zxy * e3.yzx;\ne2 = normalize(e2_temp);\nmat3 R= mat3( e1.xyz, e2.xyz, e3.xyz );\nvertex_position.xyz = R * spaceposition.xyz;\nvertex_position.w = 1.0;\nvertex_position.x += (position_atom1.x+position_atom2.x) / 2.0;\nvertex_position.y += (position_atom1.y+position_atom2.y) / 2.0;\nvertex_position.z += (position_atom1.z+position_atom2.z) / 2.0;\ngl_Position = modelViewProjectionMatrix * vertex_position;\nvec4 i_near, i_far;\nvec4 near = gl_Position;\nnear.z = 0.0 ;\nnear = modelViewProjectionMatrixInverse * near;\ni_near = near;\nvec4 far = gl_Position;\nfar.z = far.w ;\ni_far = modelViewProjectionMatrixInverse * far;\nprime1 = vec4( position_atom1 - (position_atom1 - focus.xyz)*shrink, 1.0 );\nprime2 = vec4( position_atom2 - (position_atom2 - focus.xyz)*shrink, 1.0 );\nfloat Rsquare = (radius1*radius1/shrink) - (\n(position_atom1.x - focus.x)*(position_atom1.x - focus.x) +\n(position_atom1.y - focus.y)*(position_atom1.y - focus.y) +\n(position_atom1.z - focus.z)*(position_atom1.z - focus.z)\n);\nfocus.w = Rsquare;\nmatrix_near = mat4( i_near, i_far, focus, e3 );\ngl_Position.z = 1.0;\n}"),Ve.add("shader/HyperballStickImpostor.frag","#define STANDARD\n#define IMPOSTOR\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 interiorColor;\nuniform float interiorDarkening;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float clipNear;\nuniform float shrink;\nuniform mat4 modelViewMatrix;\nuniform mat4 modelViewProjectionMatrix;\nuniform mat4 modelViewMatrixInverseTranspose;\nuniform mat4 projectionMatrix;\nvarying mat4 matrix_near;\nvarying vec4 prime1;\nvarying vec4 prime2;\nvarying float vRadius;\nvarying float vRadius2;\n#ifdef PICKING\nuniform float objectId;\nvarying vec3 vPickingColor;\n#else\nvarying vec3 vColor1;\nvarying vec3 vColor2;\n#include common\n#include fog_pars_fragment\n#include bsdfs\n#include lights_pars_begin\n#include lights_physical_pars_fragment\n#endif\nbool interior = false;\nfloat calcClip( vec4 cameraPos ){\nreturn dot( cameraPos, vec4( 0.0, 0.0, 1.0, clipNear - 0.5 ) );\n}\nfloat calcClip( vec3 cameraPos ){\nreturn calcClip( vec4( cameraPos, 1.0 ) );\n}\nfloat calcDepth( in vec3 cameraPos ){\nvec2 clipZW = cameraPos.z * projectionMatrix[2].zw + projectionMatrix[3].zw;\nreturn 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\nstruct Ray {\nvec3 origin ;\nvec3 direction ;\n};\nbool cutoff_plane (vec3 M, vec3 cutoff, vec3 x3){\nfloat a = x3.x;\nfloat b = x3.y;\nfloat c = x3.z;\nfloat d = -x3.x*cutoff.x-x3.y*cutoff.y-x3.z*cutoff.z;\nfloat l = a*M.x+b*M.y+c*M.z+d;\nif (l<0.0) {return true;}\nelse{return false;}\n}\nvec3 isect_surf(Ray r, mat4 matrix_coef){\nvec4 direction = vec4(r.direction, 0.0);\nvec4 origin = vec4(r.origin, 1.0);\nfloat a = dot(direction,(matrix_coef*direction));\nfloat b = dot(origin,(matrix_coef*direction));\nfloat c = dot(origin,(matrix_coef*origin));\nfloat delta =b*b-a*c;\ngl_FragColor.a = 1.0;\nif (delta<0.0){\ndiscard;\n}\nfloat t1 =(-b-sqrt(delta))/a;\nreturn r.origin+t1*r.direction;\n}\nvec3 isect_surf2(Ray r, mat4 matrix_coef){\nvec4 direction = vec4(r.direction, 0.0);\nvec4 origin = vec4(r.origin, 1.0);\nfloat a = dot(direction,(matrix_coef*direction));\nfloat b = dot(origin,(matrix_coef*direction));\nfloat c = dot(origin,(matrix_coef*origin));\nfloat delta =b*b-a*c;\ngl_FragColor.a = 1.0;\nif (delta<0.0){\ndiscard;\n}\nfloat t2 =(-b+sqrt(delta))/a;\nreturn r.origin+t2*r.direction;\n}\nRay primary_ray(vec4 near1, vec4 far1){\nvec3 near=near1.xyz/near1.w;\nvec3 far=far1.xyz/far1.w;\nreturn Ray(near,far-near);\n}\nfloat update_z_buffer(vec3 M, mat4 ModelViewP){\nfloat depth1;\nvec4 Ms=(ModelViewP*vec4(M,1.0));\nreturn depth1=(1.0+Ms.z/Ms.w)/2.0;\n}\nvoid main(){\nfloat radius = max( vRadius, vRadius2 );\nvec4 i_near, i_far, focus;\nvec3 e3, e1, e1_temp, e2;\ni_near = vec4(matrix_near[0][0],matrix_near[0][1],matrix_near[0][2],matrix_near[0][3]);\ni_far = vec4(matrix_near[1][0],matrix_near[1][1],matrix_near[1][2],matrix_near[1][3]);\nfocus = vec4(matrix_near[2][0],matrix_near[2][1],matrix_near[2][2],matrix_near[2][3]);\ne3 = vec3(matrix_near[3][0],matrix_near[3][1],matrix_near[3][2]);\ne1.x = 1.0;\ne1.y = 1.0;\ne1.z = ( (e3.x*focus.x + e3.y*focus.y + e3.z*focus.z) - e1.x*e3.x - e1.y*e3.y)/e3.z;\ne1_temp = e1 - focus.xyz;\ne1 = normalize(e1_temp);\ne2 = normalize(cross(e1,e3));\nvec4 equation = focus;\nfloat shrinkfactor = shrink;\nfloat t1 = -1.0/(1.0-shrinkfactor);\nfloat t2 = 1.0/(shrinkfactor);\nvec4 colonne1, colonne2, colonne3, colonne4;\nmat4 mat;\nvec3 equation1 = vec3(t2,t2,t1);\nfloat A1 = - e1.x*equation.x - e1.y*equation.y - e1.z*equation.z;\nfloat A2 = - e2.x*equation.x - e2.y*equation.y - e2.z*equation.z;\nfloat A3 = - e3.x*equation.x - e3.y*equation.y - e3.z*equation.z;\nfloat A11 = equation1.x*e1.x*e1.x + equation1.y*e2.x*e2.x + equation1.z*e3.x*e3.x;\nfloat A21 = equation1.x*e1.x*e1.y + equation1.y*e2.x*e2.y + equation1.z*e3.x*e3.y;\nfloat A31 = equation1.x*e1.x*e1.z + equation1.y*e2.x*e2.z + equation1.z*e3.x*e3.z;\nfloat A41 = equation1.x*e1.x*A1 + equation1.y*e2.x*A2 + equation1.z*e3.x*A3;\nfloat A22 = equation1.x*e1.y*e1.y + equation1.y*e2.y*e2.y + equation1.z*e3.y*e3.y;\nfloat A32 = equation1.x*e1.y*e1.z + equation1.y*e2.y*e2.z + equation1.z*e3.y*e3.z;\nfloat A42 = equation1.x*e1.y*A1 + equation1.y*e2.y*A2 + equation1.z*e3.y*A3;\nfloat A33 = equation1.x*e1.z*e1.z + equation1.y*e2.z*e2.z + equation1.z*e3.z*e3.z;\nfloat A43 = equation1.x*e1.z*A1 + equation1.y*e2.z*A2 + equation1.z*e3.z*A3;\nfloat A44 = equation1.x*A1*A1 + equation1.y*A2*A2 + equation1.z*A3*A3 - equation.w;\ncolonne1 = vec4(A11,A21,A31,A41);\ncolonne2 = vec4(A21,A22,A32,A42);\ncolonne3 = vec4(A31,A32,A33,A43);\ncolonne4 = vec4(A41,A42,A43,A44);\nmat = mat4(colonne1,colonne2,colonne3,colonne4);\nRay ray = primary_ray(i_near,i_far) ;\nvec3 M;\nM = isect_surf(ray, mat);\nif (cutoff_plane(M, prime1.xyz, -e3) || cutoff_plane(M, prime2.xyz, e3)){ discard; }\nvec4 M1 = vec4(M,1.0);\nvec4 M2 = mat*M1;\nvec3 _normal = ( modelViewMatrixInverseTranspose * M2 ).xyz;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\n#ifdef NEAR_CLIP\nif( calcClip( modelViewMatrix * vec4( M, 1.0 ) ) > 0.0 ){\nM = isect_surf2(ray, mat);\nif( calcClip( modelViewMatrix * vec4( M, 1.0 ) ) > 0.0 )\ndiscard;\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( clipNear - 0.5 ) ) ) + ( 0.0000001 / radius ) );\n}\n}else if( gl_FragDepthEXT <= 0.0 ){\nM = isect_surf2(ray, mat);\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix);\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / radius );\n}\n}\n#else\nif( gl_FragDepthEXT <= 0.0 ){\nM = isect_surf2(ray, mat);\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / radius );\n}\n}\n#endif\nif (cutoff_plane(M, prime1.xyz, -e3) || cutoff_plane(M, prime2.xyz, e3)){ discard; }\nif (gl_FragDepthEXT < 0.0)\ndiscard;\nif (gl_FragDepthEXT > 1.0)\ndiscard;\nfloat distance_ratio = ((M.x-prime2.x)*e3.x + (M.y-prime2.y)*e3.y +(M.z-prime2.z)*e3.z) /\ndistance(prime2.xyz,prime1.xyz);\n#ifdef PICKING\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 vViewPosition = -( modelViewMatrix * vec4( M, 1.0 ) ).xyz;\nvec3 vNormal = _normal;\nvec3 vColor;\nif( distance_ratio>0.5 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\nvec3 normal = normalize( vNormal );\nvec3 geometryNormal = normal;\n#include lights_physical_fragment\n#include lights_fragment_begin\n#include lights_fragment_end\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\nif( interior ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");const Sd=new Float32Array([-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,1,1,1,-1,1,1]),Cd=new Uint16Array([0,1,2,0,2,3,1,5,6,1,6,2,4,6,5,4,7,6,0,7,4,0,3,7,0,5,1,0,4,5,3,2,6,3,6,7]);class Pd extends Fc{constructor(t,e={}){super("v3",t,e)}get mapping(){return Sd}get mappingIndices(){return Cd}get mappingIndicesSize(){return 36}get mappingSize(){return 8}get mappingItemSize(){return 3}}const Id=Object.assign({shrink:.14},zo),kd=Object.assign({shrink:{uniform:!0}},Vo);class Md extends Pd{constructor(t,e={}){super(t,e),this.parameterTypes=kd,this.isImpostor=!0,this.vertexShader="HyperballStickImpostor.vert",this.fragmentShader="HyperballStickImpostor.frag",this.addUniforms({modelViewProjectionMatrix:{value:new i},modelViewProjectionMatrixInverse:{value:new i},modelViewMatrixInverseTranspose:{value:new i},shrink:{value:this.parameters.shrink}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null},radius:{type:"f",value:null},radius2:{type:"f",value:null}}),this.setAttributes(t),this.makeMapping()}get defaultParameters(){return Id}}Object.assign({disableImpostor:!1},Hh,Id);const Td=class{constructor(t,e={}){return!Ie||e&&e.disableImpostor?(t.radius=function(t,e){const i=t.length,r=new Float32Array(i);for(let s=0;sa.push(r.atomLabel(t)))))}else if("residue"===this.labelGrouping){e&&!e.position||(c=[]),e&&!e.color||(h=[]),e&&!e.radius||(l=[]),e&&!e.text||(a=[]),i.colorParams&&(i.colorParams.structure=t.getStructure());const d=Fe.getScheme(i.colorParams),u=new pa(i.radiusParams),m=t.getAtomProxy();let p=0;t.eachResidue((t=>{const i=3*p;t.isProtein()||t.isNucleic()?(m.index=t.traceAtomIndex,e&&!e.position||m.positionToArray(c,i)):(m.index=t.atomOffset,e&&!e.position||t.positionToArray(c,i)),e&&!e.color||d.atomColorToArray(m,h,i),e&&!e.radius||(l[p]=u.atomRadius(m)),e&&!e.text||a.push(r.atomLabel(m)),++p})),e&&!e.position||(s=new Float32Array(c)),e&&!e.color||(o=new Float32Array(h)),e&&!e.radius||(n=new Float32Array(l))}return{position:s,size:n,color:o,text:a}}createData(t){return{bufferList:[new Eh(this.getTextData(t,{position:!0,color:!0,radius:!0,text:!0}),this.getBufferParams({fontFamily:this.fontFamily,fontStyle:this.fontStyle,fontWeight:this.fontWeight,xOffset:this.xOffset,yOffset:this.yOffset,zOffset:this.zOffset,attachment:this.attachment,showBorder:this.showBorder,borderColor:this.borderColor,borderWidth:this.borderWidth,showBackground:this.showBackground,backgroundColor:this.backgroundColor,backgroundMargin:this.backgroundMargin,backgroundOpacity:this.backgroundOpacity,fixedSize:this.fixedSize}))]}}updateData(t,e){e.bufferList[0].setAttributes(this.getTextData(e.sview,t))}getAtomRadius(){return 0}}function Od(t){const e=t.getAtomSet(),i=t.getBondSet(),r=t.getBondProxy();return i.forEach((function(t){r.index=t,e.clear(r.atomIndex1),e.clear(r.atomIndex2)})),e}Ne.add("label",$d);class Rd extends Sh{constructor(t,e,i){super(t,e,i),this.type="line",this.parameters=Object.assign({multipleBond:{type:"select",rebuild:!0,options:{off:"off",symmetric:"symmetric",offset:"offset"}},bondSpacing:{type:"number",precision:2,max:2,min:.5},linewidth:{type:"integer",max:50,min:1,buffer:!0},lines:{type:"boolean",rebuild:!0},crosses:{type:"select",rebuild:!0,options:{off:"off",lone:"lone",all:"all"}},crossSize:{type:"number",precision:2,max:2,min:.1}},this.parameters,{flatShaded:null,side:null,wireframe:null,roughness:null,metalness:null}),this.init(i)}init(t){var e=t||{};this.multipleBond=st(e.multipleBond,"off"),this.bondSpacing=st(e.bondSpacing,1),this.linewidth=st(e.linewidth,2),this.lines=st(e.lines,!0),this.crosses=st(e.crosses,"lone"),this.crossSize=st(e.crossSize,.4),super.init(e)}getAtomRadius(t){return.1}getBondParams(t,e){return e=Object.assign({multipleBond:this.multipleBond,bondSpacing:this.bondSpacing,radiusParams:{type:"size",size:.1,scale:1}},e),super.getBondParams(t,e)}_crossData(t,e){if(t&&!t.position&&!t.color)return;const i={};"lone"===this.crosses&&Object.assign(i,{atomSet:Od(e)});const r=e.getAtomData(this.getAtomParams(t,i)),s={},n=r.position,o=r.color,a=r.picking,c=(n||o).length,l=3*c;let h=new Float32Array(0),d=new Float32Array(0),u=new Float32Array(0),m=new Float32Array(0),p=0,f=new Float32Array(0);t&&!t.position||(h=s.position1=new Float32Array(l),d=s.position2=new Float32Array(l),p=this.crossSize/2),t&&!t.color||(u=s.color=new Float32Array(l),m=s.color2=new Float32Array(l)),t&&!t.picking||(f=new Float32Array(3*r.picking.array.length));for(let e=0;el?u[f]=-1:(c=Math.sqrt(l-a),u[f]=Math.floor(c)),++f;p[g]=d,m[g]=u}}function k(i){var r,s,n,a,d,f,b,v,w,A,S,C,P,I,k,M,T,B,D=3*i,$=i;r=Math.floor(.5+o*(t[D]+u[0])),s=Math.floor(.5+o*(t[D+1]+u[1])),n=Math.floor(.5+o*(t[D+2]+u[2]));var O,R=e[$],E=m[R],F=0,L=l*h,N=p[R];for(A=0;A=c||I>=l||k>=h)){var z=P*L+I*h+k;if(g)if(y[z]&_){if(y[z]&_){var V=x[z];V!==D&&b*b+v*v+w*w<(a=r+b-Math.floor(.5+o*(t[V]+u[0])))*a+(d=s+v-Math.floor(.5+o*(t[V+1]+u[1])))*d+(f=n+w-Math.floor(.5+o*(t[V+2]+u[2])))*f&&(x[z]=i)}}else y[z]|=_,x[z]=i;else y[z]|=_}F++}}function M(e){var i,r;for(console.time("EDTSurface fillvoxels"),i=0,r=y.length;i=c||_>=l||C>=h)){var L=A*F+_*h+C;if(y[L]&S){if(g){var N=x[L];b*b+v*v+w*w<(a=Math.floor(.5+o*(t[N]+u[0])))*a+(d=Math.floor(.5+o*(t[N+1]+u[1])))*d+(f=Math.floor(.5+o*(t[N+2]+u[2])))*f&&(x[L]=i)}}else y[L]|=S,g&&(x[L]=i)}R++}}function B(){var t,e,i,r;console.time("EDTSurface fastdistancemap");var s,n=Ed(c,l,h,Uint16Array,3),o=l*h,d=f*f,u=0;for(t=0;t0);var A,P=a*a,I=new Uint16Array(3);for(t=0;t=P)||(y[s]|=C,g&&y[s]&S&&(n.toArray(t,e,i,I),A=I[0]*o+I[1]*h+I[2],x[s]=x[A])));console.timeEnd("EDTSurface fastdistancemap")}function D(t,e,i,r){var s,n,o,a,d,u,m,p,f,g,x,v,w=new Uint16Array(3),A=0;if(0===i)return A;var I=-1,k=-1,M=-1,T=l*h;for(m=0,f=i;m-1&&k-1&&M-1&&(y[x=I*T+h*k+M]&_&&!(y[x]&S)?(e.fromArray(I,k,M,w),g=(a=I-w[0])*a+(d=k-w[1])*d+(u=M-w[2])*u,b[x]=g,y[x]|=S,y[x]|=C,r[A]=I,r[A+1]=k,r[A+2]=M,A+=3):y[x]&_&&y[x]&S&&(g=(a=I-w[0])*a+(d=k-w[1])*d+(u=M-w[2])*u)-1&&k-1&&M-1&&(y[x=I*T+h*k+M]&_&&!(y[x]&S)?(e.fromArray(I,k,M,w),g=(a=I-w[0])*a+(d=k-w[1])*d+(u=M-w[2])*u,b[x]=g,y[x]|=S,y[x]|=C,r[A]=I,r[A+1]=k,r[A+2]=M,A+=3):y[x]&_&&y[x]&S&&(g=(a=I-w[0])*a+(d=k-w[1])*d+(u=M-w[2])*u)-1&&k-1&&M-1&&(y[x=I*T+h*k+M]&_&&!(y[x]&S)?(e.fromArray(I,k,M,w),g=(a=I-w[0])*a+(d=k-w[1])*d+(u=M-w[2])*u,b[x]=g,y[x]|=S,y[x]|=C,r[A]=I,r[A+1]=k,r[A+2]=M,A+=3):y[x]&_&&y[x]&S&&(g=(a=I-w[0])*a+(d=k-w[1])*d+(u=M-w[2])*u)-1&&o-1&&d-1&&aT&&(T=O)}return{neighbourListLength:27*T+1,withinRadii:function(s,n,o,a,d){for(var u=0,m=p(s,c),f=p(n,l),g=p(o,h),y=Math.max(0,m-1),w=Math.max(0,f-1),_=Math.max(0,g-1),S=Math.min(b,m+2),C=Math.min(x,f+2),M=Math.min(v,g+2),T=y;Tu&&(u=h[t]);!function(){const t=$o(c,l,u,p,0);p=t.scaleFactor,y=t.dim,b=t.matrix,$=Math.max(5,2+Math.floor(m*p)),x=Si(y[0]*y[1]*y[2],-1001),v=new Int32Array(x.length),w=new Float32Array(y[0]),A=new Float32Array(y[1]),_=new Float32Array(y[2]),R(w,c[0],1/p),R(A,c[1],1/p),R(_,c[2],1/p)}(),function(){var t=0,e=2*Math.PI/g;C=new Float32Array(g),S=new Float32Array(g);for(var i=0;i=0;){if(n!==r&&n!==s&&F(n,t,e,i))return k=n,n;n=I[++o]}return k=-1,-1}function F(e,i,r,s){var n=3*e,o=d[e],a=t[n]-i,c=t[n+1]-r,l=t[n+2]-s;return a*a+c*c+l*l0&&u=0;)t{e(this._makeSurface(t.data.sd,i))}),(t=>{console.warn("MolecularSurface.getSurfaceWorker error - trying without worker",t),this.worker.terminate(),this.worker=void 0;const r=this.getSurface(i);e(r)}))}else{const t=this.getSurface(i);e(t)}}dispose(){this.worker&&this.worker.terminate()}}class Vd extends Sh{constructor(t,e,i){super(t,e,i),this.type="surface",this.parameters=Object.assign({surfaceType:{type:"select",rebuild:!0,options:{vws:"vws",sas:"sas",ms:"ms",ses:"ses",av:"av"}},probeRadius:{type:"number",precision:1,max:20,min:0,rebuild:!0},smooth:{type:"integer",precision:1,max:10,min:0,rebuild:!0},scaleFactor:{type:"number",precision:1,max:5,min:0,rebuild:!0},cutoff:{type:"number",precision:2,max:50,min:0,rebuild:!0},contour:{type:"boolean",rebuild:!0},background:{type:"boolean",rebuild:!0},opaqueBack:{type:"boolean",buffer:!0},filterSele:{type:"text",rebuild:!0},colorVolume:{type:"hidden"},useWorker:{type:"boolean",rebuild:!0}},this.parameters,{radius:null,scale:null}),this.__infoList=[],this.structure.signals.refreshed.add((()=>{this.__forceNewMolsurf=!0})),this.toBePrepared=!0,this.init(i)}init(t){const e=t||{};e.colorScheme=st(e.colorScheme,"uniform"),e.colorValue=st(e.colorValue,14540253),e.disablePicking=st(e.disablePicking,!0),this.surfaceType=st(e.surfaceType,"ms"),this.probeRadius=st(e.probeRadius,1.4),this.smooth=st(e.smooth,2),this.scaleFactor=st(e.scaleFactor,2),this.cutoff=st(e.cutoff,0),this.contour=st(e.contour,!1),this.background=st(e.background,!1),this.opaqueBack=st(e.opaqueBack,!0),this.filterSele=st(e.filterSele,""),this.colorVolume=st(e.colorVolume,void 0),this.useWorker=st(e.useWorker,!0),super.init(t)}prepareData(t,i,r){let s=this.__infoList[i];if(s||(s={},this.__infoList[i]=s),s.molsurf&&s.sele===t.selection.string)r(i);else{if(this.filterSele){const s=t.structure.getView(new pe(this.filterSele)),n=s.boundingBox.getSize(new e),o=Math.max(n.x,n.y,n.z),a=t.getAtomSetWithinPoint(s.center,o/2+6);if(0===(t=t.getView(new pe(t.getAtomSetWithinSelection(a,3).toSeleString()))).atomCount)return void r(i)}s.sele=t.selection.string,s.molsurf=new zd(t);const n=this.getSurfaceParams(),o=t=>{s.surface=t,r(i)};this.useWorker?s.molsurf.getSurfaceWorker(n,o):o(s.molsurf.getSurface(n))}}prepare(t){if((this.__forceNewMolsurf||this.__sele!==this.selection.string||this.__surfaceParams!==JSON.stringify(this.getSurfaceParams()))&&(this.__infoList.forEach((t=>{t&&t.molsurf&&t.molsurf.dispose()})),this.__infoList.length=0),0===this.structureView.atomCount)return void t();const e=()=>{this.__sele=this.selection.string,this.__surfaceParams=JSON.stringify(this.getSurfaceParams()),this.__forceNewMolsurf=!1,t()},i="default"===this.assembly?this.defaultAssembly:this.assembly,r=this.structure.biomolDict[i];r?r.partList.forEach(((t,i)=>{const s=t.getView(this.structureView);this.prepareData(s,i,(t=>{t===r.partList.length-1&&e()}))})):this.prepareData(this.structureView,0,e)}createData(t,e){const i=this.__infoList[e],r=i.surface;if(!r)return;const s={position:r.getPosition(),color:r.getColor(this.getColorParams()),index:r.getFilteredIndex(this.filterSele,t)},n=[];if(r.contour){const t=new Xo(s,this.getBufferParams({wireframe:!1}));n.push(t)}else{Object.assign(s,{normal:r.getNormal(),picking:r.getPicking(t.getStructure())});const e=new jo(s,this.getBufferParams({background:this.background,opaqueBack:this.opaqueBack,dullInterior:!1}));if("double"==this.getBufferParams().side){const t=new qo(e);n.push(t)}else n.push(e)}return{bufferList:n,info:i}}updateData(t,e){const i={};if(t.position||t.radius)return this.__forceNewMolsurf=!0,void this.build();t.color&&(i.color=e.info.surface.getColor(this.getColorParams())),t.index&&(i.index=e.info.surface.getFilteredIndex(this.filterSele,e.sview)),e.bufferList[0].setAttributes(i)}setParameters(t,e={},i){return t&&t.filterSele&&(e.index=!0),t&&void 0!==t.colorVolume&&(e.color=!0),t&&t.wireframe&&(t.contour||void 0===t.contour&&this.contour)&&(t.wireframe=!1),super.setParameters(t,e,i),this}getSurfaceParams(t={}){return Object.assign({type:this.surfaceType,probeRadius:this.probeRadius,scaleFactor:this.scaleFactor,smooth:this.smooth&&!this.contour,cutoff:this.cutoff,contour:this.contour,useWorker:this.useWorker,radiusParams:this.getRadiusParams()},t)}getColorParams(){const t=super.getColorParams();return t.volume=this.colorVolume,t}getAtomRadius(){return 0}clear(){super.clear()}dispose(){this.__infoList.forEach((t=>{t&&t.molsurf&&t.molsurf.dispose()})),this.__infoList.length=0,super.dispose()}}Ne.add("surface",Vd);class Gd extends Sh{constructor(t,e,i){super(t,e,i),this.type="point",this.parameters=Object.assign({pointSize:{type:"number",precision:1,max:100,min:0,buffer:!0},sizeAttenuation:{type:"boolean",buffer:!0},sortParticles:{type:"boolean",rebuild:!0},useTexture:{type:"boolean",buffer:!0},alphaTest:{type:"range",step:.001,max:1,min:0,buffer:!0},forceTransparent:{type:"boolean",buffer:!0},edgeBleach:{type:"range",step:.001,max:1,min:0,buffer:!0}},this.parameters,{flatShaded:null,wireframe:null,linewidth:null,side:null,roughness:null,metalness:null}),this.init(i)}init(t){var e=t||{};this.pointSize=st(e.pointSize,1),this.sizeAttenuation=st(e.sizeAttenuation,!0),this.sortParticles=st(e.sortParticles,!1),this.useTexture=st(e.useTexture,!1),this.alphaTest=st(e.alphaTest,.5),this.forceTransparent=st(e.forceTransparent,!1),this.edgeBleach=st(e.edgeBleach,0),super.init(e)}createData(t){var e=t.getAtomData(this.getAtomParams({position:!0,color:!0,picking:!0}));return{bufferList:[new Wc(e,this.getBufferParams({pointSize:this.pointSize,sizeAttenuation:this.sizeAttenuation,sortParticles:this.sortParticles,useTexture:this.useTexture,alphaTest:this.alphaTest,forceTransparent:this.forceTransparent,edgeBleach:this.edgeBleach}))]}}updateData(t,e){var i=e.sview.getAtomData(this.getAtomParams(t)),r={};t&&!t.position||Object.assign(r,{position:i.position}),t&&!t.color||Object.assign(r,{color:i.color}),e.bufferList[0].setAttributes(r)}getAtomRadius(){return.1}}Ne.add("point",Gd),Ve.add("shader/Ribbon.vert","#define STANDARD\nuniform float clipNear;\nuniform vec3 clipCenter;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\nattribute vec3 dir;\nattribute float size;\n#ifdef PICKING\n#include unpack_color\nattribute float primitiveId;\nvarying vec3 vPickingColor;\n#else\n#include color_pars_vertex\n#ifndef FLAT_SHADED\nvarying vec3 vNormal;\n#endif\n#endif\n#include common\nvoid main(void){\n#ifdef PICKING\nvPickingColor = unpackColor( primitiveId );\n#else\n#include color_vertex\n#include beginnormal_vertex\n#include defaultnormal_vertex\n#ifndef FLAT_SHADED\nvNormal = normalize( transformedNormal );\n#endif\n#endif\n#include begin_vertex\ntransformed += normalize( dir ) * size;\n#include project_vertex\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvViewPosition = -mvPosition.xyz;\n#endif\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}");const Ud=new Uint16Array([0,1,2,1,3,2]);function jd(t){return 3*(4*(t.position.length/3-1))}class Hd extends Uo{constructor(t,e={}){super({position:new Float32Array(jd(t)),color:new Float32Array(jd(t)),index:xt(jd(t),jd(t)/3),normal:new Float32Array(jd(t)),picking:t.picking},e),this.vertexShader="Ribbon.vert";const i=t.position.length/3-1,r=4*i,s=3*r;this.addAttributes({dir:{type:"v3",value:new Float32Array(s)}}),this.addAttributes({size:{type:"f",value:new Float32Array(r)}}),t.primitiveId=Pi(i),this.setAttributes(t),this.makeIndex()}setAttributes(t={}){const e=this.size/4,i=this.geometry.attributes;let r,s,n,o,a,c,l,h,d,u,m,p,f,g,y,b,x,v,w;t.position&&(r=t.position,l=i.position.array,i.position.needsUpdate=!0),t.normal&&(s=t.normal,h=i.normal.array,i.normal.needsUpdate=!0),t.size&&(n=t.size,d=i.size.array,i.size.needsUpdate=!0),t.dir&&(o=t.dir,u=i.dir.array,i.dir.needsUpdate=!0),t.color&&(a=t.color,m=i.color.array,i.color.needsUpdate=!0),t.primitiveId&&(c=t.primitiveId,p=i.primitiveId.array,i.primitiveId.needsUpdate=!0);let A=n?n[0]:null;for(f=0;f{if(!(t.residueCount<4)){i.push(t);var r=new od(t,this.getSplineParams()),s=r.getSubdividedPosition(),n=r.getSubdividedOrientation(),o=r.getSubdividedColor(this.getColorParams()),a=r.getSubdividedPicking(),c=r.getSubdividedSize(this.getRadiusParams());e.push(new Hd({position:s.position,normal:n.binormal,dir:n.normal,color:o.color,size:c.size,picking:a.picking},this.getBufferParams()))}}),t.getSelection()),{bufferList:e,polymerList:i}}updateData(t,e){t=t||{};var i=0,r=e.polymerList.length;for(i=0;i{if(t.residueCount<4||t.isNucleic())return;const s=new Pa(t),n=s.getAxis(this.localAngle,this.centerDist,this.ssBorder,this.getColorParams(),this.getRadiusParams());e+=n.size.length,i.push(n),r.push(s)}),t.getSelection());const s={begin:new Float32Array(3*e),end:new Float32Array(3*e),size:new Float32Array(e),color:new Float32Array(3*e),picking:{}};let n=new Float32Array(e),o=0;i.forEach((function(t){s.begin.set(t.begin,3*o),s.end.set(t.end,3*o),s.size.set(t.size,o),s.color.set(t.color,3*o),n.set(t.picking.array,o),o+=t.size.length})),e&&(s.picking=new Yn(n,t.getStructure()));return{bufferList:[new td({position1:s.begin,position2:s.end,color:s.color,color2:s.color,radius:s.size,picking:s.picking},this.getBufferParams({openEnded:this.openEnded,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0}))],axisList:i,helixbundleList:r,axisData:s}}updateData(t,e){if((t=t||{}).position)this.build();else{var i={};if(t.color||t.radius){var r=0;e.helixbundleList.forEach((i=>{var s=i.getAxis(this.localAngle,this.centerDist,this.ssBorder,this.getColorParams(),this.getRadiusParams());t.color&&e.axisData.color.set(s.color,3*r),(t.radius||t.scale)&&e.axisData.size.set(s.size,r),r+=s.size.length})),t.color&&Object.assign(i,{color:e.axisData.color,color2:e.axisData.color}),(t.radius||t.scale)&&Object.assign(i,{radius:e.axisData.size})}e.bufferList[0].setAttributes(i)}}}Ne.add("rocket",qd);class Xd extends dd{constructor(t,e,i){super(t,e,i),this.type="rope",this.parameters=Object.assign({smooth:{type:"integer",max:15,min:0,rebuild:!0}},this.parameters,{aspectRatio:null,smoothSheet:null})}init(t){var e=t||{};e.aspectRatio=1,e.tension=st(e.tension,.5),e.radiusScale=st(e.radiusScale,5),e.smoothSheet=!1,this.smooth=st(e.smooth,2),super.init(e)}getSpline(t){var e=new Ca(t);return new od(t,this.getSplineParams({directional:!1,positionIterator:e.getCenterIterator(this.smooth)}))}}Ne.add("rope",Xd);class Yd extends Sh{constructor(t,e,i){super(t,e,i),this.type="spacefill",this.parameters=Object.assign({sphereDetail:!0,disableImpostor:!0},this.parameters),this.init(i)}init(t){var e=t||{};e.useInteriorColor=st(e.useInteriorColor,!0),super.init(e)}createData(t){return{bufferList:[new Gc(t.getAtomData(this.getAtomParams()),this.getBufferParams({sphereDetail:this.sphereDetail,dullInterior:!0,disableImpostor:this.disableImpostor}))]}}updateData(t,e){var i=e.sview.getAtomData(this.getAtomParams(t)),r={};t&&!t.position||Object.assign(r,{position:i.position}),t&&!t.color||Object.assign(r,{color:i.color}),t&&!t.radius||Object.assign(r,{radius:i.radius}),e.bufferList[0].setAttributes(r)}}function Kd(t){return 3*(t.position.length/3-1)*2}Ne.add("spacefill",Yd);class Zd extends Go{constructor(t,e={}){super({position:new Float32Array(Kd(t)),color:new Float32Array(Kd(t))},e),this.isLine=!0,this.vertexShader="Line.vert",this.fragmentShader="Line.frag",this.setAttributes(t)}setAttributes(t){let e,i,r,s;const n=this.geometry.attributes;if(t.position&&(e=t.position,r=n.position.array,n.position.needsUpdate=!0),t.color&&(i=t.color,s=n.color.array,n.color.needsUpdate=!0),!e&&!i)return void Me.warn("TraceBuffer.prototype.setAttributes no data");let o,a;const c=this.size-1;for(let t=0;t{if(!(t.residueCount<4)){i.push(t);var r=new od(t,this.getSplineParams()),s=r.getSubdividedPosition(),n=r.getSubdividedColor(this.getColorParams());e.push(new Zd(Object.assign({},s,n),this.getBufferParams()))}}),t.getSelection()),{bufferList:e,polymerList:i}}updateData(t,e){t=t||{};var i=0,r=e.polymerList.length;for(i=0;i{t.boundingBox||t.computeBoundingBox(),this.boundingBox.union(t.boundingBox)}))}}const lu=Object.assign({aspectRatio:1.5,radialSegments:50,openEnded:!1,disableImpostor:!1},zo);class hu{constructor(t,e={}){this.group=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.wireframeGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.pickingGroup=new __WEBPACK_IMPORTED_MODULE_0_three__["t" /* Group */],this.visible=!0,this.parameters=nt(e,this.defaultParameters),this.splitPosition=new Float32Array(t.position1.length),this.cylinderRadius=new Float32Array(t.radius.length);const r=this.makeAttributes(t),s={radialSegments:this.parameters.radialSegments,openEnded:this.parameters.openEnded,disableImpostor:this.parameters.disableImpostor};this.cylinderBuffer=new td(r.cylinder,s),this.coneBuffer=new au(r.cone,s),this.geometry=new cu([this.cylinderBuffer.geometry,this.coneBuffer.geometry]),this.matrix=st(e.matrix,new i),this.picking=t.picking}get defaultParameters(){return lu}set matrix(t){Go.prototype.setMatrix.call(this,t)}get matrix(){return this.group.matrix.clone()}get pickable(){return!!this.picking}makeAttributes(t={}){const i=this.splitPosition,r=this.cylinderRadius,s=this.parameters.aspectRatio;let n,o;const a={},c={};if(t.radius){for(n=0,o=r.length;n(this._beforeParse(),this._parse(),this._afterParse(),this[this.__objName])))}_parse(){}_beforeParse(){}_afterParse(){De&&Me.log(this[this.__objName])}}class Nu extends Lu{constructor(t,e){var i=e||{};super(t,i),this.firstModelOnly=st(i.firstModelOnly,!1),this.asTrajectory=st(i.asTrajectory,!1),this.cAlphaOnly=st(i.cAlphaOnly,!1),this.structure=new Cc(this.name,this.path),this.structureBuilder=new za(this.structure)}get type(){return"structure"}get __objName(){return"structure"}}class zu{constructor(t,e,i="",r,s=[]){this.structure=t,this.index=e,this.description=i,this.entityType=function(t){switch(t=t.toLowerCase()){case"polymer":return 1;case"non-polymer":return 2;case"macrolide":return 3;case"water":return 4;default:return 0}}(r||""),this.chainIndexList=s,s.forEach((function(i){t.chainStore.entityIndex[i]=e}))}get type(){return function(t){switch(t){case 1:return"polymer";case 2:return"non-polymer";case 3:return"macrolide";case 4:return"water";default:return}}(this.entityType)}getEntityType(){return this.entityType}isPolymer(){return 1===this.entityType}isNonPolymer(){return 2===this.entityType}isMacrolide(){return 3===this.entityType}isWater(){return 4===this.entityType}eachChain(t){const e=this.structure.getChainProxy();this.chainIndexList.forEach((function(i){e.index=i,t(e)}))}}const Vu={a:1,b:1,c:1,alpha:90,beta:90,gamma:90,spacegroup:"P 1"};class Gu{constructor(t=Vu){this.cartToFrac=new i,this.fracToCart=new i,this.a=t.a,this.b=t.b,this.c=t.c,this.alpha=t.alpha,this.beta=t.beta,this.gamma=t.gamma,this.spacegroup=t.spacegroup;const e=kt(this.alpha),r=kt(this.beta),s=kt(this.gamma),n=Math.cos(e),o=Math.cos(r),a=Math.cos(s),c=Math.sin(r),l=Math.sin(s);if(this.volume=this.a*this.b*this.c*Math.sqrt(1-n*n-o*o-a*a+2*n*o*a),void 0===t.cartToFrac){const t=this.a*this.b*l/this.volume,e=(o*a-n)/(c*l);this.fracToCart.set(this.a,0,0,0,this.b*a,this.b*l,0,0,this.c*o,-this.c*c*e,1/t,0,0,0,0,1).transpose(),this.cartToFrac.getInverse(this.fracToCart)}else this.cartToFrac.copy(t.cartToFrac),this.fracToCart.getInverse(this.cartToFrac)}getPosition(t){const i=new Float32Array(24);if(t.unitcell){const r=t.unitcell,s=t.center.clone().applyMatrix4(r.cartToFrac).floor(),n=new e;let o=0;const a=function(t,e,a){n.set(t,e,a).add(s).applyMatrix4(r.fracToCart).toArray(i,o),o+=3};a(0,0,0),a(1,0,0),a(0,1,0),a(0,0,1),a(1,1,0),a(1,0,1),a(0,1,1),a(1,1,1)}return i}getCenter(t){return function(t,i=new e){const r=t.length;for(let e=0;e0)continue;let e,i,r,s,a,g=0;if(n){if(s=S.split(Wu),g=10===s.length?1:0,D=s[2],p&&"CA"!==D)continue;e=parseFloat(s[6-g]),i=parseFloat(s[7-g]),r=parseFloat(s[8-g])}else{if(D=S.substr(12,4).trim(),p&&"CA"!==D)continue;e=parseFloat(S.substr(30,8)),i=parseFloat(S.substr(38,8)),r=parseFloat(S.substr(46,8))}if(m){const t=3*b;if(y[t+0]=e,y[t+1]=i,y[t+2]=r,b+=1,x)continue}n?(P=parseInt(s[1]),a="",$="H"===S[0],I=g?"":s[4],k=parseInt(s[5-g]),B="",M=s[3],R="",T=1):(P=parseInt(S.substr(6,5),h),l&&99999===P&&(h=16),$="H"===S[0],I=S[21].trim(),k=parseInt(S.substr(22,4),d),l&&9999===k&&(d=16),B=S[26].trim(),M=S.substr(17,4).trim()||"MOL",O=parseFloat(S.substr(60,6)),R=S[16].trim(),T=parseFloat(S.substr(54,6)),t||(o?(a=S.substr(76,3).trim(),a in pn&&(a=pn[a])):(a=S.substr(76,2).trim(),I||(I=S.substr(72,4).trim())),E=parseInt((S.substr(79,1)+S.substr(78,1)).trim()))),dt.growIfFull(),dt.atomTypeId[pt]=ht.add(D,a),dt.x[pt]=e,dt.y[pt]=i,dt.z[pt]=r,dt.serial[pt]=P,dt.altloc[pt]=R.charCodeAt(0),dt.occupancy[pt]=isNaN(T)?0:T,n?(dt.partialCharge[pt]=parseFloat(s[9-g]),dt.radius[pt]=parseFloat(s[10-g])):(dt.bfactor[pt]=isNaN(O)?0:O,o&&(dt.partialCharge[pt]=parseFloat(S.substr(70,6))),isFinite(E)&&(dt.formalCharge||dt.addField("formalCharge",1,"int8"),dt.formalCharge[pt]=E));const v=qu(k,I,B);!$||K[v]||ju.includes(M)?tt||et===I||(Q+=1,J=Q.toString()):et===I&&rt===M&&(cn.includes(M)||it===k&&st===B)||(Q+=1,J=Q.toString(),it=k,rt=M,st=B),c.addAtom(ft,I,J,M,k,$,void 0,B),U[P]=pt,pt+=1,tt=!1,et=I}else if("CONECT"===C){const t=U[parseInt(S.substr(6,5))],e=[11,16,21,26],i={};if(void 0===t)continue;for(let r=0;r<4;++r){let s=parseInt(S.substr(e[r],5));if(!Number.isNaN(s)&&(s=U[s],void 0!==s))if(t0)continue;const s=e[l].replace(Zu,"");if(k&&"CA"!==s)continue;const T=parseFloat(e[x]),$=parseFloat(e[v]),O=parseFloat(e[w]);if(I){const e=3*r;if(t[e+0]=T,t[e+1]=$,t[e+2]=O,r+=1,X>0)continue}const R=e[h],E=parseInt(e[-1!==a?a:c]);let F=e[b];F="?"===F?"":F;const L=e[o],N=e[d],z="H"===e[p][0],V=e[g],Y=parseFloat(e[A]),K=parseFloat(e[_]);let Z=e[m];if(Z="."===Z?"":Z,H.growIfFull(),H.atomTypeId[q]=j.add(s,V),H.x[q]=T,H.y[q]=$,H.z[q]=O,H.serial[q]=parseInt(e[f]),H.bfactor[q]=isNaN(Y)?0:Y,H.occupancy[q]=isNaN(K)?0:K,H.altloc[q]=Z.charCodeAt(0),C.addAtom(X,L,N,R,E,z,void 0,F),De){const t=B[N];void 0!==t&&t!==L&&De&&Me.warn(t,L)}B[N]=L;const Q=e[u];D[Q]||(D[Q]=new Set),D[Q].add(S.chainStore.count-1),q+=1}else{const t=n.match(Ku),e=t.length;N===L.length&&(N=0);for(let i=0;ic*c)return o.growIfFull(),o.atomTypeId[f]=o.atomTypeId[t],o.x[f]=u.x,o.y[f]=u.y,o.z[f]=u.z,o.occupancy[f]=o.occupancy[t],o.serial[f]=f,o.altloc[f]="A".charCodeAt(0),s.addAtom(0,"","","HET",1,!0),void(f+=1)}}}))}}(T,S,C),C.finalize(),S.finalizeAtoms(),Wa(S),S.finalizeBonds();else{var Y=function(t,e,i){var r,s,n,o,a=[],c=[],l=t.struct_conf;if(null==l?void 0:l.pdbx_PDB_helix_class)for(em(l,"id"),r=0,s=l.beg_auth_seq_id.length;r0){o=o.split("(");var l=c(o[0]),h=c(o[1]);Object.keys(l).forEach((function(t){Object.keys(h).forEach((function(e){var r=new i;r.multiplyMatrices(l[t],h[e]),s[t+"x"+e]=r}))}))}else s=c(o);var d=[];for(var u in s)d.push(s[u]);var m=t;/^(0|[1-9][0-9]*)$/.test(m)&&(m="BU"+m);for(var p=a.asym_id_list[e].split(","),f=0,g=p.length;fA){var _=w;w=A,A=_;var S=p;p=x,x=S}if(0!==w&&0!==A)for(var C=0;Cb)continue}d=I.substr(5,5).trim(),u=parseInt(I.substr(0,5)),m=parseInt(I.substr(15,5)),v.growIfFull(),v.atomTypeId[w]=x.add(h),v.x[w]=T,v.y[w]=B,v.z[w]=D,v.serial[w]=m,r.addAtom(A,"","",d,u,!1,"l"),w+=1}}}(0,i.length,i)})),r.finalize(),i.finalizeAtoms(),Ha(i),Wa(i),i.finalizeBonds(),Ga(i),De&&Me.timeEnd("GroParser._parse "+this.name)}});var om=["mmtfVersion","mmtfProducer","unitCell","spaceGroup","structureId","title","depositionDate","releaseDate","experimentalMethods","resolution","rFree","rWork","bioAssemblyList","ncsOperatorList","entityList","groupList","numBonds","numAtoms","numGroups","numChains","numModels","groupsPerChain","chainsPerModel"].concat(["xCoordList","yCoordList","zCoordList","groupIdList","groupTypeList","chainIdList","bFactorList","atomIdList","altLocList","occupancyList","secStructList","insCodeList","sequenceIndexList","chainNameList","bondAtomList","bondOrderList"]);function am(t,e,i){return e?new t(e.buffer,e.byteOffset,e.byteLength/(i||1)):void 0}function cm(t){return am(DataView,t)}function lm(t){return am(Int8Array,t)}function hm(t){return am(Int32Array,t,4)}function dm(t,e){var i=t.length/2;e||(e=new Int16Array(i));for(var r=0,s=0;rn&&++a;e=new Int32Array(a)}for(i=0,r=0;is){for(var n=[],o=0;o0&&(o.biomolDict[t]=e)}const O=a.unitCell;O&&Array.isArray(O)&&O[0]?o.unitcell=new Gu({a:O[0],b:O[1],c:O[2],alpha:O[3],beta:O[4],gamma:O[5],spacegroup:a.spaceGroup}):o.unitcell=void 0,Ka(o,!0),Ya(o,!0),o.finalizeAtoms(),o.finalizeBonds(),Za(o),De&&Me.timeEnd("MmtfParser._parse "+this.name)}});const _m=/\s+/,Sm={1:1,2:2,3:3,am:1,ar:1,du:1,un:1,nc:0};ze.add("mol2",class extends Nu{get type(){return"mol2"}_parse(){De&&Me.time("Mol2Parser._parse "+this.name);const t=this.structure,e=this.structureBuilder,i=this.firstModelOnly,r=this.asTrajectory,s=t.frames;let n,o,a=!1;const c=t.atomMap,l=t.atomStore;l.resize(Math.round(this.streamer.data.length/60)),l.addField("partialCharge",1,"float32");let h=0,d=0,u=0,m=-1,p=0,f=0;const g=t.getAtomProxy(),y=t.getAtomProxy();this.streamer.eachChunkOfLines((function(b){!function(b,x,v){for(let w=b;wMOLECULE"===b?(f=1,d=0,++m):"@ATOM"===b?(f=2,u=l.count,r&&(o=0,n=new Float32Array(3*p),s.push(n),m>0&&(a=!0))):f="@BOND"===b?3:0;else if(1===f){if(0===d)t.title=b,t.id=b;else if(1===d){const t=b.split(_m);p=parseInt(t[0])}++d}else if(2===f){const t=b.split(_m);if(i&&m>0)continue;const s=parseFloat(t[2]),d=parseFloat(t[3]),u=parseFloat(t[4]);if(r){const t=3*o;if(n[t+0]=s,n[t+1]=d,n[t+2]=u,o+=1,a)continue}const p=t[0],f=t[1],g=t[5].split(".")[0],y=t[6]?parseInt(t[6]):1,x=t[7]?t[7]:"",v=t[8]?parseFloat(t[8]):0;l.growIfFull(),l.atomTypeId[h]=c.add(f,g),l.x[h]=s,l.y[h]=d,l.z[h]=u,l.serial[h]=p,l.partialCharge[h]=v,e.addAtom(m,"","",x,y,!0),h+=1}else if(3===f){if(i&&m>0)continue;if(r&&m>0)continue;const e=b.split(_m);g.index=parseInt(e[1])-1+u,y.index=parseInt(e[2])-1+u;const s=Sm[e[3]];t.bondStore.addBond(g,y,s)}}}(0,b.length,b)})),e.finalize(),t.finalizeAtoms(),Ha(t),Ya(t,!0),Ka(t,!0),t.finalizeBonds(),ec(t),Ga(t),De&&Me.timeEnd("Mol2Parser._parse "+this.name)}});ze.add("pdbqt",class extends Xu{get type(){return"pdbqt"}});ze.add("pqr",class extends Xu{get type(){return"pqr"}});const Cm=/> +<(.+)>/;class Pm extends Nu{get type(){return"sdf"}_parse(){De&&Me.time("SdfParser._parse "+this.name);const t=this.structure,e=this.structureBuilder,i=this.firstModelOnly,r=this.asTrajectory,s=this.streamer.peekLines(2);t.id=s[0].trim(),t.title=s[1].trim();const n=t.frames;let o,a,c=!1;const l=t.atomMap,h=t.atomStore;h.resize(Math.round(this.streamer.data.length/50)),h.addField("formalCharge",1,"int8");const d=t.getAtomProxy(),u=t.getAtomProxy();let m=0,p=0,f=0,g=0;const y=[];let b,x,v,w,A,_,S,C,P,I,k,M,T,B,D=!1,$={};t.extraData.sdf=y;let O=!1,R=!1,E=!1,F=[],L=[];const N=new Map;this.streamer.eachChunkOfLines((function(s){!function(s,z,V){for(let G=s;G-1,O?N.clear():(x=parseInt(s.substr(0,3)),v=parseInt(s.substr(3,3)),w=4,A=w+x,_=A,S=_+v,r&&(a=0,o=new Float32Array(3*x),n.push(o),f>0&&(c=!0)));else if(O&&"COUNTS"===F[0])x=parseInt(F[1]),r&&(a=0,o=new Float32Array(3*x),n.push(o),f>0&&(c=!0));else if(O&&2==F.length)"ATOM"===F[1]?"BEGIN"===F[0]?R=!0:"END"===F[0]&&(R=!1):"BOND"===F[1]&&("BEGIN"===F[0]?E=!0:"END"===F[0]&&(E=!1));else if(R||!O&&p>=w&&p0)continue;let t=0;if(O){if(C=parseFloat(F[2]),P=parseFloat(F[3]),I=parseFloat(F[4]),M=F[1],T=parseInt(F[0]),N.set(T,m),k=M+T,F.length>6){let e=F.slice(6).find((t=>0===t.indexOf("CHG=")));e&&(t=parseInt(e.substring(4)))}}else C=parseFloat(s.substr(0,10)),P=parseFloat(s.substr(10,10)),I=parseFloat(s.substr(20,10)),M=s.substr(31,3).trim(),k=M+(m-g+1);if(r){const t=3*a;if(o[t+0]=C,o[t+1]=P,o[t+2]=I,a+=1,c)continue}h.growIfFull(),h.atomTypeId[m]=l.add(k,M),h.x[m]=C,h.y[m]=P,h.z[m]=I,h.serial[m]=O?T:m,h.formalCharge[m]=t,e.addAtom(f,"","","HET",1,!0),m+=1}else if(E||!O&&p>=_&&p0)continue;if(r&&f>0)continue;O?(d.index=N.get(parseInt(F[2])),u.index=N.get(parseInt(F[3])),B=parseInt(F[1])):(d.index=parseInt(s.substr(0,3))-1+g,u.index=parseInt(s.substr(3,3))-1+g,B=parseInt(s.substr(6,3))),t.bondStore.addBond(d,u,B)}else if("M CHG"===s.substr(0,6)){const t=parseInt(s.substr(6,3));for(let e=0,i=10;e"===s.charAt(0)&&(b=s.match(Cm))?(D=b[1],$[D]=[]):!1!==D&&s&&$[D].push(s);++p}}}(0,s.length,s)})),e.finalize(),t.finalizeAtoms(),t.finalizeBonds(),ec(t),De&&Me.timeEnd("SdfParser._parse "+this.name)}_postProcess(){ec(this.structure)}}ze.add("sdf",Pm),ze.add("sd",Pm),ze.add("mol",Pm);function Im(t,e,i){return parseInt(t.substr(e,i).trim())}class km extends Nu{get type(){return"prmtop"}_parse(){De&&Me.time("PrmtopParser._parse "+this.name);const t=this.structure,e=this.structureBuilder,i=t.atomMap,r=t.atomStore;r.addField("partialCharge",1,"float32"),r.addField("radius",1,"float32");const s=[],n={},o=["NATOM","NTYPES","NBONH","MBONA","NTHETH","MTHETA","NPHIH","MPHIA","NHPARM","NPARM","NNB","NRES","NBONA","NTHETA","NPHIA","NUMBND","NUMANG","NPTRA","NATYP","NPHB","IFPERT","NBPER","NGPER","NDPER","MBPER","MGPER","MDPER","IFBOX","NMXRS","IFCAP","NUMEXTRA","NCOPY"];let a,c,l,h,d;o.forEach((t=>{n[t]=0}));let u,m,p,f,g,y=new Uint8Array(0);this.streamer.eachChunkOfLines((function(t){!function(t,e,i){for(let b=t;b0)return void Me.error("dcd format with fixed atoms unsupported, aborting");const p=n.NATOM,f=4*p;for(let i=0,a=n.NSET;i=1&&(i.timeOffset=(n.ISTART-1)*i.deltaTime),De&&Me.timeEnd("DcdParser._parse "+this.name)}});const Fm={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function Lm(t){switch(Number(t)){case Fm.BYTE:return"byte";case Fm.CHAR:return"char";case Fm.SHORT:return"short";case Fm.INT:return"int";case Fm.FLOAT:return"float";case Fm.DOUBLE:return"double";default:return"undefined"}}function Nm(t){switch(Number(t)){case Fm.BYTE:case Fm.CHAR:return 1;case Fm.SHORT:return 2;case Fm.INT:case Fm.FLOAT:return 4;case Fm.DOUBLE:return 8;default:return-1}}function zm(t){switch(String(t)){case"byte":return Fm.BYTE;case"char":return Fm.CHAR;case"short":return Fm.SHORT;case"int":return Fm.INT;case"float":return Fm.FLOAT;case"double":return Fm.DOUBLE;default:return-1}}function Vm(t,e){if(1!==t){const i=new Array(t);for(let r=0;r6,"non valid type "+h);const d=t.readUint32();let u=t.readUint32();2===i&&(Om(u>0,"offsets larger than 4GB not supported"),u=t.readUint32()),c[0]===e&&(n+=d),s[r]={name:o,dimensions:c,attributes:l,type:Lm(h),size:d,offset:u,record:c[0]===e}}}return{variables:s,recordStep:n}}(t,r.recordId,e);return i.variables=s.variables,i.recordDimension.recordStep=s.recordStep,i}function Xm(t){let e;const i=t.readUint32();if(i===Um)return Om(t.readUint32()!==Um,"wrong empty tag for list of attributes"),[];{Om(i!==Wm,"wrong tag for list of attributes");const r=t.readUint32();e=new Array(r);for(let i=0;i6,"non valid type "+s);const n=t.readUint32(),o=Gm(t,s,n);Rm(t),e[i]={name:r,type:Lm(s),value:o}}}return e}class Ym{constructor(t){const e=new hi(t);e.setBigEndian(),Om("CDF"!==e.readChars(3),"should start with CDF");const i=e.readByte();Om(i>2,"unknown version"),this.header=qm(e,i),this.buffer=e}get version(){return 1===this.header.version?"classic format":"64-bit offset format"}get recordDimension(){return this.header.recordDimension}get dimensions(){return this.header.dimensions}get globalAttributes(){return this.header.globalAttributes}get variables(){return this.header.variables}hasDataVariable(t){return-1!==this.header.variables.findIndex((function(e){return e.name===t}))}getDataVariable(t){let e;return e="string"==typeof t?this.header.variables.find((function(e){return e.name===t})):t,Om(void 0===e,"variable not found"),this.buffer.seek(e.offset),e.record?function(t,e,i){const r=zm(e.type),s=e.size?e.size/Nm(r):1,n=i.length,o=new Array(n),a=i.recordStep;for(let e=0;e=1&&(e.timeOffset=s[0]),s.length>=2&&(e.deltaTime=s[1]-s[0]),De&&Me.timeEnd("NctrajParser._parse "+this.name)}}ze.add("nctraj",Km),ze.add("ncdf",Km),ze.add("nc",Km);ze.add("trr",class extends $m{get type(){return"trr"}get isBinary(){return!0}_parse(){De&&Me.time("TrrParser._parse "+this.name);const t=vt(this.streamer.data),e=new DataView(t),i=this.frames,r=i.coordinates,s=i.boxes,n=i.times;let o=0;for(;;){o+=8;const i=e.getInt32(o);o+=4,o+=i;const a=e.getInt32(o+8),c=e.getInt32(o+12),l=e.getInt32(o+16),h=e.getInt32(o+28),d=e.getInt32(o+32),u=e.getInt32(o+36),m=e.getInt32(o+40);o+=52;const p=a/9,f=3*m;if(8===p?n.push(e.getFloat64(o)):n.push(e.getFloat32(o)),o+=2*p,a){const t=new Float32Array(9);if(8===p)for(let i=0;i<9;++i)t[i]=10*e.getFloat64(o),o+=8;else for(let i=0;i<9;++i)t[i]=10*e.getFloat32(o),o+=4;s.push(t)}if(o+=c,o+=l,h){let i;if(8===p){i=new Float32Array(f);for(let t=0;t>8&65280|i>>24&255}i=new Float32Array(t,o,f);for(let t=0;t=t.byteLength)break}n.length>=1&&(i.timeOffset=n[0]),n.length>=2&&(i.deltaTime=n[1]-n[0]),De&&Me.timeEnd("TrrParser._parse "+this.name)}});const Zm=new Uint32Array([0,0,0,0,0,0,0,0,0,8,10,12,16,20,25,32,40,50,64,80,101,128,161,203,256,322,406,512,645,812,1024,1290,1625,2048,2580,3250,4096,5060,6501,8192,10321,13003,16384,20642,26007,32768,41285,52015,65536,82570,104031,131072,165140,208063,262144,330280,416127,524287,660561,832255,1048576,1321122,1664510,2097152,2642245,3329021,4194304,5284491,6658042,8388607,10568983,13316085,16777216]);function Qm(t){let e=1,i=0;for(;t>=e&&i<32;)i++,e<<=1;return i}const Jm=new Uint8Array(32);function tp(t,e){let i=1,r=0;Jm[0]=1;for(let r=0;r>=8;for(;0!==s;)Jm[t++]=255&s,s>>=8;i=t}let s=1;for(i--;Jm[i]>=s;)r++,s*=2;return r+8*i}function ep(t,e,i,r){const s=(1<=8;)o=o<<8|e[a++],c|=o>>n<0&&(n>n&(1<8;)ip[a++]=ep(t,e,8,o),r-=8;r>0&&(ip[a++]=ep(t,e,r,o));for(let t=i-1;t>0;t--){let e=0;for(let i=a-1;i>=0;i--){e=e<<8|ip[i];const r=e/s[t]|0;ip[i]=r,e-=r*s[t]}n[t]=e}n[0]=ip[0]|ip[1]<<8|ip[2]<<16|ip[3]<<24}ze.add("xtc",class extends $m{get type(){return"xtc"}get isBinary(){return!0}_parse(){De&&Me.time("XtcParser._parse "+this.name);const t=vt(this.streamer.data),e=new DataView(t),i=this.frames,r=i.coordinates,s=i.boxes,n=i.times,o=new Int32Array(6),a=new Int32Array(3),c=new Int32Array(3),l=new Uint32Array(3),h=new Float32Array(3),d=new Float32Array(3);let u=0;const m=new Int32Array(3),p=new Uint32Array(m.buffer);for(;;){let i;const f=e.getInt32(u+4);u+=12;const g=3*f;n.push(e.getFloat32(u)),u+=4;const y=new Float32Array(9);for(let t=0;t<9;++t)y[t]=10*e.getFloat32(u),u+=4;if(s.push(y),f<=9){i=new Float32Array(f);for(let t=0;t16777215?(c[0]=Qm(a[0]),c[1]=Qm(a[1]),c[2]=Qm(a[2]),f=0):f=tp(3,a);let y=e.getInt32(u);u+=4;let b=y-1;b=9>b?9:b;let x=Zm[b]/2|0,v=Zm[y]/2|0;l[0]=l[1]=l[2]=Zm[y];let w=4*Math.ceil(e.getInt32(u)/4);u+=4;const A=1/n;let _=0,S=0;const C=new Uint8Array(t,u);for(h[0]=h[1]=h[2]=0;S0){h[0]=h[1]=h[2]=0;for(let t=0;t<_;t+=3){if(rp(m,C,3,y,l,h,p),S++,h[0]+=d[0]-v,h[1]+=d[1]-v,h[2]+=d[2]-v,0===t){let t=h[0];h[0]=d[0],d[0]=t,t=h[1],h[1]=d[1],d[1]=t,t=h[2],h[2]=d[2],d[2]=t,i[r++]=d[0]*A,i[r++]=d[1]*A,i[r++]=d[2]*A}else d[0]=h[0],d[1]=h[1],d[2]=h[2];i[r++]=h[0]*A,i[r++]=h[1]*A,i[r++]=h[2]*A}}else i[r++]=h[0]*A,i[r++]=h[1]*A,i[r++]=h[2]*A;if(y+=t,t<0?(v=x,x=y>9?Zm[y-1]/2|0:0):t>0&&(x=v,v=Zm[y]/2|0),l[0]=l[1]=l[2]=Zm[y],0===l[0]||0===l[1]||0===l[2])return void console.error("(xdrfile error) Undefined error.")}u+=w}for(let t=0;t=t.byteLength)break}n.length>=1&&(i.timeOffset=n[0]),n.length>=2&&(i.deltaTime=n[1]-n[0]),De&&Me.timeEnd("XtcParser._parse "+this.name)}});class sp extends Lu{constructor(t,e){const i=e||{};super(t,i),this.volume=new Eo(this.name,this.path),this.voxelSize=st(i.voxelSize,1)}get type(){return"volume"}get __objName(){return"volume"}_afterParse(){this.volume.setMatrix(this.getMatrix()),super._afterParse()}getMatrix(){return new i}}const np=/\s+/,op=/-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/g,ap=.529177210859;class cp extends sp{get type(){return"cube"}_parse(){De&&Me.time("CubeParser._parse "+this.name);const t=this.volume,i=this.streamer.peekLines(6),r={},s=ap*this.voxelSize;function n(t,e){var r=i[t].trim().split(np)[e];return parseFloat(r)}r.atomCount=Math.abs(n(2,0)),r.originX=n(2,1)*ap,r.originY=n(2,2)*ap,r.originZ=n(2,3)*ap,r.NVX=n(3,0),r.NVY=n(4,0),r.NVZ=n(5,0),r.basisX=new e(n(3,1),n(3,2),n(3,3)).multiplyScalar(s),r.basisY=new e(n(4,1),n(4,2),n(4,3)).multiplyScalar(s),r.basisZ=new e(n(5,1),n(5,2),n(5,3)).multiplyScalar(s);const o=new Float32Array(r.NVX*r.NVY*r.NVZ);let a=0,c=0;const l=n(2,0)>0?0:1;this.streamer.eachChunkOfLines((function(t){!function(t,e,i){for(let s=t;s=r.atomCount+6+l){const e=t.match(op);for(let t=0,i=e.length;t>8&255}e.xStart=n[0],e.yStart=n[1],e.zStart=n[2],e.xExtent=n[3],e.yExtent=n[4],e.zExtent=n[5],e.xRate=n[6],e.yRate=n[7],e.zRate=n[8];const t=1/n[17],s=t*this.voxelSize;e.xlen=n[9]*s,e.ylen=n[10]*s,e.zlen=n[11]*s,e.alpha=n[12]*t,e.beta=n[13]*t,e.gamma=n[14]*t,i=n[15]/100,r=n[16],e.gamma=n[14]*t}t.header=e,De&&Me.log(e,i,r);const c=new Float32Array(e.xExtent*e.yExtent*e.zExtent);let l=512;const h=Math.ceil(e.xExtent/8),d=Math.ceil(e.yExtent/8),u=Math.ceil(e.zExtent/8);for(var m=0;ms){const t=i[r].trim();if(""!==t){const e=t.split(hp);for(let t=0,i=e.length;t=s&&(p-s)%u!=0&&m=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},addVertex:function(t,e,i){var r=this.vertices,s=this.object.geometry.vertices;s.push(r[t+0]),s.push(r[t+1]),s.push(r[t+2]),s.push(r[e+0]),s.push(r[e+1]),s.push(r[e+2]),s.push(r[i+0]),s.push(r[i+1]),s.push(r[i+2])},addVertexLine:function(t){var e=this.vertices,i=this.object.geometry.vertices;i.push(e[t+0]),i.push(e[t+1]),i.push(e[t+2])},addNormal:function(t,e,i){var r=this.normals,s=this.object.geometry.normals;s.push(r[t+0]),s.push(r[t+1]),s.push(r[t+2]),s.push(r[e+0]),s.push(r[e+1]),s.push(r[e+2]),s.push(r[i+0]),s.push(r[i+1]),s.push(r[i+2])},addFace:function(t,e,i,r,s,n,o,a){var c,l=this.vertices.length,h=this.parseVertexIndex(t,l),d=this.parseVertexIndex(e,l),u=this.parseVertexIndex(i,l);if(void 0===r?this.addVertex(h,d,u):(c=this.parseVertexIndex(r,l),this.addVertex(h,d,c),this.addVertex(d,u,c)),void 0!==s){var m=this.normals.length;h=this.parseNormalIndex(s,m),d=s===n?h:this.parseNormalIndex(n,m),u=s===o?h:this.parseNormalIndex(o,m),void 0===r?this.addNormal(h,d,u):(c=this.parseNormalIndex(a,m),this.addNormal(h,d,c),this.addNormal(d,u,c))}},addLineGeometry:function(t){this.object.geometry.type="Line";for(var e=this.vertices.length,i=0,r=t.length;i0?x.setAttribute("normal",new __WEBPACK_IMPORTED_MODULE_0_three__["f" /* BufferAttribute */](new Float32Array(b.normals),3)):x.computeVertexNormals(),y.push(x)}}return y}};ze.add("obj",class extends kp{get type(){return"obj"}getLoader(){return new Mp}});const Tp=function(){this.propertyNameMapping={}};Tp.prototype={constructor:Tp,setPropertyNameMapping:function(t){this.propertyNameMapping=t},bin2str:function(t){for(var e=new Uint8Array(t),i="",r=0;r=r.elements[o].count&&(o++,a=0);var h=this.parseASCIIElement(r.elements[o].properties,l);this.handleElement(i,r.elements[o].name,h),a++}}return this.postProcess(i)},postProcess:function(t){if(t.useColor){for(var e=0;e{const s=r.length;for(let n=0;n/g,""),{declaration:e(),root:i()};function e(){if(!s(/^<\?xml\s*/))return;const t={attributes:{}};for(;!n()&&!o("?>");){const e=r();if(!e)return t;t.attributes[e.name]=e.value}return s(/\?>\s*/),t}function i(){const t=s($p);if(!t)return;const e={name:t[1],attributes:{},children:[]};for(;!(n()||o(">")||o("?>")||o("/>"));){const t=r();if(!t)return e;e.attributes[t.name]=t.value}if(s(/^\s*\/>\s*/))return e;let a;for(s(/\??>\s*/),e.content=function(){const t=s(Op);return t?t[1]:""}();a=i();)e.children.push(a);return s(/^<\/[\w-:.]+>\s*/),e}function r(){const t=s(Rp);var e;if(t)return{name:t[1],value:(e=t[2],e.replace(Dp,""))}}function s(e){const i=t.match(e);if(i)return t=t.slice(i[0].length),i}function n(){return 0===t.length}function o(e){return 0===t.indexOf(e)}}class Fp extends Lu{constructor(t,e){const i=e||{};super(t,i),this.useDomParser=st(i.useDomParser,!1),this.xml={name:this.name,path:this.path,data:{}}}get type(){return"xml"}get __objName(){return"xml"}get isXml(){return!0}__xmlParser(t){return Ep(t)}__domParser(t){return(new window.DOMParser).parseFromString(t,"text/xml")}_parse(){De&&Me.time("XmlParser._parse "+this.name),this.useDomParser?this.streamer.data instanceof Document?this.xml.data=this.streamer.data:this.xml.data=this.__domParser(this.streamer.asText()):this.xml.data=this.__xmlParser(this.streamer.asText()),De&&Me.timeEnd("XmlParser._parse "+this.name)}}function Lp(t,e){const i=t.getNamedItem(e);return null!==i?i.value:""}function Np(t,e,i=!1){const r=Lp(t,"icode").trim(),s=Lp(t,"chain").trim(),n=Lp(t,"altcode");let o=Lp(t,"resnum");return r&&(o+="^"+r),s&&(o+=":"+s),e&&(o+="."+e),i&&n.trim()&&(o+="%"+n),o+="/"+(parseInt(Lp(t,"model"))-1),o}function zp(t){const e=Lp(t,"chain").trim();let i=`[${Lp(t,"rescode")}]${Lp(t,"resnum")}`;return e&&(i+=`:${e}`),i}function Vp(t,e,i){void 0===t[e]?t[e]=i:t[e]|=i}function Gp(t,e){return null!==t&&t.value===e}function Up(t,e,i){let r=0;const s=e.getElementsByTagName("clash");for(let e=0,i=s.length;e0&&(r+=1);e.getElementsByTagName("bond-outlier").length>0&&(r+=1);return e.getElementsByTagName("plane-outlier").length>0&&(r+=1),Gp(i.getNamedItem("rota"),"OUTLIER")&&(r+=1),Gp(i.getNamedItem("rama"),"OUTLIER")&&(r+=1),Gp(i.getNamedItem("RNApucker"),"outlier")&&(r+=1),r}ze.add("xml",Fp);class jp{constructor(t,e){this.name=t,this.path=e,this.rsrzDict={},this.rsccDict={},this.rciDict={},this.clashDict={},this.clashArray=[],this.geoDict={},this.geoAtomDict={},this.atomDict={},this.clashSele="NONE"}get type(){return"validation"}fromXml(t){De&&Me.time("Validation.fromXml");const e=this.rsrzDict,i=this.rsccDict,r=this.rciDict,s=this.clashDict,n=this.clashArray,o=this.geoDict,a=this.geoAtomDict,c=this.atomDict,l=t.getElementsByTagName("Entry");if(1===l.length){const t=l[0].getElementsByTagName("chemical_shift_list");if(1===t.length){const e=t[0].getElementsByTagName("random_coil_index");for(let t=0,i=e.length;t0&&(o[r]=t)}else{const t=e.getElementsByTagName("clash"),i=e.getElementsByTagName("mog-bond-outlier"),n=e.getElementsByTagName("mog-angle-outlier");if(i.length>0||n.length>0||t.length>0){const e={};a[r]=e;for(let i=0,r=t.length;i>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{n=n+(s=s+e[r++]|0)|0}while(--o);s%=65521,n%=65521}return s|n<<16|0}ze.add("validation",class extends Fp{constructor(t,e){super(t,e||{}),this.useDomParser=!0,this.validation=new jp(this.name,this.path)}get __objName(){return"validation"}get isXml(){return!0}_parse(){super._parse(),De&&Me.time("ValidationParser._parse "+this.name),this.validation.fromXml(this.xml.data),De&&Me.timeEnd("ValidationParser._parse "+this.name)}});var Xp=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();function Yp(t,e,i,r){var s=Xp,n=r+i;t^=-1;for(var o=r;o>>8^s[255&(t^e[o])];return-1^t}var Kp=30,Zp=12;function Qp(t,e){var i,r,s,n,o,a,c,l,h,d,u,m,p,f,g,y,b,x,v,w,A,_,S,C,P;i=t.state,r=t.next_in,C=t.input,s=r+(t.avail_in-5),n=t.next_out,P=t.output,o=n-(e-t.avail_out),a=n+(t.avail_out-257),c=i.dmax,l=i.wsize,h=i.whave,d=i.wnext,u=i.window,m=i.hold,p=i.bits,f=i.lencode,g=i.distcode,y=(1<>>=v=x>>>24,p-=v,0===(v=x>>>16&255))P[n++]=65535&x;else{if(!(16&v)){if(0==(64&v)){x=f[(65535&x)+(m&(1<>>=v,p-=v),p<15&&(m+=C[r++]<>>=v=x>>>24,p-=v,!(16&(v=x>>>16&255))){if(0==(64&v)){x=g[(65535&x)+(m&(1<c){t.msg="invalid distance too far back",i.mode=Kp;break t}if(m>>>=v,p-=v,A>(v=n-o)){if((v=A-v)>h&&i.sane){t.msg="invalid distance too far back",i.mode=Kp;break t}if(_=0,S=u,0===d){if(_+=l-v,v2;)P[n++]=S[_++],P[n++]=S[_++],P[n++]=S[_++],w-=3;w&&(P[n++]=S[_++],w>1&&(P[n++]=S[_++]))}else{_=n-A;do{P[n++]=P[_++],P[n++]=P[_++],P[n++]=P[_++],w-=3}while(w>2);w&&(P[n++]=P[_++],w>1&&(P[n++]=P[_++]))}break}}break}}while(r>3,m&=(1<<(p-=w<<3))-1,t.next_in=r,t.next_out=n,t.avail_in=r=1&&0===T[w];w--);if(A>w&&(A=w),0===w)return s[n++]=20971520,s[n++]=20971520,a.bits=1,0;for(v=1;v0&&(t===rf||1!==w))return-1;for(B[1]=0,b=1;btf||t===nf&&P>ef)return 1;for(;;){p=b-S,o[x]m?(f=D[$+o[x]],g=k[M+o[x]]):(f=96,g=0),c=1<>S)+(l-=c)]=p<<24|f<<16|g|0}while(0!==l);for(c=1<>=1;if(0!==c?(I&=c-1,I+=c):I=0,x++,0==--T[b]){if(b===w)break;b=e[i+o[x]]}if(b>A&&(I&d)!==h){for(0===S&&(S=A),u+=v,C=1<<(_=b-S);_+Stf||t===nf&&P>ef)return 1;s[h=I&d]=A<<24|_<<16|u-n|0}}return 0!==I&&(s[u+I]=b-S<<24|64<<16|0),a.bits=A,0}var df=1,uf=2,mf=0,pf=-2,ff=1,gf=12,yf=30,bf=852,xf=592;function vf(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function wf(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Af(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=ff,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(bf),e.distcode=e.distdyn=new Int32Array(xf),e.sane=1,e.back=-1,mf):pf}(t)):pf}function _f(t,e){var i,r;return t?(r=new wf,t.state=r,r.window=null,i=function(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pf:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,Af(t))):pf}(t,e),i!==mf&&(t.state=null),i):pf}var Sf,Cf,Pf=!0;function If(t){if(Pf){var e;for(Sf=new Int32Array(512),Cf=new Int32Array(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(hf(df,t.lens,0,288,Sf,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;hf(uf,t.lens,0,32,Cf,0,t.work,{bits:5}),Pf=!1}t.lencode=Sf,t.lenbits=9,t.distcode=Cf,t.distbits=5}function kf(t,e,i,r){var s,n=t.state;return null===n.window&&(n.wsize=1<=n.wsize?(Wp(n.window,e,i-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):((s=n.wsize-n.wnext)>r&&(s=r),Wp(n.window,e,i-r,s,n.wnext),(r-=s)?(Wp(n.window,e,i-r,r,0),n.wnext=r,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave>>8&255,i.check=Yp(i.check,I,2,0),l=0,h=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",i.mode=yf;break}if(8!=(15&l)){t.msg="unknown compression method",i.mode=yf;break}if(h-=4,A=8+(15&(l>>>=4)),0===i.wbits)i.wbits=A;else if(A>i.wbits){t.msg="invalid window size",i.mode=yf;break}i.dmax=1<>8&1),512&i.flags&&(I[0]=255&l,I[1]=l>>>8&255,i.check=Yp(i.check,I,2,0)),l=0,h=0,i.mode=3;case 3:for(;h<32;){if(0===a)break t;a--,l+=r[n++]<>>8&255,I[2]=l>>>16&255,I[3]=l>>>24&255,i.check=Yp(i.check,I,4,0)),l=0,h=0,i.mode=4;case 4:for(;h<16;){if(0===a)break t;a--,l+=r[n++]<>8),512&i.flags&&(I[0]=255&l,I[1]=l>>>8&255,i.check=Yp(i.check,I,2,0)),l=0,h=0,i.mode=5;case 5:if(1024&i.flags){for(;h<16;){if(0===a)break t;a--,l+=r[n++]<>>8&255,i.check=Yp(i.check,I,2,0)),l=0,h=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((m=i.length)>a&&(m=a),m&&(i.head&&(A=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),Wp(i.head.extra,r,n,m,A)),512&i.flags&&(i.check=Yp(i.check,r,m,n)),a-=m,n+=m,i.length-=m),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===a)break t;m=0;do{A=r[n+m++],i.head&&A&&i.length<65536&&(i.head.name+=String.fromCharCode(A))}while(A&&m>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=gf;break;case 10:for(;h<32;){if(0===a)break t;a--,l+=r[n++]<>>=7&h,h-=7&h,i.mode=27;break}for(;h<3;){if(0===a)break t;a--,l+=r[n++]<>>=1)){case 0:i.mode=14;break;case 1:if(If(i),i.mode=20,6===e){l>>>=2,h-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=yf}l>>>=2,h-=2;break;case 14:for(l>>>=7&h,h-=7&h;h<32;){if(0===a)break t;a--,l+=r[n++]<>>16^65535)){t.msg="invalid stored block lengths",i.mode=yf;break}if(i.length=65535&l,l=0,h=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(m=i.length){if(m>a&&(m=a),m>c&&(m=c),0===m)break t;Wp(s,r,n,m,o),a-=m,n+=m,c-=m,o+=m,i.length-=m;break}i.mode=gf;break;case 17:for(;h<14;){if(0===a)break t;a--,l+=r[n++]<>>=5,h-=5,i.ndist=1+(31&l),l>>>=5,h-=5,i.ncode=4+(15&l),l>>>=4,h-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=yf;break}i.have=0,i.mode=18;case 18:for(;i.have>>=3,h-=3}for(;i.have<19;)i.lens[k[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S={bits:i.lenbits},_=hf(0,i.lens,0,19,i.lencode,0,i.work,S),i.lenbits=S.bits,_){t.msg="invalid code lengths set",i.mode=yf;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,b=65535&P,!((g=P>>>24)<=h);){if(0===a)break t;a--,l+=r[n++]<>>=g,h-=g,i.lens[i.have++]=b;else{if(16===b){for(C=g+2;h>>=g,h-=g,0===i.have){t.msg="invalid bit length repeat",i.mode=yf;break}A=i.lens[i.have-1],m=3+(3&l),l>>>=2,h-=2}else if(17===b){for(C=g+3;h>>=g)),l>>>=3,h-=3}else{for(C=g+7;h>>=g)),l>>>=7,h-=7}if(i.have+m>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=yf;break}for(;m--;)i.lens[i.have++]=A}}if(i.mode===yf)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=yf;break}if(i.lenbits=9,S={bits:i.lenbits},_=hf(df,i.lens,0,i.nlen,i.lencode,0,i.work,S),i.lenbits=S.bits,_){t.msg="invalid literal/lengths set",i.mode=yf;break}if(i.distbits=6,i.distcode=i.distdyn,S={bits:i.distbits},_=hf(uf,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S),i.distbits=S.bits,_){t.msg="invalid distances set",i.mode=yf;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(a>=6&&c>=258){t.next_out=o,t.avail_out=c,t.next_in=n,t.avail_in=a,i.hold=l,i.bits=h,Qp(t,u),o=t.next_out,s=t.output,c=t.avail_out,n=t.next_in,r=t.input,a=t.avail_in,l=i.hold,h=i.bits,i.mode===gf&&(i.back=-1);break}for(i.back=0;y=(P=i.lencode[l&(1<>>16&255,b=65535&P,!((g=P>>>24)<=h);){if(0===a)break t;a--,l+=r[n++]<>x)])>>>16&255,b=65535&P,!(x+(g=P>>>24)<=h);){if(0===a)break t;a--,l+=r[n++]<>>=x,h-=x,i.back+=x}if(l>>>=g,h-=g,i.back+=g,i.length=b,0===y){i.mode=26;break}if(32&y){i.back=-1,i.mode=gf;break}if(64&y){t.msg="invalid literal/length code",i.mode=yf;break}i.extra=15&y,i.mode=22;case 22:if(i.extra){for(C=i.extra;h>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;y=(P=i.distcode[l&(1<>>16&255,b=65535&P,!((g=P>>>24)<=h);){if(0===a)break t;a--,l+=r[n++]<>x)])>>>16&255,b=65535&P,!(x+(g=P>>>24)<=h);){if(0===a)break t;a--,l+=r[n++]<>>=x,h-=x,i.back+=x}if(l>>>=g,h-=g,i.back+=g,64&y){t.msg="invalid distance code",i.mode=yf;break}i.offset=b,i.extra=15&y,i.mode=24;case 24:if(i.extra){for(C=i.extra;h>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=yf;break}i.mode=25;case 25:if(0===c)break t;if(m=u-c,i.offset>m){if((m=i.offset-m)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=yf;break}m>i.wnext?(m-=i.wnext,p=i.wsize-m):p=i.wnext-m,m>i.length&&(m=i.length),f=i.window}else f=s,p=o-i.offset,m=i.length;m>c&&(m=c),c-=m,i.length-=m;do{s[o++]=f[p++]}while(--m);0===i.length&&(i.mode=21);break;case 26:if(0===c)break t;s[o++]=i.length,c--,i.mode=21;break;case 27:if(i.wrap){for(;h<32;){if(0===a)break t;a--,l|=r[n++]<=252?6:Of>=248?5:Of>=240?4:Of>=224?3:Of>=192?2:1;function Rf(t){var e,i,r,s,n,o=t.length,a=0;for(s=0;s>>6,e[n++]=128|63&i):i<65536?(e[n++]=224|i>>>12,e[n++]=128|i>>>6&63,e[n++]=128|63&i):(e[n++]=240|i>>>18,e[n++]=128|i>>>12&63,e[n++]=128|i>>>6&63,e[n++]=128|63&i);return e}function Ef(t,e){var i,r,s,n,o=e||t.length,a=new Array(2*o);for(r=0,i=0;i4)a[r++]=65533,i+=n-1;else{for(s&=2===n?31:3===n?15:7;n>1&&i1?a[r++]=65533:s<65536?a[r++]=s:(s-=65536,a[r++]=55296|s>>10&1023,a[r++]=56320|1023&s)}return function(t,e){if(e<65537&&(t.subarray&&Df||!t.subarray&&Bf))return String.fromCharCode.apply(null,Hp(t,e));for(var i="",r=0;rt.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+$f[t[i]]>e?i:e}$f[254]=$f[254]=1;var Lf=0,Nf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function zf(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function Vf(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Gf=Object.prototype.toString;function Uf(t){if(!(this instanceof Uf))return new Uf(t);this.options=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}}return t}({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zf,this.strm.avail_out=0;var i,r,s,n=_f(this.strm,e.windowBits);if(n!==Lf)throw new Error(Nf[n]);this.header=new Vf,i=this.strm,r=this.header,i&&i.state&&(0==(2&(s=i.state).wrap)||(s.head=r,r.done=!1))}Uf.prototype.push=function(t,e){var i,r,s,n,o,a,c=this.strm,l=this.options.chunkSize,h=this.options.dictionary,d=!1;if(this.ended)return!1;r=e===~~e?e:!0===e?4:0,"string"==typeof t?c.input=function(t){for(var e=new Uint8Array(t.length),i=0,r=e.length;i0||0===c.avail_out)&&1!==i);return 1===i&&(r=4),4===r?(i=function(t){if(!t||!t.state)return pf;var e=t.state;return e.window&&(e.window=null),t.state=null,mf}(this.strm),this.onEnd(i),this.ended=!0,i===Lf):2!==r||(this.onEnd(Lf),c.avail_out=0,!0)},Uf.prototype.onData=function(t){this.chunks.push(t)},Uf.prototype.onEnd=function(t){t===Lf&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=function(t){var e,i,r,s,n,o;for(r=0,e=0,i=t.length;e({path:t,data:e.data})))}getUrl(t){const e=ri(t);return`${this.baseUrl}file/${e.path}${e.query}`}getCountUrl(t){const e=ri(t);return`${this.baseUrl}traj/numframes/${e.path}${e.query}`}getFrameUrl(t,e){const i=ri(t);return`${this.baseUrl}traj/frame/${e}/${i.path}${i.query}`}getFrameParams(t,e){return`atomIndices=${e.join(";")}`}getPathUrl(t,e){const i=ri(t);return`${this.baseUrl}traj/path/${e}/${i.path}${i.query}`}getExt(t){return ri(t).ext}}function ig(t,e){return{type:"integer",max:t,min:e}}function rg(t,e,i){return{type:"number",precision:t,max:e,min:i}}function sg(t,e,i){return{type:"range",step:t,max:e,min:i}}function ng(...t){return{type:"select",options:t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:e})),{})}}const og={backgroundColor:{type:"color"},quality:ng("auto","low","medium","high"),sampleLevel:sg(1,5,-1),impostor:{type:"boolean"},workerDefault:{type:"boolean"},rotateSpeed:rg(1,10,0),zoomSpeed:rg(1,10,0),panSpeed:rg(1,10,0),clipNear:sg(1,100,0),clipFar:sg(1,100,0),clipDist:ig(200,0),clipMode:ng("scene","camera"),clipScale:ng("relative","absolute"),fogNear:sg(1,100,0),fogFar:sg(1,100,0),cameraType:ng("perspective","orthographic","stereo"),cameraEyeSep:rg(3,1,.01),cameraFov:sg(1,120,15),lightColor:{type:"color"},lightIntensity:rg(2,10,0),ambientColor:{type:"color"},ambientIntensity:rg(2,10,0),hoverTimeout:ig(1e4,-1),tooltip:{type:"boolean"},mousePreset:ng(...Object.keys(Zo))};const ag="2.2.2"; + */ +var hc=function(t,e){this.points=t,this.metric=e,this.maxDepth=0,this.currentNode=0;for(var r=t.length/3,i=new Uint32Array(r),o=0;othis.maxDepth&&(this.maxDepth=t);var o=i-r;if(0===o)return-1;var n=4*this.currentNode,a=this.nodes;if(this.currentNode+=1,1===o)return a[n]=r,a[n+1]=-1,a[n+2]=-1,a[n+3]=e,n;for(var s,c,u,h,l,p=this.indices,d=this.points,f=r+Math.floor(o/2),m=t%3,g=r,y=i-1;y>g;){for(h=d[3*p[u=g+y>>1]+m],c=p[u],p[u]=p[y],p[y]=c,l=g,s=g;se&&o.pop()}var y=n[u+1],v=n[u+2];if(-1!==v||-1!==y){h=-1===v?y:-1===y?v:t[p]<=a[d+p]?y:v,c(h),(o.size()n[3*a[o[t]]+i])throw new Error("left child is > parent!");r+=this.verify(s,e+1)}if(-1!==c){if(n[3*a[o[c]]+i]0},lc.prototype.isBackbone=function(){var t=this.residueType.backboneIndexList;return t.length>0&&t.includes(this.index-this.residueAtomOffset)},lc.prototype.isPolymer=function(){if(this.structure.entityList.length>0)return this.entity.isPolymer();var t=this.residueType.moleculeType;return 3===t||4===t||5===t},lc.prototype.isSidechain=function(){return this.isPolymer()&&!this.isBackbone()},lc.prototype.isCg=function(){var t=this.residueType.backboneType;return 4===t||5===t||6===t},lc.prototype.isTrace=function(){return this.index===this.residueType.traceAtomIndex+this.residueAtomOffset},lc.prototype.isHetero=function(){return 1===this.residueType.hetero},lc.prototype.isProtein=function(){return 3===this.residueType.moleculeType},lc.prototype.isNucleic=function(){var t=this.residueType.moleculeType;return 4===t||5===t},lc.prototype.isRna=function(){return 4===this.residueType.moleculeType},lc.prototype.isDna=function(){return 5===this.residueType.moleculeType},lc.prototype.isWater=function(){return 1===this.residueType.moleculeType},lc.prototype.isIon=function(){return 2===this.residueType.moleculeType},lc.prototype.isSaccharide=function(){return 6===this.residueType.moleculeType},lc.prototype.isHelix=function(){return vn.includes(this.sstruc)},lc.prototype.isSheet=function(){return bn.includes(this.sstruc)},lc.prototype.isTurn=function(){return xn.includes(this.sstruc)&&this.isProtein()},lc.prototype.isBonded=function(){return 0!==this.bondHash.countArray[this.index]},lc.prototype.isRing=function(){return void 0!==this.residueType.getRings().atomRings[this.index-this.residueAtomOffset]},lc.prototype.isAromatic=function(){return 1===this.aromatic},lc.prototype.isPolarHydrogen=function(){var t=!1;return 1!==this.number?t:t=!this.hasBondToElement(6)},lc.prototype.isMetal=function(){return this.atomType.isMetal()},lc.prototype.isNonmetal=function(){return this.atomType.isNonmetal()},lc.prototype.isMetalloid=function(){return this.atomType.isMetalloid()},lc.prototype.isHalogen=function(){return this.atomType.isHalogen()},lc.prototype.isDiatomicNonmetal=function(){return this.atomType.isDiatomicNonmetal()},lc.prototype.isPolyatomicNonmetal=function(){return this.atomType.isPolyatomicNonmetal()},lc.prototype.isAlkaliMetal=function(){return this.atomType.isAlkaliMetal()},lc.prototype.isAlkalineEarthMetal=function(){return this.atomType.isAlkalineEarthMetal()},lc.prototype.isNobleGas=function(){return this.atomType.isNobleGas()},lc.prototype.isTransitionMetal=function(){return this.atomType.isTransitionMetal()},lc.prototype.isPostTransitionMetal=function(){return this.atomType.isPostTransitionMetal()},lc.prototype.isLanthanide=function(){return this.atomType.isLanthanide()},lc.prototype.isActinide=function(){return this.atomType.isActinide()},lc.prototype.getDefaultValence=function(){return this.atomType.getDefaultValence()},lc.prototype.getValenceList=function(){return this.atomType.getValenceList()},lc.prototype.getOuterShellElectronCount=function(){return this.atomType.getOuterShellElectronCount()},lc.prototype.distanceTo=function(t){var e=this.atomStore,r=t.atomStore,i=this.index,o=t.index,n=e.x[i]-r.x[o],a=e.y[i]-r.y[o],s=e.z[i]-r.z[o],c=n*n+a*a+s*s;return Math.sqrt(c)},lc.prototype.connectedTo=function(t){var e=this.atomStore,r=t.atomStore,i=this.index,o=t.index;if(e.altloc&&r.altloc){var n=e.altloc[i],a=r.altloc[o];if(0!==n&&0!==a&&32!==n&&32!==a&&n!==a)return!1}var s=e.x[i]-r.x[o],c=e.y[i]-r.y[o],u=e.z[i]-r.z[o],h=s*s+c*c+u*u;if(h<48&&this.isCg())return!0;if(isNaN(h))return!1;var l=this.covalent+t.covalent,p=l+.3,d=l-.5;return hd*d},lc.prototype.positionFromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e+0],this.y=t[e+1],this.z=t[e+2],this},lc.prototype.positionToArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.index,i=this.atomStore;return t[e+0]=i.x[r],t[e+1]=i.y[r],t[e+2]=i.z[r],t},lc.prototype.positionToVector3=function(t){return void 0===t&&(t=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]),t.x=this.x,t.y=this.y,t.z=this.z,t},lc.prototype.positionFromVector3=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},lc.prototype.positionAdd=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},lc.prototype.positionSub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},lc.prototype.getResidueBonds=function(t){void 0===t&&(t=!1);var e,r,i,o,n=this.residueAtomOffset,a=this.index-this.residueAtomOffset,s=this.residueType.getBonds(),c=s.atomIndices1,u=s.atomIndices2;for(t||(o=[]),e=c.indexOf(a);-1!==e;){if(i=u[e]+n,!o)return i;o.push(i),e=c.indexOf(a,e+1)}for(r=u.indexOf(a);-1!==r;){if(i=c[r]+n,!o)return i;o.push(i),r=u.indexOf(a,r+1)}return o},lc.prototype.qualifiedName=function(t){void 0===t&&(t=!1);var e="";return this.resname&&!t&&(e+="["+this.resname+"]"),void 0!==this.resno&&(e+=this.resno),this.inscode&&(e+="^"+this.inscode),this.chainname&&(e+=":"+this.chainname),this.atomname&&(e+="."+this.atomname),this.altloc&&(e+="%"+this.altloc),this.structure.modelStore.count>1&&(e+="/"+this.modelIndex),e},lc.prototype.clone=function(){return new lc(this.structure,this.index)},lc.prototype.toObject=function(){return{index:this.index,residueIndex:this.residueIndex,resname:this.resname,x:this.x,y:this.y,z:this.z,element:this.element,chainname:this.chainname,resno:this.resno,serial:this.serial,vdw:this.vdw,covalent:this.covalent,hetero:this.hetero,bfactor:this.bfactor,altloc:this.altloc,atomname:this.atomname,modelIndex:this.modelIndex}},Object.defineProperties(lc.prototype,pc);var mc=new Float32Array(3),gc=function(t,e){void 0===e&&(e=!1),He&&je.time("Kdtree build");var r=e?dc:fc,i=new Float32Array(3*t.atomCount),o=new Uint32Array(t.atomCount),n=0;t.eachAtom((function(t){i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z,o[n/3]=t.index,n+=3})),this.atomIndices=o,this.points=i,this.kdtree=new hc(i,r),He&&je.timeEnd("Kdtree build")};gc.prototype.nearest=function(t,e,i){t instanceof __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]?t.toArray(mc):t instanceof lc&&t.positionToArray(mc);for(var o=this.kdtree.nearest(mc,e,i),n=this.kdtree.indices,a=this.kdtree.nodes,s=this.atomIndices,c=[],u=0,h=o.length;u":"3/4-Z","?":"X-Y","@":"Y-X",A:"Z+1/3",B:"Z+2/3",C:"X+2/3",D:"Y+1/3",E:"-Y+2/3",F:"X-Y+1/3",G:"Y-X+2/3",H:"-X+1/3",I:"X+1/3",J:"Y+2/3",K:"-Y+1/3",L:"X-Y+2/3",M:"Y-X+1/3",N:"-X+2/3",O:"2/3+X",P:"1/3+Y",Q:"1/3+Z",R:"2/3-Y",S:"1/3+X-Y",T:"2/3+Y-X",U:"1/3-X",V:"2/3-X",W:"1/3-Y",X:"1/3-Z",Y:"2/3+Y",Z:"1/3+Y-X","[":"2/3+X-Y","]":"1/3+X","^":"2/3+Z",_:"2/3-Z","`":"5/6+Z",a:"1/6+Z",b:"5/6-Z",c:"1/6-Z",d:"Z+5/6",e:"Z+1/6",f:"Z+1/4",g:"+Y"},vc={"P 1":" !#","P -1":" !#$%&","P 1 2 1":" !#$!&","P 1 21 1":" !#$'&","C 1 2 1":" !#$!&()#*)&","P 1 m 1":" !# %#","P 1 c 1":" !# %+","C 1 m 1":" !# %#()#(,#","C 1 c 1":" !# %+()#(,+","P 1 2/m 1":" !# %#$!&$%&","P 1 21/m 1":" !#$)&$%& ,#","C 1 2/m 1":" !# %#$!&$%&()#(,#*)&*,&","P 1 2/c 1":" !#$!-$%& %+","P 1 21/c 1":" !#$%&$)- ,+","C 1 2/c 1":" !#$!-$%& %+()#*)-*,&(,+","P 2 2 2":" !#$%#$!& %&","P 2 2 21":" !#$%+$!- %&","P 21 21 2":" !#$%#*)&(,&","P 21 21 21":" !#*%+$)-(,&","C 2 2 21":" !#$%+$!- %&()#*,+*)-(,&","C 2 2 2":" !#$%#$!& %&()#*,#*)&(,&","F 2 2 2":" !#$%#$!& %& )+$,+$)- ,-(!+*%+*!-(%-()#*,#*)&(,&","I 2 2 2":" !#$%# %&$!&.'/01/.120'2","I 21 21 21":" !#*%+$)-(,&()+$,#*!& %-","P m m 2":" !#$%# %#$!#","P m c 21":" !#$%+ %+$!#","P c c 2":" !#$%# %+$!+","P m a 2":" !#$%#(%#*!#","P c a 21":" !#$%+(%#*!+","P n c 2":" !#$%# ,+$)+","P m n 21":" !#*%+(%+$!#","P b a 2":" !#$%#(,#*)#","P n a 21":" !#$%+(,#*)+","P n n 2":" !#$%#(,+*)+","C m m 2":" !#$%# %#$!#()#*,#(,#*)#","C m c 21":" !#$%+ %+$!#()#*,+(,+*)#","C c c 2":" !#$%# %+$!+()#*,#(,+*)+","A m m 2":" !#$%# %#$!# )+$,+ ,+$)+","A b m 2":" !#$%# ,#$)# )+$,+ %+$!+","A m a 2":" !#$%#(%#*!# )+$,+(,+*)+","A b a 2":" !#$%#(,#*)# )+$,+(%+*!+","F m m 2":" !#$%# %#$!# )+$,+ ,+$)+(!+*%+(%+*!+()#*,#(,#*)#","F d d 2":" !#$%#345675 )+$,+3896:9(!+*%+;49<79()#*,#;85<:5","I m m 2":" !#$%# %#$!#()+*,+(,+*)+","I b a 2":" !#$%#(,#*)#()+*,+ %+$!+","I m a 2":" !#$%#(%#*!#()+*,+ ,+$)+","P 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#","P 2/n 2/n 2/n":" !#$%#$!& %&*,-()-(,+*)+","P 2/c 2/c 2/m":" !#$%#$!- %-$%& !& %+$!+","P 2/b 2/a 2/n":" !#$%#$!& %&*,&()&(,#*)#","P 21/m 2/m 2/a":" !#*%#$!&(%&$%&(!& %#*!#","P 2/n 21/n 2/a":" !#*%#*)- ,-$%&(!&(,+$)+","P 2/m 2/n 21/a":" !#*%+*!- %&$%&(!-(%+$!#","P 21/c 2/c 2/a":" !#*%#$!-(%-$%&(!& %+*!+","P 21/b 21/a 2/m":" !#$%#*)&(,&$%& !&(,#*)#","P 21/c 21/c 2/n":" !#*,#$)-(%-$%&()& ,+*!+","P 2/b 21/c 21/m":" !#$%+$)- ,&$%& !- ,+$)#","P 21/n 21/n 2/m":" !#$%#*)-(,-$%& !&(,+*)+","P 21/m 21/m 2/n":" !#$%#*'&.,&*,&.'& %#$!#","P 21/b 2/c 21/n":" !#*,+$!-(,&$%&()- %+*)#","P 21/b 21/c 21/a":" !#*%+$)-(,&$%&(!- ,+*)#","P 21/n 21/m 21/a":" !#0%/$'&.12$%&.!2 1#0'/","C 2/m 2/c 21/m":" !#$%+$!- %&$%& !- %+$!#()#*,+*)-(,&*,&()-(,+*)#","C 2/m 2/c 21/a":" !#$,+$)- %&$%& )- ,+$!#()#*%+*!-(,&*,&(!-(%+*)#","C 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#()#*,#*)&(,&*,&()&(,#*)#","C 2/c 2/c 2/m":" !#$%#$!- %-$%& !& %+$!+()#*,#*)-(,-*,&()&(,+*)+","C 2/m 2/m 2/a":" !#$,#$)& %&$%& )& ,#$!#()#*%#*!&(,&*,&(!&(%#*)#","C 2/c 2/c 2/a":" !#*,#$!&(,&$,-(!- ,+*!+()#$%#*)& %&*%- )-(%+$)+","F 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!# )+$,+$)- ,-$,- )- ,+$)+(!+*%+*!-(%-*%-(!-(%+*!+()#*,#*)&(,&*,&()&(,#*)#","F 2/d 2/d 2/d":" !#$%#$!& %&64=37=345675 )+$,+$)- ,-68>3:>3896:9(!+*%+*!-(%-<4>;7>;49<79()#*,#*)&(,&<8=;:=;85<:5","I 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#()+*,+*)-(,-*,-()-(,+*)+","I 2/b 2/a 2/m":" !#$%#*)&(,&$%& !&(,#*)#()+*,+$!- %-*,-()- %+$!+","I 21/b 21/c 21/a":" !#*%+$)-(,&$%&(!- ,+*)#()+$,#*!& %-*,- )&(%#$!+","I 21/m 21/m 21/a":" !#$,#$)& %&$%& )& ,#$!#()+*%+*!-(,-*,-(!-(%+*)+","P 4":" !#$%#% #!$#","P 41":" !#$%+% 5!$9","P 42":" !#$%#% +!$+","P 43":" !#$%+% 9!$5","I 4":" !#$%#% #!$#()+*,+,(+)*+","I 41":" !#*,+%(5)$9()+$%#, 9!*5","P -4":" !#$%#!$&% &","I -4":" !#$%#!$&% &()+*,+)*-,(-","P 4/m":" !#$%#% #!$#$%& !&!$&% &","P 42/m":" !#$%#% +!$+$%& !&!$-% -","P 4/n":" !#$%#,(#)*#*,&()&!$&% &","P 42/n":" !#$%#,(+)*+*,-()-!$&% &","I 4/m":" !#$%#% #!$#$%& !&!$&% &()+*,+,(+)*+*,-()-)*-,(-","I 41/a":" !#*,+%(5)$9$,=(!>!$&,(-()+$%#, 9!*5*%> )=)*-% &","P 4 2 2":" !#$%#% #!$#$!& %&! &%$&","P 4 21 2":" !#$%#,(#)*#*)&(,&! &%$&","P 41 2 2":" !#$%+% 5!$9$!& %-! >%$=","P 41 21 2":" !#$%+,(5)*9*)=(,>! &%$-","P 42 2 2":" !#$%#% +!$+$!& %&! -%$-","P 42 21 2":" !#$%#,(+)*+*)-(,-! &%$&","P 43 2 2":" !#$%+% 9!$5$!& %-! =%$>","P 43 21 2":" !#$%+,(9)*5*)>(,=! &%$-","I 4 2 2":" !#$%#% #!$#$!& %&! &%$&()+*,+,(+)*+*)-(,-)(-,*-","I 41 2 2":" !#*,+%(5)$9*!> ,=)(-%$&()+$%#, 9!*5$)=(%>! &,*-","P 4 m m":" !#$%#% #!$# %#$!#%$#! #","P 4 b m":" !#$%#% #!$#(,#*)#,*#)(#","P 42 c m":" !#$%#% +!$+ %+$!+%$#! #","P 42 n m":" !#$%#,(+)*+(,+*)+%$#! #","P 4 c c":" !#$%#% #!$# %+$!+%$+! +","P 4 n c":" !#$%#% #!$#(,+*)+,*+)(+","P 42 m c":" !#$%#% +!$+ %#$!#%$+! +","P 42 b c":" !#$%#% +!$+(,#*)#,*+)(+","I 4 m m":" !#$%#% #!$# %#$!#%$#! #()+*,+,(+)*+(,+*)+,*+)(+","I 4 c m":" !#$%#% #!$# %+$!+%$+! +()+*,+,(+)*+(,#*)#,*#)(#","I 41 m d":" !#*,+%(5)$9 %#*)+%*5) 9()+$%#, 9!*5(,+$!#,$9!(5","I 41 c d":" !#*,+%(5)$9 %+*)#%*9) 5()+$%#, 9!*5(,#$!+,$5!(9","P -4 2 m":" !#$%#% &!$&$!& %&%$#! #","P -4 2 c":" !#$%#% &!$&$!- %-%$+! +","P -4 21 m":" !#$%#% &!$&*)&(,&,*#)(#","P -4 21 c":" !#$%#% &!$&*)-(,-,*+)(+","P -4 m 2":" !#$%#!$&% & %#$!#! &%$&","P -4 c 2":" !#$%#% &!$& %+$!+! -%$-","P -4 b 2":" !#$%#% &!$&(,#*)#)(&,*&","P -4 n 2":" !#$%#% &!$&(,+*)+)(-,*-","I -4 m 2":" !#$%#% &!$& %#$!#! &%$&()+*,+,(-)*-(,+*)+)(-,*-","I -4 c 2":" !#$%#% &!$& %+$!+! -%$-()+*,+,(-)*-(,#*)#)(&,*&","I -4 2 m":" !#$%#% &!$&$!& %&%$#! #()+*,+,(-)*-*)-(,-,*+)(+","I -4 2 d":" !#$%#% &!$&*!>(%>,$9) 9()+*,+,(-)*-$)= ,=%*5!(5","P 4/m 2/m 2/m":" !#$%#% #!$#$!& %&! &%$&$%& !&!$&% & %#$!#%$#! #","P 4/m 2/c 2/c":" !#$%#% #!$#$!- %-! -%$-$%& !&!$&% & %+$!+%$+! +","P 4/n 2/b 2/m":" !#$%#% #!$#$!& %&! &%$&*,&()&)*&,(&(,#*)#,*#)(#","P 4/n 2/n 2/c":" !#$%#% #!$#$!& %&! &%$&*,-()-)*-,(-(,+*)+,*+)(+","P 4/m 21/b 2/m":" !#$%#% #!$#*)&(,&)(&,*&$%& !&!$&% &(,#*)#,*#)(#","P 4/m 21/n 2/c":" !#$%#% #!$#*)-(,-)(-,*-$%& !&!$&% &(,+*)+,*+)(+","P 4/n 21/m 2/m":" !#$%#,(#)*#*)&(,&! &%$&*,&()&!$&% & %#$!#,*#)(#","P 4/n 2/c 2/c":" !#$%#,(#)*#*)-(,-! -%$-*,&()&!$&% & %+$!+,*+)(+","P 42/m 2/m 2/c":" !#$%#% +!$+$!& %&! -%$-$%& !&!$-% - %#$!#%$+! +","P 42/m 2/c 2/m":" !#$%#% +!$+$!- %-! &%$&$%& !&!$-% - %+$!+%$#! #","P 42/n 2/b 2/c":" !#$%#,(+)*+$!- %-)(&,*&*,-()-!$&% &(,#*)#%$+! +","P 42/n 2/n 2/m":" !#$%#,(+)*+$!& %&)(-,*-*,-()-!$&% &(,+*)+%$#! #","P 42/m 21/b 2/c":" !#$%#% +!$+*)&(,&)(-,*-$%& !&!$-% -(,#*)#,*+)(+","P 42/m 21/n 2/m":" !#$%#,./'*/*'-.,-! &%$&$%& !&'*-,.-.,/*'/%$#! #","P 42/n 21/m 2/c":" !#$%#,(+)*+*)-(,-! &%$&*,-()-!$&% & %#$!#,*+)(+","P 42/n 21/c 2/m":" !#$%#,(+)*+*)&(,&! -%$-*,-()-!$&% & %+$!+,*#)(#","I 4/m 2/m 2/m":" !#$%#% #!$#$!& %&! &%$&$%& !&!$&% & %#$!#%$#! #()+*,+,(+)*+*)-(,-)(-,*-*,-()-)*-,(-(,+*)+,*+)(+","I 4/m 2/c 2/m":" !#$%#% #!$#$!- %-! -%$-$%& !&!$&% & %+$!+%$+! +()+*,+,(+)*+*)&(,&)(&,*&*,-()-)*-,(-(,#*)#,*#)(#","I 41/a 2/m 2/d":" !#*,+%(5)$9*!> ,=)(-%$&$,=(!>!$&,(-(,+$!#,$9!(5()+$%#, 9!*5$)=(%>! &,*-*%> )=)*-% & %#*)+%*5) 9","I 41/a 2/c 2/d":" !#*,+%(5)$9*!= ,>)(&%$-$,=(!>!$&,(-(,#$!+,$5!(9()+$%#, 9!*5$)>(%=! -,*&*%> )=)*-% & %+*)#%*9) 5","P 3":" !#%?#@$#","P 31":" !#%?A@$B","P 32":" !#%?B@$A","H 3":" !#%?#@$#CDAEFAGHAIJBKLBMNB","R 3":" !## !!# ","P -3":" !#%?#@$#$%&!@&? &","H -3":" !#%?#@$#$%&!@&? &OPQRSQTUQVWXYZX[]X]Y^W[^ZV^UR_PT_SO_","R -3":" !## !!# $%&&$%%&$","P 3 1 2":" !#%?#@$#%$&@!& ?&","P 3 2 1":" !#%?#@$#! &?%&$@&","P 31 1 2":" !#%?Q@$^%$_@!X ?&","P 31 2 1":" !#%?A@$B! &?%_$@X","P 32 1 2":" !#%?^@$Q%$X@!_ ?&","P 32 2 1":" !#%?B@$A! &?%X$@_","H 3 2":" !#%?#@$#! &?%&$@&OPQRSQTUQY]X[WXVZX]Y^W[^ZV^PO_SR_UT_","R 3 2":" !## !!# %$&$&%&%$","P 3 m 1":" !#%?#@$#%$#@!# ?#","P 3 1 m":" !#%?#@$#! #?%#$@#","P 3 c 1":" !#%?#@$#%$+@!+ ?+","P 3 1 c":" !#%?#@$#! +?%+$@+","H 3 m":" !#%?#@$#%$#@!# ?#OPQRSQTUQRUQTPQOSQ]Y^W[^ZV^WV^ZY^][^","R 3 m":" !## !!# ! # #!#! ","H 3 c":" !#%?#@$#%$+@!+ ?+OPQRSQTUQRU`TP`OS`]Y^W[^ZV^WVaZYa][a","R 3 c":" !## !!# '././'/'.","P -3 1 2/m":" !#%?#@$#%$&@!& ?&$%&!@&? &! #?%#$@#","P -3 1 2/c":" !#%?#@$#%$-@!- ?-$%&!@&? &! +?%+$@+","P -3 2/m 1":" !#%?#@$#! &?%&$@&$%&!@&? &%$#@!# ?#","P -3 2/c 1":" !#%?#@$#! -?%-$@-$%&!@&? &%$+@!+ ?+","H -3 2/m":" !#%?#@$#! &?%&$@&$%&!@&? &%$#@!# ?#OPQRSQTUQY]X[WXVZXVWXYZX[]XRUQTPQOSQ]Y^W[^ZV^PO_SR_UT_UR_PT_SO_WV^ZY^][^","R -3 2/m":" !## !!# %$&$&%&%$$%&&$%%&$! # #!#! ","H -3 2/c":" !#%?#@$#! -?%-$@-$%&!@&? &%$+@!+ ?+OPQRSQTUQY]b[WbVZbVWXYZX[]XRU`TP`OS`]Y^W[^ZV^POcSRcUTcUR_PT_SO_WVaZYa][a","R -3 2/c":" !## !!# 102021210$%&&$%%&$'././'/'.","P 6":" !#%?#@$#$%#!@#? #","P 61":" !#%?A@$B$%/!@d? e","P 65":" !#%?B@$A$%/!@e? d","P 62":" !#%?^@$Q$%#!@^? Q","P 64":" !#%?Q@$^$%#!@Q? ^","P 63":" !#%?#@$#$%+!@+? +","P -6":" !#%?#@$# !&%?&@$&","P 6/m":" !#%?#@$#$%#!@#? #$%&!@&? & !&%?&@$&","P 63/m":" !#%?#@$#$%+!@+? +$%&!@&? & !-%?-@$-","P 6 2 2":" !#%?#@$#$%#!@#? #! &?%&$@&%$&@!& ?&","P 61 2 2":" !#%?Q@$^$%+!@`? a! X?%&$@_%$b@!- ?c","P 65 2 2":" !#%?^@$Q$%+!@a? `! _?%&$@X%$c@!- ?b","P 62 2 2":" !#%?^@$Q$%#!@^? Q! _?%&$@X%$_@!& ?X","P 64 2 2":" !#%?Q@$^$%#!@Q? ^! X?%&$@_%$X@!& ?_","P 63 2 2":" !#%?#@$#$%+!@+? +! &?%&$@&%$-@!- ?-","P 6 m m":" !#%?#@$#$%#!@#? #%$#@!# ?#! #?%#$@#","P 6 c c":" !#%?#@$#$%#!@#? #%$+@!+ ?+! +?%+$@+","P 63 c m":" !#%?#@$#$%+!@+? +%$+@!+ ?+! #?%#$@#","P 63 m c":" !#%?#@$#$%+!@+? +%$#@!# ?#! +?%+$@+","P -6 m 2":" !#%?#@$# !&%?&@$&%$#@!# ?#%$&@!& ?&","P -6 c 2":" !#%?#@$# !-%?-@$-%$+@!+ ?+%$&@!& ?&","P -6 2 m":" !#%?#@$# !&%?&@$&! &?%&$@&! #?%#$@#","P -6 2 c":" !#%?#@$# !-%?-@$-! &?%&$@&! +?%+$@+","P 6/m 2/m 2/m":" !#%?#@$#$%#!@#? #! &?%&$@&%$&@!& ?&$%&!@&? & !&@$&%?&%$#@!# ?#! #?%#$@#","P 6/m 2/c 2/c":" !#%?#@$#$%#!@#? #! -?%-$@-%$-@!- ?-$%&!@&? & !&@$&%?&%$+@!+ ?+! +?%+$@+","P 63/m 2/c 2/m":" !#%?#@$#$%+!@+? +! -?%-$@-%$&@!& ?&$%&!@&? & !-@$-%?-%$+@!+ ?+! #?%#$@#","P 63/m 2/m 2/c":" !#%?#@$#$%+!@+? +! &?%&$@&%$-@!- ?-$%&!@&? & !-@$-%?-%$#@!# ?#! +?%+$@+","P 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ","F 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-((!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ","I 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-(","P 21 3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(","I 21 3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- ","P 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$","P 2/n -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& *,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*","F 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$ )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-($,- )- ,+$)+&*,&()#(,#*)%-*!-(%+(!+*(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(*%-(!-(%+*!+-$,- )+ ,+$),&*)&(,#()#*()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- *,&()&(,#*)#-*%-(!+(%+*!,-$)- ,+ )+$","F 2/d -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& 64=37=345675=64=375345674=67=3453756 )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(68>3:>3896:9=<8=;:5;85<:4><7>;49;79<(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(<4>;7>;49<79>68>3:93896:8=<:=;85;:5<()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- <8=;:=;8f<:f><4>;79;49<78>6:>3893:96","I 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-(*,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*","P 21/a -3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&($%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*","I 21/a -3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&($%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*()+$,#*g& %-+()#$,&*!- %)+(,#$!&*%- *,- )&(%#$!+-*,& )#(%+$!,-*)& %#(!+$","P 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$","P 42 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*","F 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$ )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(-%*-!*+%(+ +,$+)$-, -)#)*#,(&)(&,*(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&() -,$-)$+, +(#,*#)*&,(&)+!*+%(-!(-%*()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- )(&,*&)*#,(#(+%*+!*-%(-!+)$+, -) -,$","F 41 3 2":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=46 )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<(!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>86","I 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*","P 43 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(7;>46=:<5839398<5:6=4;>75:<983>7;=46","P 41 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<","I 41 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- 7;>46=:<5839398<5:6=4;>75:<983>7;=46","P -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% ","F -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(+%*+!*-%(- +)$+,$-) -,#)(#,*&)*&,((!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&() +,$+)$-, -(#)*#,*&)(&,+!(+%*-!*-%(()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- )(#,*#)*&,(&(+!*+%*-!(-%+) +,$-)$-, ","I -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,(","P -4 3 n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,(","F -4 3 c":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,( )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-() #,$#)$&, &(#!*#%*&!(&%+! +%$-!$-% (!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(!(#%*#!*&%(& +!$+%$-! -%#) #,$&)$&, ()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ! +%$+!$-% - #)$#,$&) &,#!(#%*&!*&%(","I -4 3 d":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(7354<9:6>8;=357<946>:;=857394<>:6=8;()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- :;98657<=43>;9:658<=73>49:;586=7<>43","P 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ","P 4/n -3 2/n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$*,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","P 42/m -3 2/n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","P 42/n -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,**,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ","F 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(-%*-!*+%(+ +,$+)$-, -)#)*#,(&)(&,*$,- )- ,+$)+&*,&()#(,#*)%-*!-(%+(!+*%*+!(+%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94<5:6>83=79:6543>7;=8<68>37=;49<:5=<8>;753496:4><:=;893756,*#!(+% &)$-*-!(&, +)$#%-, &!$+%*#)((!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<<4>;:=389675>68=379;45<:8=<7>;453:96%$#) +,(&!*-$&! -,(#)*+%&% -)$#,*+!(()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>86<8=;7>3456:9><4=;:9385678>67=349;:5<%*+)(#, -!$&$-) &%(+!*#,&,(-!*#%$+) ","F 41/d -3 2/c":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=46<8>;7=3496:5><8=;793456:8><7=;493:56%*#)(+, &!$-$-! &,(+)*#%&, -!$#%*+)( )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<<4=;:>385679>64=3:9;85<78=67>345;:9<%$+) #,(-!*&$&) -%(#!*+,&%(-)*#,$+! (!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<68=37>;45<:9=<4>;:5389674>6:=389;75<,*+!(#% -)$&*-)(&% +!$#,-,(&!*+%$#) ()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>8664>3:=;89<75=68>375;49<:4=<:>;853796,$#! +%(&)*-*&!(-, #)$+%-% &)$+,*#!(","I 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,**,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","I 41/a -3 2/d":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<$%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*4<97358;=:6>6>:;=8357<94=8;>:694<573()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- 7;>46=:<5839398<5:6=4;>75:<983>7;=46*,- )&(%#$!+-*,& )#(%+$!,-*)& %#(!+$865:;943>7<=<=73>4;9:658>43=7<5869:;","P 1 1 2":" !#$%#","P 1 1 21":" !#$%+","B 1 1 2":" !#$%#(g+*%+","A 1 2 1":" !#$!& )+$)-","C 1 21 1":" !#$)&()#*!&","I 1 2 1":" !#$!&.'/0'2","I 1 21 1":" !#$)&.'/0!-","P 1 1 m":" !# !&","P 1 1 b":" !# )&","B 1 1 m":" !# !&(!+(!-","B 1 1 b":" !# )&(!+()-","P 1 1 2/m":" !# !&$%#$%&","P 1 1 21/m":" !#$%+$%& !-","B 1 1 2/m":" !# !&$%#$%&(!+(!-*%+*%-","P 1 1 2/b":" !#$,#$%& )&","P 1 1 21/b":" !#$%&$,+ )-","B 1 1 2/b":" !#$,#$%& )&(!+*,+*%-()-","P 21 2 2":" !#$!&(%&*%#","P 2 21 2":" !# ,&$)&$%#","P 21 21 2 (a)":" !#*,#.%&$'&","P 21 2 21":" !#$!&(%-*%+","P 2 21 21":" !# %&$)-$,+","C 2 2 21a)":" !#*%+(,&$)-()#$,+ %&*!-","C 2 2 2a":" !#*,#.%&$'&()#$%# ,&*!&","F 2 2 2a":" !#*,#.%&$'& '/*%/.12$!2.!/$,/ %20'2.'#$%# 1&0!&","I 2 2 2a":" !#*,#.%&$'&()+$%+*!- ,-","P 21/m 21/m 2/n a":" !#*,#$)&(%&$%&.'& ,#*!#","P 42 21 2a":" !#*,#%.+'$+$'&.%&! -,*-","I 2 3a":" !#*,#.%&$'&!# ,- '&$%/$# !-*!/$%&.%()+$%+ ,-*!-)+(%&(!-*,#*+()&$)#*,- ,"},bc=/^[1-9]$/;function xc(t){var e="";return t.length>0&&(e=":"+wt(t).join(" OR :")),new _e(e)}var _c=function(t){void 0===t&&(t=""),this.name=t,this.partList=[]},wc={type:{configurable:!0}};wc.type.get=function(){return"Assembly"},_c.prototype.addPart=function(t,e){var r=new Ac(t,e);return this.partList.push(r),r},_c.prototype.getAtomCount=function(t){return this.partList.reduce((function(e,r){return e+r.getAtomCount(t)}),0)},_c.prototype.getResidueCount=function(t){return this.partList.reduce((function(e,r){return e+r.getResidueCount(t)}),0)},_c.prototype.getInstanceCount=function(){var t=0;return this.partList.forEach((function(e){t+=e.matrixList.length})),t},_c.prototype.isIdentity=function(t){if(1!==this.partList.length)return!1;var e=this.partList[0];if(1!==e.matrixList.length)return!1;if(!(new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]).equals(e.matrixList[0]))return!1;var r=[];return t.eachChain((function(t){r.push(t.chainname)})),r=wt(r),e.chainList.length===r.length},_c.prototype.getBoundingBox=function(t){var e=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */];return this.partList.forEach((function(r){var i=r.getBoundingBox(t);e.expandByPoint(i.min),e.expandByPoint(i.max)})),e},_c.prototype.getCenter=function(t){return this.getBoundingBox(t).getCenter(new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */])},_c.prototype.getSelection=function(){var t=[];return this.partList.forEach((function(e){t=t.concat(e.chainList)})),xc(t)},Object.defineProperties(_c.prototype,wc);var Ac=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=[]),this.matrixList=t,this.chainList=e},Sc={type:{configurable:!0}};Sc.type.get=function(){return"AssemblyPart"},Ac.prototype._getCount=function(t,e){var r=this,i=0;return t.eachChain((function(t){(0===r.chainList.length||r.chainList.includes(t.chainname))&&(i+=t[e])})),this.matrixList.length*i},Ac.prototype.getAtomCount=function(t){return this._getCount(t,"atomCount")},Ac.prototype.getResidueCount=function(t){return this._getCount(t,"residueCount")},Ac.prototype.getBoundingBox=function(t){var e=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */],r=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */],i=this.getSelection(),o=t.getBoundingBox(i);return this.matrixList.forEach((function(t){r.copy(o).applyMatrix4(t),e.expandByPoint(r.min),e.expandByPoint(r.max)})),e},Ac.prototype.getSelection=function(){return xc(this.chainList)},Ac.prototype.getView=function(t){var e=this.getSelection();return e?t.getView(e):t},Ac.prototype.getInstanceList=function(){for(var t=[],e=0,r=this.matrixList.length;e=0}));n.sort((function(t,e){var r=t[0],n=e[0],a=t[1],s=e[1];if(r===n)return a===s?0:a=0}));s.sort((function(t,e){var r=t[0],n=e[0];if(r===n)return 0;var a=xt(i,r),s=xt(i,n);return o[a]0&&this.addResidueType(this.ri-1),u.growIfFull(),u.resno[this.ri]=o,void 0!==a&&(u.sstruc[this.ri]=a.charCodeAt(0)),void 0!==s&&(u.inscode[this.ri]=s.charCodeAt(0)),u.atomOffset[this.ri]=this.ai,u.atomCount[this.ri]=0,u.count+=1,u.chainIndex[this.ri]=this.ci,h.residueCount[this.ci]+=1),c.count+=1,c.residueIndex[this.ai]=this.ri,u.atomCount[this.ri]+=1,this.currentModelindex=t,this.currentChainid=r,this.currentResname=i,this.currentResno=o,this.currentInscode=s,this.currentHetero=n},Cc.prototype.finalize=function(){this.previousResname=this.currentResname,this.previousHetero=this.currentHetero,this.ri>-1&&this.addResidueType(this.ri)};var Ic,Oc,kc,Mc=(Ic=function(t,e,r,i){for(var o=t.structure,n=t.residueIndexStart,a=o.getResidueProxy(),s=o.getResidueProxy(),c=o.getAtomProxy(),u=o.getAtomProxy(),h=Math.max(0,e-2);h<=e;++h)for(var l=2;l<5;++l)if(!(h+l>=t.residueCount)){a.index=n+h,s.index=n+h+l,c.index=a.traceAtomIndex,u.index=s.traceAtomIndex;var p=c.distanceTo(u);if(Math.abs(p-r[l-2])>i)return!1}return!0},Oc=function(t,e){return Ic(t,e,[5.45,5.18,6.37],2.1)},kc=function(t,e){return Ic(t,e,[6.1,10.4,13],1.42)},function(t){He&&je.time("calculateSecondaryStructure"),t.eachPolymer((function(t){if(!(t.residueCount<4)){if(t.isCg())!function(t){for(var e=t.residueStore,i=t.residueIndexStart,o=new cc(t).position,n=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],a=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],s=0,c=t.residueCount;s1&&o.bending[s]<20&&(e.sstruc[i+s]="h".charCodeAt(0),e.sstruc[i+s+1]="h".charCodeAt(0))}}(t);else{if(!t.isProtein())return;!function(t){for(var e=t.residueStore,r=t.residueIndexStart,i=0,o=t.residueCount;i=e;)o+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[(r=Math.floor(r/e))%e],i+=1;return i>=5&&je.warn("chainname overflow"),o}function Bc(t,e){void 0===e&&(e=!1),He&&je.time("calculateChainnames");var r=!0;if(t.eachChain((function(t){t.chainname&&(r=!1)})),r){var i=t.modelStore,o=t.chainStore,n=t.residueStore,a=t.getAtomProxy(),s=t.getAtomProxy(),c=0,u=0,h=0,l=0,p=[];1===n.count?p.push({mIndex:0,chainname:"A",rStart:0,rCount:1}):t.eachResidueN(2,(function(t,r){var i=!1,o=t.backboneType,d=r.backboneType;l=t.index,t.modelIndex!==r.modelIndex||t.moleculeType!==r.moleculeType?i=!0:0!==o&&o===d&&(a.index=t.backboneEndAtomIndex,s.index=r.backboneStartAtomIndex,i=e?!a.hasBondTo(s):!a.connectedTo(s)),i||r.index!==n.count-1||(i=!0,l=r.index),i&&(p.push({mIndex:u,chainname:Tc(c),rStart:h,rCount:l-h+1}),c+=1,t.modelIndex!==r.modelIndex&&(c=0,u+=1),r.index===n.count-1&&l!==r.index&&p.push({mIndex:u,chainname:Tc(c),rStart:n.count-1,rCount:1}),h=r.index,l=r.index)})),o.count=0,i.chainCount.fill(0,0,i.count),i.chainOffset.fill(0,0,i.count),p.forEach((function(t){!function(t,e,r,a){for(var s=o.count,c=0;c500)return void je.warn("more than 500 atoms, skip residue for auto-bonding",t.qualifiedName());for(var l=t.getBonds(),p=l.atomIndices1,d=l.atomIndices2,f=l.bondOrders,m=p.length,g=0;g0)break;++r}else i=o+1;(r>0||i=3&&-1!==Nc.indexOf(e[0])?e[0]:""}function Vc(t){var e=t.bondHash,r=e.countArray,i=e.offsetArray,o=e.indexArray,n=t.getBondProxy();t.eachResidue((function(t){var e=t.residueType;if(void 0===e.bonds){var a=t.atomOffset,s=[],c=[],u=[],h={},l=a+t.atomCount;t.eachAtom((function(t){for(var e=t.index,p=i[e],d=0,f=r[e];d=l)){var g=n.atomIndex2;if(!(g=l)){if(m>g){var y=g;g=m,m=y}var v=m+"|"+g;void 0===h[v]&&(h[v]=!0,s.push(m-a),c.push(g-a),u.push(n.bondOrder))}}}})),e.bonds={atomIndices1:s,atomIndices2:c,bondOrders:u}}}))}function Gc(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];He&&je.time("concatStructures");var i=new gu(t,""),o=new Cc(i),n=i.atomStore,a=i.atomMap;n.addField("formalCharge",1,"int8"),n.addField("partialCharge",1,"float32");var s={},c=0,u=0,h=0;e.forEach((function(t){t.eachAtom((function(t){n.growIfFull(),n.atomTypeId[c]=a.add(t.atomname,t.element),n.x[c]=t.x,n.y[c]=t.y,n.z[c]=t.z,n.serial[c]=t.serial,n.formalCharge[c]=t.formalCharge,n.partialCharge[c]=t.partialCharge,n.altloc[c]=t.altloc,n.occupancy[c]=t.occupancy,n.bfactor[c]=t.bfactor,o.addAtom(t.modelIndex+h,t.chainname,t.chainid,t.resname,t.resno,1===t.hetero,t.sstruc,t.inscode),s[t.index+u]=c,c+=1})),u+=t.atomStore.count,h+=t.modelStore.count}));var l=i.bondStore,p=i.getAtomProxy(),d=i.getAtomProxy();return u=0,e.forEach((function(t){t.eachBond((function(t){p.index=s[t.atomIndex1+u],d.index=s[t.atomIndex2+u],l.addBond(p,d,t.bondOrder)})),u+=t.atomStore.count})),o.finalize(),$c(i,!0),Rc(i,!0),i.finalizeAtoms(),i.finalizeBonds(),Vc(i),He&&je.timeEnd("concatStructures"),i}var Uc=[3,11,19,37,55,87],Hc=[4,12,20,38,56,88],Wc=[6,15,16,34],qc=[1,7,8,9,17,35,53],Xc=[2,10,18,36,54,86],Yc=[13,30,31,48,49,50,80,81,82,83,84,85,112],Kc=[5,14,32,33,51,52,85],Zc=[9,17,35,53,85],Qc=function(t,e,r){this.structure=t,this.atomname=e,r=r||jc(e),this.element=r,this.number=_n[r]||0,this.vdw=wn[this.number]||2,this.covalent=An[this.number]||1.6};Qc.prototype.getDefaultValence=function(){var t=Sn[this.number];return t?t[0]:-1},Qc.prototype.getValenceList=function(){return Sn[this.number]||[]},Qc.prototype.getOuterShellElectronCount=function(){return Cn[this.number]||2},Qc.prototype.isMetal=function(){return this.isAlkaliMetal()||this.isAlkalineEarthMetal()||this.isLanthanide()||this.isActinide()||this.isTransitionMetal()||this.isPostTransitionMetal()},Qc.prototype.isNonmetal=function(){return this.isDiatomicNonmetal()||this.isPolyatomicNonmetal()||this.isNobleGas()},Qc.prototype.isMetalloid=function(){return Kc.includes(this.number)},Qc.prototype.isHalogen=function(){return Zc.includes(this.number)},Qc.prototype.isDiatomicNonmetal=function(){return qc.includes(this.number)},Qc.prototype.isPolyatomicNonmetal=function(){return Wc.includes(this.number)},Qc.prototype.isAlkaliMetal=function(){return Uc.includes(this.number)},Qc.prototype.isAlkalineEarthMetal=function(){return Hc.includes(this.number)},Qc.prototype.isNobleGas=function(){return Xc.includes(this.number)},Qc.prototype.isTransitionMetal=function(){var t=this.number;return t>=21&&t<=29||t>=39&&t<=47||t>=72&&t<=79||t>=104&&t<=108},Qc.prototype.isPostTransitionMetal=function(){return Yc.includes(this.number)},Qc.prototype.isLanthanide=function(){return this.number>=57&&this.number<=71},Qc.prototype.isActinide=function(){return this.number>=89&&this.number<=103};var Jc=function(t){this.structure=t,this.dict={},this.list=[],this.structure=t};Jc.prototype.add=function(t,e){var r=function(t,e){return t+"|"+e}(t=t.toUpperCase(),e=e?e.toUpperCase():jc(t)),i=this.dict[r];if(void 0===i){var o=new Qc(this.structure,t,e);i=this.list.length,this.dict[r]=i,this.list.push(o)}return i},Jc.prototype.get=function(t){return this.list[t]};var tu=function(t,e,r,i,o,n){this.structure=t,this.bondReferenceAtomIndices=[],this.resname=e,this.atomTypeIdList=r,this.hetero=i?1:0,this.chemCompType=o,this.bonds=n,this.atomCount=r.length,this.moleculeType=this.getMoleculeType(),this.backboneType=this.getBackboneType(0),this.backboneEndType=this.getBackboneType(-1),this.backboneStartType=this.getBackboneType(1),this.backboneIndexList=this.getBackboneIndexList();var a=Nn[this.backboneType],s=Nn[this.backboneStartType],c=Nn[this.backboneEndType],u=this.getAtomIndexByName(a.trace);this.traceAtomIndex=ht(u,-1);var h=this.getAtomIndexByName(a.direction1);this.direction1AtomIndex=ht(h,-1);var l=this.getAtomIndexByName(a.direction2);this.direction2AtomIndex=ht(l,-1);var p=this.getAtomIndexByName(s.backboneStart);this.backboneStartAtomIndex=ht(p,-1);var d,f=this.getAtomIndexByName(c.backboneEnd);this.backboneEndAtomIndex=ht(f,-1),d=Bn.includes(e)?this.getAtomIndexByName("N1"):this.getAtomIndexByName("N3"),this.rungEndAtomIndex=ht(d,-1)};tu.prototype.getBackboneIndexList=function(){var t,e=[];switch(this.moleculeType){case 3:t=$n;break;case 4:case 5:t=Ln;break;default:return e}for(var r=this.structure.atomMap,i=this.atomTypeIdList,o=0,n=this.atomCount;o500)He&&je.warn("more than 500 atoms, skip residue for auto-bonding",t.qualifiedName());else if(o>50)for(var h=new gc(t,!0),l=t.isCg()?1.2:2.3,p=n;p=0||iu(t,e);this.rings={atomRings:t.atomRings,rings:t.rings}},tu.prototype.isAromatic=function(t){return this.aromaticAtoms=this.getAromatic(t),1===this.aromaticAtoms[t.index-t.residueAtomOffset]},tu.prototype.calculateAromatic=function(t){var e=this,r=this.aromaticAtoms=new Uint8Array(this.atomCount),i=this.getRings().rings,o=i.map((function(r){return function(t){if(t.some((function(t){return!eu.includes(t.number)})))return!1;var e=0,r=new Ga(3,t.length),i=r.data;return t.forEach((function(t){i[e+0]=t.x,i[e+1]=t.y,i[e+2]=t.z,e+=3})),new Qs(r).vecC.length()<.05}(r.map((function(r){return e.structure.getAtomProxy(r+t.atomOffset)})))})),n=this.aromaticRings=[];i.forEach((function(t,e){o[e]&&(n.push(t),t.forEach((function(t){return r[t]=1})))}))},tu.prototype.assignBondReferenceAtomIndices=function(){var t=this.getBondGraph(),e=this.getRings(),r=e.atomRings,i=e.rings,o=this.bonds,n=o.atomIndices1,a=o.atomIndices2,s=o.bondOrders,c=this.bondReferenceAtomIndices,u=o.atomIndices1.length;c.length=0;for(var h=0;h1)for(var y=0;y1)for(var b=0;b=0;x--)y[v++]=a[x];for(var _=t.rings.length,w=0;w0?n[l]!==c&&n[c]!==l&&ru(t,c,l):(i[l]=1,o[s++]=l,n[l]=c)}}}var ou=4;var nu=function(t){this.structure=t,this.dict={},this.list=[]};nu.prototype.add=function(t,e,r,i,o){void 0===i&&(i="");var n=function(t,e,r,i){return void 0===i&&(i=""),t+"|"+e.join(",")+"|"+(r?1:0)+"|"+i}(t=t.toUpperCase(),e,r,i),a=this.dict[n];if(void 0===a){var s=new tu(this.structure,t,e,r,i,o);a=this.list.length,this.dict[n]=a,this.list.push(s)}return a},nu.prototype.get=function(t){return this.list[t]};var au=function(t,e){void 0===e&&(e=0),this.structure=t,this.index=e,this.bondStore=t.bondStore,this._v12=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this._v13=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this._ap1=this.structure.getAtomProxy(),this._ap2=this.structure.getAtomProxy(),this._ap3=this.structure.getAtomProxy()},su={atom1:{configurable:!0},atom2:{configurable:!0},atomIndex1:{configurable:!0},atomIndex2:{configurable:!0},bondOrder:{configurable:!0}};su.atom1.get=function(){return this.structure.getAtomProxy(this.atomIndex1)},su.atom2.get=function(){return this.structure.getAtomProxy(this.atomIndex2)},su.atomIndex1.get=function(){return this.bondStore.atomIndex1[this.index]},su.atomIndex1.set=function(t){this.bondStore.atomIndex1[this.index]=t},su.atomIndex2.get=function(){return this.bondStore.atomIndex2[this.index]},su.atomIndex2.set=function(t){this.bondStore.atomIndex2[this.index]=t},su.bondOrder.get=function(){return this.bondStore.bondOrder[this.index]},su.bondOrder.set=function(t){this.bondStore.bondOrder[this.index]=t},au.prototype.getOtherAtomIndex=function(t){return t===this.atomIndex1?this.atomIndex2:this.atomIndex1},au.prototype.getOtherAtom=function(t){return this.structure.getAtomProxy(this.getOtherAtomIndex(t.index))},au.prototype.getReferenceAtomIndex=function(){var t=this._ap1,e=this._ap2;if(t.index=this.atomIndex1,e.index=this.atomIndex2,t.residueIndex===e.residueIndex){var r=t.index-t.residueAtomOffset,i=e.index-e.residueAtomOffset,o=t.residueType.getBondReferenceAtomIndex(r,i);if(void 0!==o)return o+t.residueAtomOffset;console.warn("No reference atom found",t.index,e.index)}},au.prototype.calculateShiftDir=function(t){void 0===t&&(t=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]);var e=this._ap1,i=this._ap2,o=this._ap3,n=this._v12,a=this._v13;e.index=this.atomIndex1,i.index=this.atomIndex2;var s=this.getReferenceAtomIndex();n.subVectors(e,i).normalize(),void 0!==s?(o.index=s,a.subVectors(e,o)):a.copy(e),a.normalize();var c=n.dot(a);return 1-Math.abs(c)<1e-5&&(a.set(1,0,0),c=n.dot(a),1-Math.abs(c)<1e-5&&(a.set(0,1,0),c=n.dot(a))),t.copy(a.sub(n.multiplyScalar(c))).normalize()},au.prototype.qualifiedName=function(){return this.atomIndex1+"="+this.atomIndex2},au.prototype.clone=function(){return new au(this.structure,this.index)},au.prototype.toObject=function(){return{atomIndex1:this.atomIndex1,atomIndex2:this.atomIndex2,bondOrder:this.bondOrder}},Object.defineProperties(au.prototype,su);var cu=function(t,e){void 0===e&&(e=0),this.structure=t,this.index=e,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.atomStore=t.atomStore,this.residueMap=t.residueMap,this.atomMap=t.atomMap},uu={entity:{configurable:!0},entityIndex:{configurable:!0},chain:{configurable:!0},chainIndex:{configurable:!0},atomOffset:{configurable:!0},atomCount:{configurable:!0},atomEnd:{configurable:!0},modelIndex:{configurable:!0},chainname:{configurable:!0},chainid:{configurable:!0},resno:{configurable:!0},sstruc:{configurable:!0},inscode:{configurable:!0},residueType:{configurable:!0},resname:{configurable:!0},hetero:{configurable:!0},moleculeType:{configurable:!0},backboneType:{configurable:!0},backboneStartType:{configurable:!0},backboneEndType:{configurable:!0},traceAtomIndex:{configurable:!0},direction1AtomIndex:{configurable:!0},direction2AtomIndex:{configurable:!0},backboneStartAtomIndex:{configurable:!0},backboneEndAtomIndex:{configurable:!0},rungEndAtomIndex:{configurable:!0},x:{configurable:!0},y:{configurable:!0},z:{configurable:!0}};uu.entity.get=function(){return this.structure.entityList[this.entityIndex]},uu.entityIndex.get=function(){return this.chainStore.entityIndex[this.chainIndex]},uu.chain.get=function(){return this.structure.getChainProxy(this.chainIndex)},uu.chainIndex.get=function(){return this.residueStore.chainIndex[this.index]},uu.chainIndex.set=function(t){this.residueStore.chainIndex[this.index]=t},uu.atomOffset.get=function(){return this.residueStore.atomOffset[this.index]},uu.atomOffset.set=function(t){this.residueStore.atomOffset[this.index]=t},uu.atomCount.get=function(){return this.residueStore.atomCount[this.index]},uu.atomCount.set=function(t){this.residueStore.atomCount[this.index]=t},uu.atomEnd.get=function(){return this.atomOffset+this.atomCount-1},uu.modelIndex.get=function(){return this.chainStore.modelIndex[this.chainIndex]},uu.chainname.get=function(){return this.chainStore.getChainname(this.chainIndex)},uu.chainid.get=function(){return this.chainStore.getChainid(this.chainIndex)},uu.resno.get=function(){return this.residueStore.resno[this.index]},uu.resno.set=function(t){this.residueStore.resno[this.index]=t},uu.sstruc.get=function(){return this.residueStore.getSstruc(this.index)},uu.sstruc.set=function(t){this.residueStore.setSstruc(this.index,t)},uu.inscode.get=function(){return this.residueStore.getInscode(this.index)},uu.inscode.set=function(t){this.residueStore.setInscode(this.index,t)},uu.residueType.get=function(){return this.residueMap.get(this.residueStore.residueTypeId[this.index])},uu.resname.get=function(){return this.residueType.resname},uu.hetero.get=function(){return this.residueType.hetero},uu.moleculeType.get=function(){return this.residueType.moleculeType},uu.backboneType.get=function(){return this.residueType.backboneType},uu.backboneStartType.get=function(){return this.residueType.backboneStartType},uu.backboneEndType.get=function(){return this.residueType.backboneEndType},uu.traceAtomIndex.get=function(){return this.residueType.traceAtomIndex+this.atomOffset},uu.direction1AtomIndex.get=function(){return this.residueType.direction1AtomIndex+this.atomOffset},uu.direction2AtomIndex.get=function(){return this.residueType.direction2AtomIndex+this.atomOffset},uu.backboneStartAtomIndex.get=function(){return this.residueType.backboneStartAtomIndex+this.atomOffset},uu.backboneEndAtomIndex.get=function(){return this.residueType.backboneEndAtomIndex+this.atomOffset},uu.rungEndAtomIndex.get=function(){return this.residueType.rungEndAtomIndex+this.atomOffset},uu.x.get=function(){for(var t=0,e=this.atomOffset;e<=this.atomEnd;++e)t+=this.atomStore.x[e];return t/this.atomCount},uu.y.get=function(){for(var t=0,e=this.atomOffset;e<=this.atomEnd;++e)t+=this.atomStore.y[e];return t/this.atomCount},uu.z.get=function(){for(var t=0,e=this.atomOffset;e<=this.atomEnd;++e)t+=this.atomStore.z[e];return t/this.atomCount},cu.prototype.eachAtom=function(t,e){var r=this.atomCount,i=this.atomOffset,o=this.structure._ap,n=i+r;if(e&&e.atomOnlyTest)for(var a=e.atomOnlyTest,s=i;s0)return this.entity.isPolymer();var t=this.residueType.moleculeType;return 3===t||4===t||5===t},cu.prototype.isHetero=function(){return 1===this.residueType.hetero},cu.prototype.isWater=function(){return 1===this.residueType.moleculeType},cu.prototype.isIon=function(){return 2===this.residueType.moleculeType},cu.prototype.isSaccharide=function(){return 6===this.residueType.moleculeType},cu.prototype.isStandardAminoacid=function(){return this.residueType.isStandardAminoacid()},cu.prototype.isStandardBase=function(){return this.residueType.isStandardBase()},cu.prototype.isHelix=function(){return vn.includes(this.sstruc)},cu.prototype.isSheet=function(){return bn.includes(this.sstruc)},cu.prototype.isTurn=function(){return xn.includes(this.sstruc)&&this.isProtein()},cu.prototype.getAtomType=function(t){return this.atomMap.get(this.atomStore.atomTypeId[t])},cu.prototype.getResname1=function(){return On[this.resname.toUpperCase()]||"X"},cu.prototype.getBackboneType=function(t){switch(t){case-1:return this.residueType.backboneStartType;case 1:return this.residueType.backboneEndType;default:return this.residueType.backboneType}},cu.prototype.getAtomIndexByName=function(t){var e=this.residueType.getAtomIndexByName(t);return void 0!==e&&(e+=this.atomOffset),e},cu.prototype.hasAtomWithName=function(t){return this.residueType.hasAtomWithName(t)},cu.prototype.getAtomnameList=function(){console.warn("getAtomnameList - might be expensive");for(var t=this.atomCount,e=this.atomOffset,r=new Array(t),i=0;i=e){var i=ht(t,this.structure.getResidueProxy());if(i.index=r,i.connectedTo(this))return i}else if(r===e-1){var o=this.chainStore.residueCount[this.chainIndex],n=ht(t,this.structure.getResidueProxy());if(n.index=e+o-1,n.connectedTo(this))return n}},cu.prototype.getBonds=function(){return this.residueType.getBonds(this)},cu.prototype.getRings=function(){return this.residueType.getRings()},cu.prototype.getAromaticRings=function(){return this.residueType.getAromaticRings(this)},cu.prototype.qualifiedName=function(t){void 0===t&&(t=!1);var e="";return this.resname&&!t&&(e+="["+this.resname+"]"),void 0!==this.resno&&(e+=this.resno),this.inscode&&(e+="^"+this.inscode),this.chain&&(e+=":"+this.chainname),e+="/"+this.modelIndex},cu.prototype.clone=function(){return new cu(this.structure,this.index)},cu.prototype.toObject=function(){return{index:this.index,chainIndex:this.chainIndex,atomOffset:this.atomOffset,atomCount:this.atomCount,resno:this.resno,resname:this.resname,sstruc:this.sstruc}},Object.defineProperties(cu.prototype,uu);var hu=function(t,e,r){this.structure=t,this.residueIndexStart=e,this.residueIndexEnd=r,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.atomStore=t.atomStore,this.residueCount=r-e+1;var i=this.structure.getResidueProxy(this.residueIndexStart),o=this.structure.getResidueProxy(this.residueIndexEnd);this.isPrevConnected=void 0!==i.getPreviousConnectedResidue();var n=o.getNextConnectedResidue();this.isNextConnected=void 0!==n,this.isNextNextConnected=void 0!==n&&void 0!==n.getNextConnectedResidue(),this.isCyclic=o.connectedTo(i),this.__residueProxy=this.structure.getResidueProxy()},lu={chainIndex:{configurable:!0},modelIndex:{configurable:!0},chainname:{configurable:!0}};lu.chainIndex.get=function(){return this.residueStore.chainIndex[this.residueIndexStart]},lu.modelIndex.get=function(){return this.chainStore.modelIndex[this.chainIndex]},lu.chainname.get=function(){return this.chainStore.getChainname(this.chainIndex)},hu.prototype.isProtein=function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isProtein()},hu.prototype.isCg=function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isCg()},hu.prototype.isNucleic=function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isNucleic()},hu.prototype.getMoleculeType=function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.moleculeType},hu.prototype.getBackboneType=function(t){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.getBackboneType(t)},hu.prototype.getAtomIndexByType=function(t,e){this.isCyclic?-1===t?t=this.residueCount-1:t===this.residueCount&&(t=0):(-1!==t||this.isPrevConnected||(t+=1),t!==this.residueCount||this.isNextNextConnected||(t-=1));var r,i=this.__residueProxy;switch(i.index=this.residueIndexStart+t,e){case"trace":r=i.traceAtomIndex;break;case"direction1":r=i.direction1AtomIndex;break;case"direction2":r=i.direction2AtomIndex;break;default:r=i.getAtomIndexByName(e)}return r},hu.prototype.eachAtom=function(t,e){this.eachResidue((function(r){r.eachAtom(t,e)}))},hu.prototype.eachAtomN=function(t,e,r){for(var i=this.residueCount,o=new Array(t),n=0;n1&&t(new hu(n,r,u.index)),r=i)):(0!==m&&u.index-r>1&&t(new hu(n,r,u.index)),r=i)}i-r>1&&this.structure.getResidueProxy(r).backboneEndType&&t(new hu(n,r,i))},pu.prototype.qualifiedName=function(){return":"+this.chainname+"/"+this.modelIndex},pu.prototype.clone=function(){return new pu(this.structure,this.index)},pu.prototype.toObject=function(){return{index:this.index,residueOffset:this.residueOffset,residueCount:this.residueCount,chainname:this.chainname}},Object.defineProperties(pu.prototype,du);var fu=function(t,e){void 0===e&&(e=0),this.structure=t,this.index=e,this.modelStore=t.modelStore,this.chainStore=t.chainStore,this.residueStore=t.residueStore},mu={chainOffset:{configurable:!0},chainCount:{configurable:!0},residueOffset:{configurable:!0},atomOffset:{configurable:!0},chainEnd:{configurable:!0},residueEnd:{configurable:!0},atomEnd:{configurable:!0},residueCount:{configurable:!0},atomCount:{configurable:!0}};mu.chainOffset.get=function(){return this.modelStore.chainOffset[this.index]},mu.chainOffset.set=function(t){this.modelStore.chainOffset[this.index]=t},mu.chainCount.get=function(){return this.modelStore.chainCount[this.index]},mu.chainCount.set=function(t){this.modelStore.chainCount[this.index]=t},mu.residueOffset.get=function(){return this.chainStore.residueOffset[this.chainOffset]},mu.atomOffset.get=function(){return this.residueStore.atomOffset[this.residueOffset]},mu.chainEnd.get=function(){return this.chainOffset+this.chainCount-1},mu.residueEnd.get=function(){return this.chainStore.residueOffset[this.chainEnd]+this.chainStore.residueCount[this.chainEnd]-1},mu.atomEnd.get=function(){return this.residueStore.atomOffset[this.residueEnd]+this.residueStore.atomCount[this.residueEnd]-1},mu.residueCount.get=function(){return 0===this.chainCount?0:this.residueEnd-this.residueOffset+1},mu.atomCount.get=function(){return 0===this.residueCount?0:this.atomEnd-this.atomOffset+1},fu.prototype.eachAtom=function(t,e){this.eachChain((function(r){r.eachAtom(t,e)}),e)},fu.prototype.eachResidue=function(t,e){this.eachChain((function(r){r.eachResidue(t,e)}),e)},fu.prototype.eachPolymer=function(t,e){if(e&&e.chainOnlyTest){var r=e.chainOnlyTest;this.eachChain((function(i){r(i)&&i.eachPolymer(t,e)}))}else this.eachChain((function(r){r.eachPolymer(t,e)}))},fu.prototype.eachChain=function(t,e){var r=this.chainCount,i=this.chainOffset,o=this.structure._cp,n=i+r;if(e&&e.test){var a=e.chainOnlyTest;if(a)for(var s=i;s1){var e=i.atomRadius(m);A=e*h/(.5*_),d.calculateShiftDir(E),u?(w=2*l*e,E.multiplyScalar(w),E.negate(),D.subVectors(g,m).multiplyScalar(Math.max(.1,w/1.88)),m.positionToArray(S,b),g.positionToArray(C,b),_>=2&&(B.addVectors(m,E).add(D).toArray(S,b+3),B.addVectors(g,E).sub(D).toArray(C,b+3),_>=3&&(B.subVectors(m,E).add(D).toArray(S,b+6),B.subVectors(g,E).sub(D).toArray(C,b+6)))):(w=(l-h)*e,E.multiplyScalar(w),2===_?(B.addVectors(m,E).toArray(S,b),B.subVectors(m,E).toArray(S,b+3),B.addVectors(g,E).toArray(C,b),B.subVectors(g,E).toArray(C,b+3)):3===_?(m.positionToArray(S,b),B.addVectors(m,E).toArray(S,b+3),B.subVectors(m,E).toArray(S,b+6),g.positionToArray(C,b),B.addVectors(g,E).toArray(C,b+3),B.subVectors(g,E).toArray(C,b+6)):(m.positionToArray(S,b),g.positionToArray(C,b)))}else m.positionToArray(S,b),g.positionToArray(C,b);if(P&&I&&(o.bondColorToArray(d,1,P,b),o.bondColorToArray(d,0,I,b),c&&_>1))for(v=1;v<_;++v)qr(P,b,x=3*v+b,3),qr(I,b,x,3);if(O&&O.array&&(O.array[T]=t,c&&_>1))for(v=1;v<_;++v)O.array[T+v]=t;if(k&&(k[T]=i.atomRadius(m),c&&_>1))for(A=k[T]*h/(u?1:.5*_),v=u?1:0;v<_;++v)k[T+v]=A;if(M&&(M[T]=i.atomRadius(g),c&&_>1))for(A=M[T]*h/(u?1:.5*_),v=u?1:0;v<_;++v)M[T+v]=A;T+=c?_:1})),p},gu.prototype.getBackboneAtomData=function(t){return t=Object.assign({atomSet:this.atomSetCache.__backbone},t),this.getAtomData(t)},gu.prototype.getBackboneBondData=function(t){return t=Object.assign({bondSet:this.getBackboneBondSet(),bondStore:this.backboneBondStore},t),this.getBondData(t)},gu.prototype.getRungAtomData=function(t){return t=Object.assign({atomSet:this.atomSetCache.__rung},t),this.getAtomData(t)},gu.prototype.getRungBondData=function(t){return t=Object.assign({bondSet:this.getRungBondSet(),bondStore:this.rungBondStore},t),this.getBondData(t)},gu.prototype.getBoundingBox=function(t,e){He&&je.time("getBoundingBox"),e=e||new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */];var r=1/0,i=1/0,o=1/0,n=-1/0,a=-1/0,s=-1/0;return this.eachAtom((function(t){var e=t.x,c=t.y,u=t.z;en&&(n=e),c>a&&(a=c),u>s&&(s=u)}),t),e.min.set(r,i,o),e.max.set(n,a,s),He&&je.timeEnd("getBoundingBox"),e},gu.prototype.getPrincipalAxes=function(t){He&&je.time("getPrincipalAxes");var e=0,r=new Ga(3,this.atomCount),i=r.data;return this.eachAtom((function(t){i[e+0]=t.x,i[e+1]=t.y,i[e+2]=t.z,e+=3}),t),He&&je.timeEnd("getPrincipalAxes"),new Qs(r)},gu.prototype.atomCenter=function(t){return t?this.getBoundingBox(t).getCenter(new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]):this.center.clone()},gu.prototype.hasCoords=function(){if(void 0===this._hasCoords){var t=this.atomStore;this._hasCoords=0!==Yr(t.x)||0!==Xr(t.x)||0!==Yr(t.y)||0!==Xr(t.y)||0!==Yr(t.z)||0!==Xr(t.z)||t.count/this.modelStore.count==1}return this._hasCoords},gu.prototype.getSequence=function(t){var e=[],r=this.getResidueProxy();return this.eachAtom((function(t){r.index=t.residueIndex,t.index===r.traceAtomIndex&&e.push(r.getResname1())}),t),e},gu.prototype.getAtomIndices=function(t){if(t&&t.string){var e=[];return this.eachAtom((function(t){e.push(t.index)}),t),new Uint32Array(e)}return this.getAtomData({what:{index:!0}}).index},gu.prototype.getChainnameCount=function(t){var e=new Set;return this.eachChain((function(t){t.residueCount&&e.add(t.chainname)}),t),e.size},gu.prototype.updatePosition=function(t,e){void 0===e&&(e=!0);var r=0;this.eachAtom((function(e){e.positionFromArray(t,r),r+=3}),void 0),this._hasCoords=void 0,e&&this.refreshPosition()},gu.prototype.refreshPosition=function(){this.getBoundingBox(void 0,this.boundingBox),this.boundingBox.getCenter(this.center),this.spatialHash=new rn(this.atomStore,this.boundingBox),this.signals.refreshed.dispatch(this)},gu.prototype.dispose=function(){this.frames&&(this.frames.length=0),this.boxes&&(this.boxes.length=0),this.bondStore.dispose(),this.backboneBondStore.dispose(),this.rungBondStore.dispose(),this.atomStore.dispose(),this.residueStore.dispose(),this.chainStore.dispose(),this.modelStore.dispose(),delete this.bondSet,delete this.atomSet},Object.defineProperties(gu.prototype,yu);var vu=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */],bu=[Yo,Ho,Ko,Xo,Zo,Wo,Uo,qo,Jo,Qo,tn,en],xu={aspectRatio:1.5,sphereDetail:2,radialSegments:50,disableImpostor:!1,openEnded:!1,dashedCylinder:!1,labelParams:{},pointSize:2,sizeAttenuation:!1,useTexture:!0,linewidth:2},_u=function(t,e){var r=this;void 0===t&&(t="shape"),void 0===e&&(e={}),this.boundingBox=new __WEBPACK_IMPORTED_MODULE_1_three__["d" /* Box3 */],this.bufferList=[],this.meshCount=0,this._primitiveData={},this.name=t,this.parameters=lt(e,xu),bu.forEach((function(t){Object.keys(t.fields).forEach((function(e){r._primitiveData[t.getShapeKey(e)]=[]})),r._primitiveData[t.getShapeKey("name")]=[]}))},wu={center:{configurable:!0},type:{configurable:!0}};_u.prototype.addBuffer=function(t){this.bufferList.push(t);var e=t.geometry;return e.boundingBox||e.computeBoundingBox(),this.boundingBox.union(e.boundingBox),this},_u.prototype.addMesh=function(t,e,r,i,o){var n;t=Tt(t),e=Tt(e),Array.isArray(r)&&(r=Ct(r,t.length)),i&&(i=Tt(i)),n=void 0===i||0==i.length?{position:t,color:e,index:r}:{position:t,color:e,index:r,normal:i};var a=new Ma(this,Object.assign({serial:this.meshCount,name:o},n)),s=new ws(Object.assign({picking:a},n));return this.bufferList.push(s),vu.setFromArray(t),this.boundingBox.union(vu),this.meshCount+=1,this},_u.prototype.addSphere=function(t,e,r,i){return Uo.objectToShape(this,{position:t,color:e,radius:r,name:i}),this},_u.prototype.addEllipsoid=function(t,e,r,i,o,n){return Zo.objectToShape(this,{position:t,color:e,radius:r,majorAxis:i,minorAxis:o,name:n}),this},_u.prototype.addTorus=function(t,e,r,i,o,n){return Qo.objectToShape(this,{position:t,color:e,radius:r,majorAxis:i,minorAxis:o,name:n}),this},_u.prototype.addCylinder=function(t,e,r,i,o){return Xo.objectToShape(this,{position1:t,position2:e,color:r,radius:i,name:o}),this},_u.prototype.addCone=function(t,e,r,i,o){return Ko.objectToShape(this,{position1:t,position2:e,color:r,radius:i,name:o}),this},_u.prototype.addArrow=function(t,e,r,i,o){return Yo.objectToShape(this,{position1:t,position2:e,color:r,radius:i,name:o}),this},_u.prototype.addBox=function(t,e,r,i,o,n){return Ho.objectToShape(this,{position:t,color:e,size:r,heightAxis:i,depthAxis:o,name:n}),this},_u.prototype.addOctahedron=function(t,e,r,i,o,n){return Wo.objectToShape(this,{position:t,color:e,size:r,heightAxis:i,depthAxis:o,name:n}),this},_u.prototype.addTetrahedron=function(t,e,r,i,o,n){return qo.objectToShape(this,{position:t,color:e,size:r,heightAxis:i,depthAxis:o,name:n}),this},_u.prototype.addText=function(t,e,r,i){return Jo.objectToShape(this,{position:t,color:e,size:r,text:i}),this},_u.prototype.addPoint=function(t,e,r){return tn.objectToShape(this,{position:t,color:e,name:r}),this},_u.prototype.addWideline=function(t,e,r,i,o){return this.parameters.linewidth=i,en.objectToShape(this,{position1:t,position2:e,color:r,name:o}),this},_u.prototype.addLabel=function(t,e,r,i){return console.warn("Shape.addLabel is deprecated, use .addText instead"),this.addText(t,e,r,i)},_u.prototype.getBufferList=function(){var t=this,e=[];return bu.forEach((function(r){t._primitiveData[r.getShapeKey("color")].length&&e.push(r.bufferFromShape(t,t.parameters))})),this.bufferList.concat(e)},_u.prototype.dispose=function(){var t=this;this.bufferList.forEach((function(t){t.dispose()})),this.bufferList.length=0,bu.forEach((function(e){Object.keys(e.fields).forEach((function(r){t._primitiveData[e.getShapeKey(r)].length=0})),t._primitiveData[e.getShapeKey("name")].length=0}))},wu.center.get=function(){return this._center||(this._center=this.boundingBox.getCenter(new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */])),this._center},wu.type.get=function(){return"Shape"},Object.defineProperties(_u.prototype,wu);var Au=function(t){function e(e,r,i){Array.isArray(e)||(e=[e]),t.call(this,e,r,i),this.type="buffer",this.parameters=Object.assign({},this.parameters,{colorScheme:null,colorScale:null,colorValue:null,colorDomain:null,colorMode:null}),this.buffer=e,this.init(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){t.prototype.init.call(this,e),this.build()},e.prototype.create=function(){this.bufferList.push.apply(this.bufferList,this.buffer)},e.prototype.attach=function(t){var e=this;this.bufferList.forEach((function(t){e.viewer.add(t),t.setParameters(e.getBufferParams())})),this.setVisibility(this.visible),t()},e}(lo),Su=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],Cu=new __WEBPACK_IMPORTED_MODULE_1_three__["y" /* Matrix3 */];var Pu=function(t){function e(e,r,i){void 0===r&&(r={}),t.call(this,function(t,e){var r,i=e.attributes.position.array,o=e.index?e.index.array:void 0,n=t.position.length/3,a=i.length/3,s=n*a,c=new Float32Array(3*s),u=new Float32Array(3*s),h=new Float32Array(3*s);return o&&(r=Ct(n*o.length,s)),{position:c,color:h,index:r,normal:u,primitiveId:t.primitiveId||Ur(n,a),picking:t.picking}}(e,i),r),this.updateNormals=!1;var o=i.attributes.position.array,n=i.attributes.normal.array,a=i.index?i.index.array:void 0;this.geoPosition=o,this.geoNormal=n,this.geoIndex=a,this.positionCount=e.position.length/3,this.geoPositionCount=o.length/3,this.transformedGeoPosition=new Float32Array(3*this.geoPositionCount),this.transformedGeoNormal=new Float32Array(3*this.geoPositionCount);var s=this.geometry.attributes;if(this.meshPosition=s.position.array,this.meshColor=s.color.array,this.meshNormal=s.normal.array,this.setAttributes(e),a){var c=this.geometry.getIndex();if(!c)return void je.error("Index is null");this.meshIndex=c.array,this.makeIndex()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setAttributes=function(t,e){void 0===t&&(t={}),void 0===e&&(e=!1);var r,i,o,n,a,s,c,u,h,l=this.geometry.attributes,p=this.updateNormals;t.position&&(r=t.position,o=this.geoPosition,c=this.meshPosition,a=this.transformedGeoPosition,l.position.needsUpdate=!0,(p||e)&&(n=this.geoNormal,h=this.meshNormal,s=this.transformedGeoNormal,l.normal.needsUpdate=!0)),t.color&&(i=t.color,u=this.meshColor,l.color.needsUpdate=!0);for(var d=this.positionCount,f=this.geoPositionCount,m=0;m 0.0 ){\ncameraPos = rayDirection * posT + rayOrigin;\ninterior = true;\nflag2 = true;\n}\n#else\nif( calcDepth( cameraPos ) <= 0.0 ){\ncameraPos = rayDirection * posT + rayOrigin;\ninterior = true;\n}\n#endif\ncameraNormal = normalize( cameraPos - cameraSpherePos );\ncameraNormal *= float(!interior) * 2.0 - 1.0;\nreturn !interior;\n}\nvoid main(void){\nbool flag = Impostor( cameraPos, cameraNormal );\n#ifdef NEAR_CLIP\nif( calcClip( cameraPos ) > 0.0 )\ndiscard;\n#endif\ngl_FragDepthEXT = calcDepth( cameraPos );\nif( !flag ){\n#ifdef NEAR_CLIP\nif( flag2 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( clipNear - 0.5 ) ) ) + ( 0.0000001 / vRadius ) );\n}else if( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n#else\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n#endif\n}\nif (gl_FragDepthEXT < 0.0)\ndiscard;\nif (gl_FragDepthEXT > 1.0)\ndiscard;\n#ifdef PICKING\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 vNormal = cameraNormal;\nvec3 vViewPosition = -cameraPos;\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\n#include normal_fragment_begin\n#include lights_physical_fragment\n#include lights_fragment_begin\n#include lights_fragment_end\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\nif( interior ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var Mu=function(t){function e(e,r,i){void 0===i&&(i={}),t.call(this,r,i),this.index=Ct(this.indexSize,this.attributeSize),this.makeIndex(),this.initIndex(this.index),this.addAttributes({mapping:{type:e,value:null}}),this.setAttributes({primitiveId:Gr(this.size)})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={attributeSize:{configurable:!0},indexSize:{configurable:!0}};return r.attributeSize.get=function(){return this.size*this.mappingSize},r.indexSize.get=function(){return this.size*this.mappingIndicesSize},e.prototype.addAttributes=function(e){var r={};for(var i in e){var o=e[i];r[i]={type:o.type,value:null}}t.prototype.addAttributes.call(this,r)},e.prototype.getAttributeIndex=function(t){return 3*t*this.mappingSize},e.prototype.setAttributes=function(t){t&&!t.position&&t.position1&&t.position2&&(t.position=Nr(t.position1,t.position2));var e,r,i,o,n,a,s,c=this.size,u=this.mappingSize,h=this.geometry.attributes;for(var l in t)if("index"!==l&&"picking"!==l){r=t[l],i=(e=h[l]).itemSize,o=e.array;for(var p=0;p0&&this.parameters.alphaTest<=1&&(r.ALPHATEST=this.parameters.alphaTest.toPrecision(2)),r},e.prototype.setUniforms=function(e){e&&void 0!==e.edgeBleach&&(this.makeTexture(),e.map=this.tex),t.prototype.setUniforms.call(this,e)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.tex&&this.tex.dispose()},Object.defineProperties(e.prototype,r),e}(xs);or.add("point",Lu);var Nu=function(t){function e(e,r,i){t.call(this,e,r,i),this.type="dot",this.parameters=Object.assign({thresholdType:{type:"select",rebuild:!0,options:{value:"value",sigma:"sigma"}},thresholdMin:{type:"number",precision:3,max:1/0,min:-1/0,rebuild:!0},thresholdMax:{type:"number",precision:3,max:1/0,min:-1/0,rebuild:!0},thresholdOut:{type:"boolean",rebuild:!0},dotType:{type:"select",rebuild:!0,options:{"":"",sphere:"sphere",point:"point"}},radiusType:{type:"select",options:{"":"",value:"value","abs-value":"abs-value","value-min":"value-min",deviation:"deviation",size:"size"}},radius:{type:"number",precision:3,max:10,min:.001,property:"size"},scale:{type:"number",precision:3,max:10,min:.001},sphereDetail:!0,disableImpostor:!0,pointSize:{type:"number",precision:1,max:100,min:0,buffer:!0},sizeAttenuation:{type:"boolean",buffer:!0},sortParticles:{type:"boolean",rebuild:!0},useTexture:{type:"boolean",buffer:!0},alphaTest:{type:"range",step:.001,max:1,min:0,buffer:!0},forceTransparent:{type:"boolean",buffer:!0},edgeBleach:{type:"range",step:.001,max:1,min:0,buffer:!0}},this.parameters,{colorScheme:{type:"select",update:"color",options:{"":"",value:"value",uniform:"uniform",random:"random"}}}),e instanceof ds?(this.surface=void 0,this.volume=new Js(e)):(this.surface=e,this.volume=void 0),this.init(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};r.colorScheme=ht(r.colorScheme,"uniform"),r.colorValue=ht(r.colorValue,14540253),this.thresholdType=ht(r.thresholdType,"sigma"),this.thresholdMin=ht(r.thresholdMin,2),this.thresholdMax=ht(r.thresholdMax,1/0),this.thresholdOut=ht(r.thresholdOut,!1),this.dotType=ht(r.dotType,"point"),this.radius=ht(r.radius,.1),this.scale=ht(r.scale,1),this.pointSize=ht(r.pointSize,1),this.sizeAttenuation=ht(r.sizeAttenuation,!0),this.sortParticles=ht(r.sortParticles,!1),this.useTexture=ht(r.useTexture,!1),this.alphaTest=ht(r.alphaTest,.5),this.forceTransparent=ht(r.forceTransparent,!1),this.edgeBleach=ht(r.edgeBleach,0),t.prototype.init.call(this,r),this.build()},e.prototype.attach=function(t){var e=this;this.bufferList.forEach((function(t){e.viewer.add(t)})),this.setVisibility(this.visible),t()},e.prototype.create=function(){var t={};if(this.volume){var e,r,i=this.volume;"sigma"===this.thresholdType?(e=i.getValueForSigma(this.thresholdMin),r=i.getValueForSigma(this.thresholdMax)):(e=this.thresholdMin,r=this.thresholdMax),i.setFilter(e,r,this.thresholdOut),Object.assign(t,{position:i.getDataPosition(),color:i.getDataColor(this.getColorParams())}),"sphere"===this.dotType&&Object.assign(t,{radius:i.getDataSize(this.radius,this.scale),picking:i.getDataPicking()})}else{var o=this.surface;Object.assign(t,{position:o.getPosition(),color:o.getColor(this.getColorParams())}),"sphere"===this.dotType&&Object.assign(t,{radius:o.getSize(this.radius,this.scale),picking:o.getPicking()})}"sphere"===this.dotType?this.dotBuffer=new Fu(t,this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!1})):this.dotBuffer=new Lu(t,this.getBufferParams({pointSize:this.pointSize,sizeAttenuation:this.sizeAttenuation,sortParticles:this.sortParticles,useTexture:this.useTexture,alphaTest:this.alphaTest,forceTransparent:this.forceTransparent,edgeBleach:this.edgeBleach})),this.bufferList.push(this.dotBuffer)},e.prototype.update=function(t){if(void 0===t&&(t={}),0!==this.bufferList.length){var e={};t.color&&(this.volume?Object.assign(e,{color:this.volume.getDataColor(this.getColorParams())}):Object.assign(e,{color:this.surface.getColor(this.getColorParams())})),"sphere"===this.dotType&&(t.radius||t.scale)&&(this.volume?Object.assign(e,{radius:this.volume.getDataSize(this.radius,this.scale)}):Object.assign(e,{radius:this.surface.getSize(this.radius,this.scale)})),this.dotBuffer.setAttributes(e)}},e.prototype.setParameters=function(e,r,i){return void 0===r&&(r={}),e&&void 0!==e.thresholdType&&this.volume instanceof ds&&("value"===this.thresholdType&&"sigma"===e.thresholdType?(this.thresholdMin=this.volume.getSigmaForValue(this.thresholdMin),this.thresholdMax=this.volume.getSigmaForValue(this.thresholdMax)):"sigma"===this.thresholdType&&"value"===e.thresholdType&&(this.thresholdMin=this.volume.getValueForSigma(this.thresholdMin),this.thresholdMax=this.volume.getValueForSigma(this.thresholdMax)),this.thresholdType=e.thresholdType),e&&void 0!==e.radiusType&&("radius"===e.radiusType?this.radius=.1:this.radius=parseFloat(e.radiusType),r.radius=!0,"sphere"!==this.dotType||Ne&&!this.disableImpostor||(i=!0)),e&&void 0!==e.radius&&(r.radius=!0,"sphere"!==this.dotType||Ne&&!this.disableImpostor||(i=!0)),e&&void 0!==e.scale&&(r.scale=!0,"sphere"!==this.dotType||Ne&&!this.disableImpostor||(i=!0)),t.prototype.setParameters.call(this,e,r,i),this},e}(lo);er.add("shader/Image.vert","uniform float clipRadius;\nuniform vec3 clipCenter;\nvarying vec2 vUv;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\nvoid main() {\n#include begin_vertex\n#include project_vertex\nvUv = uv;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvViewPosition = -mvPosition.xyz;\n#endif\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n}"),er.add("shader/Image.frag","uniform sampler2D map;\nuniform float opacity;\nuniform vec2 mapSize;\nuniform float clipNear;\nuniform float clipRadius;\nvarying vec2 vUv;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#if defined( PICKING )\nuniform sampler2D pickingMap;\nuniform float objectId;\n#else\n#include fog_pars_fragment\n#endif\n#if defined( CUBIC_INTERPOLATION )\n#if defined( CATMULROM_FILTER ) || defined( MITCHELL_FILTER )\n#if defined( CATMULROM_FILTER )\nconst float B = 0.0;\nconst float C = 0.5;\n#elif defined( MITCHELL_FILTER )\nconst float B = 0.333;\nconst float C = 0.333;\n#endif\nfloat filter( float x ){\nfloat f = x;\nif( f < 0.0 ){\nf = -f;\n}\nif( f < 1.0 ){\nreturn ( ( 12.0 - 9.0 * B - 6.0 * C ) * ( f * f * f ) +\n( -18.0 + 12.0 * B + 6.0 *C ) * ( f * f ) +\n( 6.0 - 2.0 * B ) ) / 6.0;\n}else if( f >= 1.0 && f < 2.0 ){\nreturn ( ( -B - 6.0 * C ) * ( f * f * f )\n+ ( 6.0 * B + 30.0 * C ) * ( f *f ) +\n( - ( 12.0 * B ) - 48.0 * C ) * f +\n8.0 * B + 24.0 * C ) / 6.0;\n}else{\nreturn 0.0;\n}\n}\n#elif defined( BSPLINE_FILTER )\nfloat filter( float x ){\nfloat f = x;\nif( f < 0.0 ){\nf = -f;\n}\nif( f >= 0.0 && f <= 1.0 ){\nreturn ( 2.0 / 3.0 ) + ( 0.5 ) * ( f * f * f ) - ( f * f );\n}else if( f > 1.0 && f <= 2.0 ){\nreturn 1.0 / 6.0 * pow( ( 2.0 - f ), 3.0 );\n}\nreturn 1.0;\n}\n#else\nfloat filter( float x ){\nreturn 1.0;\n}\n#endif\nvec4 biCubic( sampler2D tex, vec2 texCoord ){\nvec2 texelSize = 1.0 / mapSize;\ntexCoord -= texelSize / 2.0;\nvec4 nSum = vec4( 0.0 );\nfloat nDenom = 0.0;\nvec2 cell = fract( texCoord * mapSize );\nfor( float m = -1.0; m <= 2.0; ++m ){\nfor( float n = -1.0; n <= 2.0; ++n ){\nvec4 vecData = texture2D(\ntex, texCoord + texelSize * vec2( m, n )\n);\nfloat c = filter( m - cell.x ) * filter( -n + cell.y );\nnSum += vecData * c;\nnDenom += c;\n}\n}\nreturn nSum / nDenom;\n}\n#endif\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\n#if defined( CUBIC_INTERPOLATION )\ngl_FragColor = biCubic( map, vUv );\n#else\ngl_FragColor = texture2D( map, vUv );\n#endif\n#if defined( PICKING )\nif( gl_FragColor.a < 0.3 )\ndiscard;\ngl_FragColor = vec4( texture2D( pickingMap, vUv ).xyz, objectId );\n#else\nif( gl_FragColor.a < 0.01 )\ndiscard;\ngl_FragColor.a *= opacity;\n#include fog_fragment\n#endif\n}");var zu=new Uint16Array([0,1,2,1,3,2]),ju=new Float32Array([0,1,0,0,1,1,1,0]),Vu=Object.assign({filter:"nearest",forceTransparent:!0},vs),Gu=Object.assign({filter:{updateShader:!0,uniform:!0}},bs),Uu=function(t){function r(r,i){t.call(this,{position:r.position,index:zu,picking:r.picking},i),this.parameterTypes=Gu,this.alwaysTransparent=!0,this.hasWireframe=!1,this.vertexShader="Image.vert",this.fragmentShader="Image.frag";var o=r.imageData,n=r.width,a=r.height,s=new __WEBPACK_IMPORTED_MODULE_1_three__["l" /* DataTexture */](o,n,a);s.flipY=!0,this.tex=s;for(var c=o.length,u=new Uint8Array(c),h=0;h>16&255,u[h+1]=l>>8&255,u[h+2]=255&l}var p=new __WEBPACK_IMPORTED_MODULE_1_three__["l" /* DataTexture */](u,n,a);p.flipY=!0,p.minFilter=__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],p.magFilter=__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],this.pickingTex=p,this.addUniforms({map:{value:s},pickingMap:{value:p},mapSize:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */](n,a)}}),this.geometry.setAttribute("uv",new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](ju,2))}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var i={defaultParameters:{configurable:!0}};return i.defaultParameters.get=function(){return Vu},r.prototype.getDefines=function(e){var r=t.prototype.getDefines.call(this,e),i=this.parameters.filter;return i.startsWith("cubic")&&(r.CUBIC_INTERPOLATION=1,i.endsWith("bspline")?r.BSPLINE_FILTER=1:i.endsWith("catmulrom")?r.CATMULROM_FILTER=1:i.endsWith("mitchell")&&(r.MITCHELL_FILTER=1)),r},r.prototype.updateTexture=function(){var t=this.tex,e=this.parameters.filter;e.startsWith("cubic")?(t.minFilter=__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],t.magFilter=__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */]):"linear"===e?(t.minFilter=__WEBPACK_IMPORTED_MODULE_1_three__["x" /* LinearFilter */],t.magFilter=__WEBPACK_IMPORTED_MODULE_1_three__["x" /* LinearFilter */]):(t.minFilter=__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */],t.magFilter=__WEBPACK_IMPORTED_MODULE_1_three__["B" /* NearestFilter */]),t.needsUpdate=!0,this.pickingTex.needsUpdate=!0},r.prototype.makeMaterial=function(){t.prototype.makeMaterial.call(this),this.updateTexture();var e=this.material;e.uniforms.map.value=this.tex,e.blending=__WEBPACK_IMPORTED_MODULE_1_three__["D" /* NormalBlending */],e.needsUpdate=!0;var r=this.wireframeMaterial;r.uniforms.map.value=this.tex,r.blending=__WEBPACK_IMPORTED_MODULE_1_three__["D" /* NormalBlending */],r.needsUpdate=!0;var i=this.pickingMaterial;i.uniforms.map.value=this.tex,i.uniforms.pickingMap.value=this.pickingTex,i.blending=__WEBPACK_IMPORTED_MODULE_1_three__["D" /* NormalBlending */],i.needsUpdate=!0},r.prototype.setUniforms=function(e){e&&void 0!==e.filter&&(this.updateTexture(),e.map=this.tex),t.prototype.setUniforms.call(this,e)},Object.defineProperties(r.prototype,i),r}(xs),Hu=function(t,e){var r=e||{};this.dimension=ht(r.dimension,"x"),this.positionType=ht(r.positionType,"percent"),this.position=ht(r.position,30),this.thresholdType=ht(r.thresholdType,"sigma"),this.thresholdMin=ht(r.thresholdMin,-1/0),this.thresholdMax=ht(r.thresholdMax,1/0),this.normalize=ht(r.normalize,!1),this.volume=t};Hu.prototype.getPositionFromCoordinate=function(t){var e,i=this.dimension,o=this.volume,n=o.matrix,a=(new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]).setFromMatrixPosition(n)[i],s=(new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]).setFromMatrixScale(n)[i];return e="x"===i?o.nx:"y"===i?o.ny:o.nz,Math.round(((t-a)/(e/100)+1)/s)},Hu.prototype.getData=function(t){t=t||{};var e,i=this.volume,o=i.data,n=i.matrix;function a(t){return Math.round(t/100*(e-1))}function s(t,e,r,o){return 3*(r*i.ny*i.nx+e*i.nx+t)+o}e="coordinate"===this.positionType?this.getPositionFromCoordinate(this.position):this.position;var c,u,h,l,p,d=new Float32Array(12),f=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],m=0,g=0,y=0,v=i.nx,b=i.ny,x=i.nz;function _(t,e,r,i){f.set(t,e,r).applyMatrix4(n).toArray(d,i)}"x"===this.dimension?(h=a(i.nx),l=i.ny-1,p=i.nz-1,c=i.nz,u=i.ny,v=(m=h)+1,_(h,0,0,0),_(h,l,0,3),_(h,0,p,6),_(h,l,p,9)):"y"===this.dimension?(h=i.nx-1,l=a(i.ny),p=i.nz-1,c=i.nz,u=i.nx,b=(g=l)+1,_(0,l,0,0),_(h,l,0,3),_(0,l,p,6),_(h,l,p,9)):"z"===this.dimension&&(h=i.nx-1,l=i.ny-1,p=a(i.nz),c=i.nx,u=i.ny,x=(y=p)+1,_(0,0,p,0),_(0,l,p,3),_(h,0,p,6),_(h,l,p,9));var w,A,S=0,C=0,P=new Uint8Array(c*u*4),I=new Float32Array(c*u);"sigma"===this.thresholdType?(w=i.getValueForSigma(this.thresholdMin),A=i.getValueForSigma(this.thresholdMax)):(w=this.thresholdMin,A=this.thresholdMax);var O=Object.assign({},t.colorParams,{volume:i});this.normalize&&(O.domain=[0,1]);var k,M=Ze.getScheme(O),T=new Float32Array(3),B=M.getScale(),D=0,E=0;if(this.normalize){D=1/0,k=-1/0;for(var F=g;Fk&&(k=L)}E=k-D}for(var N=g;Nw&&G0?this.list[0]:void 0},oh.prototype.forEach=function(t){return this.list.forEach(t),this},oh.prototype.dispose=function(){return this.forEach((function(t){return t.dispose()}))},Object.defineProperties(oh.prototype,nh);var ah=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setParameters=function(t){return this.forEach((function(e){return e.setParameters(t)}))},e.prototype.setVisibility=function(t){return this.forEach((function(e){return e.setVisibility(t)}))},e.prototype.setSelection=function(t){return this.forEach((function(e){return e.setSelection(t)}))},e.prototype.setColor=function(t){return this.forEach((function(e){return e.setColor(t)}))},e.prototype.update=function(t){return this.forEach((function(e){return e.update(t)}))},e.prototype.build=function(t){return this.forEach((function(e){return e.build(t)}))},e.prototype.dispose=function(t){return this.forEach((function(t){return t.dispose()}))},e}(oh),sh=Object.assign({defaultStep:1,defaultTimeout:50,defaultInterpolateType:"",defaultInterpolateStep:5,defaultMode:"loop",defaultDirection:"forward",initialFrame:0},Xu),ch=function(t){function e(e,r,i){var o=this;void 0===i&&(i={}),t.call(this,e,Object.assign({name:r.name},i)),this.trajectory=r,this.signals=Object.assign(this.signals,{frameChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],playerChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],countChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],parametersChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]}),r.signals.frameChanged.add((function(t){o.signals.frameChanged.dispatch(t)})),r.signals.playerChanged.add((function(t){o.signals.playerChanged.dispatch(t)})),r.signals.countChanged.add((function(t){o.signals.countChanged.dispatch(t)})),void 0!==i.initialFrame&&this.setFrame(i.initialFrame)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultParameters:{configurable:!0},type:{configurable:!0}};return r.defaultParameters.get=function(){return sh},r.type.get=function(){return"trajectory"},e.prototype.setFrame=function(t){this.trajectory.setFrame(t)},e.prototype.setParameters=function(t){void 0===t&&(t={}),this.trajectory.setParameters(t),this.signals.parametersChanged.dispatch(t)},e.prototype.dispose=function(){this.trajectory.dispose(),t.prototype.dispose.call(this)},Object.defineProperties(e.prototype,r),e}(Yu),uh=function(t,e){this.name=t,this.path=e,this.coordinates=[],this.boxes=[],this.times=[],this.timeOffset=0,this.deltaTime=1},hh={type:{configurable:!0}};hh.type.get=function(){return"Frames"},Object.defineProperties(uh.prototype,hh);var lh=function(t,e){var r,o;if(this.A=new Ga(3,3),this.W=new Ga(1,3),this.U=new Ga(3,3),this.V=new Ga(3,3),this.VH=new Ga(3,3),this.R=new Ga(3,3),this.tmp=new Ga(3,3),this.c=new Ga(3,3),t instanceof gu)r=t.atomCount;else{if(!(t instanceof Float32Array))return;r=t.length/3}if(e instanceof gu)o=e.atomCount;else{if(!(e instanceof Float32Array))return;o=e.length/3}var n=Math.min(r,o),a=new Ga(3,n),s=new Ga(3,n);this.coords1t=new Ga(n,3),this.coords2t=new Ga(n,3),this.transformationMatrix=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */],this.c.data.set([1,0,0,0,1,0,0,0,-1]),this.prepCoords(t,a,n,!1),this.prepCoords(e,s,n,!1),this._superpose(a,s)};lh.prototype._superpose=function(t,e){var r,i,o,n,a,s,c,u,h,l,p,d,f,m,g,y,v,b,x,_,w,A;this.mean1=qa(t),this.mean2=qa(e),Xa(t,this.mean1),Xa(e,this.mean2),Ua(this.coords1t,t),Ua(this.coords2t,e),Ha(this.A,this.coords2t,this.coords1t),Za(this.A,this.W,this.U,this.V),r=this.V,i=this.VH,o=r.data,n=i.data,a=o[4],s=o[8],c=o[5],u=o[7],h=o[0],l=h*a,p=h*c,d=o[3],f=o[1],m=d*f,g=o[2],y=d*g,v=o[6],_=1/(l*s-p*u-m*s+y*u+(b=v*f)*c-(x=v*g)*a),n[0]=(a*s-c*u)*_,n[1]=-(f*s-g*u)*_,n[2]=-(-f*c+g*a)*_,n[3]=-(d*s-c*v)*_,n[4]=(h*s-x)*_,n[5]=-(p-y)*_,n[6]=-(-d*u+a*v)*_,n[7]=-(h*u-b)*_,n[8]=(l-m)*_,Wa(this.R,this.U,this.VH),w=this.R,(A=w.data)[0]*A[4]*A[8]-A[0]*A[5]*A[7]-A[3]*A[1]*A[8]+A[3]*A[2]*A[7]+A[6]*A[1]*A[5]-A[6]*A[2]*A[4]<0&&(He&&je.log("R not a right handed system"),Wa(this.tmp,this.c,this.VH),Wa(this.R,this.U,this.tmp));var S=new Ga(4,4),C=new Ga(4,4),P=new Ga(4,4),I=new Ga(4,4),O=new Ga(4,4),k=new Ga(4,4),M=this.R.data,T=this.mean1,B=this.mean2;I.data.set([1,0,0,-T[0],0,1,0,-T[1],0,0,1,-T[2],0,0,0,1]),O.data.set([M[0],M[1],M[2],0,M[3],M[4],M[5],0,M[6],M[7],M[8],0,0,0,0,1]),k.data.set([1,0,0,B[0],0,1,0,B[1],0,0,1,B[2],0,0,0,1]),Ua(C,I),Ha(S,O,C),Ua(P,S),Ha(C,k,P),Ua(S,C),this.transformationMatrix.elements=S.data},lh.prototype.prepCoords=function(t,e,r,i){var o=0,n=e.data,a=3,s=3*r;if(i&&(s=4*r,a=4),t instanceof gu)t.eachAtom((function(t){o=r)if(this.parameters.interpolateType)if(this._currentStep>this.parameters.interpolateStep&&(this._currentStep=1),1===this._currentStep&&(this._currentFrame=this._nextInterpolated()),i.hasFrame(this._currentFrame)){this._currentStep+=1;var o=this._currentStep/(this.parameters.interpolateStep+1),n=this._currentFrame,a=n[0],s=n[1],c=n[2],u=n[3];i.setFrameInterpolated(a,s,c,u,o,this.parameters.interpolateType),this._previousTime=this._currentTime}else i.loadFrame(this._currentFrame);else{var h=this._next();i.hasFrame(h)?(i.setFrame(h),this._previousTime=this._currentTime):i.loadFrame(h)}window.requestAnimationFrame(this._animate)}},dh.prototype._next=function(){var t,e=this.parameters;return((t="forward"===this._direction?this.traj.currentFrame+e.step:this.traj.currentFrame-e.step)>e.end||t=t.end?r=t.start:"backward"===t.direction&&e<=t.start&&(r=t.end),this.traj.setFrame(r),this._run=!0,this._animate(),this.signals.startedRunning.dispatch()}},dh.prototype.pause=function(){this._run=!1,this.signals.haltedRunning.dispatch()},dh.prototype.stop=function(){this.pause(),this.traj.setFrame(this.parameters.start)},Object.defineProperties(dh.prototype,fh);var mh=function(t,e,r){var i=this;void 0===r&&(r={}),this.signals={countChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],frameChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],playerChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]},this.frameCache={},this.loadQueue={},this.boxCache={},this.pathCache={},this.frameCacheSize=0,this._frameCount=0,this._currentFrame=-1,this._disposed=!1,this.deltaTime=ht(r.deltaTime,0),this.timeOffset=ht(r.timeOffset,0),this.centerPbc=ht(r.centerPbc,!1),this.removePbc=ht(r.removePbc,!1),this.removePeriodicity=ht(r.removePeriodicity,!1),this.superpose=ht(r.superpose,!1),this.name=t.replace(/^.*[\\/]/,""),this.trajPath=t,this.selection=new _e(ht(r.sele,"backbone and not hydrogen")),this.selection.signals.stringChanged.add((function(){i.selectionIndices=i.structure.getAtomIndices(i.selection),i._resetCache(),i._saveInitialCoords(),i.setFrame(i._currentFrame)}))},gh={frameCount:{configurable:!0},currentFrame:{configurable:!0}};gh.frameCount.get=function(){return this._frameCount},gh.currentFrame.get=function(){return this._currentFrame},mh.prototype._init=function(t){this.setStructure(t),this._loadFrameCount(),this.setPlayer(new dh(this))},mh.prototype._loadFrameCount=function(){},mh.prototype.setStructure=function(t){this.structure=t,this.atomCount=t.atomCount,this.backboneIndices=this._getIndices(new _e("backbone and not hydrogen")),this._makeAtomIndices(),this._saveStructureCoords(),this.selectionIndices=this._getIndices(this.selection),this._resetCache(),this._saveInitialCoords(),this.setFrame(this._currentFrame)},mh.prototype._saveInitialCoords=function(){var t=this;this.structure.hasCoords()?(this.initialCoords=new Float32Array(this.structureCoords),this._makeSuperposeCoords()):this.frameCache[0]?(this.initialCoords=new Float32Array(this.frameCache[0]),this._makeSuperposeCoords()):this.loadFrame(0,(function(){return t._saveInitialCoords()}))},mh.prototype._saveStructureCoords=function(){this.structureCoords=this.structure.getAtomData({what:{position:!0}}).position},mh.prototype.setSelection=function(t){return this.selection.setString(t),this},mh.prototype._getIndices=function(t){var e=0,r=t.test,i=[];return r&&this.structure.eachAtom((function(t){r(t)&&i.push(e),e+=1})),i},mh.prototype._makeSuperposeCoords=function(){var t=3*this.selectionIndices.length;this.coords1=new Float32Array(t),this.coords2=new Float32Array(t);for(var e=this.initialCoords,r=this.coords2,i=0;i0&&this.centerPbc){var o=[e[0],e[4],e[8]],n=function(t,e,r){return[Lr(e,r[0],3,0,t),Lr(e,r[1],3,1,t),Lr(e,r[2],3,2,t)]}(this.backboneIndices,r,o);!function(t,e,r){if(0!==r[0]&&0!==r[8]&&0!==r[4])for(var i=t.length,o=r[0],n=r[1],a=r[2],s=-e[0]+o+o/2,c=-e[1]+n+n/2,u=-e[2]+a+a/2,h=0;h.5&&(t[o+n]-=e[3*n+n]*Math.round(a))}}}(r,e,a)}this.removePbc&&function(t,e){if(0!==e[0]&&0!==e[8]&&0!==e[4]){for(var r=t.length,i=3;i.9*e[3*o+o])if(n>0)for(var a=0;a<3;++a)t[i+a]-=e[3*o+a];else for(var s=0;s<3;++s)t[i+s]+=e[3*o+s]}}}(r,e)}this.selectionIndices.length>0&&this.coords1&&this.superpose&&this._doSuperpose(r),this.frameCache[t]=r,this.boxCache[t]=e,this.frameCacheSize+=1},mh.prototype._setFrameCount=function(t){t!==this._frameCount&&(this._frameCount=t,this.signals.countChanged.dispatch(t))},mh.prototype.dispose=function(){this._resetCache(),this._disposed=!0,this.player&&this.player.stop()},mh.prototype.setPlayer=function(t){this.player=t,this.signals.playerChanged.dispatch(t)},mh.prototype.getFrameTime=function(t){return this.timeOffset+t*this.deltaTime},Object.defineProperties(mh.prototype,gh);var yh=function(t){function e(e,r,i){var o=i||{};o.timeOffset=ht(o.timeOffset,e.timeOffset),o.deltaTime=ht(o.deltaTime,e.deltaTime),t.call(this,"",r,o),this.name=e.name,this.path=e.path,this.frames=e.coordinates,this.boxes=e.boxes,this._init(r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"frames"},e.prototype._makeAtomIndices=function(){"StructureView"===this.structure.type?this.atomIndices=this.structure.getAtomIndices():this.atomIndices=void 0},e.prototype._loadFrame=function(t,e){var r,i=this.frames[t];if(this.atomIndices){var o=this.atomIndices,n=o.length;r=new Float32Array(3*n);for(var a=0;a0&&(i="( "+e.join(" ) AND ( ")+" )"),new _e(i)},e.prototype.getStructure=function(){return this.structure.getStructure()},e.prototype.eachBond=function(t,e){this.structure.eachBond(t,this.getSelection(e))},e.prototype.eachAtom=function(t,e){var r=this.getAtomProxy(),i=this.getAtomSet(e),o=this.atomStore.count;if(i.getSize()=this.V[r][i]?(t="S",this.score=this.S[r][i]):this.V[r][i]>=this.H[r][i]?(t="V",this.score=this.V[r][i]):(t="H",this.score=this.H[r][i]),He&&je.log("Alignment: SCORE",this.score),He&&je.log("Alignment: S, V, H",this.S[r][i],this.V[r][i],this.H[r][i]);r>0&&i>0;)"S"===t?this.S[r][i]===this.S[r-1][i-1]+e(r-1,i-1)?(this.ali1=this.seq1[r-1]+this.ali1,this.ali2=this.seq2[i-1]+this.ali2,--r,--i,t="S"):this.S[r][i]===this.V[r][i]?t="V":this.S[r][i]===this.H[r][i]?t="H":(--r,--i):"V"===t?this.V[r][i]===this.V[r-1][i]+this.gapExtensionPenalty?(this.ali1=this.seq1[r-1]+this.ali1,this.ali2="-"+this.ali2,--r,t="V"):this.V[r][i]===this.S[r-1][i]+this.gap(0)?(this.ali1=this.seq1[r-1]+this.ali1,this.ali2="-"+this.ali2,--r,t="S"):--r:"H"===t?this.H[r][i]===this.H[r][i-1]+this.gapExtensionPenalty?(this.ali1="-"+this.ali1,this.ali2=this.seq2[i-1]+this.ali2,--i,t="H"):this.H[r][i]===this.S[r][i-1]+this.gap(0)?(this.ali1="-"+this.ali1,this.ali2=this.seq2[i-1]+this.ali2,--i,t="S"):--i:je.error("Alignment: no matrix");for(;r>0;)this.ali1=this.seq1[r-1]+this.ali1,this.ali2="-"+this.ali2,--r;for(;i>0;)this.ali1="-"+this.ali1,this.ali2=this.seq2[i-1]+this.ali2,--i;He&&je.timeEnd("Alignment.trace"),He&&je.log([this.ali1,this.ali2])};var Ih=Object.assign({sele:"",defaultAssembly:""},eh),Oh=function(t){function e(e,r,i){var o,n,a,s,c,u=this;void 0===i&&(i={}),t.call(this,e,r,Object.assign({name:r.name},i)),this.structure=r,this.trajList=[],this.signals=Object.assign(this.signals,{trajectoryAdded:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],trajectoryRemoved:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],defaultAssemblyChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]}),this.initSelection(this.parameters.sele),this.pickBuffer=(o=4,n=0,a=0,s=[],{has:function(t){return-1!==s.indexOf(t)},get:function(t){return s[t]},push:function(t){s[n]=t,n=(o+n+1)%o,++a},get count(){return a},get data(){return s.slice(0,Math.min(a,o))},clear:function(){a=0,n=0,s.length=0}}),this.pickDict=(c={},{has:function(t){return void 0!==c[JSON.stringify(t)]},add:function(t,e){c[JSON.stringify(t)]=e},del:function(t){delete c[JSON.stringify(t)]},get values(){return Object.keys(c).map((function(t){return c[t]}))}}),this.spacefillRepresentation=this.addRepresentation("spacefill",{sele:"none",opacity:Ve.opacity,color:Ve.color,disablePicking:!0,radiusType:"data"},!0),this.distanceRepresentation=this.addRepresentation("distance",Ve,!0),this.angleRepresentation=this.addRepresentation("angle",Ve,!0),this.dihedralRepresentation=this.addRepresentation("dihedral",Ve,!0),this.measureRepresentations=new ah([this.spacefillRepresentation,this.distanceRepresentation,this.angleRepresentation,this.dihedralRepresentation]),this.setDefaultAssembly(this.parameters.defaultAssembly),this.structure.signals.refreshed.add((function(){u.updateRepresentations({position:!0})}))}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultParameters:{configurable:!0},type:{configurable:!0}};return r.defaultParameters.get=function(){return Ih},r.type.get=function(){return"structure"},e.prototype.initSelection=function(t){var e=this;this.selection=new _e(t),this.structureView=new _h(this.structure,this.selection),this.selection.signals.stringChanged.add((function(){e.structureView.setSelection(e.selection),e.rebuildRepresentations(),e.rebuildTrajectories()}))},e.prototype.setSelection=function(t){return this.parameters.sele=t,this.selection.setString(t),this},e.prototype.setDefaultAssembly=function(t){if(void 0===this.structure.biomolDict[t]&&(t=""),this.parameters.defaultAssembly!==t){var e={defaultAssembly:t};this.reprList.forEach((function(t){return t.setParameters(e)})),this.measureRepresentations.setParameters(e),this.parameters.defaultAssembly=t,this.signals.defaultAssemblyChanged.dispatch(t)}return this},e.prototype.rebuildRepresentations=function(){this.reprList.forEach((function(t){t.build()})),this.measureRepresentations.build()},e.prototype.rebuildTrajectories=function(){var t=this;this.trajList.forEach((function(e){e.trajectory.setStructure(t.structureView)}))},e.prototype.updateRepresentations=function(e){t.prototype.updateRepresentations.call(this,e),this.measureRepresentations.update(e)},e.prototype.updateRepresentationMatrices=function(){t.prototype.updateRepresentationMatrices.call(this),this.measureRepresentations.setParameters({matrix:this.matrix})},e.prototype.addRepresentation=function(t,e,r){var i=this;void 0===e&&(e={}),void 0===r&&(r=!1),e.defaultAssembly=this.parameters.defaultAssembly;var o=this._addRepresentation(t,this.structureView,e,r);return r||o.signals.parametersChanged.add((function(){return i.measureUpdate()})),o},e.prototype.addTrajectory=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=function(t,e,r){return t&&t instanceof uh?new yh(t,e,r):!t&&e.frames?new vh(t,e,r):t&&"function"==typeof t?new xh(t,e,r):new bh(t,e,r)}(t,this.structureView,e),i=new ch(this.stage,r,e);return this.trajList.push(i),this.signals.trajectoryAdded.dispatch(i),i},e.prototype.removeTrajectory=function(t){var e=this.trajList.indexOf(t);-1!==e&&this.trajList.splice(e,1),t.dispose(),this.signals.trajectoryRemoved.dispatch(t)},e.prototype.dispose=function(){this.trajList.slice().forEach((function(t){return t.dispose()})),this.trajList.length=0,this.structure.dispose(),this.measureRepresentations.dispose(),t.prototype.dispose.call(this)},e.prototype.autoView=function(t,e){"number"==typeof t&&(e=t,t=""),this.stage.animationControls.zoomMove(this.getCenter(t),this.getZoom(t),ht(e,0))},e.prototype.getBoxUntransformed=function(t){return t?this.structureView.getBoundingBox(new _e(t)):this.structureView.boundingBox},e.prototype.getCenterUntransformed=function(t){return t&&"string"==typeof t?this.structure.atomCenter(new _e(t)):this.structure.center},e.prototype.superpose=function(t,e,r,i){return Ph(this.structureView,t.structureView,e,r,i),this.updateRepresentations({position:!0}),this},e.prototype.getMaxRepresentationRadius=function(t){var e=0,r=this.structure.getAtomProxy(t);return this.eachRepresentation((function(t){if(t.getVisibility()){var i=t.repr;e=Math.max(i.getAtomRadius(r),e)}})),e},e.prototype.measurePick=function(t){var e=this.pickBuffer.count;if(this.lastPick===t.index&&e>=1){if(e>1){var r=this.pickBuffer.data,i=this.pickBuffer.data.sort();this.pickDict.has(i)?this.pickDict.del(i):this.pickDict.add(i,r),2===e?this.distanceRepresentation.setParameters({atomPair:this.pickDict.values.filter((function(t){return 2===t.length}))}):3===e?this.angleRepresentation.setParameters({atomTriple:this.pickDict.values.filter((function(t){return 3===t.length}))}):4===e&&this.dihedralRepresentation.setParameters({atomQuad:this.pickDict.values.filter((function(t){return 4===t.length}))})}this.pickBuffer.clear(),this.lastPick=void 0}else this.pickBuffer.has(t.index)||this.pickBuffer.push(t.index),this.lastPick=t.index;this.measureUpdate()},e.prototype.measureClear=function(){this.pickBuffer.clear(),this.lastPick=void 0,this.spacefillRepresentation.setSelection("none")},e.prototype.measureBuild=function(){var t=this.measureData();this.distanceRepresentation.setParameters({atomPair:t.distance}),this.angleRepresentation.setParameters({atomTriple:t.angle}),this.dihedralRepresentation.setParameters({atomQuad:t.dihedral})},e.prototype.measureUpdate=function(){var t=this,e=this.pickBuffer.data,r={};e.forEach((function(e){var i=Math.max(.1,t.getMaxRepresentationRadius(e));r[e]=i*(2.3-Vt(.1,2,i))})),this.spacefillRepresentation.setSelection(e.length?"@"+e.join(","):"none"),e.length&&this.spacefillRepresentation.setParameters({radiusData:r})},e.prototype.measureData=function(){var t=this.pickDict.values;return{distance:t.filter((function(t){return 2===t.length})),angle:t.filter((function(t){return 3===t.length})),dihedral:t.filter((function(t){return 4===t.length}))}},e.prototype.removeAllMeasurements=function(t){var e=this.pickDict,r=e.values,i=function(t){r.filter((function(e){return e.length===t})).forEach((function(t){return e.del(t.slice().sort())}))};(!t||1&t)&&i(2),(!t||2&t)&&i(3),(!t||4&t)&&i(4),this.measureBuild()},e.prototype.removeMeasurement=function(t){this.pickDict.del(t.slice().sort()),this.measureBuild()},e.prototype.addMeasurement=function(t){if(!(t.length<2||t.length>4)){var e=t.slice().sort();this.pickDict.has(e)||this.pickDict.add(e,t),this.measureBuild()}},Object.defineProperties(e.prototype,r),e}(rh);ir.add("structure",Oh),ir.add("structureview",Oh);var kh=function(t){function e(e,r,i){void 0===i&&(i={}),t.call(this,e,r,Object.assign({name:r.name},i)),this.surface=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"surface"},e.prototype.addRepresentation=function(t,e){return void 0===e&&(e={}),this._addRepresentation(t,this.surface,e)},e.prototype.getBoxUntransformed=function(){return this.surface.boundingBox},e.prototype.getCenterUntransformed=function(){return this.surface.center},e.prototype.dispose=function(){this.surface.dispose(),t.prototype.dispose.call(this)},Object.defineProperties(e.prototype,r),e}(rh);ir.add("surface",kh);var Mh=function(t){function e(e,r,i){void 0===i&&(i={}),t.call(this,e,r,Object.assign({name:r.name},i)),this.volume=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"volume"},e.prototype.addRepresentation=function(t,e){return void 0===e&&(e={}),this._addRepresentation(t,this.volume,e)},e.prototype.getBoxUntransformed=function(){return this.volume.boundingBox},e.prototype.getCenterUntransformed=function(){return this.volume.center},e.prototype.dispose=function(){this.volume.dispose(),t.prototype.dispose.call(this)},Object.defineProperties(e.prototype,r),e}(rh);ir.add("volume",Mh);var Th=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addRepresentation=function(t,e){return this.forEach((function(r){return r.addRepresentation(t,e)}))},e.prototype.autoView=function(t){return this.forEach((function(e){return e.autoView(t)}))},e}(oh);function Bh(t,e){return t instanceof RegExp?null!==e.name.match(t):e.name===t}var Dh=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],Eh={impostor:!0,quality:"medium",workerDefault:!0,sampleLevel:0,backgroundColor:"black",rotateSpeed:2,zoomSpeed:1.2,panSpeed:1,clipNear:0,clipFar:100,clipDist:10,clipMode:"scene",clipScale:"relative",fogNear:50,fogFar:100,cameraFov:40,cameraEyeSep:.3,cameraType:"perspective",lightColor:14540253,lightIntensity:1,ambientColor:14540253,ambientIntensity:.2,hoverTimeout:0,tooltip:!0,mousePreset:"default"},Fh=function(t,e){void 0===e&&(e={}),this.signals={parametersChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],fullscreenChanged:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],componentAdded:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],componentRemoved:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],clicked:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"],hovered:new __WEBPACK_IMPORTED_MODULE_3_signals__["Signal"]},this.tasks=new Sr,this.compList=[],this.defaultFileParams={},this.logList=[],this.viewer=new gi(t),this.viewer.renderer&&(this.tooltip=document.createElement("div"),Object.assign(this.tooltip.style,{display:"none",position:"fixed",zIndex:"1000000",pointerEvents:"none",backgroundColor:"rgba( 0, 0, 0, 0.6 )",color:"lightgrey",padding:"8px",fontFamily:"sans-serif"}),this.viewer.container.appendChild(this.tooltip),this.mouseObserver=new wi(this.viewer.renderer.domElement),this.viewerControls=new Yi(this),this.trackballControls=new Fi(this),this.pickingControls=new zi(this),this.animationControls=new co(this),this.mouseControls=new Ds(this),this.keyControls=new Rs(this),this.pickingBehavior=new $s(this),this.mouseBehavior=new Ls(this),this.animationBehavior=new Ns(this),this.keyBehavior=new js(this),this.spinAnimation=this.animationControls.spin([0,1,0],.005),this.spinAnimation.pause(!0),this.rockAnimation=this.animationControls.rock([0,1,0],.005),this.rockAnimation.pause(!0),this.parameters=lt(e,Eh),this.setParameters(this.parameters),this.viewer.animate())};Fh.prototype.setParameters=function(t){void 0===t&&(t={}),pt(this.parameters,t);var e=t,r=this.parameters,i=this.viewer,o=this.trackballControls;return void 0!==e.quality&&this.setQuality(r.quality),void 0!==e.impostor&&this.setImpostor(r.impostor),void 0!==e.rotateSpeed&&(o.rotateSpeed=r.rotateSpeed),void 0!==e.zoomSpeed&&(o.zoomSpeed=r.zoomSpeed),void 0!==e.panSpeed&&(o.panSpeed=r.panSpeed),void 0!==e.mousePreset&&this.mouseControls.preset(r.mousePreset),this.mouseObserver.setParameters({hoverTimeout:r.hoverTimeout}),i.setClip(r.clipNear,r.clipFar,r.clipDist,r.clipMode,r.clipScale),i.setFog(void 0,r.fogNear,r.fogFar),i.setCamera(r.cameraType,r.cameraFov,r.cameraEyeSep),i.setSampling(r.sampleLevel),i.setBackground(r.backgroundColor),i.setLight(r.lightColor,r.lightIntensity,r.ambientColor,r.ambientIntensity),this.signals.parametersChanged.dispatch(this.getParameters()),this},Fh.prototype.log=function(t){console.log("STAGE LOG",t),this.logList.push(t)},Fh.prototype.getParameters=function(){return Object.assign({},this.parameters)},Fh.prototype.defaultFileRepresentation=function(t){if(t instanceof Oh){var e,r,i;t.setSelection("/0");var o=t.structure;if(o.biomolDict.BU1){var n=o.biomolDict.BU1;e=n.getAtomCount(o),r=n.getResidueCount(o),i=n.getInstanceCount(),t.setDefaultAssembly("BU1")}else e=o.getModelProxy(0).atomCount,r=o.getModelProxy(0).residueCount,i=1;var a=e;Re&&(a*=4);var s=o.atomStore.count/o.residueStore.count<2;s&&(a*=10);var c="chainname",u="RdYlBu",h=!1;if(1===o.getChainnameCount(new _e("polymer and /0"))&&(c="residueindex",u="Spectral",h=!0),He&&console.log(a,e,i,s),r/i<4)t.addRepresentation("ball+stick",{colorScheme:"element",radiusScale:2,aspectRatio:1.5,bondScale:.3,bondSpacing:.75,quality:"auto"});else if(i>5&&a>15e3||a>7e5){var l=Math.min(2,Math.max(.1,6e3/(a/i)));s&&(l=Math.min(l,.5)),t.addRepresentation("surface",{colorScheme:c,colorScale:u,colorReverse:h,sele:"polymer",surfaceType:"av",probeRadius:1.4,scaleFactor:l,useWorker:!1})}else a>25e4?t.addRepresentation("backbone",{colorScheme:c,colorScale:u,colorReverse:h,lineOnly:!0}):a>1e5?t.addRepresentation("backbone",{colorScheme:c,colorScale:u,colorReverse:h,quality:"low",disableImpostor:!0,radiusScale:2}):a>8e4?t.addRepresentation("backbone",{colorScheme:c,colorScale:u,colorReverse:h,radiusScale:2}):(t.addRepresentation("cartoon",{colorScheme:c,colorScale:u,colorReverse:h,radiusScale:.7,aspectRatio:5,quality:"auto"}),a<5e4&&t.addRepresentation("base",{colorScheme:c,colorScale:u,colorReverse:h,quality:"auto"}),t.addRepresentation("ball+stick",{sele:"ligand",colorScheme:"element",radiusScale:2,aspectRatio:1.5,bondScale:.3,bondSpacing:.75,quality:"auto"}));t.structure.frames.length&&t.addTrajectory()}else(t instanceof kh||t instanceof Mh)&&t.addRepresentation("surface");this.tasks.onZeroOnce(this.autoView,this)},Fh.prototype.loadFile=function(t,e){var r=this;void 0===e&&(e={});var i=Object.assign({},this.defaultFileParams,e),o=mr(t).name;this.tasks.increment(),this.log("loading file '"+o+"'");var n=ht(i.ext,mr(t).ext);return(tr.isTrajectory(n)?Promise.reject(new Error("loadFile: ext '"+n+"' is a trajectory and must be loaded into a structure component")):yr(t,i)).then((function(t){r.log("loaded '"+o+"'");var e=r.addComponentFromObject(t,i);return i.defaultRepresentation&&r.defaultFileRepresentation(e),r.tasks.decrement(),e}),(function(t){r.tasks.decrement();var e="error loading file: '"+t+"'";throw r.log(e),e}))},Fh.prototype.loadScript=function(t){var e=this,r=mr(t).name;return this.log("loading script '"+r+"'"),yr(t).then((function(t){e.tasks.increment(),e.log("running script '"+r+"'"),t.run(e).then((function(){e.tasks.decrement(),e.log("finished script '"+r+"'")})),e.log("called script '"+r+"'")}),(function(t){e.tasks.decrement();var i="errored script '"+r+"' \""+t+'"';throw e.log(i),i}))},Fh.prototype.addComponent=function(t){t?(this.compList.push(t),this.signals.componentAdded.dispatch(t)):je.warn("Stage.addComponent: no component given")},Fh.prototype.addComponentFromObject=function(t,e){void 0===e&&(e={});var r=ir.get(t.type);if(r){var i=new r(this,t,e);return this.addComponent(i),i}je.warn("no component for object type",t.type)},Fh.prototype.removeComponent=function(t){var e=this.compList.indexOf(t);-1!==e&&(this.compList.splice(e,1),t.dispose(),this.signals.componentRemoved.dispatch(t))},Fh.prototype.removeAllComponents=function(){var t=this;this.compList.slice().forEach((function(e){return t.removeComponent(e)}))},Fh.prototype.handleResize=function(){this.viewer.handleResize()},Fh.prototype.setSize=function(t,e){var r=this.viewer.container;r!==document.body&&(void 0!==t&&(r.style.width=t),void 0!==e&&(r.style.height=e),this.handleResize())},Fh.prototype.toggleFullscreen=function(t){if(document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled){var e=this;t=t||this.viewer.container,this.lastFullscreenElement=t,r()?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():(t.dataset.normalWidth=t.style.width||"",t.dataset.normalHeight=t.style.height||"",t.style.width=window.screen.width+"px",t.style.height=window.screen.height+"px",t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen(),document.addEventListener("fullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),this.handleResize(),this.signals.fullscreenChanged.dispatch(!0),setTimeout((function(){e.handleResize()}),100))}else je.log("fullscreen mode (currently) not possible");function r(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement}function i(){if(!r()&&e.lastFullscreenElement){var t=e.lastFullscreenElement;t.style.width=t.dataset.normalWidth||"",t.style.height=t.dataset.normalHeight||"",document.removeEventListener("fullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i),e.handleResize(),e.signals.fullscreenChanged.dispatch(!1)}}},Fh.prototype.setSpin=function(t){t?(this.spinAnimation.resume(!0),this.rockAnimation.pause(!0)):this.spinAnimation.pause(!0)},Fh.prototype.setRock=function(t){t?(this.rockAnimation.resume(!0),this.spinAnimation.pause(!0)):this.rockAnimation.pause(!0)},Fh.prototype.toggleSpin=function(){this.setSpin(this.spinAnimation.paused)},Fh.prototype.toggleRock=function(){this.setRock(this.rockAnimation.paused)},Fh.prototype.getFocus=function(){var t=this.parameters;if("scene"!==t.clipMode)return 0;var e=t.clipNear;return"absolute"===t.clipScale&&(e=this.viewer.absoluteToRelative(e)),2*e},Fh.prototype.setFocus=function(t){var e,r,i,o;"scene"===this.parameters.clipMode&&("relative"===this.parameters.clipScale?(i=50,o=function(t){return Nt(t,0,100)}(2*(r=100-(e=Nt(t/2,0,49.9)))-50)):(i=0,o=2*(r=e=this.viewer.relativeToAbsolute(t/2))),this.setParameters({clipNear:e,clipFar:r,fogNear:i,fogFar:o}))},Fh.prototype.getZoomForBox=function(t){var e=t.getSize(Dh),r=Math.max(e.x,e.y,e.z),i=Math.min(e.x,e.y,e.z),o=r+Math.sqrt(i),n=Ft(this.viewer.perspectiveCamera.fov),a=this.viewer.width,s=this.viewer.height,c=s=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a}ir.add("shape",Rh);var Lh=function(t){function e(e){var r=this;t.call(this,e),e.scale||(this.parameters.scale="rainbow",this.parameters.reverse=ht(e.reverse,!0)),this.scalePerModel={},e.structure.eachModel((function(t){r.parameters.domain=[t.atomOffset,t.atomEnd],r.scalePerModel[t.index]=r.getScale()}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.scalePerModel[t.modelIndex](t.index)},e}(Xt);$h([Wt],Lh.prototype,"atomColor",null),Ze.add("atomindex",Lh);var Nh=function(t){function e(e){if(t.call(this,e),e.scale||(this.parameters.scale="OrRd"),!e.domain){var r,i=1/0,o=-1/0;e.sele&&(r=new _e(e.sele)),e.structure.eachAtom((function(t){var e=t.bfactor;i=Math.min(i,e),o=Math.max(o,e)}),r),this.parameters.domain=[i,o]}this.bfactorScale=this.getScale()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.bfactorScale(t.bfactor)},e}(Xt);$h([Wt],Nh.prototype,"atomColor",null),Ze.add("bfactor",Nh);var zh=function(t){function e(e){var r=this;t.call(this,e),this.chainidDictPerModel={},this.scalePerModel={},e.scale||(this.parameters.scale="Spectral"),e.structure.eachModel((function(t){var e=0,i={};t.eachChain((function(t){void 0===i[t.chainid]&&(i[t.chainid]=e,e+=1)})),r.parameters.domain=[0,e-1],r.chainidDictPerModel[t.index]=i,r.scalePerModel[t.index]=r.getScale()}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=this.chainidDictPerModel[t.modelIndex];return this.scalePerModel[t.modelIndex](e[t.chainid])},e}(Xt);$h([Wt],zh.prototype,"atomColor",null),Ze.add("chainid",zh);var jh=function(t){function e(e){var r=this;t.call(this,e),this.scalePerModel={},e.scale||(this.parameters.scale="Spectral"),e.structure.eachModel((function(t){r.parameters.domain=[t.chainOffset,t.chainEnd],r.scalePerModel[t.index]=r.getScale()}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.scalePerModel[t.modelIndex](t.chainIndex)},e}(Xt);$h([Wt],jh.prototype,"atomColor",null),Ze.add("chainindex",jh);var Vh=function(t){function e(e){var r=this;t.call(this,e),this.chainnameDictPerModel={},this.scalePerModel={},e.scale||(this.parameters.scale="Spectral"),e.structure.eachModel((function(t){var e=0,i={};t.eachChain((function(t){void 0===i[t.chainname]&&(i[t.chainname]=e,e+=1)})),r.parameters.domain=[0,e-1],r.chainnameDictPerModel[t.index]=i,r.scalePerModel[t.index]=r.getScale()}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=this.chainnameDictPerModel[t.modelIndex];return this.scalePerModel[t.modelIndex](e[t.chainname])},e}(Xt);$h([Wt],Vh.prototype,"atomColor",null),Ze.add("chainname",Vh);var Gh=function(t){function e(e){t.call(this,e),this.rsrzDict={},this.rsccDict={},e.scale||(this.parameters.scale="RdYlBu"),this.rsrzScale=this.getScale({domain:[2,0]}),this.rsccScale=this.getScale({domain:[.678,1]});var r=e.structure.validation;r&&(this.rsrzDict=r.rsrzDict,this.rsccDict=r.rsccDict)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=t.resno+"";t.inscode&&(e+="^"+t.inscode),t.chainname&&(e+=":"+t.chainname),e+="/"+t.modelIndex;var r=this.rsrzDict[e];if(void 0!==r)return this.rsrzScale(r);var i=this.rsccDict[e];return void 0!==i?this.rsccScale(i):9474192},e}(Xt);$h([Wt],Gh.prototype,"atomColor",null),Ze.add("densityfit",Gh);var Uh={ARG:{CD:.1,CZ:.5,NE:-.1},ASN:{CG:.55,OD1:-.55},ASP:{CB:-.16,CG:.36,OD1:-.6,OD2:-.6},CYS:{CB:.19,SG:-.19},GLN:{CD:.55,OE1:-.55},GLU:{CD:.36,CG:-.16,OE1:-.6,OE2:-.6},HIS:{CB:.1,CD2:.2,CE1:.45,CG:.15,ND1:.05,NE2:.05},LYS:{CE:.25,NZ:.75},MET:{CE:.06,CG:.06,SD:-.12},PTR:{C:.55,CA:.1,CZ:.25,N:-.35,O:-.55,O1P:-.85,O2P:-.85,O3P:-.85,OG1:-1.1,P:1.4},SEP:{C:.55,CA:.1,CB:.25,N:-.35,O:-.55,O1P:-.85,O2P:-.85,O3P:-.85,OG1:-1.1,P:1.4},SER:{CB:.25,OG:-.25},THR:{CB:.25,OG1:-.25},TPO:{C:.55,CA:.1,CB:.25,N:-.35,O:-.55,OG1:-1.1,O1P:-.85,O2P:-.85,O3P:-.85,P:1.4},TRP:{CD1:.06,CD2:.1,CE2:-.04,CE3:-.03,CG:-.03,NE1:-.06},TYR:{CZ:.25,OH:-.25},backbone:{C:.55,O:-.55,N:-.35,CA:.1}};var Hh=function(t){function e(e){var i=this;t.call(this,e),this.delta=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.hCharges=[],e.scale||(this.parameters.scale="rwb"),e.domain||(this.parameters.domain=[-50,50]),this.scale=this.getScale(),this.charges=new Float32Array(e.structure.atomCount);var o=[];e.structure.eachAtom((function(t){var e;if(i.charges[t.index]=(null!==(e=t).partialCharge?e.partialCharge:e.isProtein()&&(Uh[e.resname]&&Uh[e.resname][e.atomname]||Uh.backbone[e.atomname])||0)*t.occupancy,"N"===t.atomname){if(t.bondCount>=3)return;if(t.bondToElementCount(1))return;var n=function(t,e){void 0===e&&(e=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */]);var i=!1,o=!1,n=!1;return e.set(2*t.x,2*t.y,2*t.z),t.eachBondedAtom((function(t){if(!i)return"H"===t.atomname?(e.set(t.x,t.y,t.z),void(i=!0)):void(o||"CA"!==t.atomname?n||"C"!==t.atomname||(n=!0,e.sub(t)):(e.sub(t),o=!0))})),i?e:o&&n?(e.normalize(),e.multiplyScalar(1.04),e.add(t),e):void 0}(t);void 0!==n&&(o.push(n),i.hCharges.push(.25*t.occupancy))}}));var n=e.structure.getBoundingBox();n.expandByScalar(1.04),this.hStore=function(t){for(var e=t.length,r=new Float32Array(e),i=new Float32Array(e),o=new Float32Array(e),n=0;n>1&1431655765))+(i>>2&858993459))+(i>>4)&252645135)>>24}else e=this.geoDict[r]||0;return 0===e?2188972:1===e?16703627:2===e?16018755:e>=3?10813478:9474192},e}(Xt);$h([Wt],Kh.prototype,"atomColor",null),Ze.add("geoquality",Kh);var Zh=function(t){function e(e){t.call(this,e),this.resHF={},e.scale||(this.parameters.scale="RdYlGn");for(var r in Pn)this.resHF[r]=Pn[r][0];if(this.defaultResidueHydrophobicity=In[0],!e.domain){var i=1/0,o=-1/0;for(var n in this.resHF){var a=this.resHF[n];i=Math.min(i,a),o=Math.max(o,a)}this.parameters.domain=[i,0,o]}this.hfScale=this.getScale()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.hfScale(this.resHF[t.resname]||this.defaultResidueHydrophobicity)},e}(Xt);$h([Wt],Zh.prototype,"atomColor",null),Ze.add("hydrophobicity",Zh);var Qh=function(t){function e(e){t.call(this,e),e.scale||(this.parameters.scale="rainbow"),e.domain||(this.parameters.domain=[0,e.structure.modelStore.count]),this.modelindexScale=this.getScale()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.modelindexScale(t.modelIndex)},e}(Xt);$h([Wt],Qh.prototype,"atomColor",null),Ze.add("modelindex",Qh);var Jh=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){switch(t.residueType.moleculeType){case 1:return 3697840;case 2:return 15729279;case 3:return 12496596;case 4:return 16629894;case 5:return 12540695;case 6:return 8374655;default:return 16777113}},e}(Xt);$h([Wt],Jh.prototype,"atomColor",null),Ze.add("moleculetype",Jh);var tl=function(t){function e(e){t.call(this,e),e.scale||(this.parameters.scale="PuBu"),e.domain||(this.parameters.domain=[0,1]),this.occupancyScale=this.getScale()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.occupancyScale(t.occupancy)},e}(Xt);$h([Wt],tl.prototype,"atomColor",null),Ze.add("occupancy",tl);var el=function(t){function e(e){t.call(this,e),e.scale||(this.parameters.scale="rwb"),e.domain||(this.parameters.domain=[-1,1]),this.partialchargeScale=this.getScale()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.partialchargeScale(t.partialCharge||0)},e}(Xt);function rl(){return 16777215*Math.random()}$h([Wt],el.prototype,"atomColor",null),Ze.add("partialcharge",el);var il=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(){return rl()},e.prototype.volumeColor=function(){return rl()},e.prototype.positionColor=function(){return rl()},e}(Xt);$h([Wt],il.prototype,"atomColor",null),$h([Wt],il.prototype,"volumeColor",null),$h([Wt],il.prototype,"positionColor",null),Ze.add("random",il);var ol=function(t){function e(e){t.call(this,e),this.rciDict={},e.scale||(this.parameters.scale="RdYlBu"),this.rciScale=this.getScale({domain:[.6,0]});var r=e.structure.validation;r&&(this.rciDict=r.rciDict)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e="["+t.resname+"]"+t.resno;t.chainname&&(e+=":"+t.chainname);var r=this.rciDict[e];return void 0!==r?this.rciScale(r):9474192},e}(Xt);$h([Wt],ol.prototype,"atomColor",null),Ze.add("randomcoilindex",ol);var nl=function(t){function e(e){var r=this;t.call(this,e),this.scalePerChain={},e.scale||(this.parameters.scale="rainbow",this.parameters.reverse=ht(e.reverse,!0)),e.structure.eachChain((function(t){r.parameters.domain=[t.residueOffset,t.residueEnd],r.scalePerChain[t.index]=r.getScale()}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.scalePerChain[t.chainIndex](t.residueIndex)},e}(Xt);$h([Wt],nl.prototype,"atomColor",null),Ze.add("residueindex",nl);var al={ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:16777215,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,ASX:16711935,GLX:16711935,ASH:16711935,GLH:16711935,A:14423100,G:3329330,I:10145074,X:8190976,C:16766720,T:4286945,U:4251856,D:35723,DA:14423100,DG:3329330,DI:10145074,DX:8190976,DC:16766720,DT:4286945,DU:4251856,DD:35723},sl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return al[t.resname]||16711935},e}(Xt);$h([Wt],sl.prototype,"atomColor",null),Ze.add("resname",sl);var cl=16711808,ul=10485888,hl=6291584,ll=16762880,pl=6324479,dl=16777215,fl=11403518,ml=16580962,gl=10921722,yl=function(t){function e(e){t.call(this,e),this.residueProxy=e.structure.getResidueProxy()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=t.sstruc,r=this.residueProxy;return"h"===e?cl:"g"===e?ul:"i"===e?hl:"e"===e||"b"===e?ll:"t"===e?pl:(r.index=t.residueIndex,r.isDna()?fl:r.isRna()?ml:r.isSaccharide()?gl:r.isProtein()||"s"===e||"l"===e?dl:8421504)},e}(Xt);$h([Wt],yl.prototype,"atomColor",null),Ze.add("sstruc",yl);var vl=function(t){function e(e){var r,i;t.call(this,e),e.scale||(this.parameters.scale="rwb"),this.atomData=null===(r=this.parameters.data)||void 0===r?void 0:r.atomData,this.bondData=null===(i=this.parameters.data)||void 0===i?void 0:i.bondData,this.scale=this.getScale(this.parameters)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e,r=null===(e=this.atomData)||void 0===e?void 0:e[t.index];return void 0!==r?this.scale(r):this.parameters.value},e.prototype.bondColor=function(t,e){var r,i=null===(r=this.bondData)||void 0===r?void 0:r[t.index];return void 0!==i?this.scale(i):this.atomProxy?(this.atomProxy.index=e?t.atomIndex1:t.atomIndex2,this.atomColor(this.atomProxy)):this.parameters.value},e}(Xt);$h([Wt],vl.prototype,"atomColor",null),$h([Wt],vl.prototype,"bondColor",null),Ze.add("structuredata",vl);var bl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(){return this.parameters.value},e.prototype.bondColor=function(){return this.parameters.value},e.prototype.valueColor=function(){return this.parameters.value},e.prototype.volumeColor=function(){return this.parameters.value},e}(Xt);$h([Wt],bl.prototype,"atomColor",null),$h([Wt],bl.prototype,"bondColor",null),$h([Wt],bl.prototype,"valueColor",null),$h([Wt],bl.prototype,"volumeColor",null),Ze.add("uniform",bl);var xl=function(t){function e(e){t.call(this,e),this.valueScale=this.getScale()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.volumeColor=function(t){return this.valueScale(this.parameters.volume.data[t])},e}(Xt);$h([Wt],xl.prototype,"volumeColor",null),Ze.add("value",xl);var _l=function(t){function e(e){t.call(this,e),this.vec=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.valueScale=this.getScale()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.positionColor=function(t){var e=this.parameters.volume;if(!e||!e.inverseMatrix)return this.parameters.value;var r=this.vec,i=e.data,o=e.nx,n=e.ny,a=o*n;r.copy(t),r.applyMatrix4(e.inverseMatrix);var s=Math.floor(r.x),c=Math.floor(r.y),u=Math.floor(r.z),h=(u*n+c)*o+s,l=h+1,p=h+o,d=h+a,f=p+1,m=d+1,g=p+a,y=g+1,v=i[h],b=i[l],x=i[p],_=i[d],w=i[f],A=i[m],S=i[g],C=i[y],P=r.x-s,I=r.y-c,O=r.z-u,k=zt(v,b,P),M=zt(_,A,P),T=zt(x,w,P),B=zt(S,C,P),D=zt(k,T,I),E=zt(M,B,I),F=zt(D,E,O);return this.valueScale(F)},e}(Xt);$h([Wt],_l.prototype,"positionColor",null),Ze.add("volume",_l);var wl=function(t){function e(e,r,i){var o=i||{};if(t.call(this,e,r,o),this.type="structure",this.parameters=Object.assign({radiusType:{type:"select",options:Ys.types},radiusData:{type:"hidden"},radiusSize:{type:"number",precision:3,max:10,min:.001},radiusScale:{type:"number",precision:3,max:10,min:.001},assembly:null,defaultAssembly:{type:"hidden"}},this.parameters),this.selection=new _e(o.sele),this.dataList=[],this.structure=e,this.structureView=this.structure.getView(this.selection),e.biomolDict){var n={default:"default","":e.unitcell?"AU":"FULL"};Object.keys(e.biomolDict).forEach((function(t){n[t]=t})),this.parameters.assembly={type:"select",options:n,rebuild:!0}}else this.parameters.assembly=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultScale:{configurable:!0}};return r.defaultScale.get=function(){return{vdw:1,covalent:1,bfactor:.01,sstruc:1}},e.prototype.init=function(e){var r=this,i=e||{};i.colorScheme=ht(i.colorScheme,"element"),this.setRadius(i.radius,i),this.radiusType=ht(i.radiusType,"vdw"),this.radiusData=ht(i.radiusData,{}),this.radiusSize=ht(i.radiusSize,1),this.radiusScale=ht(i.radiusScale,1),this.assembly=ht(i.assembly,"default"),this.defaultAssembly=ht(i.defaultAssembly,""),"auto"===i.quality&&(i.quality=this.getQuality()),t.prototype.init.call(this,i),this.selection.signals.stringChanged.add((function(){r.build()})),this.build()},e.prototype.setRadius=function(t,e){var r=Object.keys(Xs);return"string"==typeof t&&r.includes(t.toLowerCase())?e.radiusType=t:void 0!==t&&(e.radiusType="size",e.radiusSize=t),this},e.prototype.getAssembly=function(){var t="default"===this.assembly?this.defaultAssembly:this.assembly;return this.structure.biomolDict[t]},e.prototype.getQuality=function(){var t,e=this.structureView,r=this.getAssembly();return t=r?r.getAtomCount(e):e.atomCount,Re&&(t*=4),e.atomStore.count/e.residueStore.count<2&&(t*=10),t<15e3?"high":t<8e4?"medium":"low"},e.prototype.create=function(){var t=this;if(0!==this.structureView.atomCount)if(this.structureView.hasCoords()){this.needsBuild=!1;var e=this.getAssembly();if(e)e.partList.forEach((function(e,r){var i=e.getView(t.structureView);if(0!==i.atomCount){var o=t.createData(i,r);o&&(o.sview=i,o.instanceList=e.getInstanceList(),t.dataList.push(o))}}));else{var r=this.createData(this.structureView,0);r&&(r.sview=this.structureView,this.dataList.push(r))}}else this.needsBuild=!0},e.prototype.update=function(t){var e=this;!this.lazy||this.visible?this.needsBuild?this.build():this.dataList.forEach((function(r){r.bufferList.length>0&&e.updateData(t,r)}),this):Object.assign(this.lazyProps.what,t)},e.prototype.updateData=function(t,e){this.build()},e.prototype.getColorParams=function(){return Object.assign(Object.assign({},t.prototype.getColorParams.call(this)),{structure:this.structure})},e.prototype.getRadiusParams=function(t){return{type:this.radiusType,scale:this.radiusScale,size:this.radiusSize,data:this.radiusData}},e.prototype.getAtomParams=function(t,e){return Object.assign({what:t,colorParams:this.getColorParams(),radiusParams:this.getRadiusParams()},e)},e.prototype.getBondParams=function(t,e){return Object.assign({what:t,colorParams:this.getColorParams(),radiusParams:this.getRadiusParams()},e)},e.prototype.getAtomRadius=function(t){return this.structureView.atomSet.isSet(t.index)?new Ys(this.getRadiusParams()).atomRadius(t):0},e.prototype.setSelection=function(t,e){return this.selection.setString(t,e),this},e.prototype.setParameters=function(e,r,i){void 0===r&&(r={}),void 0===i&&(i=!1);var o=e||{};return this.setRadius(o.radius,o),void 0===o.radiusType&&void 0===o.radiusData&&void 0===o.radiusSize&&void 0===o.radiusScale||(r.radius=!0,Ne&&!this.disableImpostor||(i=!0)),void 0!==o.defaultAssembly&&o.defaultAssembly!==this.defaultAssembly&&("default"===this.assembly&&void 0===o.assembly||"default"===o.assembly)&&(i=!0),t.prototype.setParameters.call(this,o,r,i),this},e.prototype.getParameters=function(){return Object.assign(t.prototype.getParameters.call(this),{sele:this.selection?this.selection.string:void 0,defaultAssembly:this.defaultAssembly})},e.prototype.attach=function(t){var e=this.viewer,r=this.bufferList;this.dataList.forEach((function(t){t.bufferList.forEach((function(i){r.push(i),e.add(i,t.instanceList)}))})),this.setVisibility(this.visible),t()},e.prototype.clear=function(){this.dataList.length=0,t.prototype.clear.call(this)},e.prototype.dispose=function(){this.structureView.dispose(),t.prototype.dispose.call(this)},Object.defineProperties(e.prototype,r),e}(lo),Al=function(t){function e(e,r,i){t.call(this,e,r,i),this.n=0,this.parameters=Object.assign({labelVisible:{type:"boolean"},labelSize:{type:"number",precision:3,max:10,min:.001},labelColor:{type:"color"},labelFontFamily:{type:"select",options:{"sans-serif":"sans-serif",monospace:"monospace",serif:"serif"},buffer:"fontFamily"},labelFontStyle:{type:"select",options:{normal:"normal",italic:"italic"},buffer:"fontStyle"},labelFontWeight:{type:"select",options:{normal:"normal",bold:"bold"},buffer:"fontWeight"},labelsdf:{type:"boolean",buffer:"sdf"},labelXOffset:{type:"number",precision:1,max:20,min:-20,buffer:"xOffset"},labelYOffset:{type:"number",precision:1,max:20,min:-20,buffer:"yOffset"},labelZOffset:{type:"number",precision:1,max:20,min:-20,buffer:"zOffset"},labelAttachment:{type:"select",options:{"bottom-left":"bottom-left","bottom-center":"bottom-center","bottom-right":"bottom-right","middle-left":"middle-left","middle-center":"middle-center","middle-right":"middle-right","top-left":"top-left","top-center":"top-center","top-right":"top-right"},rebuild:!0},labelBorder:{type:"boolean",buffer:"showBorder"},labelBorderColor:{type:"color",buffer:"borderColor"},labelBorderWidth:{type:"number",precision:2,max:.3,min:0,buffer:"borderWidth"},labelBackground:{type:"boolean",rebuild:!0},labelBackgroundColor:{type:"color",buffer:"backgroundColor"},labelBackgroundMargin:{type:"number",precision:2,max:2,min:0,rebuild:!0},labelBackgroundOpacity:{type:"range",step:.01,max:1,min:0,buffer:"backgroundOpacity"},labelFixedSize:{type:"boolean",buffer:"fixedSize"},lineOpacity:{type:"range",min:0,max:1,step:.01},linewidth:{type:"integer",max:50,min:1,buffer:!0}},this.parameters,{flatShaded:null})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};this.labelVisible=ht(r.labelVisible,!0),this.labelSize=ht(r.labelSize,2),this.labelColor=ht(r.labelColor,16777215),this.labelFontFamily=ht(r.labelFontFamily,"sans-serif"),this.labelFontStyle=ht(r.labelFontstyle,"normal"),this.labelFontWeight=ht(r.labelFontWeight,"bold"),this.labelsdf=ht(r.labelsdf,"Chrome"===De),this.labelXOffset=ht(r.labelXOffset,0),this.labelYOffset=ht(r.labelYOffset,0),this.labelZOffset=ht(r.labelZOffset,.5),this.labelAttachment=ht(r.labelAttachment,"bottom-left"),this.labelBorder=ht(r.labelBorder,!1),this.labelBorderColor=ht(r.labelBorderColor,"lightgrey"),this.labelBorderWidth=ht(r.labelBorderWidth,.15),this.labelBackground=ht(r.labelBackground,!1),this.labelBackgroundColor=ht(r.labelBackgroundColor,"lightgrey"),this.labelBackgroundMargin=ht(r.labelBackgroundMargin,.5),this.labelBackgroundOpacity=ht(r.labelBackgroundOpacity,1),this.labelFixedSize=ht(r.labelFixedSize,!1),this.lineOpacity=ht(r.lineOpacity,1),this.linewidth=ht(r.linewidth,2),t.prototype.init.call(this,r)},e.prototype.update=function(e){e.position?this.build():t.prototype.update.call(this,e)},e.prototype.updateData=function(t,e){var r={};if(t&&!t.labelSize||Object.assign(r,{size:jr(this.n,this.labelSize)}),!t||t.labelColor){var i=new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](this.labelColor);Object.assign(r,{color:Vr(this.n,i.r,i.g,i.b)})}this.textBuffer.setAttributes(r)},e.prototype.setParameters=function(e,r,i){return void 0===r&&(r={}),void 0===i&&(i=!1),e&&e.labelSize&&(r.labelSize=!0),e&&(e.labelColor||0===e.labelColor)&&(r.labelColor=!0,i=!0),t.prototype.setParameters.call(this,e,r,i),e&&void 0!==e.opacity&&this.textBuffer.setParameters({opacity:1}),e&&void 0!==e.labelVisible&&this.setVisibility(this.visible),this},e.prototype.setVisibility=function(e,r){return t.prototype.setVisibility.call(this,e,!0),this.textBuffer&&this.textBuffer.setVisibility(this.labelVisible&&this.visible),r||this.viewer.requestRender(),this},e.prototype.getLabelBufferParams=function(e){return void 0===e&&(e={}),t.prototype.getBufferParams.call(this,Object.assign({fontFamily:this.labelFontFamily,fontStyle:this.labelFontStyle,fontWeight:this.labelFontWeight,sdf:this.labelsdf,xOffset:this.labelXOffset,yOffset:this.labelYOffset,zOffset:this.labelZOffset,attachment:this.labelAttachment,showBorder:this.labelBorder,borderColor:this.labelBorderColor,borderWidth:this.labelBorderWidth,showBackground:this.labelBackground,backgroundColor:this.labelBackgroundColor,backgroundMargin:this.labelBackgroundMargin,backgroundOpacity:this.labelBackgroundOpacity,fixedSize:this.labelFixedSize,disablePicking:!0,visible:this.labelVisible},e,{opacity:1}))},e.prototype.getAtomRadius=function(){return 0},e}(wl);function Sl(t,e){var r=t.getAtomProxy(),i=new _e,o=e.length;if(0===o)return new Float32Array(0);var n=e[0].length,a=t.getAtomSet(),s=new Float32Array(o*n*3),c=0;return e.forEach((function(e){for(var o=!1,u=0;u 1.0 ){\ngl_FragColor = vec4( backgroundColor, backgroundOpacity );\n}else{\nfloat sdf = texture2D( fontTexture, texCoord ).a;\nif( showBorder ) sdf += borderWidth;\nfloat a = smoothstep(padding - gamma, padding + gamma, sdf);\nif( a < 0.2 ) discard;\na *= opacity;\nvec3 outgoingLight = vColor;\nif( showBorder && sdf < ( padding + borderWidth ) ){\noutgoingLight = borderColor;\n}\ngl_FragColor = vec4( outgoingLight, a );\n}\n#if defined( PICKING )\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var Ol={};var kl={font:"sans-serif",size:36,style:"normal",variant:"normal",weight:"normal",outline:3,width:1024,height:1024},Ml=function(t){void 0===t&&(t={}),this.gamma=1,this.mapped={},this.scratchW=0,this.scratchH=0,this.currentX=0,this.currentY=0,this.cutoff=.25,this.parameters=lt(t,kl);var e=this.parameters;this.radius=e.size/8,this.padding=e.size/3;var r=this.lineHeight=e.size+2*e.outline+Math.round(e.size/4),i=this.maxWidth=e.width/4,o=this.canvas=document.createElement("canvas");o.width=i,o.height=r;var n=this.context=this.canvas.getContext("2d");n.font=e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.font,n.fillStyle="black",n.textAlign="left",n.textBaseline="bottom",n.lineJoin="round",this.gridOuter=new Float64Array(r*i),this.gridInner=new Float64Array(r*i),this.f=new Float64Array(Math.max(r,i)),this.d=new Float64Array(Math.max(r,i)),this.z=new Float64Array(Math.max(r,i)+1),this.v=new Int16Array(Math.max(r,i)),this.data=new Uint8Array(e.width*e.height*4),this.canvas2=document.createElement("canvas"),this.canvas2.width=e.width,this.canvas2.height=e.height,this.context2=this.canvas2.getContext("2d"),this.placeholder=this.map(String.fromCharCode(65533));for(var a=32;a<=126;++a)this.map(String.fromCharCode(a));this.map(String.fromCharCode(176)),this.map(String.fromCharCode(8491)),this.texture=new __WEBPACK_IMPORTED_MODULE_1_three__["h" /* CanvasTexture */](this.canvas2),this.texture.flipY=!1,this.texture.needsUpdate=!0};Ml.prototype.map=function(t){var e=this.parameters;return void 0===this.mapped[t]&&(this.draw(t),this.currentX+this.scratchW>e.width&&(this.currentX=0,this.currentY+=this.scratchH),this.currentY+this.scratchH>e.height&&console.warn("canvas to small"),this.mapped[t]={x:this.currentX,y:this.currentY,w:this.scratchW,h:this.scratchH},this.context2.drawImage(this.canvas,0,0,this.scratchW,this.scratchH,this.currentX,this.currentY,this.scratchW,this.scratchH),this.currentX+=this.scratchW),this.mapped[t]},Ml.prototype.get=function(t){return this.mapped[t]||this.placeholder},Ml.prototype.draw=function(t){var e=this.parameters,r=this.lineHeight,i=e.outline,o=this.context,n=this.maxWidth,a=i,s=r-e.outline,c=o.measureText(t),u=Math.min(n,Math.ceil(c.width+2*a+1)),h=u*r;o.clearRect(0,0,u,r),o.fillText(t,a,s);for(var l=o.getImageData(0,0,u,r),p=l.data,d=0;d= 0.0 ) {\ntrimSegment( start, end );\n} else if ( end.z < 0.0 && start.z >= 0.0 ) {\ntrimSegment( end, start );\n}\n}\nvec4 clipStart = projectionMatrix * start;\nvec4 clipEnd = projectionMatrix * end;\nvec2 ndcStart = clipStart.xy / clipStart.w;\nvec2 ndcEnd = clipEnd.xy / clipEnd.w;\nvec2 dir = ndcEnd - ndcStart;\ndir.x *= aspect;\ndir = normalize( dir );\nvec2 offset = vec2( dir.y, - dir.x );\ndir.x /= aspect;\noffset.x /= aspect;\nif ( mapping.x < 0.0 ) offset *= - 1.0;\noffset *= linewidth;\noffset /= resolution.y;\nvec4 clip = ( mapping.y < 0.5 ) ? clipStart : clipEnd;\noffset *= clip.w;\nclip.xy += offset;\ngl_Position = clip;\n#ifndef PICKING\nvViewPosition = ( projectionMatrixInverse * clip ).xyz;\n#endif\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}"),er.add("shader/WideLine.frag","uniform vec3 diffuse;\nuniform float opacity;\nuniform float clipNear;\nuniform float clipRadius;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#ifdef PICKING\nuniform float objectId;\nvarying vec3 vPickingColor;\n#else\n#include common\n#include fog_pars_fragment\nvarying vec3 vViewPosition;\nvarying vec3 vColor;\nvarying vec3 vColor2;\nvarying float flag;\n#endif\nvoid main() {\n#include nearclip_fragment\n#include radiusclip_fragment\n#if defined( PICKING )\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 outgoingLight = vec3( 0.0 );\nvec4 diffuseColor = vec4( diffuse, 1.0 );\nif ( flag < 0.0 ) {\ndiffuseColor.rgb *= vColor;\n} else {\ndiffuseColor.rgb *= vColor2;\n}\n#include alphatest_fragment\noutgoingLight = diffuseColor.rgb;\ngl_FragColor = vec4( outgoingLight, diffuseColor.a * opacity );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var Fl=Object.assign({linewidth:2},vs),Rl=Object.assign({linewidth:{uniform:!0}},bs),$l=function(t){function r(r,o){void 0===o&&(o={}),t.call(this,r,o),this.parameterTypes=Rl,this.vertexShader="WideLine.vert",this.fragmentShader="WideLine.frag",!r.color2&&r.color&&(r.color2=r.color),this.addUniforms({linewidth:{value:this.parameters.linewidth},resolution:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["X" /* Vector2 */]},projectionMatrixInverse:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null}}),this.setAttributes(r),this.makeMapping()}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var o={defaultParameters:{configurable:!0}};return o.defaultParameters.get=function(){return Fl},r.prototype.setParameters=function(e){t.prototype.setParameters.call(this,e)},Object.defineProperties(r.prototype,o),r}(Du);or.add("wideline",$l);var Ll=function(t){function e(e,r,i){t.call(this,e,r,i),this.type="angle",this.parameters=Object.assign({atomTriple:{type:"hidden",rebuild:!0},vectorVisible:{type:"boolean",default:!0},arcVisible:{type:"boolean",default:!0},sectorVisible:{type:"boolean",default:!0}},this.parameters),this.init(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};r.side=ht(r.side,"double"),r.opacity=ht(r.opacity,.5),this.atomTriple=ht(r.atomTriple,[]),this.arcVisible=ht(r.arcVisible,!0),this.sectorVisible=ht(r.sectorVisible,!0),this.vectorVisible=ht(r.vectorVisible,!0),t.prototype.init.call(this,r)},e.prototype.createData=function(t){if(t.atomCount&&this.atomTriple.length){var e=function(t,e){return function(t){for(var e=[],r=t.length/9,i=0;i radius2) {\ndiscard;\n}\n#ifdef CAP\nsurface_point = front_point;\n_normal = axis;\n#else\nsurface_point = ray_target + ( (-a1 - sqrt(d)) / a2 ) * ray_direction;\ndNV = dot(-axis, ray_direction);\nnear = dot(axis, end) / dNV;\nnew_point2 = ray_direction * near + ray_origin;\nif (dot(new_point2 - end, new_point2-base) < radius2) {\ndiscard;\n}\ninterior = true;\n#endif\n}\nif( end_cap_test > 0.0 )\n{\nfloat dNV;\nfloat near;\nvec3 end_point;\nif ( ortho == 1.0 ) {\nend_point = ray_target;\n} else {\ndNV = dot(axis, ray_direction);\nif (dNV < 0.0) {\ndiscard;\n}\nnear = dot(axis, end) / dNV;\nend_point = ray_direction * near + ray_origin;\n}\n\nif( dot(end_point - end, end_point-base) > radius2 ) {\ndiscard;\n}\n#ifdef CAP\nsurface_point = end_point;\n_normal = axis;\n#else\nsurface_point = ray_target + ( (-a1 - sqrt(d)) / a2 ) * ray_direction;\ndNV = dot(-axis, ray_direction);\nnear = dot(-axis, (base)) / dNV;\nnew_point2 = ray_direction * near + ray_origin;\nif (dot(new_point2 - base, new_point2-base) < radius2) {\ndiscard;\n}\ninterior = true;\n#endif\n}\ngl_FragDepthEXT = calcDepth( surface_point );\n\n#ifdef NEAR_CLIP\nif( calcClip( surface_point ) > 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nsurface_point = ray_target + dist * ray_direction;\nif( calcClip( surface_point ) > 0.0 ) {\ndiscard;\n}\ninterior = true;\ngl_FragDepthEXT = calcDepth( surface_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( clipNear - 0.5 ) ) ) + ( 0.0000001 / vRadius ) );\n}\n}else if( gl_FragDepthEXT <= 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nsurface_point = ray_target + dist * ray_direction;\ninterior = true;\ngl_FragDepthEXT = calcDepth( surface_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n}\n#else\nif( gl_FragDepthEXT <= 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nsurface_point = ray_target + dist * ray_direction;\ninterior = true;\ngl_FragDepthEXT = calcDepth( surface_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n}\n#endif\nif (gl_FragDepthEXT < 0.0) {\ndiscard;\n}\nif (gl_FragDepthEXT > 1.0) {\ndiscard;\n}\n#ifdef PICKING\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 vViewPosition = -surface_point;\nvec3 vNormal = _normal;\nvec3 vColor;\nif( distSq3( surface_point, end ) < distSq3( surface_point, base ) ){\nif( b < 0.0 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\n}else{\nif( b > 0.0 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\n}\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\nvec3 normal = normalize( vNormal );\nvec3 geometryNormal = normal;\n#include lights_physical_fragment\n#include lights_fragment_begin\n#include lights_fragment_end\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\nif( interior ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var Wl=new Float32Array([-1,1,-1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1]),ql=new Uint16Array([0,1,2,1,4,2,2,4,3,4,5,3]),Xl=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"v3",e,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={mapping:{configurable:!0},mappingIndices:{configurable:!0},mappingIndicesSize:{configurable:!0},mappingSize:{configurable:!0},mappingItemSize:{configurable:!0}};return r.mapping.get=function(){return Wl},r.mappingIndices.get=function(){return ql},r.mappingIndicesSize.get=function(){return 12},r.mappingSize.get=function(){return 6},r.mappingItemSize.get=function(){return 3},Object.defineProperties(e.prototype,r),e}(Mu),Yl=Object.assign({openEnded:!1},vs),Kl=Object.assign({openEnded:{updateShader:!0}},bs),Zl=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,e,r),this.parameterTypes=Kl,this.isImpostor=!0,this.vertexShader="CylinderImpostor.vert",this.fragmentShader="CylinderImpostor.frag",this.addUniforms({modelViewMatrixInverse:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]},ortho:{value:0}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null},radius:{type:"f",value:null}}),this.setAttributes(e),this.makeMapping()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultParameters:{configurable:!0}};return r.defaultParameters.get=function(){return Yl},e.prototype.getDefines=function(e){var r=t.prototype.getDefines.call(this,e);return this.parameters.openEnded||(r.CAP=1),r},Object.defineProperties(e.prototype,r),e}(Xl);Object.assign({disableImpostor:!1},Gl,Yl);var Ql=function(t,e){return void 0===e&&(e={}),!t.color2&&t.color&&(t.color2=t.color),!Ne||e&&e.disableImpostor?new Hl(t,e):new Zl(t,e)};or.add("cylinder",Ql);var Jl=function(t){function e(e,r,i){t.call(this,e,r,i),this.type="axes",this.parameters=Object.assign({radiusSize:{type:"number",precision:3,max:10,min:.001},sphereDetail:!0,radialSegments:!0,disableImpostor:!0,showAxes:{type:"boolean",rebuild:!0},showBox:{type:"boolean",rebuild:!0}},this.parameters,{assembly:null}),this.init(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};r.radiusSize=ht(r.radiusSize,.5),r.colorValue=ht(r.colorValue,"lightgreen"),r.useInteriorColor=ht(r.useInteriorColor,!0),this.showAxes=ht(r.showAxes,!0),this.showBox=ht(r.showBox,!1),t.prototype.init.call(this,r)},e.prototype.getPrincipalAxes=function(){var t,e=this.getAssembly();return e&&(t=e.partList[0].getSelection()),this.structureView.getPrincipalAxes(t)},e.prototype.getAxesData=function(t){var e=this.getPrincipalAxes(),i=new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](this.colorValue),o=0,a=0;this.showAxes&&(o+=6,a+=3),this.showBox&&(o+=8,a+=12);var s=new Float32Array(3*o),c=Vr(o,i.r,i.g,i.b),u=jr(o,this.radiusSize),h=new Float32Array(3*a),l=new Float32Array(3*a),p=Vr(a,i.r,i.g,i.b),d=jr(a,this.radiusSize),f=0;if(this.showAxes){var m=function(t,e){t.toArray(s,2*f),e.toArray(s,2*f+3),t.toArray(h,f),e.toArray(l,f),f+=3};m(e.begA,e.endA),m(e.begB,e.endB),m(e.begC,e.endC)}if(this.showBox){var g=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],y=e.getProjectedScaleForAtoms(t),v=y.d1a,b=y.d2a,x=y.d3a,_=y.d1b,w=y.d2b,A=y.d3b,S=2*f,C=function(t,r,i){g.copy(e.center).addScaledVector(e.normVecA,t).addScaledVector(e.normVecB,r).addScaledVector(e.normVecC,i),g.toArray(s,S),S+=3};C(v,b,x),C(v,b,A),C(v,w,A),C(v,w,x),C(_,w,A),C(_,w,x),C(_,b,x),C(_,b,A);var P=f,I=function(t,e){g.fromArray(s,2*f+3*t).toArray(h,P),g.fromArray(s,2*f+3*e).toArray(l,P),P+=3};I(0,1),I(0,3),I(0,6),I(1,2),I(1,7),I(2,3),I(2,4),I(3,5),I(4,5),I(4,7),I(5,6),I(6,7)}var O=new xa(e);return{vertex:{position:s,color:c,radius:u,picking:O},edge:{position1:h,position2:l,color:p,color2:p,radius:d,picking:O}}},e.prototype.create=function(){var t=this.getAxesData(this.structureView);this.sphereBuffer=new Fu(t.vertex,this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0})),this.cylinderBuffer=new Ql(t.edge,this.getBufferParams({openEnded:!0,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0})),this.dataList.push({sview:this.structureView,bufferList:[this.sphereBuffer,this.cylinderBuffer]})},e.prototype.createData=function(t){},e.prototype.updateData=function(t,e){var r=this.getAxesData(e.sview),i={},o={};t&&!t.position||(Object.assign(i,{position:r.vertex.position}),Object.assign(o,{position1:r.edge.position1,position2:r.edge.position2})),t&&!t.color||(Object.assign(i,{color:r.vertex.color}),Object.assign(o,{color:r.edge.color,color2:r.edge.color})),t&&!t.radius||(Object.assign(i,{radius:r.vertex.radius}),Object.assign(o,{radius:r.edge.radius})),this.sphereBuffer.setAttributes(i),this.cylinderBuffer.setAttributes(o)},e}(wl);Je.add("axes",Jl);var tp=function(t){function e(e,r,i){t.call(this,e,r,i),this.type="ball+stick",this.parameters=Object.assign({sphereDetail:!0,radialSegments:!0,openEnded:!0,disableImpostor:!0,aspectRatio:{type:"number",precision:1,max:10,min:1},lineOnly:{type:"boolean",rebuild:!0},cylinderOnly:{type:"boolean",rebuild:!0},multipleBond:{type:"select",rebuild:!0,options:{off:"off",symmetric:"symmetric",offset:"offset"}},bondScale:{type:"number",precision:2,max:1,min:.01},bondSpacing:{type:"number",precision:2,max:2,min:.5},linewidth:{type:"integer",max:50,min:1,buffer:!0}},this.parameters),this.init(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};r.radiusType=ht(r.radiusType,"size"),r.radiusSize=ht(r.radiusSize,.15),r.useInteriorColor=ht(r.useInteriorColor,!0),this.aspectRatio=ht(r.aspectRatio,2),this.lineOnly=ht(r.lineOnly,!1),this.cylinderOnly=ht(r.cylinderOnly,!1),this.multipleBond=ht(r.multipleBond,"off"),this.bondSpacing=ht(r.bondSpacing,1),this.bondScale=ht(r.bondScale,.4),this.linewidth=ht(r.linewidth,2),t.prototype.init.call(this,r)},e.prototype.getAtomRadius=function(e){return this.aspectRatio*t.prototype.getAtomRadius.call(this,e)},e.prototype.getAtomParams=function(e,r){var i=t.prototype.getAtomParams.call(this,e,r);return i.radiusParams.scale*=this.aspectRatio,i},e.prototype.getAtomData=function(t,e,r){return t.getAtomData(this.getAtomParams(e,r))},e.prototype.getBondParams=function(e,r){return r=Object.assign({multipleBond:this.multipleBond,bondSpacing:this.bondSpacing,bondScale:this.bondScale},r),t.prototype.getBondParams.call(this,e,r)},e.prototype.getBondData=function(t,e,r){return t.getBondData(this.getBondParams(e,r))},e.prototype.createData=function(t){var e=[];if(this.lineOnly)this.lineBuffer=new $l(this.getBondData(t,{position:!0,color:!0,picking:!0}),this.getBufferParams({linewidth:this.linewidth})),e.push(this.lineBuffer);else{var r=new Ql(this.getBondData(t),this.getBufferParams({openEnded:this.openEnded,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0}));if(e.push(r),!this.cylinderOnly){var i=new Fu(this.getAtomData(t),this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0}));e.push(i)}}return{bufferList:e}},e.prototype.updateData=function(t,e){"off"!==this.multipleBond&&t&&t.radius&&(t.position=!0);var r=this.getBondData(e.sview,t);if(this.lineOnly){var i={};t&&!t.position||Object.assign(i,{position1:r.position1,position2:r.position2}),t&&!t.color||Object.assign(i,{color:r.color,color2:r.color2}),e.bufferList[0].setAttributes(i)}else{var o={};if(t&&!t.position||Object.assign(o,{position1:r.position1,position2:r.position2}),t&&!t.color||Object.assign(o,{color:r.color,color2:r.color2}),t&&!t.radius||Object.assign(o,{radius:r.radius}),e.bufferList[0].setAttributes(o),!this.cylinderOnly){var n=this.getAtomData(e.sview,t),a={};t&&!t.position||Object.assign(a,{position:n.position}),t&&!t.color||Object.assign(a,{color:n.color}),t&&!t.radius||Object.assign(a,{radius:n.radius}),e.bufferList[1].setAttributes(a)}}},e.prototype.setParameters=function(e){void 0===e&&(e={});var r=!1,i={};return(e.aspectRatio||e.bondSpacing||e.bondScale)&&(Object.assign(i,{radius:!0}),Ne&&!this.disableImpostor||(r=!0)),t.prototype.setParameters.call(this,e,i,r),this},e}(wl);Je.add("ball+stick",tp);var ep=function(t){function e(e,r,i){t.call(this,e,r,i),this.type="backbone",this.parameters=Object.assign({},this.parameters,{multipleBond:null,bondSpacing:null}),this.init(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};r.aspectRatio=ht(r.aspectRatio,1),r.radiusSize=ht(r.radiusSize,.25),t.prototype.init.call(this,r)},e.prototype.getAtomRadius=function(e){return e.isTrace()?t.prototype.getAtomRadius.call(this,e):0},e.prototype.getAtomData=function(t,e,r){return t.getBackboneAtomData(this.getAtomParams(e,r))},e.prototype.getBondData=function(t,e,r){return t.getBackboneBondData(this.getBondParams(e,r))},e}(tp);Je.add("backbone",ep);var rp=function(t){function e(e,r,i){t.call(this,e,r,i),this.type="base",this.parameters=Object.assign({},this.parameters,{multipleBond:null,bondSpacing:null})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(e){var r=e||{};r.aspectRatio=ht(r.aspectRatio,1),r.radiusSize=ht(r.radiusSize,.3),t.prototype.init.call(this,r)},e.prototype.getAtomData=function(t,e,r){return t.getRungAtomData(this.getAtomParams(e,r))},e.prototype.getBondData=function(t,e,r){var i=this.getBondParams(e,r);return Object.assign(i.colorParams,{rung:!0}),t.getRungBondData(i)},e}(tp);Je.add("base",rp);var ip=function(t,e){this.m=t,this.tension=e,this.dt=1/this.m,this.delta=1e-4,this.vec1=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.vec2=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.vDir=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.vTan=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.vNorm=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.vBin=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */],this.m2=Math.ceil(this.m/2)};ip.prototype.interpolateToArr=function(t,e,r,i,o,n,a){n[a+0]=jt(t.x,e.x,r.x,i.x,o,this.tension),n[a+1]=jt(t.y,e.y,r.y,i.y,o,this.tension),n[a+2]=jt(t.z,e.z,r.z,i.z,o,this.tension)},ip.prototype.interpolateToVec=function(t,e,r,i,o,n){n.x=jt(t.x,e.x,r.x,i.x,o,this.tension),n.y=jt(t.y,e.y,r.y,i.y,o,this.tension),n.z=jt(t.z,e.z,r.z,i.z,o,this.tension)},ip.prototype.interpolatePosition=function(t,e,r,i,o,n){for(var a=0;a1&&(u=1),this.interpolateToVec(t,e,r,i,c,this.vec1),this.interpolateToVec(t,e,r,i,u,this.vec2),this.vec2.sub(this.vec1).normalize(),this.vec2.toArray(o,h)}},ip.prototype.vectorSubdivide=function(t,e,r,i,o){for(var n,a=e.next(),s=e.next(),c=e.next(),u=e.size,h=u-1,l=i||0,p=0;p0&&r0;So(w,v,A);var T=Ao(w,x)<0;if(To(w,x,Ao(x,b)),So(S,b,w),To(w,x,Ao(x,_)),So(C,_,w),0!==ko(S)&&0!==ko(C)){Bo(S,S),Bo(C,C);var B=n[M]=function(t,e){var r=t[0],i=t[1],o=t[2],n=e[0],a=e[1],s=e[2],c=i*s-o*a,u=o*n-r*s,h=r*a-i*n,l=Math.sqrt(c*c+u*u+h*h),p=r*n+i*a+o*s;return Math.atan2(l,p)}(S,C);s[M]=($r*B).toFixed(1)+String.fromCharCode(176),wo(O,S,x),Bo(O,O),Ao(O,C)<0&&$o(O,O),Cl(w,A,S,O,B/2),Io(w,a,3*M);var D=Math.ceil(B/r),E=D+(e.extendLine?4:2),F=e.extendLine?36:0,R=new Float32Array(3*E),$=new Float32Array(3*E),L=new Float32Array(9*D),N=new Float32Array(F);c[M]=R,u[M]=$,h[M]=L,l[M]=N,e.extendLine&&(o?(So(w,m,y),Bo(w,w),To(P,w,1/Ao(S,w)),Co(P,P,y)):(To(P,b,1/Ao(S,b)),Co(P,P,g)),T?(So(w,v,g),Bo(w,w),To(I,w,1/Ao(C,w)),Co(I,I,g)):(To(I,_,1/Ao(C,_)),Co(I,I,y))),Co(k,A,S);var z=0;e.extendLine?(Io(m,R,z),Io(P,$,z),Io(P,R,z+=3),Io(k,$,z),z+=3,Io(P,N,0),Io(k,N,3),Io(o?y:g,N,6),Io(o?y:g,N,9),Io(k,N,12),Io(A,N,15)):(Io(A,R,z),Io(k,$,z),z+=3);for(var j=function(t,e){var r=9*e;Io(A,L,r),Io(k,L,r+3),Io(k,R,z),Cl(k,A,S,O,t),Io(k,L,r+6),Io(k,$,z),z+=3},V=0,G=r;G=3&&(o=mp(n)),void 0!==o&&r.push(o)}return this.frontHistogramBinBordersBuffer=s(r.map((function(t){return t.frontHistogramBinBorders})),this.getHistogramBinBorderBufferParameters()),this.backHistogramBinBordersBuffer=s(r.map((function(t){return t.backHistogramBinBorders})),this.getHistogramBinBorderBufferParameters()),this.adjacentBondArrowsBuffer=s(r.map((function(t){return t.adjacentBondArrows})),this.getBondArrowsBufferParameters()),this.distantBondArrowsBuffer=s(r.map((function(t){return t.distantBondArrows})),this.getBondArrowsBufferParameters()),this.opaqueMiddleDiscBuffer=c(r.map((function(t){return t.opaqueMiddleDisc})),this.getOpaqueMiddleDiscBufferParameters()),this.frontHistogramBuffer=c(r.map((function(t){return t.frontHistogram})),this.getHistogramBufferParameters()),this.backHistogramBuffer=c(r.map((function(t){return t.backHistogram})),this.getHistogramBufferParameters()),{bufferList:[].concat(this.frontHistogramBinBordersBuffer,this.backHistogramBinBordersBuffer,this.adjacentBondArrowsBuffer,this.distantBondArrowsBuffer,this.opaqueMiddleDiscBuffer,this.frontHistogramBuffer,this.backHistogramBuffer)}}function a(t){for(var e=t.map((function(t){return t.length})),r=new Float32Array(Kr(e)),i=0,o=0;o0&&(i-=l,n=n.subarray(0,3*i));var d=new cn(c.count,!0);return{text:o,position:n,bondSet:d,bondStore:c}},e.prototype.getBondData=function(t,e,r){var i=t.getBondData(this.getBondParams(e,r));return i.picking&&(i.picking=new Ca(i.picking.array,i.picking.structure,r.bondStore)),i},e.prototype.createData=function(t){if(t.atomCount&&this.atomPair.length){var e=this.atomPair.length,r=new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](this.labelColor),i=this.getDistanceData(t,this.atomPair);this.textBuffer=new El({position:i.position,size:jr(e,this.labelSize),color:Vr(e,r.r,r.g,r.b),text:i.text},this.getLabelBufferParams());var o={bondSet:i.bondSet,bondStore:i.bondStore},a=this.getBondData(t,{position:!0,color:!0,picking:!0,radius:this.useCylinder},o);return this.useCylinder?this.distanceBuffer=new Ql(a,this.getBufferParams({openEnded:this.openEnded,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0})):this.distanceBuffer=new $l(No(a),this.getBufferParams({linewidth:this.linewidth,visible:this.lineVisible,opacity:this.lineOpacity})),{bondSet:i.bondSet,bondStore:i.bondStore,position:i.position,bufferList:[this.textBuffer,this.distanceBuffer]}}},e.prototype.updateData=function(e,r){t.prototype.updateData.call(this,e,r);var i={bondSet:r.bondSet,bondStore:r.bondStore},o=this.getBondData(r.sview,e,i),n={};e&&!e.color||Object.assign(n,{color:o.color,color2:o.color2}),e&&!e.radius||Object.assign(n,{radius:o.radius}),this.distanceBuffer.setAttributes(n)},e.prototype.setParameters=function(e){return t.prototype.setParameters.call(this,e,{},!1),this.useCylinder||(e&&e.lineOpacity&&this.distanceBuffer.setParameters({opacity:e.lineOpacity}),e&&void 0!==e.opacity&&this.distanceBuffer.setParameters({opacity:this.lineOpacity}),e&&e.linewidth&&this.distanceBuffer.setParameters({linewidth:e.linewidth})),this},e}(Al);function yp(t){return 2*(t.position.length/3)*3}Je.add("distance",gp);var vp=Object.assign({scale:1,color:"grey"},vs),bp=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,{position:new Float32Array(yp(e)),color:new Float32Array(yp(e))},r),this.isLine=!0,this.vertexShader="Line.vert",this.fragmentShader="Line.frag";var i=new __WEBPACK_IMPORTED_MODULE_1_three__["i" /* Color */](this.parameters.color),o=this.geometry.attributes;Vr(yp(e)/3,i.r,i.g,i.b,o.color.array),this.setAttributes(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultParameters:{configurable:!0}};return r.defaultParameters.get=function(){return vp},e.prototype.setAttributes=function(t){void 0===t&&(t={});var e,r,i,o=this.geometry.attributes;t.position&&t.vector&&(e=t.position,r=t.vector,i=o.position.array,o.position.needsUpdate=!0);var n=this.size/2,a=this.parameters.scale;if(e&&r)for(var s=0;s radius2) {\nspaceposition.y = mapping.y * 1.5 * radius1;\nspaceposition.x = mapping.x * 1.5 * radius1;\n} else {\nspaceposition.y = mapping.y * 1.5 * radius2;\nspaceposition.x = mapping.x * 1.5 * radius2;\n}\nspaceposition.w = 1.0;\nvec4 e3 = vec4( 1.0 );\nvec3 e1, e1_temp, e2, e2_temp;\ne3.xyz = normalize(position_atom1-position_atom2);\nif (e3.z == 0.0) { e3.z = 0.0000000000001;}\nif ( (position_atom1.x - position_atom2.x) == 0.0) { position_atom1.x += 0.001;}\nif ( (position_atom1.y - position_atom2.y) == 0.0) { position_atom1.y += 0.001;}\nif ( (position_atom1.z - position_atom2.z) == 0.0) { position_atom1.z += 0.001;}\nvec4 focus = vec4( 1.0 );\nfocus.x = ( position_atom1.x*position_atom1.x - position_atom2.x*position_atom2.x +\n( radius2*radius2 - radius1*radius1 )*e3.x*e3.x/shrink )/(2.0*(position_atom1.x - position_atom2.x));\nfocus.y = ( position_atom1.y*position_atom1.y - position_atom2.y*position_atom2.y +\n( radius2*radius2 - radius1*radius1 )*e3.y*e3.y/shrink )/(2.0*(position_atom1.y - position_atom2.y));\nfocus.z = ( position_atom1.z*position_atom1.z - position_atom2.z*position_atom2.z +\n( radius2*radius2 - radius1*radius1 )*e3.z*e3.z/shrink )/(2.0*(position_atom1.z - position_atom2.z));\ne1.x = 1.0;\ne1.y = 1.0;\ne1.z = ( (e3.x*focus.x + e3.y*focus.y + e3.z*focus.z) - e1.x*e3.x - e1.y*e3.y)/e3.z;\ne1_temp = e1 - focus.xyz;\ne1 = normalize(e1_temp);\ne2_temp = e1.yzx * e3.zxy - e1.zxy * e3.yzx;\ne2 = normalize(e2_temp);\nmat3 R= mat3( e1.xyz, e2.xyz, e3.xyz );\nvertex_position.xyz = R * spaceposition.xyz;\nvertex_position.w = 1.0;\nvertex_position.x += (position_atom1.x+position_atom2.x) / 2.0;\nvertex_position.y += (position_atom1.y+position_atom2.y) / 2.0;\nvertex_position.z += (position_atom1.z+position_atom2.z) / 2.0;\ngl_Position = modelViewProjectionMatrix * vertex_position;\nvec4 i_near, i_far;\nvec4 near = gl_Position;\nnear.z = 0.0 ;\nnear = modelViewProjectionMatrixInverse * near;\ni_near = near;\nvec4 far = gl_Position;\nfar.z = far.w ;\ni_far = modelViewProjectionMatrixInverse * far;\nprime1 = vec4( position_atom1 - (position_atom1 - focus.xyz)*shrink, 1.0 );\nprime2 = vec4( position_atom2 - (position_atom2 - focus.xyz)*shrink, 1.0 );\nfloat Rsquare = (radius1*radius1/shrink) - (\n(position_atom1.x - focus.x)*(position_atom1.x - focus.x) +\n(position_atom1.y - focus.y)*(position_atom1.y - focus.y) +\n(position_atom1.z - focus.z)*(position_atom1.z - focus.z)\n);\nfocus.w = Rsquare;\nmatrix_near = mat4( i_near, i_far, focus, e3 );\ngl_Position.z = 1.0;\n}"),er.add("shader/HyperballStickImpostor.frag","#define STANDARD\n#define IMPOSTOR\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 interiorColor;\nuniform float interiorDarkening;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float clipNear;\nuniform float shrink;\nuniform mat4 modelViewMatrix;\nuniform mat4 modelViewProjectionMatrix;\nuniform mat4 modelViewMatrixInverseTranspose;\nuniform mat4 projectionMatrix;\nvarying mat4 matrix_near;\nvarying vec4 prime1;\nvarying vec4 prime2;\nvarying float vRadius;\nvarying float vRadius2;\n#ifdef PICKING\nuniform float objectId;\nvarying vec3 vPickingColor;\n#else\nvarying vec3 vColor1;\nvarying vec3 vColor2;\n#include common\n#include fog_pars_fragment\n#include bsdfs\n#include lights_pars_begin\n#include lights_physical_pars_fragment\n#endif\nbool interior = false;\nfloat calcClip( vec4 cameraPos ){\nreturn dot( cameraPos, vec4( 0.0, 0.0, 1.0, clipNear - 0.5 ) );\n}\nfloat calcClip( vec3 cameraPos ){\nreturn calcClip( vec4( cameraPos, 1.0 ) );\n}\nfloat calcDepth( in vec3 cameraPos ){\nvec2 clipZW = cameraPos.z * projectionMatrix[2].zw + projectionMatrix[3].zw;\nreturn 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\nstruct Ray {\nvec3 origin ;\nvec3 direction ;\n};\nbool cutoff_plane (vec3 M, vec3 cutoff, vec3 x3){\nfloat a = x3.x;\nfloat b = x3.y;\nfloat c = x3.z;\nfloat d = -x3.x*cutoff.x-x3.y*cutoff.y-x3.z*cutoff.z;\nfloat l = a*M.x+b*M.y+c*M.z+d;\nif (l<0.0) {return true;}\nelse{return false;}\n}\nvec3 isect_surf(Ray r, mat4 matrix_coef){\nvec4 direction = vec4(r.direction, 0.0);\nvec4 origin = vec4(r.origin, 1.0);\nfloat a = dot(direction,(matrix_coef*direction));\nfloat b = dot(origin,(matrix_coef*direction));\nfloat c = dot(origin,(matrix_coef*origin));\nfloat delta =b*b-a*c;\ngl_FragColor.a = 1.0;\nif (delta<0.0){\ndiscard;\n}\nfloat t1 =(-b-sqrt(delta))/a;\nreturn r.origin+t1*r.direction;\n}\nvec3 isect_surf2(Ray r, mat4 matrix_coef){\nvec4 direction = vec4(r.direction, 0.0);\nvec4 origin = vec4(r.origin, 1.0);\nfloat a = dot(direction,(matrix_coef*direction));\nfloat b = dot(origin,(matrix_coef*direction));\nfloat c = dot(origin,(matrix_coef*origin));\nfloat delta =b*b-a*c;\ngl_FragColor.a = 1.0;\nif (delta<0.0){\ndiscard;\n}\nfloat t2 =(-b+sqrt(delta))/a;\nreturn r.origin+t2*r.direction;\n}\nRay primary_ray(vec4 near1, vec4 far1){\nvec3 near=near1.xyz/near1.w;\nvec3 far=far1.xyz/far1.w;\nreturn Ray(near,far-near);\n}\nfloat update_z_buffer(vec3 M, mat4 ModelViewP){\nfloat depth1;\nvec4 Ms=(ModelViewP*vec4(M,1.0));\nreturn depth1=(1.0+Ms.z/Ms.w)/2.0;\n}\nvoid main(){\nfloat radius = max( vRadius, vRadius2 );\nvec4 i_near, i_far, focus;\nvec3 e3, e1, e1_temp, e2;\ni_near = vec4(matrix_near[0][0],matrix_near[0][1],matrix_near[0][2],matrix_near[0][3]);\ni_far = vec4(matrix_near[1][0],matrix_near[1][1],matrix_near[1][2],matrix_near[1][3]);\nfocus = vec4(matrix_near[2][0],matrix_near[2][1],matrix_near[2][2],matrix_near[2][3]);\ne3 = vec3(matrix_near[3][0],matrix_near[3][1],matrix_near[3][2]);\ne1.x = 1.0;\ne1.y = 1.0;\ne1.z = ( (e3.x*focus.x + e3.y*focus.y + e3.z*focus.z) - e1.x*e3.x - e1.y*e3.y)/e3.z;\ne1_temp = e1 - focus.xyz;\ne1 = normalize(e1_temp);\ne2 = normalize(cross(e1,e3));\nvec4 equation = focus;\nfloat shrinkfactor = shrink;\nfloat t1 = -1.0/(1.0-shrinkfactor);\nfloat t2 = 1.0/(shrinkfactor);\nvec4 colonne1, colonne2, colonne3, colonne4;\nmat4 mat;\nvec3 equation1 = vec3(t2,t2,t1);\nfloat A1 = - e1.x*equation.x - e1.y*equation.y - e1.z*equation.z;\nfloat A2 = - e2.x*equation.x - e2.y*equation.y - e2.z*equation.z;\nfloat A3 = - e3.x*equation.x - e3.y*equation.y - e3.z*equation.z;\nfloat A11 = equation1.x*e1.x*e1.x + equation1.y*e2.x*e2.x + equation1.z*e3.x*e3.x;\nfloat A21 = equation1.x*e1.x*e1.y + equation1.y*e2.x*e2.y + equation1.z*e3.x*e3.y;\nfloat A31 = equation1.x*e1.x*e1.z + equation1.y*e2.x*e2.z + equation1.z*e3.x*e3.z;\nfloat A41 = equation1.x*e1.x*A1 + equation1.y*e2.x*A2 + equation1.z*e3.x*A3;\nfloat A22 = equation1.x*e1.y*e1.y + equation1.y*e2.y*e2.y + equation1.z*e3.y*e3.y;\nfloat A32 = equation1.x*e1.y*e1.z + equation1.y*e2.y*e2.z + equation1.z*e3.y*e3.z;\nfloat A42 = equation1.x*e1.y*A1 + equation1.y*e2.y*A2 + equation1.z*e3.y*A3;\nfloat A33 = equation1.x*e1.z*e1.z + equation1.y*e2.z*e2.z + equation1.z*e3.z*e3.z;\nfloat A43 = equation1.x*e1.z*A1 + equation1.y*e2.z*A2 + equation1.z*e3.z*A3;\nfloat A44 = equation1.x*A1*A1 + equation1.y*A2*A2 + equation1.z*A3*A3 - equation.w;\ncolonne1 = vec4(A11,A21,A31,A41);\ncolonne2 = vec4(A21,A22,A32,A42);\ncolonne3 = vec4(A31,A32,A33,A43);\ncolonne4 = vec4(A41,A42,A43,A44);\nmat = mat4(colonne1,colonne2,colonne3,colonne4);\nRay ray = primary_ray(i_near,i_far) ;\nvec3 M;\nM = isect_surf(ray, mat);\nif (cutoff_plane(M, prime1.xyz, -e3) || cutoff_plane(M, prime2.xyz, e3)){ discard; }\nvec4 M1 = vec4(M,1.0);\nvec4 M2 = mat*M1;\nvec3 _normal = ( modelViewMatrixInverseTranspose * M2 ).xyz;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\n#ifdef NEAR_CLIP\nif( calcClip( modelViewMatrix * vec4( M, 1.0 ) ) > 0.0 ){\nM = isect_surf2(ray, mat);\nif( calcClip( modelViewMatrix * vec4( M, 1.0 ) ) > 0.0 )\ndiscard;\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( clipNear - 0.5 ) ) ) + ( 0.0000001 / radius ) );\n}\n}else if( gl_FragDepthEXT <= 0.0 ){\nM = isect_surf2(ray, mat);\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix);\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / radius );\n}\n}\n#else\nif( gl_FragDepthEXT <= 0.0 ){\nM = isect_surf2(ray, mat);\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / radius );\n}\n}\n#endif\nif (cutoff_plane(M, prime1.xyz, -e3) || cutoff_plane(M, prime2.xyz, e3)){ discard; }\nif (gl_FragDepthEXT < 0.0)\ndiscard;\nif (gl_FragDepthEXT > 1.0)\ndiscard;\nfloat distance_ratio = ((M.x-prime2.x)*e3.x + (M.y-prime2.y)*e3.y +(M.z-prime2.z)*e3.z) /\ndistance(prime2.xyz,prime1.xyz);\n#ifdef PICKING\nif( opacity < 0.3 )\ndiscard;\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 vViewPosition = -( modelViewMatrix * vec4( M, 1.0 ) ).xyz;\nvec3 vNormal = _normal;\nvec3 vColor;\nif( distance_ratio>0.5 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\nvec3 normal = normalize( vNormal );\nvec3 geometryNormal = normal;\n#include lights_physical_fragment\n#include lights_fragment_begin\n#include lights_fragment_end\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\nif( interior ){\n#ifdef USE_INTERIOR_COLOR\noutgoingLight.xyz = interiorColor;\n#else\n#ifdef DIFFUSE_INTERIOR\noutgoingLight.xyz = vColor;\n#endif\n#endif\noutgoingLight.xyz *= 1.0 - interiorDarkening;\n}\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var wp=new Float32Array([-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,1,1,1,-1,1,1]),Ap=new Uint16Array([0,1,2,0,2,3,1,5,6,1,6,2,4,6,5,4,7,6,0,7,4,0,3,7,0,5,1,0,4,5,3,2,6,3,6,7]),Sp=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"v3",e,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={mapping:{configurable:!0},mappingIndices:{configurable:!0},mappingIndicesSize:{configurable:!0},mappingSize:{configurable:!0},mappingItemSize:{configurable:!0}};return r.mapping.get=function(){return wp},r.mappingIndices.get=function(){return Ap},r.mappingIndicesSize.get=function(){return 36},r.mappingSize.get=function(){return 8},r.mappingItemSize.get=function(){return 3},Object.defineProperties(e.prototype,r),e}(Mu),Cp=Object.assign({shrink:.14},vs),Pp=Object.assign({shrink:{uniform:!0}},bs),Ip=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,e,r),this.parameterTypes=Pp,this.isImpostor=!0,this.vertexShader="HyperballStickImpostor.vert",this.fragmentShader="HyperballStickImpostor.frag",this.addUniforms({modelViewProjectionMatrix:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]},modelViewProjectionMatrixInverse:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]},modelViewMatrixInverseTranspose:{value:new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]},shrink:{value:this.parameters.shrink}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null},radius:{type:"f",value:null},radius2:{type:"f",value:null}}),this.setAttributes(e),this.makeMapping()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultParameters:{configurable:!0}};return r.defaultParameters.get=function(){return Cp},Object.defineProperties(e.prototype,r),e}(Sp);Object.assign({disableImpostor:!1},Gl,Cp);var Op=function(t,e){return void 0===e&&(e={}),!Ne||e&&e.disableImpostor?(t.radius=function(t,e){for(var r=t.length,i=new Float32Array(r),o=0;o0;)i[s]=arguments[s+3];for(var c=a(t,e,r),u=0;uu?p[m]=-1:(c=Math.sqrt(u-s),p[m]=Math.floor(c)),++m;f[g]=l,d[g]=p}}function C(r){var i,o,n,s,l,m,v,x,_,w,A,S,C,P,I,O,k,M,T=3*r,B=r;i=Math.floor(.5+a*(t[T]+p[0])),o=Math.floor(.5+a*(t[T+1]+p[1])),n=Math.floor(.5+a*(t[T+2]+p[2]));var D,E=e[B],F=d[E],R=0,$=u*h,L=f[E];for(w=0;w=c||P>=u||I>=h)){var N=C*$+P*h+I;if(g)if(1&y[N]){if(1&y[N]){var z=b[N];z!==T&&v*v+x*x+_*_<(s=i+v-Math.floor(.5+a*(t[z]+p[0])))*s+(l=o+x-Math.floor(.5+a*(t[z+1]+p[1])))*l+(m=n+_-Math.floor(.5+a*(t[z+2]+p[2])))*m&&(b[N]=r)}}else y[N]|=1,b[N]=r;else y[N]|=1}R++}}function P(e){var r,i;for(console.time("EDTSurface fillvoxels"),r=0,i=y.length;r=c||A>=u||S>=h)){var $=w*R+A*h+S;if(2&y[$]){if(g){var L=b[$];v*v+x*x+_*_<(s=Math.floor(.5+a*(t[L]+p[0])))*s+(l=Math.floor(.5+a*(t[L+1]+p[1])))*l+(m=Math.floor(.5+a*(t[L+2]+p[2])))*m&&(b[$]=r)}}else y[$]|=2,g&&(b[$]=r)}E++}}function O(){var t,e,r,i;console.time("EDTSurface fastdistancemap");var o,n=Dp(c,u,h,Uint16Array,3),a=u*h,l=m*m,p=0;for(t=0;t0);var w,A=s*s,S=new Uint16Array(3);for(t=0;t=A)||(y[o]|=4,g&&2&y[o]&&(n.toArray(t,e,r,S),w=S[0]*a+S[1]*h+S[2],b[o]=b[w])));console.timeEnd("EDTSurface fastdistancemap")}function k(t,e,r,i){var o,n,a,s,l,p,d,f,m,g,b,x,_=new Uint16Array(3),w=0;if(0===r)return w;var S=-1,C=-1,P=-1,I=u*h;for(d=0,m=r;d-1&&C-1&&P-1&&(1&y[b=S*I+h*C+P]&&!(2&y[b])?(e.fromArray(S,C,P,_),g=(s=S-_[0])*s+(l=C-_[1])*l+(p=P-_[2])*p,v[b]=g,y[b]|=2,y[b]|=4,i[w]=S,i[w+1]=C,i[w+2]=P,w+=3):1&y[b]&&2&y[b]&&(g=(s=S-_[0])*s+(l=C-_[1])*l+(p=P-_[2])*p)-1&&C-1&&P-1&&(1&y[b=S*I+h*C+P]&&!(2&y[b])?(e.fromArray(S,C,P,_),g=(s=S-_[0])*s+(l=C-_[1])*l+(p=P-_[2])*p,v[b]=g,y[b]|=2,y[b]|=4,i[w]=S,i[w+1]=C,i[w+2]=P,w+=3):1&y[b]&&2&y[b]&&(g=(s=S-_[0])*s+(l=C-_[1])*l+(p=P-_[2])*p)-1&&C-1&&P-1&&(1&y[b=S*I+h*C+P]&&!(2&y[b])?(e.fromArray(S,C,P,_),g=(s=S-_[0])*s+(l=C-_[1])*l+(p=P-_[2])*p,v[b]=g,y[b]|=2,y[b]|=4,i[w]=S,i[w+1]=C,i[w+2]=P,w+=3):1&y[b]&&2&y[b]&&(g=(s=S-_[0])*s+(l=C-_[1])*l+(p=P-_[2])*p)-1&&a-1&&l-1&&sM&&(M=E)}return{neighbourListLength:27*M+1,withinRadii:function(o,n,a,s,l){for(var p=0,d=f(o,c),m=f(n,u),g=f(a,h),y=Math.max(0,d-1),_=Math.max(0,m-1),A=Math.max(0,g-1),S=Math.min(v,d+2),C=Math.min(b,m+2),k=Math.min(x,g+2),M=y;Mp&&(p=h[D]);var E;E=us(k,M,p,f,0),f=E.scaleFactor,y=E.dim,v=E.matrix,O=Math.max(5,2+Math.floor(d*f)),b=jr(y[0]*y[1]*y[2],-1001),x=new Int32Array(b.length),_=new Float32Array(y[0]),w=new Float32Array(y[1]),A=new Float32Array(y[2]),$(_,k[0],1/f),$(w,k[1],1/f),$(A,k[2],1/f),function(){var t=0,e=2*Math.PI/g;C=new Float32Array(g),S=new Float32Array(g);for(var r=0;r=0;){if(n!==i&&n!==o&&N(n,t,e,r))return T=n,n;n=I[++a]}return T=-1,-1}function N(e,r,i,o){var n=3*e,a=l[e],s=t[n]-r,c=t[n+1]-i,u=t[n+2]-o;return s*s+c*c+u*u0&&l=0;)t0)continue;var vt=void 0,bt=void 0,xt=void 0,_t=void 0,wt=0;if(N){if(wt=10===(_t=h.split(Wd)).length?1:0,v=_t[2],X&&"CA"!==v)continue;vt=parseFloat(_t[6-wt]),bt=parseFloat(_t[7-wt]),xt=parseFloat(_t[8-wt])}else{if(v=h.substr(12,4).trim(),X&&"CA"!==v)continue;vt=parseFloat(h.substr(30,8)),bt=parseFloat(h.substr(38,8)),xt=parseFloat(h.substr(46,8))}if(q){var At=3*a;if(n[At+0]=vt,n[At+1]=bt,n[At+2]=xt,a+=1,Z)continue}var St=void 0;N?(p=parseInt(_t[1]),St="",b="H"===h[0]?1:0,d=wt?"":_t[4],f=parseInt(_t[5-wt]),y="",m=_t[3],_="",g=1):(p=parseInt(h.substr(6,5),U),G&&99999===p&&(U=16),b="H"===h[0]?1:0,d=h[21].trim(),f=parseInt(h.substr(22,4),H),G&&9999===f&&(H=16),y=h[26].trim(),m=h.substr(17,4).trim()||"MOL",x=parseFloat(h.substr(60,6)),_=h[16].trim(),g=parseFloat(h.substr(54,6)),t||(z?(St=h.substr(76,3).trim())in zn&&(St=zn[St]):(St=h.substr(76,2).trim(),d||(d=h.substr(72,4).trim())),w=parseInt((h.substr(79,1)+h.substr(78,1)).trim()))),lt.growIfFull(),lt.atomTypeId[ft]=ht.add(v,St),lt.x[ft]=vt,lt.y[ft]=bt,lt.z[ft]=xt,lt.serial[ft]=p,lt.altloc[ft]=_.charCodeAt(0),lt.occupancy[ft]=isNaN(g)?0:g,N?(lt.partialCharge[ft]=parseFloat(_t[9-wt]),lt.radius[ft]=parseFloat(_t[10-wt])):(lt.bfactor[ft]=isNaN(x)?0:x,z&&(lt.partialCharge[ft]=parseFloat(h.substr(70,6))),isFinite(w)&&(lt.formalCharge||lt.addField("formalCharge",1,"int8"),lt.formalCharge[ft]=w));var Ct=qd(f,d,y);!b||ot[Ct]||Ud.includes(m)?D||E===d||(B=(T+=1).toString()):E===d&&R===m&&(En.includes(m)||F===f&&$===y)||(B=(T+=1).toString(),F=f,R=m,$=y),V.addAtom(mt,d,B,m,f,b,void 0,y),J[p]=ft,ft+=1,D=!1,E=d}else if("CONECT"===l){var Pt=J[parseInt(h.substr(6,5))],It=[11,16,21,26],Ot={};if(void 0===Pt)continue;for(var kt=0;kt<4;++kt){var Mt=parseInt(h.substr(It[kt],5));if(!Number.isNaN(Mt)&&void 0!==(Mt=J[Mt]))if(Pt0)continue;var nt=it[u].replace(Zd,"");if(O&&"CA"!==nt)continue;var at=parseFloat(it[b]),st=parseFloat(it[x]),ct=parseFloat(it[_]);if(I){var ut=3*e;if(t[ut+0]=at,t[ut+1]=st,t[ut+2]=ct,e+=1,X>0)continue}var ht=it[h],lt=parseInt(it[-1!==s?s:c]),pt=it[v];pt="?"===pt?"":pt;var dt=it[a],ft=it[l],mt="H"===it[f][0]?1:0,gt=it[g],yt=parseFloat(it[w]),vt=parseFloat(it[A]),bt=it[d];if(bt="."===bt?"":bt,H.growIfFull(),H.atomTypeId[q]=U.add(nt,gt),H.x[q]=at,H.y[q]=st,H.z[q]=ct,H.serial[q]=parseInt(it[m]),H.bfactor[q]=isNaN(yt)?0:yt,H.occupancy[q]=isNaN(vt)?0:vt,H.altloc[q]=bt.charCodeAt(0),C.addAtom(X,dt,ft,ht,lt,mt,void 0,pt),He){var xt=T[ft];void 0!==xt&&xt!==dt&&He&&je.warn(xt,dt)}T[ft]=dt;var _t=it[p];B[_t]||(B[_t]=new Set),B[_t].add(S.chainStore.count-1),q+=1}else{var wt=n.match(Kd),At=wt.length;N===L.length&&(N=0);for(var St=0;Stl*l)return n.growIfFull(),n.atomTypeId[g]=n.atomTypeId[t],n.x[g]=d.x,n.y[g]=d.y,n.z[g]=d.z,n.occupancy[g]=n.occupancy[t],n.serial[g]=g,n.altloc[g]="A".charCodeAt(0),o.addAtom(0,"","","HET",1,!0),void(g+=1)}}}))},x=0;x0){a=a.split("(");var u=c(a[0]),h=c(a[1]);Object.keys(u).forEach((function(t){Object.keys(h).forEach((function(e){var r=new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */];r.multiplyMatrices(u[t],h[e]),o[t+"x"+e]=r}))}))}else o=c(a);var l=[];for(var p in o)l.push(o[p]);var d=t;/^(0|[1-9][0-9]*)$/.test(d)&&(d="BU"+d);for(var f=s.asym_id_list[e].split(","),m=0,g=f.length;mw){var A=_;_=w,w=A;var S=f;f=b,b=S}if(0!==_&&0!==w)for(var C=0;Cv)continue}l=I.substr(5,5).trim(),p=parseInt(I.substr(0,5)),d=parseInt(I.substr(15,5)),x.growIfFull(),x.atomTypeId[_]=b.add(h),x.x[_]=M,x.y[_]=T,x.z[_]=B,x.serial[_]=d,i.addAtom(w,"","",l,p,0,"l"),_+=1}}}(0,r.length,r)})),i.finalize(),r.finalizeAtoms(),Bc(r),Dc(r),r.finalizeBonds(),Mc(r),He&&je.timeEnd("GroParser._parse "+this.name)},Object.defineProperties(e.prototype,r),e}(Ld);tr.add("gro",af);var sf=["mmtfVersion","mmtfProducer","unitCell","spaceGroup","structureId","title","depositionDate","releaseDate","experimentalMethods","resolution","rFree","rWork","bioAssemblyList","ncsOperatorList","entityList","groupList","numBonds","numAtoms","numGroups","numChains","numModels","groupsPerChain","chainsPerModel"].concat(["xCoordList","yCoordList","zCoordList","groupIdList","groupTypeList","chainIdList","bFactorList","atomIdList","altLocList","occupancyList","secStructList","insCodeList","sequenceIndexList","chainNameList","bondAtomList","bondOrderList"]);function cf(t,e,r){return e?new t(e.buffer,e.byteOffset,e.byteLength/(r||1)):void 0}function uf(t){return cf(DataView,t)}function hf(t){return cf(Int8Array,t)}function lf(t){return cf(Int32Array,t,4)}function pf(t,e){var r=t.length/2;e||(e=new Int16Array(r));for(var i=0,o=0;in&&++s;e=new Int32Array(s)}for(r=0,i=0;ro){for(var n=[],a=0;a0&&(p.biomolDict.NCS=st)}var ut=d.unitCell;ut&&Array.isArray(ut)&&ut[0]?p.unitcell=new Vd({a:ut[0],b:ut[1],c:ut[2],alpha:ut[3],beta:ut[4],gamma:ut[5],spacegroup:d.spaceGroup}):p.unitcell=void 0,$c(p,!0),Rc(p,!0),p.finalizeAtoms(),p.finalizeBonds(),Lc(p),He&&je.timeEnd("MmtfParser._parse "+this.name)},Object.defineProperties(e.prototype,r),e}(Ld);tr.add("mmtf",Sf);var Cf=/\s+/,Pf={1:1,2:2,3:3,am:1,ar:1,du:1,un:1,nc:0},If=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"mol2"},e.prototype._parse=function(){He&&je.time("Mol2Parser._parse "+this.name);var t,e,r=this.structure,i=this.structureBuilder,o=this.firstModelOnly,n=this.asTrajectory,a=r.frames,s=!1,c=r.atomMap,u=r.atomStore;u.resize(Math.round(this.streamer.data.length/60)),u.addField("partialCharge",1,"float32");var h=0,l=0,p=0,d=-1,f=0,m=0,g=r.getAtomProxy(),y=r.getAtomProxy();this.streamer.eachChunkOfLines((function(v){!function(v,b,x){for(var _=v;_MOLECULE"===w?(m=1,l=0,++d):"@ATOM"===w?(m=2,p=u.count,n&&(e=0,t=new Float32Array(3*f),a.push(t),d>0&&(s=!0))):m="@BOND"===w?3:0;else if(1===m){if(0===l)r.title=w,r.id=w;else if(1===l){var A=w.split(Cf);f=parseInt(A[0])}++l}else if(2===m){var S=w.split(Cf);if(o&&d>0)continue;var C=parseFloat(S[2]),P=parseFloat(S[3]),I=parseFloat(S[4]);if(n){var O=3*e;if(t[O+0]=C,t[O+1]=P,t[O+2]=I,e+=1,s)continue}var k=S[0],M=S[1],T=S[5].split(".")[0],B=S[6]?parseInt(S[6]):1,D=S[7]?S[7]:"",E=S[8]?parseFloat(S[8]):0;u.growIfFull(),u.atomTypeId[h]=c.add(M,T),u.x[h]=C,u.y[h]=P,u.z[h]=I,u.serial[h]=k,u.partialCharge[h]=E,i.addAtom(d,"","",D,B,1),h+=1}else if(3===m){if(o&&d>0)continue;if(n&&d>0)continue;var F=w.split(Cf);g.index=parseInt(F[1])-1+p,y.index=parseInt(F[2])-1+p;var R=Pf[F[3]];r.bondStore.addBond(g,y,R)}}}(0,v.length,v)})),i.finalize(),r.finalizeAtoms(),Bc(r),Rc(r,!0),$c(r,!0),r.finalizeBonds(),Vc(r),Mc(r),He&&je.timeEnd("Mol2Parser._parse "+this.name)},Object.defineProperties(e.prototype,r),e}(Ld);tr.add("mol2",If);var Of=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"pdbqt"},Object.defineProperties(e.prototype,r),e}(Xd);tr.add("pdbqt",Of);var kf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"pqr"},Object.defineProperties(e.prototype,r),e}(Xd);tr.add("pqr",kf);var Mf=/> +<(.+)>/,Tf=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"sdf"},e.prototype._parse=function(){He&&je.time("SdfParser._parse "+this.name);var t=this.structure,e=this.structureBuilder,r=this.firstModelOnly,i=this.asTrajectory,o=this.streamer.peekLines(2);t.id=o[0].trim(),t.title=o[1].trim();var n,a,s=t.frames,c=!1,u=t.atomMap,h=t.atomStore;h.resize(Math.round(this.streamer.data.length/50)),h.addField("formalCharge",1,"int8");var l,p,d,f,m,g,y,v,b,x,_,w,A,S,C=t.getAtomProxy(),P=t.getAtomProxy(),I=0,O=0,k=0,M=0,T=[],B=!1,D={};t.extraData.sdf=T;var E=!1,F=!1,R=!1,$=[],L=[],N=new Map;this.streamer.eachChunkOfLines((function(o){!function(o,z,j){for(var V=o;V-1)?N.clear():(p=parseInt(G.substr(0,3)),d=parseInt(G.substr(3,3)),y=(g=m=(f=4)+p)+d,i&&(a=0,n=new Float32Array(3*p),s.push(n),k>0&&(c=!0)));else if(E&&"COUNTS"===$[0])p=parseInt($[1]),i&&(a=0,n=new Float32Array(3*p),s.push(n),k>0&&(c=!0));else if(E&&2==$.length)"ATOM"===$[1]?"BEGIN"===$[0]?F=!0:"END"===$[0]&&(F=!1):"BOND"===$[1]&&("BEGIN"===$[0]?R=!0:"END"===$[0]&&(R=!1));else if(F||!E&&O>=f&&O0)continue;var U=0;if(E){if(v=parseFloat($[2]),b=parseFloat($[3]),x=parseFloat($[4]),w=$[1],A=parseInt($[0]),N.set(A,I),_=w+A,$.length>6){var H=$.slice(6).find((function(t){return 0===t.indexOf("CHG=")}));H&&(U=parseInt(H.substring(4)))}}else v=parseFloat(G.substr(0,10)),b=parseFloat(G.substr(10,10)),x=parseFloat(G.substr(20,10)),w=G.substr(31,3).trim(),_=w+(I-M+1);if(i){var W=3*a;if(n[W+0]=v,n[W+1]=b,n[W+2]=x,a+=1,c)continue}h.growIfFull(),h.atomTypeId[I]=u.add(_,w),h.x[I]=v,h.y[I]=b,h.z[I]=x,h.serial[I]=E?A:I,h.formalCharge[I]=U,e.addAtom(k,"","","HET",1,1),I+=1}else if(R||!E&&O>=g&&O0)continue;if(i&&k>0)continue;E?(C.index=N.get(parseInt($[2])),P.index=N.get(parseInt($[3])),S=parseInt($[1])):(C.index=parseInt(G.substr(0,3))-1+M,P.index=parseInt(G.substr(3,3))-1+M,S=parseInt(G.substr(6,3))),t.bondStore.addBond(C,P,S)}else if("M CHG"===G.substr(0,6))for(var q=parseInt(G.substr(6,3)),X=0,Y=10;X"===G.charAt(0)&&(l=G.match(Mf))?(B=l[1],D[B]=[]):!1!==B&&G&&D[B].push(G);++O}}}(0,o.length,o)})),e.finalize(),t.finalizeAtoms(),t.finalizeBonds(),Vc(t),He&&je.timeEnd("SdfParser._parse "+this.name)},e.prototype._postProcess=function(){Vc(this.structure)},Object.defineProperties(e.prototype,r),e}(Ld);tr.add("sdf",Tf),tr.add("sd",Tf),tr.add("mol",Tf);function Bf(t,e,r){return parseInt(t.substr(e,r).trim())}var Df=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"prmtop"},e.prototype._parse=function(){He&&je.time("PrmtopParser._parse "+this.name);var t=this.structure,e=this.structureBuilder,r=t.atomMap,i=t.atomStore;i.addField("partialCharge",1,"float32"),i.addField("radius",1,"float32");var o,n,a,s,c,u=[],h={},l=["NATOM","NTYPES","NBONH","MBONA","NTHETH","MTHETA","NPHIH","MPHIA","NHPARM","NPARM","NNB","NRES","NBONA","NTHETA","NPHIA","NUMBND","NUMANG","NPTRA","NATYP","NPHB","IFPERT","NBPER","NGPER","NDPER","MBPER","MGPER","MDPER","IFBOX","NMXRS","IFCAP","NUMEXTRA","NCOPY"];l.forEach((function(t){h[t]=0}));var p,d,f,m,g,y=new Uint8Array(0);this.streamer.eachChunkOfLines((function(t){!function(t,e,r){for(var v=t;v0)je.error("dcd format with fixed atoms unsupported, aborting");else{for(var g=n.NATOM,y=4*g,v=0,b=n.NSET;v=1&&(r.timeOffset=(n.ISTART-1)*r.deltaTime),He&&je.timeEnd("DcdParser._parse "+this.name)}},Object.defineProperties(e.prototype,r),e}(zf);function Vf(t,e){if(t)throw new TypeError("Not a valid NetCDF v3.x file: "+e)}function Gf(t){t.offset%4!=0&&t.skip(4-t.offset%4)}function Uf(t){var e=t.readUint32(),r=t.readChars(e);return Gf(t),r}tr.add("dcd",jf);var Hf=1,Wf=2,qf=3,Xf=4,Yf=5,Kf=6;function Zf(t){switch(Number(t)){case Hf:return"byte";case Wf:return"char";case qf:return"short";case Xf:return"int";case Yf:return"float";case Kf:return"double";default:return"undefined"}}function Qf(t){switch(Number(t)){case Hf:case Wf:return 1;case qf:return 2;case Xf:case Yf:return 4;case Kf:return 8;default:return-1}}function Jf(t){switch(String(t)){case"byte":return Hf;case"char":return Wf;case"short":return qf;case"int":return Xf;case"float":return Yf;case"double":return Kf;default:return-1}}function tm(t,e){if(1!==t){for(var r=new Array(t),i=0;i6,"non valid type "+d);var f=t.readUint32(),m=t.readUint32();2===r&&(Vf(m>0,"offsets larger than 4GB not supported"),m=t.readUint32()),h[0]===e&&(n+=f),i[s]={name:c,dimensions:h,attributes:p,type:Zf(d),size:f,offset:m,record:h[0]===e}}return{variables:i,recordStep:n}}(t,i.recordId,e);return r.variables=o.variables,r.recordDimension.recordStep=o.recordStep,r}function im(t){var e,r=t.readUint32();if(0===r)return Vf(0!==t.readUint32(),"wrong empty tag for list of attributes"),[];Vf(12!==r,"wrong tag for list of attributes");var i=t.readUint32();e=new Array(i);for(var o=0;o6,"non valid type "+a);var s=t.readUint32(),c=em(t,a,s);Gf(t),e[o]={name:n,type:Zf(a),value:c}}return e}var om=function(t){var e=new wr(t);e.setBigEndian(),Vf("CDF"!==e.readChars(3),"should start with CDF");var r=e.readByte();Vf(r>2,"unknown version"),this.header=rm(e,r),this.buffer=e},nm={version:{configurable:!0},recordDimension:{configurable:!0},dimensions:{configurable:!0},globalAttributes:{configurable:!0},variables:{configurable:!0}};nm.version.get=function(){return 1===this.header.version?"classic format":"64-bit offset format"},nm.recordDimension.get=function(){return this.header.recordDimension},nm.dimensions.get=function(){return this.header.dimensions},nm.globalAttributes.get=function(){return this.header.globalAttributes},nm.variables.get=function(){return this.header.variables},om.prototype.hasDataVariable=function(t){return-1!==this.header.variables.findIndex((function(e){return e.name===t}))},om.prototype.getDataVariable=function(t){var e;return Vf(void 0===(e="string"==typeof t?this.header.variables.find((function(e){return e.name===t})):t),"variable not found"),this.buffer.seek(e.offset),e.record?function(t,e,r){for(var i=Jf(e.type),o=e.size?e.size/Qf(i):1,n=r.length,a=new Array(n),s=r.recordStep,c=0;c=1&&(e.timeOffset=o[0]),o.length>=2&&(e.deltaTime=o[1]-o[0]),He&&je.timeEnd("NctrajParser._parse "+this.name)},Object.defineProperties(e.prototype,r),e}(zf);tr.add("nctraj",am),tr.add("ncdf",am),tr.add("nc",am);var sm=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0},isBinary:{configurable:!0}};return r.type.get=function(){return"trr"},r.isBinary.get=function(){return!0},e.prototype._parse=function(){He&&je.time("TrrParser._parse "+this.name);for(var t=Pt(this.streamer.data),e=new DataView(t),r=this.frames,i=r.coordinates,o=r.boxes,n=r.times,a=0;;){a+=8;var s=e.getInt32(a);a+=4,a+=s;var c=e.getInt32(a+8),u=e.getInt32(a+12),h=e.getInt32(a+16),l=e.getInt32(a+28),p=e.getInt32(a+32),d=e.getInt32(a+36),f=e.getInt32(a+40);a+=52;var m=c/9,g=3*f;if(8===m?n.push(e.getFloat64(a)):n.push(e.getFloat32(a)),a+=2*m,c){var y=new Float32Array(9);if(8===m)for(var v=0;v<9;++v)y[v]=10*e.getFloat64(a),a+=8;else for(var b=0;b<9;++b)y[b]=10*e.getFloat32(a),a+=4;o.push(y)}if(a+=u,a+=h,l){var x=void 0;if(8===m){x=new Float32Array(g);for(var _=0;_>8&65280|S>>24&255}x=new Float32Array(t,a,g);for(var C=0;C=t.byteLength)break}n.length>=1&&(r.timeOffset=n[0]),n.length>=2&&(r.deltaTime=n[1]-n[0]),He&&je.timeEnd("TrrParser._parse "+this.name)},Object.defineProperties(e.prototype,r),e}(zf);tr.add("trr",sm);var cm=new Uint32Array([0,0,0,0,0,0,0,0,0,8,10,12,16,20,25,32,40,50,64,80,101,128,161,203,256,322,406,512,645,812,1024,1290,1625,2048,2580,3250,4096,5060,6501,8192,10321,13003,16384,20642,26007,32768,41285,52015,65536,82570,104031,131072,165140,208063,262144,330280,416127,524287,660561,832255,1048576,1321122,1664510,2097152,2642245,3329021,4194304,5284491,6658042,8388607,10568983,13316085,16777216]);function um(t){for(var e=1,r=0;t>=e&&r<32;)r++,e<<=1;return r}var hm=new Uint8Array(32);function lm(t,e){var r=1,i=0;hm[0]=1;for(var o=0;o>=8;for(;0!==a;)hm[n++]=255&a,a>>=8;r=n}var s=1;for(r--;hm[r]>=s;)i++,s*=2;return i+8*r}function pm(t,e,r,i){for(var o=(1<=8;)c|=(a=a<<8|e[s++])>>n<0&&(n>(n-=r)&(1<8;)dm[s++]=pm(t,e,8,a),i-=8;i>0&&(dm[s++]=pm(t,e,i,a));for(var c=r-1;c>0;c--){for(var u=0,h=s-1;h>=0;h--){var l=(u=u<<8|dm[h])/o[c]|0;dm[h]=l,u-=l*o[c]}n[c]=u}n[0]=dm[0]|dm[1]<<8|dm[2]<<16|dm[3]<<24}var mm=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0},isBinary:{configurable:!0}};return r.type.get=function(){return"xtc"},r.isBinary.get=function(){return!0},e.prototype._parse=function(){He&&je.time("XtcParser._parse "+this.name);for(var t=Pt(this.streamer.data),e=new DataView(t),r=this.frames,i=r.coordinates,o=r.boxes,n=r.times,a=new Int32Array(6),s=new Int32Array(3),c=new Int32Array(3),u=new Uint32Array(3),h=new Float32Array(3),l=new Float32Array(3),p=0,d=new Int32Array(3),f=new Uint32Array(d.buffer);;){var m=void 0,g=e.getInt32(p+4);p+=12;var y=3*g;n.push(e.getFloat32(p)),p+=4;for(var v=new Float32Array(9),b=0;b<9;++b)v[b]=10*e.getFloat32(p),p+=4;if(o.push(v),g<=9){m=new Float32Array(g);for(var x=0;x16777215?(c[0]=um(s[0]),c[1]=um(s[1]),c[2]=um(s[2]),S=0):S=lm(3,s);var C=e.getInt32(p);p+=4;var P=C-1,I=cm[P=9>P?9:P]/2|0,O=cm[C]/2|0;u[0]=u[1]=u[2]=cm[C];var k=4*Math.ceil(e.getInt32(p)/4);p+=4;var M=1/A,T=0,B=0,D=new Uint8Array(t,p);for(h[0]=h[1]=h[2]=0;B0){h[0]=h[1]=h[2]=0;for(var F=0;F9?cm[C-1]/2|0:0):E>0&&(I=O,O=cm[C]/2|0),u[0]=u[1]=u[2]=cm[C],0===u[0]||0===u[1]||0===u[2])return void console.error("(xdrfile error) Undefined error.")}p+=k}for(var $=0;$=t.byteLength)break}n.length>=1&&(r.timeOffset=n[0]),n.length>=2&&(r.deltaTime=n[1]-n[0]),He&&je.timeEnd("XtcParser._parse "+this.name)},Object.defineProperties(e.prototype,r),e}(zf);tr.add("xtc",mm);var gm=function(t){function e(e,r){var i=r||{};t.call(this,e,i),this.volume=new ds(this.name,this.path),this.voxelSize=ht(i.voxelSize,1)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0},__objName:{configurable:!0}};return r.type.get=function(){return"volume"},r.__objName.get=function(){return"volume"},e.prototype._afterParse=function(){this.volume.setMatrix(this.getMatrix()),t.prototype._afterParse.call(this)},e.prototype.getMatrix=function(){return new __WEBPACK_IMPORTED_MODULE_1_three__["z" /* Matrix4 */]},Object.defineProperties(e.prototype,r),e}(Rd),ym=/\s+/,vm=/-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/g,bm=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var o={type:{configurable:!0}};return o.type.get=function(){return"cube"},e.prototype._parse=function(){He&&je.time("CubeParser._parse "+this.name);var t=this.volume,e=this.streamer.peekLines(6),i={},o=.529177210859*this.voxelSize;function n(t,r){var i=e[t].trim().split(ym)[r];return parseFloat(i)}i.atomCount=Math.abs(n(2,0)),i.originX=.529177210859*n(2,1),i.originY=.529177210859*n(2,2),i.originZ=.529177210859*n(2,3),i.NVX=n(3,0),i.NVY=n(4,0),i.NVZ=n(5,0),i.basisX=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](n(3,1),n(3,2),n(3,3)).multiplyScalar(o),i.basisY=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](n(4,1),n(4,2),n(4,3)).multiplyScalar(o),i.basisZ=new __WEBPACK_IMPORTED_MODULE_1_three__["Y" /* Vector3 */](n(5,1),n(5,2),n(5,3)).multiplyScalar(o);var a=new Float32Array(i.NVX*i.NVY*i.NVZ),s=0,c=0,u=n(2,0)>0?0:1;this.streamer.eachChunkOfLines((function(t){!function(t,e,r){for(var o=t;o=i.atomCount+6+u)for(var h=n.match(vm),l=0,p=h.length;l>8&255}i.xStart=n[0],i.yStart=n[1],i.zStart=n[2],i.xExtent=n[3],i.yExtent=n[4],i.zExtent=n[5],i.xRate=n[6],i.yRate=n[7],i.zRate=n[8];var l=1/n[17],p=l*this.voxelSize;i.xlen=n[9]*p,i.ylen=n[10]*p,i.zlen=n[11]*p,i.alpha=n[12]*l,i.beta=n[13]*l,i.gamma=n[14]*l,t=n[15]/100,e=n[16],i.gamma=n[14]*l}r.header=i,He&&je.log(i,t,e);for(var d=new Float32Array(i.xExtent*i.yExtent*i.zExtent),f=512,m=Math.ceil(i.xExtent/8),g=Math.ceil(i.yExtent/8),y=Math.ceil(i.zExtent/8),v=0;vo){var u=r[i].trim();if(""!==u)for(var h=u.split(_m),l=0,p=h.length;l=o&&(f-o)%p!=0&&d=0?r-1:r+e/3)},parseNormalIndex:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)},addVertex:function(t,e,r){var i=this.vertices,o=this.object.geometry.vertices;o.push(i[t+0]),o.push(i[t+1]),o.push(i[t+2]),o.push(i[e+0]),o.push(i[e+1]),o.push(i[e+2]),o.push(i[r+0]),o.push(i[r+1]),o.push(i[r+2])},addVertexLine:function(t){var e=this.vertices,r=this.object.geometry.vertices;r.push(e[t+0]),r.push(e[t+1]),r.push(e[t+2])},addNormal:function(t,e,r){var i=this.normals,o=this.object.geometry.normals;o.push(i[t+0]),o.push(i[t+1]),o.push(i[t+2]),o.push(i[e+0]),o.push(i[e+1]),o.push(i[e+2]),o.push(i[r+0]),o.push(i[r+1]),o.push(i[r+2])},addFace:function(t,e,r,i,o,n,a,s){var c,u=this.vertices.length,h=this.parseVertexIndex(t,u),l=this.parseVertexIndex(e,u),p=this.parseVertexIndex(r,u);if(void 0===i?this.addVertex(h,l,p):(c=this.parseVertexIndex(i,u),this.addVertex(h,l,c),this.addVertex(l,p,c)),void 0!==o){var d=this.normals.length;h=this.parseNormalIndex(o,d),l=o===n?h:this.parseNormalIndex(n,d),p=o===a?h:this.parseNormalIndex(a,d),void 0===i?this.addNormal(h,l,p):(c=this.parseNormalIndex(s,d),this.addNormal(h,l,c),this.addNormal(l,p,c))}},addLineGeometry:function(t){this.object.geometry.type="Line";for(var e=this.vertices.length,r=0,i=t.length;r0?b.setAttribute("normal",new __WEBPACK_IMPORTED_MODULE_1_three__["f" /* BufferAttribute */](new Float32Array(v.normals),3)):b.computeVertexNormals(),y.push(b)}}return y}};var Gm=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0}};return r.type.get=function(){return"obj"},e.prototype.getLoader=function(){return new Vm},Object.defineProperties(e.prototype,r),e}(jm);tr.add("obj",Gm);var Um=function(){this.propertyNameMapping={}};Um.prototype={constructor:Um,setPropertyNameMapping:function(t){this.propertyNameMapping=t},bin2str:function(t){for(var e=new Uint8Array(t),r="",i=0;i=i.elements[a].count&&(a++,s=0);var h=this.parseASCIIElement(i.elements[a].properties,u);this.handleElement(r,i.elements[a].name,h),s++}}return this.postProcess(r)},postProcess:function(t){if(t.useColor){for(var e=0;e/g,""),{declaration:e(),root:r()};function e(){if(o(/^<\?xml\s*/)){for(var t={attributes:{}};!n()&&!a("?>");){var e=i();if(!e)return t;t.attributes[e.name]=e.value}return o(/\?>\s*/),t}}function r(){var t=o(Qm);if(t){for(var e,s={name:t[1],attributes:{},children:[]};!(n()||a(">")||a("?>")||a("/>"));){var c=i();if(!c)return s;s.attributes[c.name]=c.value}if(o(/^\s*\/>\s*/))return s;for(o(/\??>\s*/),s.content=function(){var t=o(Jm);if(t)return t[1];return""}();e=r();)s.children.push(e);return o(/^<\/[\w-:.]+>\s*/),s}}function i(){var t,e=o(tg);if(e)return{name:e[1],value:(t=e[2],t.replace(Zm,""))}}function o(e){var r=t.match(e);if(r)return t=t.slice(r[0].length),r}function n(){return 0===t.length}function a(e){return 0===t.indexOf(e)}}var rg=function(t){function e(e,r){var i=r||{};t.call(this,e,i),this.useDomParser=ht(i.useDomParser,!1),this.xml={name:this.name,path:this.path,data:{}}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={type:{configurable:!0},__objName:{configurable:!0},isXml:{configurable:!0}};return r.type.get=function(){return"xml"},r.__objName.get=function(){return"xml"},r.isXml.get=function(){return!0},e.prototype.__xmlParser=function(t){return eg(t)},e.prototype.__domParser=function(t){return(new window.DOMParser).parseFromString(t,"text/xml")},e.prototype._parse=function(){He&&je.time("XmlParser._parse "+this.name),this.useDomParser?this.streamer.data instanceof Document?this.xml.data=this.streamer.data:this.xml.data=this.__domParser(this.streamer.asText()):this.xml.data=this.__xmlParser(this.streamer.asText()),He&&je.timeEnd("XmlParser._parse "+this.name)},Object.defineProperties(e.prototype,r),e}(Rd);function ig(t,e){var r=t.getNamedItem(e);return null!==r?r.value:""}function og(t,e,r){void 0===r&&(r=!1);var i=ig(t,"icode").trim(),o=ig(t,"chain").trim(),n=ig(t,"altcode"),a=ig(t,"resnum");return i&&(a+="^"+i),o&&(a+=":"+o),e&&(a+="."+e),r&&n.trim()&&(a+="%"+n),a+="/"+(parseInt(ig(t,"model"))-1)}function ng(t){var e=ig(t,"chain").trim(),r="["+ig(t,"rescode")+"]"+ig(t,"resnum");return e&&(r+=":"+e),r}function ag(t,e,r){void 0===t[e]?t[e]=r:t[e]|=r}function sg(t,e){return null!==t&&t.value===e}function cg(t,e,r){for(var i=0,o=e.getElementsByTagName("clash"),n=0,a=o.length;n0&&(i+=1),e.getElementsByTagName("bond-outlier").length>0&&(i+=1),e.getElementsByTagName("plane-outlier").length>0&&(i+=1),sg(r.getNamedItem("rota"),"OUTLIER")&&(i+=1),sg(r.getNamedItem("rama"),"OUTLIER")&&(i+=1),sg(r.getNamedItem("RNApucker"),"outlier")&&(i+=1),i}tr.add("xml",rg);var ug=function(t,e){this.name=t,this.path=e,this.rsrzDict={},this.rsccDict={},this.rciDict={},this.clashDict={},this.clashArray=[],this.geoDict={},this.geoAtomDict={},this.atomDict={},this.clashSele="NONE"},hg={type:{configurable:!0}};hg.type.get=function(){return"validation"},ug.prototype.fromXml=function(t){He&&je.time("Validation.fromXml");var e=this.rsrzDict,r=this.rsccDict,i=this.rciDict,o=this.clashDict,n=this.clashArray,a=this.geoDict,s=this.geoAtomDict,c=this.atomDict,u=t.getElementsByTagName("Entry");if(1===u.length){var h=u[0].getElementsByTagName("chemical_shift_list");if(1===h.length)for(var l=h[0].getElementsByTagName("random_coil_index"),p=0,d=l.length;p0&&(a[R]=$)}else{var L=E.getElementsByTagName("clash"),N=E.getElementsByTagName("mog-bond-outlier"),z=E.getElementsByTagName("mog-angle-outlier");if(N.length>0||z.length>0||L.length>0){var j={};s[R]=j;for(var V=0,G=L.length;V>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{n=n+(o=o+e[i++]|0)|0}while(--a);o%=65521,n%=65521}return o|n<<16|0}tr.add("validation",lg);var mg=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();function gg(t,e,r,i){var o=mg,n=i+r;t^=-1;for(var a=i;a>>8^o[255&(t^e[a])];return-1^t}function yg(t,e){var r,i,o,n,a,s,c,u,h,l,p,d,f,m,g,y,v,b,x,_,w,A,S,C,P;r=t.state,i=t.next_in,C=t.input,o=i+(t.avail_in-5),n=t.next_out,P=t.output,a=n-(e-t.avail_out),s=n+(t.avail_out-257),c=r.dmax,u=r.wsize,h=r.whave,l=r.wnext,p=r.window,d=r.hold,f=r.bits,m=r.lencode,g=r.distcode,y=(1<>>=x=b>>>24,f-=x,0===(x=b>>>16&255))P[n++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=m[(65535&b)+(d&(1<>>=x,f-=x),f<15&&(d+=C[i++]<>>=x=b>>>24,f-=x,!(16&(x=b>>>16&255))){if(0==(64&x)){b=g[(65535&b)+(d&(1<c){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=x,f-=x,w>(x=n-a)){if((x=w-x)>h&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(A=0,S=p,0===l){if(A+=u-x,x<_){_-=x;do{P[n++]=p[A++]}while(--x);A=n-w,S=P}}else if(l2;)P[n++]=S[A++],P[n++]=S[A++],P[n++]=S[A++],_-=3;_&&(P[n++]=S[A++],_>1&&(P[n++]=S[A++]))}else{A=n-w;do{P[n++]=P[A++],P[n++]=P[A++],P[n++]=P[A++],_-=3}while(_>2);_&&(P[n++]=P[A++],_>1&&(P[n++]=P[A++]))}break}}break}}while(i>3,d&=(1<<(f-=_<<3))-1,t.next_in=i,t.next_out=n,t.avail_in=i=1&&0===M[_];_--);if(w>_&&(w=_),0===_)return o[n++]=20971520,o[n++]=20971520,s.bits=1,0;for(x=1;x<_&&0===M[x];x++);for(w0&&(0===t||1!==_))return-1;for(T[1]=0,v=1;v<15;v++)T[v+1]=T[v]+M[v];for(b=0;b852||2===t&&P>592)return 1;for(;;){f=v-S,a[b]d?(m=B[D+a[b]],g=O[k+a[b]]):(m=96,g=0),c=1<>S)+(u-=c)]=f<<24|m<<16|g|0}while(0!==u);for(c=1<>=1;if(0!==c?(I&=c-1,I+=c):I=0,b++,0==--M[v]){if(v===_)break;v=e[r+a[b]]}if(v>w&&(I&l)!==h){for(0===S&&(S=w),p+=x,C=1<<(A=v-S);A+S<_&&!((C-=M[A+S])<=0);)A++,C<<=1;if(P+=1<852||2===t&&P>592)return 1;o[h=I&l]=w<<24|A<<16|p-n|0}}return 0!==I&&(o[p+I]=v-S<<24|64<<16|0),s.bits=w,0}function Ag(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function Sg(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Cg(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,0):-2}(t)):-2}function Pg(t,e){var r,i;return t?(i=new Sg,t.state=i,i.window=null,r=function(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,Cg(t))):-2}(t,e),0!==r&&(t.state=null),r):-2}var Ig,Og,kg=!0;function Mg(t){if(kg){var e;for(Ig=new Int32Array(512),Og=new Int32Array(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(wg(1,t.lens,0,288,Ig,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;wg(2,t.lens,0,32,Og,0,t.work,{bits:5}),kg=!1}t.lencode=Ig,t.lenbits=9,t.distcode=Og,t.distbits=5}function Tg(t,e,r,i){var o,n=t.state;return null===n.window&&(n.wsize=1<=n.wsize?(dg(n.window,e,r-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):((o=n.wsize-n.wnext)>i&&(o=i),dg(n.window,e,r-i,o,n.wnext),(i-=o)?(dg(n.window,e,r-i,i,0),n.wnext=i,n.whave=n.wsize):(n.wnext+=o,n.wnext===n.wsize&&(n.wnext=0),n.whave>>8&255,r.check=gg(r.check,I,2,0),u=0,h=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){t.msg="unknown compression method",r.mode=30;break}if(h-=4,w=8+(15&(u>>>=4)),0===r.wbits)r.wbits=w;else if(w>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=gg(r.check,I,2,0)),u=0,h=0,r.mode=3;case 3:for(;h<32;){if(0===s)break t;s--,u+=i[n++]<>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,r.check=gg(r.check,I,4,0)),u=0,h=0,r.mode=4;case 4:for(;h<16;){if(0===s)break t;s--,u+=i[n++]<>8),512&r.flags&&(I[0]=255&u,I[1]=u>>>8&255,r.check=gg(r.check,I,2,0)),u=0,h=0,r.mode=5;case 5:if(1024&r.flags){for(;h<16;){if(0===s)break t;s--,u+=i[n++]<>>8&255,r.check=gg(r.check,I,2,0)),u=0,h=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),dg(r.head.extra,i,n,d,w)),512&r.flags&&(r.check=gg(r.check,i,d,n)),s-=d,n+=d,r.length-=d),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break t;d=0;do{w=i[n+d++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w))}while(w&&d>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;h<32;){if(0===s)break t;s--,u+=i[n++]<>>=7&h,h-=7&h,r.mode=27;break}for(;h<3;){if(0===s)break t;s--,u+=i[n++]<>>=1)){case 0:r.mode=14;break;case 1:if(Mg(r),r.mode=20,6===e){u>>>=2,h-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}u>>>=2,h-=2;break;case 14:for(u>>>=7&h,h-=7&h;h<32;){if(0===s)break t;s--,u+=i[n++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,u=0,h=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>c&&(d=c),0===d)break t;dg(o,i,n,d,a),s-=d,n+=d,c-=d,a+=d,r.length-=d;break}r.mode=12;break;case 17:for(;h<14;){if(0===s)break t;s--,u+=i[n++]<>>=5,h-=5,r.ndist=1+(31&u),u>>>=5,h-=5,r.ncode=4+(15&u),u>>>=4,h-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,h-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},A=wg(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,A){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,v=65535&P,!((g=P>>>24)<=h);){if(0===s)break t;s--,u+=i[n++]<>>=g,h-=g,r.lens[r.have++]=v;else{if(16===v){for(C=g+2;h>>=g,h-=g,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}w=r.lens[r.have-1],d=3+(3&u),u>>>=2,h-=2}else if(17===v){for(C=g+3;h>>=g)),u>>>=3,h-=3}else{for(C=g+7;h>>=g)),u>>>=7,h-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=w}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},A=wg(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,A){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},A=wg(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,A){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(s>=6&&c>=258){t.next_out=a,t.avail_out=c,t.next_in=n,t.avail_in=s,r.hold=u,r.bits=h,yg(t,p),a=t.next_out,o=t.output,c=t.avail_out,n=t.next_in,i=t.input,s=t.avail_in,u=r.hold,h=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;y=(P=r.lencode[u&(1<>>16&255,v=65535&P,!((g=P>>>24)<=h);){if(0===s)break t;s--,u+=i[n++]<>b)])>>>16&255,v=65535&P,!(b+(g=P>>>24)<=h);){if(0===s)break t;s--,u+=i[n++]<>>=b,h-=b,r.back+=b}if(u>>>=g,h-=g,r.back+=g,r.length=v,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=12;break}if(64&y){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(C=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(P=r.distcode[u&(1<>>16&255,v=65535&P,!((g=P>>>24)<=h);){if(0===s)break t;s--,u+=i[n++]<>b)])>>>16&255,v=65535&P,!(b+(g=P>>>24)<=h);){if(0===s)break t;s--,u+=i[n++]<>>=b,h-=b,r.back+=b}if(u>>>=g,h-=g,r.back+=g,64&y){t.msg="invalid distance code",r.mode=30;break}r.offset=v,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(C=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break t;if(d=p-c,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,f=r.wsize-d):f=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=o,f=a-r.offset,d=r.length;d>c&&(d=c),c-=d,r.length-=d;do{o[a++]=m[f++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===c)break t;o[a++]=r.length,c--,r.mode=21;break;case 27:if(r.wrap){for(;h<32;){if(0===s)break t;s--,u|=i[n++]<=252?6:$g>=248?5:$g>=240?4:$g>=224?3:$g>=192?2:1;function Lg(t){var e,r,i,o,n,a=t.length,s=0;for(o=0;o>>6,e[n++]=128|63&r):r<65536?(e[n++]=224|r>>>12,e[n++]=128|r>>>6&63,e[n++]=128|63&r):(e[n++]=240|r>>>18,e[n++]=128|r>>>12&63,e[n++]=128|r>>>6&63,e[n++]=128|63&r);return e}function Ng(t,e){var r,i,o,n,a=e||t.length,s=new Array(2*a);for(i=0,r=0;r4)s[i++]=65533,r+=n-1;else{for(o&=2===n?31:3===n?15:7;n>1&&r1?s[i++]=65533:o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|1023&o)}return function(t,e){if(e<65537&&(t.subarray&&Fg||!t.subarray&&Eg))return String.fromCharCode.apply(null,pg(t,e));for(var r="",i=0;it.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+Rg[t[r]]>e?r:e}Rg[254]=Rg[254]=1;var jg={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function Vg(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function Gg(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Ug=Object.prototype.toString;function Hg(t){if(!(this instanceof Hg))return new Hg(t);this.options=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}}return t}({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Vg,this.strm.avail_out=0;var r,i,o,n=Pg(this.strm,e.windowBits);if(0!==n)throw new Error(jg[n]);this.header=new Gg,r=this.strm,i=this.header,r&&r.state&&(0==(2&(o=r.state).wrap)||(o.head=i,i.done=!1))}Hg.prototype.push=function(t,e){var r,i,o,n,a,s,c=this.strm,u=this.options.chunkSize,h=this.options.dictionary,l=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?c.input=function(t){for(var e=new Uint8Array(t.length),r=0,i=e.length;r0||0===c.avail_out)&&1!==r);return 1===r&&(i=4),4===i?(r=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0}(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==i||(this.onEnd(0),c.avail_out=0,!0)},Hg.prototype.onData=function(t){this.chunks.push(t)},Hg.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=function(t){var e,r,i,o,n,a;for(i=0,e=0,r=t.length;e */ // Html -var UI = __webpack_require__(50).UI; +var UI = __webpack_require__(51).UI; UI.Html = function (html) { UI.Element.call(this); var dom = document.createElement('span'); @@ -68826,11 +68851,11 @@ module.exports = { //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidWkuZXh0cmEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdWkvdWkuZXh0cmEuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxPQUFPO0FBRVAsSUFBSSxFQUFFLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsQ0FBQztBQUUvQixFQUFFLENBQUMsSUFBSSxHQUFHLFVBQVUsSUFBSTtJQUN0QixFQUFFLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQTtJQUVyQixJQUFJLEdBQUcsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLE1BQU0sQ0FBQyxDQUFBO0lBQ3hDLEdBQUcsQ0FBQyxTQUFTLEdBQUcsTUFBTSxDQUFBO0lBQ3RCLEdBQUcsQ0FBQyxLQUFLLENBQUMsTUFBTSxH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tRQUM5QixJQUFJLENBQUMsYUFBYSxHQUFHLEtBQUssQ0FBQTtJQUM1QixDQUFDO0lBRUQsT0FBTyxJQUFJLENBQUE7QUFDYixDQUFDLENBQUE7QUFFRCxFQUFFLENBQUMsV0FBVyxDQUFDLFNBQVMsQ0FBQyxRQUFRLEdBQUc7SUFDbEMsT0FBTyxJQUFJLENBQUMsR0FBRyxDQUFBO0FBQ2pCLENBQUMsQ0FBQTtBQUVELE1BQU0sQ0FBQyxPQUFPLEdBQUc7SUFDYixJQUFJLEVBQUUsRUFBRTtDQUNYLENBQUEifQ== /***/ }), -/* 103 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - * jQuery UI Keycode 1.13.3 + * jQuery UI Keycode 1.14.1 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors @@ -68849,7 +68874,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ if ( true ) { // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(3) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2), __webpack_require__(5) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -68884,7 +68909,7 @@ return $.ui.keyCode = { /***/ }), -/* 104 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) { @@ -68893,7 +68918,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ if ( true ) { // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(3) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2), __webpack_require__(5) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -68939,99 +68964,12 @@ return $.ui.plugin = { } ); -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) { - "use strict"; - - if ( true ) { - - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(3) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - - // Browser globals - factory( jQuery ); - } -} )( function( $ ) { -"use strict"; - -return $.ui.safeActiveElement = function( document ) { - var activeElement; - - // Support: IE 9 only - // IE9 throws an "Unspecified error" accessing document.activeElement from an