diff --git a/backend/proteins/templates/proteins/_structure_section.html b/backend/proteins/templates/proteins/_structure_section.html index c71755f3c..96bc3c289 100644 --- a/backend/proteins/templates/proteins/_structure_section.html +++ b/backend/proteins/templates/proteins/_structure_section.html @@ -1,11 +1,11 @@

Structure

-
-
+
+
diff --git a/biome.json b/biome.json index 6d68661ab..8d15471bb 100644 --- a/biome.json +++ b/biome.json @@ -8,13 +8,7 @@ } }, "files": { - "includes": [ - "frontend/**", - "packages/**", - "!!frontend/src/css/litemol", - "!!frontend/src/js/pdb/LiteMol-plugin.js", - "!!packages/spectra/src/index.css" - ] + "includes": ["frontend/**", "packages/**", "!!packages/spectra/src/index.css"] }, "formatter": { "indentStyle": "space", diff --git a/frontend/package.json b/frontend/package.json index 7298615b6..162a49f41 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -24,6 +24,7 @@ "d3-zoom": "^3.0.0", "highcharts": "^12.4.0", "nouislider": "^14.7.0", + "pdbe-molstar": "^3.8.0", "process": "^0.11.10", "progressbar.js": "^1.1.0", "react": "^19.2.0", diff --git a/frontend/src/css/_litemol.scss b/frontend/src/css/_litemol.scss deleted file mode 100644 index 5e39f1720..000000000 --- a/frontend/src/css/_litemol.scss +++ /dev/null @@ -1,105 +0,0 @@ -.lm-plugin { - z-index: 10; - background: white !important; - - .lm-plugin-content.lm-layout-expanded{ - z-index: 100000 !important; - } - - .lm-highlight-info { - background: rgba(255,255,255,0.9) !important; - color: #777 !important; - padding: 5px !important; - } - - .lm-viewport .lm-btn-link { - background: rgba(255,255,255,0.7) !important; - } - - .lm-viewport-controls{ - opacity: 0.35; - transition: opacity .3s ease-in-out; - -moz-transition: opacity .3s ease-in-out; - -webkit-transition: opacity .3s ease-in-out; - &:hover { - opacity: .9; - } - } - - .lm-viewport-controls-buttons .lm-btn-link, .lm-viewport-controls-buttons .lm-btn-link-toggle-on { - color: #637ca0 !important; - &:hover { - color: #86F !important; - } - } - - // button[title="Screenshot"] { - // display: none !important; - // } - - .lm-task-state { - div { - //display: none; - background: white !important; - color: #555 !important; - } - button { - background: white !important; - color: $danger; - } - } - - .lm-overlay { - display: none; - } - - .lm-logo-image { - background: #AAA; - } - -.lm-layout-standard-outside { - .lm-layout-left, .lm-layout-right { - bottom: -330px !important; - height: 330px !important; - @include media-breakpoint-up(md){ - bottom: 0 !important; - height: 100% !important; - } - .lm-layout-scrollable { - top: 0px !important; - } - } - .lm-layout-right { - right: 0 !important; - @include media-breakpoint-up(md){ - right: -100% !important; - } - } - .lm-layout-left { - left: 0 !important; - @include media-breakpoint-up(md){ - left: 100% !important; - } - } -} - -.lm-toast-container .lm-toast-entry { - background: rgba(255,255,255, 0.5) !important; - color: #333 !important; - border: none !important; - font-size: 0.8rem; - .lm-toast-title { - background: rgba(245,245,245, 0.5) !important; - font-weight: 700; - &::after { - content: ' loaded: ' !important; - } - } - } -} - -#chem-title { - color: #666; - font-size: 1rem; - font-weight: 400; -} diff --git a/frontend/src/css/_molstar.scss b/frontend/src/css/_molstar.scss new file mode 100644 index 000000000..2307d12a7 --- /dev/null +++ b/frontend/src/css/_molstar.scss @@ -0,0 +1,36 @@ +// Mol* viewer custom styles + +#chem-title { + color: #666; + font-size: 1rem; + font-weight: 400; +} + +// Ensure Mol* viewer fills container properly +#molstar-viewer { + width: 100%; + height: 100%; + position: relative; + + // pdbe-molstar plugin container + >div { + width: 100% !important; + height: 100% !important; + } +} + +/* hide black window borders */ +.msp-plugin .msp-plugin-content.msp-layout-standard { + border: none; +} + +#molstar-viewer { + /* Higher than the comparison slider's z-index (100) */ + z-index: 150; +} + +// Hide certain controls in the simple standard view +// Hide the "Toggle Controls Panel" button (wrench icon) +.msp-layout-standard button[title="Toggle Controls Panel"] { + display: none; +} diff --git a/frontend/src/css/litemol/LiteMol-plugin-blue.css b/frontend/src/css/litemol/LiteMol-plugin-blue.css deleted file mode 100755 index 42eae5b1c..000000000 --- a/frontend/src/css/litemol/LiteMol-plugin-blue.css +++ /dev/null @@ -1,3256 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,700); -@font-face { - font-family: 'fontello'; - src: url("../../fonts/fontello.eot?22556350"); - src: url("../../fonts/fontello.eot?22556350#iefix") format("embedded-opentype"), url("../../fonts/fontello.woff2?22556350") format("woff2"), url("../../fonts/fontello.woff?22556350") format("woff"), url("../../fonts/fontello.ttf?22556350") format("truetype"), url("../../fonts/fontello.svg?22556350#fontello") format("svg"); - font-weight: normal; - font-style: normal; } - -.lm-plugin { - font-family: "Helvetica Neue", "Source Sans Pro", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.42857143; - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - /*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ - /* info */ - /* badge */ - /* overlay */ - /* background */ - /* highlight */ - background: #2D3E50; } - .lm-plugin html { - font-family: sans-serif; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; } - .lm-plugin body { - margin: 0; } - .lm-plugin article, - .lm-plugin aside, - .lm-plugin details, - .lm-plugin figcaption, - .lm-plugin figure, - .lm-plugin footer, - .lm-plugin header, - .lm-plugin hgroup, - .lm-plugin main, - .lm-plugin menu, - .lm-plugin nav, - .lm-plugin section, - .lm-plugin summary { - display: block; } - .lm-plugin audio, - .lm-plugin canvas, - .lm-plugin progress, - .lm-plugin video { - display: inline-block; - vertical-align: baseline; } - .lm-plugin audio:not([controls]) { - display: none; - height: 0; } - .lm-plugin [hidden], - .lm-plugin template { - display: none; } - .lm-plugin a { - background-color: transparent; } - .lm-plugin a:active, - .lm-plugin a:hover { - outline: 0; } - .lm-plugin abbr[title] { - border-bottom: 1px dotted; } - .lm-plugin b, - .lm-plugin strong { - font-weight: bold; } - .lm-plugin dfn { - font-style: italic; } - .lm-plugin h1 { - font-size: 2em; - margin: 0.67em 0; } - .lm-plugin mark { - background: #ff0; - color: #000; } - .lm-plugin small { - font-size: 80%; } - .lm-plugin sub, - .lm-plugin sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; } - .lm-plugin sup { - top: -0.5em; } - .lm-plugin sub { - bottom: -0.25em; } - .lm-plugin img { - border: 0; } - .lm-plugin svg:not(:root) { - overflow: hidden; } - .lm-plugin figure { - margin: 1em 40px; } - .lm-plugin hr { - box-sizing: content-box; - height: 0; } - .lm-plugin pre { - overflow: auto; } - .lm-plugin code, - .lm-plugin kbd, - .lm-plugin pre, - .lm-plugin samp { - font-family: monospace, monospace; - font-size: 1em; } - .lm-plugin button, - .lm-plugin input, - .lm-plugin optgroup, - .lm-plugin select, - .lm-plugin textarea { - color: inherit; - font: inherit; - margin: 0; } - .lm-plugin button { - overflow: visible; } - .lm-plugin button, - .lm-plugin select { - text-transform: none; } - .lm-plugin button, - .lm-plugin html input[type="button"], - .lm-plugin input[type="reset"], - .lm-plugin input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; } - .lm-plugin button[disabled], - .lm-plugin html input[disabled] { - cursor: default; } - .lm-plugin button::-moz-focus-inner, - .lm-plugin input::-moz-focus-inner { - border: 0; - padding: 0; } - .lm-plugin input { - line-height: normal; } - .lm-plugin input[type="checkbox"], - .lm-plugin input[type="radio"] { - box-sizing: border-box; - padding: 0; } - .lm-plugin input[type="number"]::-webkit-inner-spin-button, - .lm-plugin input[type="number"]::-webkit-outer-spin-button { - height: auto; } - .lm-plugin input[type="search"] { - -webkit-appearance: textfield; - box-sizing: content-box; } - .lm-plugin input[type="search"]::-webkit-search-cancel-button, - .lm-plugin input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; } - .lm-plugin fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; } - .lm-plugin legend { - border: 0; - padding: 0; } - .lm-plugin textarea { - overflow: auto; } - .lm-plugin optgroup { - font-weight: bold; } - .lm-plugin table { - border-collapse: collapse; - border-spacing: 0; } - .lm-plugin td, - .lm-plugin th { - padding: 0; } - .lm-plugin * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .lm-plugin *:before, - .lm-plugin *:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .lm-plugin html { - font-size: 10px; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } - .lm-plugin body { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.42857; - color: #333333; - background-color: #fff; } - .lm-plugin input, - .lm-plugin button, - .lm-plugin select, - .lm-plugin textarea { - font-family: inherit; - font-size: inherit; - line-height: inherit; } - .lm-plugin a { - color: #337ab7; - text-decoration: none; } - .lm-plugin a:hover, .lm-plugin a:focus { - color: #23527c; - text-decoration: underline; } - .lm-plugin a:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; } - .lm-plugin figure { - margin: 0; } - .lm-plugin img { - vertical-align: middle; } - .lm-plugin .img-responsive { - display: block; - max-width: 100%; - height: auto; } - .lm-plugin .img-rounded { - border-radius: 0; } - .lm-plugin .img-thumbnail { - padding: 4px; - line-height: 1.42857; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 0; - -webkit-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; - display: inline-block; - max-width: 100%; - height: auto; } - .lm-plugin .img-circle { - border-radius: 50%; } - .lm-plugin hr { - margin-top: 20px; - margin-bottom: 20px; - border: 0; - border-top: 1px solid #eeeeee; } - .lm-plugin .sr-only { - position: absolute; - width: 1px; - height: 1px; - margin: -1px; - padding: 0; - overflow: hidden; - clip: rect(0, 0, 0, 0); - border: 0; } - .lm-plugin .sr-only-focusable:active, .lm-plugin .sr-only-focusable:focus { - position: static; - width: auto; - height: auto; - margin: 0; - overflow: visible; - clip: auto; } - .lm-plugin [role="button"] { - cursor: pointer; } - .lm-plugin h1, .lm-plugin h2, .lm-plugin h3, .lm-plugin h4, .lm-plugin h5, .lm-plugin h6, - .lm-plugin .h1, .lm-plugin .h2, .lm-plugin .h3, .lm-plugin .h4, .lm-plugin .h5, .lm-plugin .h6 { - font-family: inherit; - font-weight: 500; - line-height: 1.1; - color: inherit; } - .lm-plugin h1 small, - .lm-plugin h1 .small, .lm-plugin h2 small, - .lm-plugin h2 .small, .lm-plugin h3 small, - .lm-plugin h3 .small, .lm-plugin h4 small, - .lm-plugin h4 .small, .lm-plugin h5 small, - .lm-plugin h5 .small, .lm-plugin h6 small, - .lm-plugin h6 .small, - .lm-plugin .h1 small, - .lm-plugin .h1 .small, .lm-plugin .h2 small, - .lm-plugin .h2 .small, .lm-plugin .h3 small, - .lm-plugin .h3 .small, .lm-plugin .h4 small, - .lm-plugin .h4 .small, .lm-plugin .h5 small, - .lm-plugin .h5 .small, .lm-plugin .h6 small, - .lm-plugin .h6 .small { - font-weight: normal; - line-height: 1; - color: #777777; } - .lm-plugin h1, .lm-plugin .h1, - .lm-plugin h2, .lm-plugin .h2, - .lm-plugin h3, .lm-plugin .h3 { - margin-top: 20px; - margin-bottom: 10px; } - .lm-plugin h1 small, - .lm-plugin h1 .small, .lm-plugin .h1 small, - .lm-plugin .h1 .small, - .lm-plugin h2 small, - .lm-plugin h2 .small, .lm-plugin .h2 small, - .lm-plugin .h2 .small, - .lm-plugin h3 small, - .lm-plugin h3 .small, .lm-plugin .h3 small, - .lm-plugin .h3 .small { - font-size: 65%; } - .lm-plugin h4, .lm-plugin .h4, - .lm-plugin h5, .lm-plugin .h5, - .lm-plugin h6, .lm-plugin .h6 { - margin-top: 10px; - margin-bottom: 10px; } - .lm-plugin h4 small, - .lm-plugin h4 .small, .lm-plugin .h4 small, - .lm-plugin .h4 .small, - .lm-plugin h5 small, - .lm-plugin h5 .small, .lm-plugin .h5 small, - .lm-plugin .h5 .small, - .lm-plugin h6 small, - .lm-plugin h6 .small, .lm-plugin .h6 small, - .lm-plugin .h6 .small { - font-size: 75%; } - .lm-plugin h1, .lm-plugin .h1 { - font-size: 36px; } - .lm-plugin h2, .lm-plugin .h2 { - font-size: 30px; } - .lm-plugin h3, .lm-plugin .h3 { - font-size: 24px; } - .lm-plugin h4, .lm-plugin .h4 { - font-size: 18px; } - .lm-plugin h5, .lm-plugin .h5 { - font-size: 14px; } - .lm-plugin h6, .lm-plugin .h6 { - font-size: 12px; } - .lm-plugin p { - margin: 0 0 10px; } - .lm-plugin .lead { - margin-bottom: 20px; - font-size: 16px; - font-weight: 300; - line-height: 1.4; } - @media (min-width: 768px) { - .lm-plugin .lead { - font-size: 21px; } } - .lm-plugin small, - .lm-plugin .small { - font-size: 85%; } - .lm-plugin mark, - .lm-plugin .mark { - background-color: #fcf8e3; - padding: .2em; } - .lm-plugin .text-left { - text-align: left; } - .lm-plugin .text-right { - text-align: right; } - .lm-plugin .text-center { - text-align: center; } - .lm-plugin .text-justify { - text-align: justify; } - .lm-plugin .text-nowrap { - white-space: nowrap; } - .lm-plugin .text-lowercase { - text-transform: lowercase; } - .lm-plugin .text-uppercase, .lm-plugin .initialism { - text-transform: uppercase; } - .lm-plugin .text-capitalize { - text-transform: capitalize; } - .lm-plugin .text-muted { - color: #777777; } - .lm-plugin .text-primary { - color: #337ab7; } - .lm-plugin a.text-primary:hover, - .lm-plugin a.text-primary:focus { - color: #286090; } - .lm-plugin .text-success { - color: #3c763d; } - .lm-plugin a.text-success:hover, - .lm-plugin a.text-success:focus { - color: #2b542c; } - .lm-plugin .text-info { - color: #31708f; } - .lm-plugin a.text-info:hover, - .lm-plugin a.text-info:focus { - color: #245269; } - .lm-plugin .text-warning { - color: #8a6d3b; } - .lm-plugin a.text-warning:hover, - .lm-plugin a.text-warning:focus { - color: #66512c; } - .lm-plugin .text-danger { - color: #a94442; } - .lm-plugin a.text-danger:hover, - .lm-plugin a.text-danger:focus { - color: #843534; } - .lm-plugin .bg-primary { - color: #fff; } - .lm-plugin .bg-primary { - background-color: #337ab7; } - .lm-plugin a.bg-primary:hover, - .lm-plugin a.bg-primary:focus { - background-color: #286090; } - .lm-plugin .bg-success { - background-color: #dff0d8; } - .lm-plugin a.bg-success:hover, - .lm-plugin a.bg-success:focus { - background-color: #c1e2b3; } - .lm-plugin .bg-info { - background-color: #d9edf7; } - .lm-plugin a.bg-info:hover, - .lm-plugin a.bg-info:focus { - background-color: #afd9ee; } - .lm-plugin .bg-warning { - background-color: #fcf8e3; } - .lm-plugin a.bg-warning:hover, - .lm-plugin a.bg-warning:focus { - background-color: #f7ecb5; } - .lm-plugin .bg-danger { - background-color: #f2dede; } - .lm-plugin a.bg-danger:hover, - .lm-plugin a.bg-danger:focus { - background-color: #e4b9b9; } - .lm-plugin .page-header { - padding-bottom: 9px; - margin: 40px 0 20px; - border-bottom: 1px solid #eeeeee; } - .lm-plugin ul, - .lm-plugin ol { - margin-top: 0; - margin-bottom: 10px; } - .lm-plugin ul ul, - .lm-plugin ul ol, - .lm-plugin ol ul, - .lm-plugin ol ol { - margin-bottom: 0; } - .lm-plugin .lm-list-unstyled { - padding-left: 0; - list-style: none; } - .lm-plugin .list-inline { - padding-left: 0; - list-style: none; - margin-left: -5px; } - .lm-plugin .list-inline > li { - display: inline-block; - padding-left: 5px; - padding-right: 5px; } - .lm-plugin dl { - margin-top: 0; - margin-bottom: 20px; } - .lm-plugin dt, - .lm-plugin dd { - line-height: 1.42857; } - .lm-plugin dt { - font-weight: bold; } - .lm-plugin dd { - margin-left: 0; } - .lm-plugin .dl-horizontal dd:before, .lm-plugin .dl-horizontal dd:after { - content: " "; - display: table; } - .lm-plugin .dl-horizontal dd:after { - clear: both; } - @media (min-width: 768px) { - .lm-plugin .dl-horizontal dt { - float: left; - width: 160px; - clear: left; - text-align: right; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } - .lm-plugin .dl-horizontal dd { - margin-left: 180px; } } - .lm-plugin abbr[title], - .lm-plugin abbr[data-original-title] { - cursor: help; - border-bottom: 1px dotted #777777; } - .lm-plugin .initialism { - font-size: 90%; } - .lm-plugin blockquote { - padding: 10px 20px; - margin: 0 0 20px; - font-size: 17.5px; - border-left: 5px solid #eeeeee; } - .lm-plugin blockquote p:last-child, - .lm-plugin blockquote ul:last-child, - .lm-plugin blockquote ol:last-child { - margin-bottom: 0; } - .lm-plugin blockquote footer, - .lm-plugin blockquote small, - .lm-plugin blockquote .small { - display: block; - font-size: 80%; - line-height: 1.42857; - color: #777777; } - .lm-plugin blockquote footer:before, - .lm-plugin blockquote small:before, - .lm-plugin blockquote .small:before { - content: '\2014 \00A0'; } - .lm-plugin .blockquote-reverse, - .lm-plugin blockquote.pull-right { - padding-right: 15px; - padding-left: 0; - border-right: 5px solid #eeeeee; - border-left: 0; - text-align: right; } - .lm-plugin .blockquote-reverse footer:before, - .lm-plugin .blockquote-reverse small:before, - .lm-plugin .blockquote-reverse .small:before, - .lm-plugin blockquote.pull-right footer:before, - .lm-plugin blockquote.pull-right small:before, - .lm-plugin blockquote.pull-right .small:before { - content: ''; } - .lm-plugin .blockquote-reverse footer:after, - .lm-plugin .blockquote-reverse small:after, - .lm-plugin .blockquote-reverse .small:after, - .lm-plugin blockquote.pull-right footer:after, - .lm-plugin blockquote.pull-right small:after, - .lm-plugin blockquote.pull-right .small:after { - content: '\00A0 \2014'; } - .lm-plugin address { - margin-bottom: 20px; - font-style: normal; - line-height: 1.42857; } - .lm-plugin fieldset { - padding: 0; - margin: 0; - border: 0; - min-width: 0; } - .lm-plugin legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: 20px; - font-size: 21px; - line-height: inherit; - color: #333333; - border: 0; - border-bottom: 1px solid #e5e5e5; } - .lm-plugin label { - display: inline-block; - max-width: 100%; - margin-bottom: 5px; - font-weight: bold; } - .lm-plugin input[type="search"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .lm-plugin input[type="radio"], - .lm-plugin input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - line-height: normal; } - .lm-plugin input[type="file"] { - display: block; } - .lm-plugin input[type="range"] { - display: block; - width: 100%; } - .lm-plugin select[multiple], - .lm-plugin select[size] { - height: auto; } - .lm-plugin input[type="file"]:focus, - .lm-plugin input[type="radio"]:focus, - .lm-plugin input[type="checkbox"]:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; } - .lm-plugin output { - display: block; - padding-top: 7px; - font-size: 14px; - line-height: 1.42857; - color: #555555; } - .lm-plugin .lm-form-control, .lm-plugin .lm-control-row select, .lm-plugin .lm-control-row button, .lm-plugin .lm-control-row input[type=text] { - display: block; - width: 100%; - height: 34px; - padding: 6px 12px; - font-size: 14px; - line-height: 1.42857; - color: #555555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 0; } - .lm-plugin .lm-form-control:focus, .lm-plugin .lm-control-row select:focus, .lm-plugin .lm-control-row button:focus, .lm-plugin .lm-control-row input:focus[type=text] { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); } - .lm-plugin .lm-form-control::-moz-placeholder, .lm-plugin .lm-control-row select::-moz-placeholder, .lm-plugin .lm-control-row button::-moz-placeholder, .lm-plugin .lm-control-row input[type=text]::-moz-placeholder { - color: #999; - opacity: 1; } - .lm-plugin .lm-form-control:-ms-input-placeholder, .lm-plugin .lm-control-row select:-ms-input-placeholder, .lm-plugin .lm-control-row button:-ms-input-placeholder, .lm-plugin .lm-control-row input:-ms-input-placeholder[type=text] { - color: #999; } - .lm-plugin .lm-form-control::-webkit-input-placeholder, .lm-plugin .lm-control-row select::-webkit-input-placeholder, .lm-plugin .lm-control-row button::-webkit-input-placeholder, .lm-plugin .lm-control-row input[type=text]::-webkit-input-placeholder { - color: #999; } - .lm-plugin .lm-form-control::-ms-expand, .lm-plugin .lm-control-row select::-ms-expand, .lm-plugin .lm-control-row button::-ms-expand, .lm-plugin .lm-control-row input[type=text]::-ms-expand { - border: 0; - background-color: transparent; } - .lm-plugin .lm-form-control[disabled], .lm-plugin .lm-control-row select[disabled], .lm-plugin .lm-control-row button[disabled], .lm-plugin .lm-control-row input[disabled][type=text], .lm-plugin .lm-form-control[readonly], .lm-plugin .lm-control-row select[readonly], .lm-plugin .lm-control-row button[readonly], .lm-plugin .lm-control-row input[readonly][type=text], - fieldset[disabled] .lm-plugin .lm-form-control, - fieldset[disabled] .lm-plugin .lm-control-row select, - fieldset[disabled] .lm-plugin .lm-control-row button, - fieldset[disabled] .lm-plugin .lm-control-row input[type=text] { - background-color: #eeeeee; - opacity: 1; } - .lm-plugin .lm-form-control[disabled], .lm-plugin .lm-control-row select[disabled], .lm-plugin .lm-control-row button[disabled], .lm-plugin .lm-control-row input[disabled][type=text], - fieldset[disabled] .lm-plugin .lm-form-control, - fieldset[disabled] .lm-plugin .lm-control-row select, - fieldset[disabled] .lm-plugin .lm-control-row button, - fieldset[disabled] .lm-plugin .lm-control-row input[type=text] { - cursor: not-allowed; } - .lm-plugin textarea.lm-form-control { - height: auto; } - .lm-plugin input[type="search"] { - -webkit-appearance: none; } - @media screen and (-webkit-min-device-pixel-ratio: 0) { - .lm-plugin input[type="date"].lm-form-control, .lm-plugin .lm-control-row input[type="date"][type=text], - .lm-plugin input[type="time"].lm-form-control, - .lm-plugin .lm-control-row input[type="time"][type=text], - .lm-plugin input[type="datetime-local"].lm-form-control, - .lm-plugin .lm-control-row input[type="datetime-local"][type=text], - .lm-plugin input[type="month"].lm-form-control, - .lm-plugin .lm-control-row input[type="month"][type=text] { - line-height: 34px; } - .lm-plugin input[type="date"].input-sm, .lm-plugin .input-group-sm > input.lm-form-control[type="date"], .lm-plugin .lm-control-row .input-group-sm > input[type="date"][type=text], - .lm-plugin .input-group-sm > input.input-group-addon[type="date"], - .lm-plugin .input-group-sm > .input-group-lm-btn > input.lm-btn[type="date"], - .input-group-sm .lm-plugin input[type="date"], - .lm-plugin input[type="time"].input-sm, - .lm-plugin .input-group-sm > input.lm-form-control[type="time"], - .lm-plugin .lm-control-row .input-group-sm > input[type="time"][type=text], - .lm-plugin .input-group-sm > input.input-group-addon[type="time"], - .lm-plugin .input-group-sm > .input-group-lm-btn > input.lm-btn[type="time"], - .input-group-sm - .lm-plugin input[type="time"], - .lm-plugin input[type="datetime-local"].input-sm, - .lm-plugin .input-group-sm > input.lm-form-control[type="datetime-local"], - .lm-plugin .lm-control-row .input-group-sm > input[type="datetime-local"][type=text], - .lm-plugin .input-group-sm > input.input-group-addon[type="datetime-local"], - .lm-plugin .input-group-sm > .input-group-lm-btn > input.lm-btn[type="datetime-local"], - .input-group-sm - .lm-plugin input[type="datetime-local"], - .lm-plugin input[type="month"].input-sm, - .lm-plugin .input-group-sm > input.lm-form-control[type="month"], - .lm-plugin .lm-control-row .input-group-sm > input[type="month"][type=text], - .lm-plugin .input-group-sm > input.input-group-addon[type="month"], - .lm-plugin .input-group-sm > .input-group-lm-btn > input.lm-btn[type="month"], - .input-group-sm - .lm-plugin input[type="month"] { - line-height: 30px; } - .lm-plugin input[type="date"].input-lg, .lm-plugin .input-group-lg > input.lm-form-control[type="date"], .lm-plugin .lm-control-row .input-group-lg > input[type="date"][type=text], - .lm-plugin .input-group-lg > input.input-group-addon[type="date"], - .lm-plugin .input-group-lg > .input-group-lm-btn > input.lm-btn[type="date"], - .input-group-lg .lm-plugin input[type="date"], - .lm-plugin input[type="time"].input-lg, - .lm-plugin .input-group-lg > input.lm-form-control[type="time"], - .lm-plugin .lm-control-row .input-group-lg > input[type="time"][type=text], - .lm-plugin .input-group-lg > input.input-group-addon[type="time"], - .lm-plugin .input-group-lg > .input-group-lm-btn > input.lm-btn[type="time"], - .input-group-lg - .lm-plugin input[type="time"], - .lm-plugin input[type="datetime-local"].input-lg, - .lm-plugin .input-group-lg > input.lm-form-control[type="datetime-local"], - .lm-plugin .lm-control-row .input-group-lg > input[type="datetime-local"][type=text], - .lm-plugin .input-group-lg > input.input-group-addon[type="datetime-local"], - .lm-plugin .input-group-lg > .input-group-lm-btn > input.lm-btn[type="datetime-local"], - .input-group-lg - .lm-plugin input[type="datetime-local"], - .lm-plugin input[type="month"].input-lg, - .lm-plugin .input-group-lg > input.lm-form-control[type="month"], - .lm-plugin .lm-control-row .input-group-lg > input[type="month"][type=text], - .lm-plugin .input-group-lg > input.input-group-addon[type="month"], - .lm-plugin .input-group-lg > .input-group-lm-btn > input.lm-btn[type="month"], - .input-group-lg - .lm-plugin input[type="month"] { - line-height: 46px; } } - .lm-plugin .form-group { - margin-bottom: 15px; } - .lm-plugin .radio, - .lm-plugin .checkbox { - position: relative; - display: block; - margin-top: 10px; - margin-bottom: 10px; } - .lm-plugin .radio label, - .lm-plugin .checkbox label { - min-height: 20px; - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - cursor: pointer; } - .lm-plugin .radio input[type="radio"], - .lm-plugin .radio-inline input[type="radio"], - .lm-plugin .checkbox input[type="checkbox"], - .lm-plugin .checkbox-inline input[type="checkbox"] { - position: absolute; - margin-left: -20px; - margin-top: 4px \9; } - .lm-plugin .radio + .radio, - .lm-plugin .checkbox + .checkbox { - margin-top: -5px; } - .lm-plugin .radio-inline, - .lm-plugin .checkbox-inline { - position: relative; - display: inline-block; - padding-left: 20px; - margin-bottom: 0; - vertical-align: middle; - font-weight: normal; - cursor: pointer; } - .lm-plugin .radio-inline + .radio-inline, - .lm-plugin .checkbox-inline + .checkbox-inline { - margin-top: 0; - margin-left: 10px; } - .lm-plugin input[type="radio"][disabled], .lm-plugin input[type="radio"].disabled, - fieldset[disabled] .lm-plugin input[type="radio"], - .lm-plugin input[type="checkbox"][disabled], - .lm-plugin input[type="checkbox"].disabled, - fieldset[disabled] - .lm-plugin input[type="checkbox"] { - cursor: not-allowed; } - .lm-plugin .radio-inline.disabled, - fieldset[disabled] .lm-plugin .radio-inline, - .lm-plugin .checkbox-inline.disabled, - fieldset[disabled] - .lm-plugin .checkbox-inline { - cursor: not-allowed; } - .lm-plugin .radio.disabled label, - fieldset[disabled] .lm-plugin .radio label, - .lm-plugin .checkbox.disabled label, - fieldset[disabled] - .lm-plugin .checkbox label { - cursor: not-allowed; } - .lm-plugin .lm-form-control-static { - padding-top: 7px; - padding-bottom: 7px; - margin-bottom: 0; - min-height: 34px; } - .lm-plugin .lm-form-control-static.input-lg, .lm-plugin .input-group-lg > .lm-form-control-static.lm-form-control, .lm-plugin .lm-control-row .input-group-lg > select.lm-form-control-static, .lm-plugin .lm-control-row .input-group-lg > button.lm-form-control-static, .lm-plugin .lm-control-row .input-group-lg > input.lm-form-control-static[type=text], - .lm-plugin .input-group-lg > .lm-form-control-static.input-group-addon, - .lm-plugin .input-group-lg > .input-group-lm-btn > .lm-form-control-static.lm-btn, .lm-plugin .lm-control-row .input-group-lg > .input-group-lm-btn > button.lm-form-control-static, .lm-plugin .lm-form-control-static.input-sm, .lm-plugin .input-group-sm > .lm-form-control-static.lm-form-control, .lm-plugin .lm-control-row .input-group-sm > select.lm-form-control-static, .lm-plugin .lm-control-row .input-group-sm > button.lm-form-control-static, .lm-plugin .lm-control-row .input-group-sm > input.lm-form-control-static[type=text], - .lm-plugin .input-group-sm > .lm-form-control-static.input-group-addon, - .lm-plugin .input-group-sm > .input-group-lm-btn > .lm-form-control-static.lm-btn, .lm-plugin .lm-control-row .input-group-sm > .input-group-lm-btn > button.lm-form-control-static { - padding-left: 0; - padding-right: 0; } - .lm-plugin .input-sm, .lm-plugin .input-group-sm > .lm-form-control, .lm-plugin .lm-control-row .input-group-sm > select, .lm-plugin .lm-control-row .input-group-sm > button, .lm-plugin .lm-control-row .input-group-sm > input[type=text], - .lm-plugin .input-group-sm > .input-group-addon, - .lm-plugin .input-group-sm > .input-group-lm-btn > .lm-btn, .lm-plugin .lm-control-row .input-group-sm > .input-group-lm-btn > button { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; } - .lm-plugin select.input-sm, .lm-plugin .input-group-sm > select.lm-form-control, .lm-plugin .lm-control-row .input-group-sm > select, - .lm-plugin .input-group-sm > select.input-group-addon, - .lm-plugin .input-group-sm > .input-group-lm-btn > select.lm-btn { - height: 30px; - line-height: 30px; } - .lm-plugin textarea.input-sm, .lm-plugin .input-group-sm > textarea.lm-form-control, - .lm-plugin .input-group-sm > textarea.input-group-addon, - .lm-plugin .input-group-sm > .input-group-lm-btn > textarea.lm-btn, - .lm-plugin select[multiple].input-sm, - .lm-plugin .input-group-sm > select.lm-form-control[multiple], - .lm-plugin .lm-control-row .input-group-sm > select[multiple], - .lm-plugin .input-group-sm > select.input-group-addon[multiple], - .lm-plugin .input-group-sm > .input-group-lm-btn > select.lm-btn[multiple] { - height: auto; } - .lm-plugin .form-group-sm .lm-form-control, .lm-plugin .form-group-sm .lm-control-row select, .lm-plugin .lm-control-row .form-group-sm select, .lm-plugin .form-group-sm .lm-control-row button, .lm-plugin .lm-control-row .form-group-sm button, .lm-plugin .form-group-sm .lm-control-row input[type=text], .lm-plugin .lm-control-row .form-group-sm input[type=text] { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; } - .lm-plugin .form-group-sm select.lm-form-control, .lm-plugin .form-group-sm .lm-control-row select, .lm-plugin .lm-control-row .form-group-sm select { - height: 30px; - line-height: 30px; } - .lm-plugin .form-group-sm textarea.lm-form-control, - .lm-plugin .form-group-sm select[multiple].lm-form-control, - .lm-plugin .form-group-sm .lm-control-row select[multiple], - .lm-plugin .lm-control-row .form-group-sm select[multiple] { - height: auto; } - .lm-plugin .form-group-sm .lm-form-control-static { - height: 30px; - min-height: 32px; - padding: 6px 10px; - font-size: 12px; - line-height: 1.5; } - .lm-plugin .input-lg, .lm-plugin .input-group-lg > .lm-form-control, .lm-plugin .lm-control-row .input-group-lg > select, .lm-plugin .lm-control-row .input-group-lg > button, .lm-plugin .lm-control-row .input-group-lg > input[type=text], - .lm-plugin .input-group-lg > .input-group-addon, - .lm-plugin .input-group-lg > .input-group-lm-btn > .lm-btn, .lm-plugin .lm-control-row .input-group-lg > .input-group-lm-btn > button { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33333; - border-radius: 0; } - .lm-plugin select.input-lg, .lm-plugin .input-group-lg > select.lm-form-control, .lm-plugin .lm-control-row .input-group-lg > select, - .lm-plugin .input-group-lg > select.input-group-addon, - .lm-plugin .input-group-lg > .input-group-lm-btn > select.lm-btn { - height: 46px; - line-height: 46px; } - .lm-plugin textarea.input-lg, .lm-plugin .input-group-lg > textarea.lm-form-control, - .lm-plugin .input-group-lg > textarea.input-group-addon, - .lm-plugin .input-group-lg > .input-group-lm-btn > textarea.lm-btn, - .lm-plugin select[multiple].input-lg, - .lm-plugin .input-group-lg > select.lm-form-control[multiple], - .lm-plugin .lm-control-row .input-group-lg > select[multiple], - .lm-plugin .input-group-lg > select.input-group-addon[multiple], - .lm-plugin .input-group-lg > .input-group-lm-btn > select.lm-btn[multiple] { - height: auto; } - .lm-plugin .form-group-lg .lm-form-control, .lm-plugin .form-group-lg .lm-control-row select, .lm-plugin .lm-control-row .form-group-lg select, .lm-plugin .form-group-lg .lm-control-row button, .lm-plugin .lm-control-row .form-group-lg button, .lm-plugin .form-group-lg .lm-control-row input[type=text], .lm-plugin .lm-control-row .form-group-lg input[type=text] { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33333; - border-radius: 0; } - .lm-plugin .form-group-lg select.lm-form-control, .lm-plugin .form-group-lg .lm-control-row select, .lm-plugin .lm-control-row .form-group-lg select { - height: 46px; - line-height: 46px; } - .lm-plugin .form-group-lg textarea.lm-form-control, - .lm-plugin .form-group-lg select[multiple].lm-form-control, - .lm-plugin .form-group-lg .lm-control-row select[multiple], - .lm-plugin .lm-control-row .form-group-lg select[multiple] { - height: auto; } - .lm-plugin .form-group-lg .lm-form-control-static { - height: 46px; - min-height: 38px; - padding: 11px 16px; - font-size: 18px; - line-height: 1.33333; } - .lm-plugin .has-feedback { - position: relative; } - .lm-plugin .has-feedback .lm-form-control, .lm-plugin .has-feedback .lm-control-row select, .lm-plugin .lm-control-row .has-feedback select, .lm-plugin .has-feedback .lm-control-row button, .lm-plugin .lm-control-row .has-feedback button, .lm-plugin .has-feedback .lm-control-row input[type=text], .lm-plugin .lm-control-row .has-feedback input[type=text] { - padding-right: 42.5px; } - .lm-plugin .lm-form-control-feedback { - position: absolute; - top: 0; - right: 0; - z-index: 2; - display: block; - width: 34px; - height: 34px; - line-height: 34px; - text-align: center; - pointer-events: none; } - .lm-plugin .input-lg + .lm-form-control-feedback, .lm-plugin .input-group-lg > .lm-form-control + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-lg > select + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-lg > button + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-lg > input[type=text] + .lm-form-control-feedback, .lm-plugin .input-group-lg > .input-group-addon + .lm-form-control-feedback, .lm-plugin .input-group-lg > .input-group-lm-btn > .lm-btn + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-lg > .input-group-lm-btn > button + .lm-form-control-feedback, - .lm-plugin .input-group-lg + .lm-form-control-feedback, - .lm-plugin .form-group-lg .lm-form-control + .lm-form-control-feedback, - .lm-plugin .form-group-lg .lm-control-row select + .lm-form-control-feedback, - .lm-plugin .lm-control-row .form-group-lg select + .lm-form-control-feedback, - .lm-plugin .form-group-lg .lm-control-row button + .lm-form-control-feedback, - .lm-plugin .lm-control-row .form-group-lg button + .lm-form-control-feedback, - .lm-plugin .form-group-lg .lm-control-row input[type=text] + .lm-form-control-feedback, - .lm-plugin .lm-control-row .form-group-lg input[type=text] + .lm-form-control-feedback { - width: 46px; - height: 46px; - line-height: 46px; } - .lm-plugin .input-sm + .lm-form-control-feedback, .lm-plugin .input-group-sm > .lm-form-control + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-sm > select + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-sm > button + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-sm > input[type=text] + .lm-form-control-feedback, .lm-plugin .input-group-sm > .input-group-addon + .lm-form-control-feedback, .lm-plugin .input-group-sm > .input-group-lm-btn > .lm-btn + .lm-form-control-feedback, .lm-plugin .lm-control-row .input-group-sm > .input-group-lm-btn > button + .lm-form-control-feedback, - .lm-plugin .input-group-sm + .lm-form-control-feedback, - .lm-plugin .form-group-sm .lm-form-control + .lm-form-control-feedback, - .lm-plugin .form-group-sm .lm-control-row select + .lm-form-control-feedback, - .lm-plugin .lm-control-row .form-group-sm select + .lm-form-control-feedback, - .lm-plugin .form-group-sm .lm-control-row button + .lm-form-control-feedback, - .lm-plugin .lm-control-row .form-group-sm button + .lm-form-control-feedback, - .lm-plugin .form-group-sm .lm-control-row input[type=text] + .lm-form-control-feedback, - .lm-plugin .lm-control-row .form-group-sm input[type=text] + .lm-form-control-feedback { - width: 30px; - height: 30px; - line-height: 30px; } - .lm-plugin .has-success .help-block, - .lm-plugin .has-success .control-label, - .lm-plugin .has-success .radio, - .lm-plugin .has-success .checkbox, - .lm-plugin .has-success .radio-inline, - .lm-plugin .has-success .checkbox-inline, - .lm-plugin .has-success.radio label, - .lm-plugin .has-success.checkbox label, - .lm-plugin .has-success.radio-inline label, - .lm-plugin .has-success.checkbox-inline label { - color: #3c763d; } - .lm-plugin .has-success .lm-form-control, .lm-plugin .has-success .lm-control-row select, .lm-plugin .lm-control-row .has-success select, .lm-plugin .has-success .lm-control-row button, .lm-plugin .lm-control-row .has-success button, .lm-plugin .has-success .lm-control-row input[type=text], .lm-plugin .lm-control-row .has-success input[type=text] { - border-color: #3c763d; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } - .lm-plugin .has-success .lm-form-control:focus, .lm-plugin .has-success .lm-control-row select:focus, .lm-plugin .lm-control-row .has-success select:focus, .lm-plugin .has-success .lm-control-row button:focus, .lm-plugin .lm-control-row .has-success button:focus, .lm-plugin .has-success .lm-control-row input:focus[type=text], .lm-plugin .lm-control-row .has-success input:focus[type=text] { - border-color: #2b542c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; } - .lm-plugin .has-success .input-group-addon { - color: #3c763d; - border-color: #3c763d; - background-color: #dff0d8; } - .lm-plugin .has-success .lm-form-control-feedback { - color: #3c763d; } - .lm-plugin .has-warning .help-block, - .lm-plugin .has-warning .control-label, - .lm-plugin .has-warning .radio, - .lm-plugin .has-warning .checkbox, - .lm-plugin .has-warning .radio-inline, - .lm-plugin .has-warning .checkbox-inline, - .lm-plugin .has-warning.radio label, - .lm-plugin .has-warning.checkbox label, - .lm-plugin .has-warning.radio-inline label, - .lm-plugin .has-warning.checkbox-inline label { - color: #8a6d3b; } - .lm-plugin .has-warning .lm-form-control, .lm-plugin .has-warning .lm-control-row select, .lm-plugin .lm-control-row .has-warning select, .lm-plugin .has-warning .lm-control-row button, .lm-plugin .lm-control-row .has-warning button, .lm-plugin .has-warning .lm-control-row input[type=text], .lm-plugin .lm-control-row .has-warning input[type=text] { - border-color: #8a6d3b; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } - .lm-plugin .has-warning .lm-form-control:focus, .lm-plugin .has-warning .lm-control-row select:focus, .lm-plugin .lm-control-row .has-warning select:focus, .lm-plugin .has-warning .lm-control-row button:focus, .lm-plugin .lm-control-row .has-warning button:focus, .lm-plugin .has-warning .lm-control-row input:focus[type=text], .lm-plugin .lm-control-row .has-warning input:focus[type=text] { - border-color: #66512c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; } - .lm-plugin .has-warning .input-group-addon { - color: #8a6d3b; - border-color: #8a6d3b; - background-color: #fcf8e3; } - .lm-plugin .has-warning .lm-form-control-feedback { - color: #8a6d3b; } - .lm-plugin .has-error .help-block, - .lm-plugin .has-error .control-label, - .lm-plugin .has-error .radio, - .lm-plugin .has-error .checkbox, - .lm-plugin .has-error .radio-inline, - .lm-plugin .has-error .checkbox-inline, - .lm-plugin .has-error.radio label, - .lm-plugin .has-error.checkbox label, - .lm-plugin .has-error.radio-inline label, - .lm-plugin .has-error.checkbox-inline label { - color: #a94442; } - .lm-plugin .has-error .lm-form-control, .lm-plugin .has-error .lm-control-row select, .lm-plugin .lm-control-row .has-error select, .lm-plugin .has-error .lm-control-row button, .lm-plugin .lm-control-row .has-error button, .lm-plugin .has-error .lm-control-row input[type=text], .lm-plugin .lm-control-row .has-error input[type=text] { - border-color: #a94442; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } - .lm-plugin .has-error .lm-form-control:focus, .lm-plugin .has-error .lm-control-row select:focus, .lm-plugin .lm-control-row .has-error select:focus, .lm-plugin .has-error .lm-control-row button:focus, .lm-plugin .lm-control-row .has-error button:focus, .lm-plugin .has-error .lm-control-row input:focus[type=text], .lm-plugin .lm-control-row .has-error input:focus[type=text] { - border-color: #843534; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; } - .lm-plugin .has-error .input-group-addon { - color: #a94442; - border-color: #a94442; - background-color: #f2dede; } - .lm-plugin .has-error .lm-form-control-feedback { - color: #a94442; } - .lm-plugin .has-feedback label ~ .lm-form-control-feedback { - top: 25px; } - .lm-plugin .has-feedback label.sr-only ~ .lm-form-control-feedback { - top: 0; } - .lm-plugin .help-block { - display: block; - margin-top: 5px; - margin-bottom: 10px; - color: #737373; } - @media (min-width: 768px) { - .lm-plugin .form-inline .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; } - .lm-plugin .form-inline .lm-form-control, .lm-plugin .form-inline .lm-control-row select, .lm-plugin .lm-control-row .form-inline select, .lm-plugin .form-inline .lm-control-row button, .lm-plugin .lm-control-row .form-inline button, .lm-plugin .form-inline .lm-control-row input[type=text], .lm-plugin .lm-control-row .form-inline input[type=text] { - display: inline-block; - width: auto; - vertical-align: middle; } - .lm-plugin .form-inline .lm-form-control-static { - display: inline-block; } - .lm-plugin .form-inline .input-group { - display: inline-table; - vertical-align: middle; } - .lm-plugin .form-inline .input-group .input-group-addon, - .lm-plugin .form-inline .input-group .input-group-lm-btn, - .lm-plugin .form-inline .input-group .lm-form-control, - .lm-plugin .form-inline .input-group .lm-control-row select, - .lm-plugin .lm-control-row .form-inline .input-group select, - .lm-plugin .form-inline .input-group .lm-control-row button, - .lm-plugin .lm-control-row .form-inline .input-group button, - .lm-plugin .form-inline .input-group .lm-control-row input[type=text], - .lm-plugin .lm-control-row .form-inline .input-group input[type=text] { - width: auto; } - .lm-plugin .form-inline .input-group > .lm-form-control, .lm-plugin .form-inline .lm-control-row .input-group > select, .lm-plugin .lm-control-row .form-inline .input-group > select, .lm-plugin .form-inline .lm-control-row .input-group > button, .lm-plugin .lm-control-row .form-inline .input-group > button, .lm-plugin .form-inline .lm-control-row .input-group > input[type=text], .lm-plugin .lm-control-row .form-inline .input-group > input[type=text] { - width: 100%; } - .lm-plugin .form-inline .control-label { - margin-bottom: 0; - vertical-align: middle; } - .lm-plugin .form-inline .radio, - .lm-plugin .form-inline .checkbox { - display: inline-block; - margin-top: 0; - margin-bottom: 0; - vertical-align: middle; } - .lm-plugin .form-inline .radio label, - .lm-plugin .form-inline .checkbox label { - padding-left: 0; } - .lm-plugin .form-inline .radio input[type="radio"], - .lm-plugin .form-inline .checkbox input[type="checkbox"] { - position: relative; - margin-left: 0; } - .lm-plugin .form-inline .has-feedback .lm-form-control-feedback { - top: 0; } } - .lm-plugin .form-horizontal .radio, - .lm-plugin .form-horizontal .checkbox, - .lm-plugin .form-horizontal .radio-inline, - .lm-plugin .form-horizontal .checkbox-inline { - margin-top: 0; - margin-bottom: 0; - padding-top: 7px; } - .lm-plugin .form-horizontal .radio, - .lm-plugin .form-horizontal .checkbox { - min-height: 27px; } - .lm-plugin .form-horizontal .form-group { - margin-left: -15px; - margin-right: -15px; } - .lm-plugin .form-horizontal .form-group:before, .lm-plugin .form-horizontal .form-group:after { - content: " "; - display: table; } - .lm-plugin .form-horizontal .form-group:after { - clear: both; } - @media (min-width: 768px) { - .lm-plugin .form-horizontal .control-label { - text-align: right; - margin-bottom: 0; - padding-top: 7px; } } - .lm-plugin .form-horizontal .has-feedback .lm-form-control-feedback { - right: 15px; } - @media (min-width: 768px) { - .lm-plugin .form-horizontal .form-group-lg .control-label { - padding-top: 11px; - font-size: 18px; } } - @media (min-width: 768px) { - .lm-plugin .form-horizontal .form-group-sm .control-label { - padding-top: 6px; - font-size: 12px; } } - .lm-plugin .lm-btn, .lm-plugin .lm-control-row button { - display: inline-block; - margin-bottom: 0; - font-weight: normal; - text-align: center; - vertical-align: middle; - touch-action: manipulation; - cursor: pointer; - background-image: none; - border: 1px solid transparent; - white-space: nowrap; - padding: 6px 12px; - font-size: 14px; - line-height: 1.42857; - border-radius: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; } - .lm-plugin .lm-btn:focus, .lm-plugin .lm-control-row button:focus, .lm-plugin .lm-btn.focus, .lm-plugin .lm-control-row button.focus, .lm-plugin .lm-btn:active:focus, .lm-plugin .lm-control-row button:active:focus, .lm-plugin .lm-btn:active.focus, .lm-plugin .lm-control-row button:active.focus, .lm-plugin .lm-btn.active:focus, .lm-plugin .lm-control-row button.active:focus, .lm-plugin .lm-btn.active.focus, .lm-plugin .lm-control-row button.active.focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; } - .lm-plugin .lm-btn:hover, .lm-plugin .lm-control-row button:hover, .lm-plugin .lm-btn:focus, .lm-plugin .lm-control-row button:focus, .lm-plugin .lm-btn.focus, .lm-plugin .lm-control-row button.focus { - color: #333; - text-decoration: none; } - .lm-plugin .lm-btn:active, .lm-plugin .lm-control-row button:active, .lm-plugin .lm-btn.active, .lm-plugin .lm-control-row button.active { - outline: 0; - background-image: none; - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } - .lm-plugin .lm-btn.disabled, .lm-plugin .lm-control-row button.disabled, .lm-plugin .lm-btn[disabled], .lm-plugin .lm-control-row button[disabled], - fieldset[disabled] .lm-plugin .lm-btn, - fieldset[disabled] .lm-plugin .lm-control-row button { - cursor: not-allowed; - opacity: 0.65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - box-shadow: none; } - .lm-plugin a.lm-btn.disabled, - fieldset[disabled] .lm-plugin a.lm-btn { - pointer-events: none; } - .lm-plugin .lm-btn-default { - color: #333; - background-color: #fff; - border-color: #ccc; } - .lm-plugin .lm-btn-default:focus, .lm-plugin .lm-btn-default.focus { - color: #333; - background-color: #e6e6e6; - border-color: #8c8c8c; } - .lm-plugin .lm-btn-default:hover { - color: #333; - background-color: #e6e6e6; - border-color: #adadad; } - .lm-plugin .lm-btn-default:active, .lm-plugin .lm-btn-default.active, - .open > .lm-plugin .lm-btn-default.dropdown-toggle { - color: #333; - background-color: #e6e6e6; - border-color: #adadad; } - .lm-plugin .lm-btn-default:active:hover, .lm-plugin .lm-btn-default:active:focus, .lm-plugin .lm-btn-default:active.focus, .lm-plugin .lm-btn-default.active:hover, .lm-plugin .lm-btn-default.active:focus, .lm-plugin .lm-btn-default.active.focus, - .open > .lm-plugin .lm-btn-default.dropdown-toggle:hover, - .open > .lm-plugin .lm-btn-default.dropdown-toggle:focus, - .open > .lm-plugin .lm-btn-default.dropdown-toggle.focus { - color: #333; - background-color: #d4d4d4; - border-color: #8c8c8c; } - .lm-plugin .lm-btn-default:active, .lm-plugin .lm-btn-default.active, - .open > .lm-plugin .lm-btn-default.dropdown-toggle { - background-image: none; } - .lm-plugin .lm-btn-default.disabled:hover, .lm-plugin .lm-btn-default.disabled:focus, .lm-plugin .lm-btn-default.disabled.focus, .lm-plugin .lm-btn-default[disabled]:hover, .lm-plugin .lm-btn-default[disabled]:focus, .lm-plugin .lm-btn-default[disabled].focus, - fieldset[disabled] .lm-plugin .lm-btn-default:hover, - fieldset[disabled] .lm-plugin .lm-btn-default:focus, - fieldset[disabled] .lm-plugin .lm-btn-default.focus { - background-color: #fff; - border-color: #ccc; } - .lm-plugin .lm-btn-default .badge { - color: #fff; - background-color: #333; } - .lm-plugin .lm-btn-primary { - color: #fff; - background-color: #337ab7; - border-color: #2e6da4; } - .lm-plugin .lm-btn-primary:focus, .lm-plugin .lm-btn-primary.focus { - color: #fff; - background-color: #286090; - border-color: #122b40; } - .lm-plugin .lm-btn-primary:hover { - color: #fff; - background-color: #286090; - border-color: #204d74; } - .lm-plugin .lm-btn-primary:active, .lm-plugin .lm-btn-primary.active, - .open > .lm-plugin .lm-btn-primary.dropdown-toggle { - color: #fff; - background-color: #286090; - border-color: #204d74; } - .lm-plugin .lm-btn-primary:active:hover, .lm-plugin .lm-btn-primary:active:focus, .lm-plugin .lm-btn-primary:active.focus, .lm-plugin .lm-btn-primary.active:hover, .lm-plugin .lm-btn-primary.active:focus, .lm-plugin .lm-btn-primary.active.focus, - .open > .lm-plugin .lm-btn-primary.dropdown-toggle:hover, - .open > .lm-plugin .lm-btn-primary.dropdown-toggle:focus, - .open > .lm-plugin .lm-btn-primary.dropdown-toggle.focus { - color: #fff; - background-color: #204d74; - border-color: #122b40; } - .lm-plugin .lm-btn-primary:active, .lm-plugin .lm-btn-primary.active, - .open > .lm-plugin .lm-btn-primary.dropdown-toggle { - background-image: none; } - .lm-plugin .lm-btn-primary.disabled:hover, .lm-plugin .lm-btn-primary.disabled:focus, .lm-plugin .lm-btn-primary.disabled.focus, .lm-plugin .lm-btn-primary[disabled]:hover, .lm-plugin .lm-btn-primary[disabled]:focus, .lm-plugin .lm-btn-primary[disabled].focus, - fieldset[disabled] .lm-plugin .lm-btn-primary:hover, - fieldset[disabled] .lm-plugin .lm-btn-primary:focus, - fieldset[disabled] .lm-plugin .lm-btn-primary.focus { - background-color: #337ab7; - border-color: #2e6da4; } - .lm-plugin .lm-btn-primary .badge { - color: #337ab7; - background-color: #fff; } - .lm-plugin .lm-btn-success { - color: #fff; - background-color: #5cb85c; - border-color: #4cae4c; } - .lm-plugin .lm-btn-success:focus, .lm-plugin .lm-btn-success.focus { - color: #fff; - background-color: #449d44; - border-color: #255625; } - .lm-plugin .lm-btn-success:hover { - color: #fff; - background-color: #449d44; - border-color: #398439; } - .lm-plugin .lm-btn-success:active, .lm-plugin .lm-btn-success.active, - .open > .lm-plugin .lm-btn-success.dropdown-toggle { - color: #fff; - background-color: #449d44; - border-color: #398439; } - .lm-plugin .lm-btn-success:active:hover, .lm-plugin .lm-btn-success:active:focus, .lm-plugin .lm-btn-success:active.focus, .lm-plugin .lm-btn-success.active:hover, .lm-plugin .lm-btn-success.active:focus, .lm-plugin .lm-btn-success.active.focus, - .open > .lm-plugin .lm-btn-success.dropdown-toggle:hover, - .open > .lm-plugin .lm-btn-success.dropdown-toggle:focus, - .open > .lm-plugin .lm-btn-success.dropdown-toggle.focus { - color: #fff; - background-color: #398439; - border-color: #255625; } - .lm-plugin .lm-btn-success:active, .lm-plugin .lm-btn-success.active, - .open > .lm-plugin .lm-btn-success.dropdown-toggle { - background-image: none; } - .lm-plugin .lm-btn-success.disabled:hover, .lm-plugin .lm-btn-success.disabled:focus, .lm-plugin .lm-btn-success.disabled.focus, .lm-plugin .lm-btn-success[disabled]:hover, .lm-plugin .lm-btn-success[disabled]:focus, .lm-plugin .lm-btn-success[disabled].focus, - fieldset[disabled] .lm-plugin .lm-btn-success:hover, - fieldset[disabled] .lm-plugin .lm-btn-success:focus, - fieldset[disabled] .lm-plugin .lm-btn-success.focus { - background-color: #5cb85c; - border-color: #4cae4c; } - .lm-plugin .lm-btn-success .badge { - color: #5cb85c; - background-color: #fff; } - .lm-plugin .lm-btn-info { - color: #fff; - background-color: #5bc0de; - border-color: #46b8da; } - .lm-plugin .lm-btn-info:focus, .lm-plugin .lm-btn-info.focus { - color: #fff; - background-color: #31b0d5; - border-color: #1b6d85; } - .lm-plugin .lm-btn-info:hover { - color: #fff; - background-color: #31b0d5; - border-color: #269abc; } - .lm-plugin .lm-btn-info:active, .lm-plugin .lm-btn-info.active, - .open > .lm-plugin .lm-btn-info.dropdown-toggle { - color: #fff; - background-color: #31b0d5; - border-color: #269abc; } - .lm-plugin .lm-btn-info:active:hover, .lm-plugin .lm-btn-info:active:focus, .lm-plugin .lm-btn-info:active.focus, .lm-plugin .lm-btn-info.active:hover, .lm-plugin .lm-btn-info.active:focus, .lm-plugin .lm-btn-info.active.focus, - .open > .lm-plugin .lm-btn-info.dropdown-toggle:hover, - .open > .lm-plugin .lm-btn-info.dropdown-toggle:focus, - .open > .lm-plugin .lm-btn-info.dropdown-toggle.focus { - color: #fff; - background-color: #269abc; - border-color: #1b6d85; } - .lm-plugin .lm-btn-info:active, .lm-plugin .lm-btn-info.active, - .open > .lm-plugin .lm-btn-info.dropdown-toggle { - background-image: none; } - .lm-plugin .lm-btn-info.disabled:hover, .lm-plugin .lm-btn-info.disabled:focus, .lm-plugin .lm-btn-info.disabled.focus, .lm-plugin .lm-btn-info[disabled]:hover, .lm-plugin .lm-btn-info[disabled]:focus, .lm-plugin .lm-btn-info[disabled].focus, - fieldset[disabled] .lm-plugin .lm-btn-info:hover, - fieldset[disabled] .lm-plugin .lm-btn-info:focus, - fieldset[disabled] .lm-plugin .lm-btn-info.focus { - background-color: #5bc0de; - border-color: #46b8da; } - .lm-plugin .lm-btn-info .badge { - color: #5bc0de; - background-color: #fff; } - .lm-plugin .lm-btn-warning { - color: #fff; - background-color: #f0ad4e; - border-color: #eea236; } - .lm-plugin .lm-btn-warning:focus, .lm-plugin .lm-btn-warning.focus { - color: #fff; - background-color: #ec971f; - border-color: #985f0d; } - .lm-plugin .lm-btn-warning:hover { - color: #fff; - background-color: #ec971f; - border-color: #d58512; } - .lm-plugin .lm-btn-warning:active, .lm-plugin .lm-btn-warning.active, - .open > .lm-plugin .lm-btn-warning.dropdown-toggle { - color: #fff; - background-color: #ec971f; - border-color: #d58512; } - .lm-plugin .lm-btn-warning:active:hover, .lm-plugin .lm-btn-warning:active:focus, .lm-plugin .lm-btn-warning:active.focus, .lm-plugin .lm-btn-warning.active:hover, .lm-plugin .lm-btn-warning.active:focus, .lm-plugin .lm-btn-warning.active.focus, - .open > .lm-plugin .lm-btn-warning.dropdown-toggle:hover, - .open > .lm-plugin .lm-btn-warning.dropdown-toggle:focus, - .open > .lm-plugin .lm-btn-warning.dropdown-toggle.focus { - color: #fff; - background-color: #d58512; - border-color: #985f0d; } - .lm-plugin .lm-btn-warning:active, .lm-plugin .lm-btn-warning.active, - .open > .lm-plugin .lm-btn-warning.dropdown-toggle { - background-image: none; } - .lm-plugin .lm-btn-warning.disabled:hover, .lm-plugin .lm-btn-warning.disabled:focus, .lm-plugin .lm-btn-warning.disabled.focus, .lm-plugin .lm-btn-warning[disabled]:hover, .lm-plugin .lm-btn-warning[disabled]:focus, .lm-plugin .lm-btn-warning[disabled].focus, - fieldset[disabled] .lm-plugin .lm-btn-warning:hover, - fieldset[disabled] .lm-plugin .lm-btn-warning:focus, - fieldset[disabled] .lm-plugin .lm-btn-warning.focus { - background-color: #f0ad4e; - border-color: #eea236; } - .lm-plugin .lm-btn-warning .badge { - color: #f0ad4e; - background-color: #fff; } - .lm-plugin .lm-btn-danger { - color: #fff; - background-color: #d9534f; - border-color: #d43f3a; } - .lm-plugin .lm-btn-danger:focus, .lm-plugin .lm-btn-danger.focus { - color: #fff; - background-color: #c9302c; - border-color: #761c19; } - .lm-plugin .lm-btn-danger:hover { - color: #fff; - background-color: #c9302c; - border-color: #ac2925; } - .lm-plugin .lm-btn-danger:active, .lm-plugin .lm-btn-danger.active, - .open > .lm-plugin .lm-btn-danger.dropdown-toggle { - color: #fff; - background-color: #c9302c; - border-color: #ac2925; } - .lm-plugin .lm-btn-danger:active:hover, .lm-plugin .lm-btn-danger:active:focus, .lm-plugin .lm-btn-danger:active.focus, .lm-plugin .lm-btn-danger.active:hover, .lm-plugin .lm-btn-danger.active:focus, .lm-plugin .lm-btn-danger.active.focus, - .open > .lm-plugin .lm-btn-danger.dropdown-toggle:hover, - .open > .lm-plugin .lm-btn-danger.dropdown-toggle:focus, - .open > .lm-plugin .lm-btn-danger.dropdown-toggle.focus { - color: #fff; - background-color: #ac2925; - border-color: #761c19; } - .lm-plugin .lm-btn-danger:active, .lm-plugin .lm-btn-danger.active, - .open > .lm-plugin .lm-btn-danger.dropdown-toggle { - background-image: none; } - .lm-plugin .lm-btn-danger.disabled:hover, .lm-plugin .lm-btn-danger.disabled:focus, .lm-plugin .lm-btn-danger.disabled.focus, .lm-plugin .lm-btn-danger[disabled]:hover, .lm-plugin .lm-btn-danger[disabled]:focus, .lm-plugin .lm-btn-danger[disabled].focus, - fieldset[disabled] .lm-plugin .lm-btn-danger:hover, - fieldset[disabled] .lm-plugin .lm-btn-danger:focus, - fieldset[disabled] .lm-plugin .lm-btn-danger.focus { - background-color: #d9534f; - border-color: #d43f3a; } - .lm-plugin .lm-btn-danger .badge { - color: #d9534f; - background-color: #fff; } - .lm-plugin .lm-btn-link { - color: #337ab7; - font-weight: normal; - border-radius: 0; } - .lm-plugin .lm-btn-link, .lm-plugin .lm-btn-link:active, .lm-plugin .lm-btn-link.active, .lm-plugin .lm-btn-link[disabled], - fieldset[disabled] .lm-plugin .lm-btn-link { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; } - .lm-plugin .lm-btn-link, .lm-plugin .lm-btn-link:hover, .lm-plugin .lm-btn-link:focus, .lm-plugin .lm-btn-link:active { - border-color: transparent; } - .lm-plugin .lm-btn-link:hover, .lm-plugin .lm-btn-link:focus { - color: #23527c; - text-decoration: underline; - background-color: transparent; } - .lm-plugin .lm-btn-link[disabled]:hover, .lm-plugin .lm-btn-link[disabled]:focus, - fieldset[disabled] .lm-plugin .lm-btn-link:hover, - fieldset[disabled] .lm-plugin .lm-btn-link:focus { - color: #777777; - text-decoration: none; } - .lm-plugin .lm-btn-lg, .lm-plugin .lm-btn-group-lg > .lm-btn, .lm-plugin .lm-control-row .lm-btn-group-lg > button { - padding: 10px 16px; - font-size: 18px; - line-height: 1.33333; - border-radius: 0; } - .lm-plugin .lm-btn-sm, .lm-plugin .lm-btn-group-sm > .lm-btn, .lm-plugin .lm-control-row .lm-btn-group-sm > button { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; } - .lm-plugin .lm-btn-xs, .lm-plugin .lm-btn-group-xs > .lm-btn, .lm-plugin .lm-control-row .lm-btn-group-xs > button { - padding: 1px 5px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; } - .lm-plugin .lm-btn-block, .lm-plugin .lm-control-row button { - display: block; - width: 100%; } - .lm-plugin .lm-btn-block + .lm-btn-block, .lm-plugin .lm-control-row button + .lm-btn-block, .lm-plugin .lm-control-row .lm-btn-block + button, .lm-plugin .lm-control-row button + button { - margin-top: 5px; } - .lm-plugin input[type="submit"].lm-btn-block, - .lm-plugin input[type="reset"].lm-btn-block, - .lm-plugin input[type="button"].lm-btn-block { - width: 100%; } - .lm-plugin .lm-btn-group, - .lm-plugin .lm-btn-group-vertical { - position: relative; - display: inline-block; - vertical-align: middle; } - .lm-plugin .lm-btn-group > .lm-btn, .lm-plugin .lm-control-row .lm-btn-group > button, - .lm-plugin .lm-btn-group-vertical > .lm-btn, - .lm-plugin .lm-control-row .lm-btn-group-vertical > button { - position: relative; - float: left; } - .lm-plugin .lm-btn-group > .lm-btn:hover, .lm-plugin .lm-control-row .lm-btn-group > button:hover, .lm-plugin .lm-btn-group > .lm-btn:focus, .lm-plugin .lm-control-row .lm-btn-group > button:focus, .lm-plugin .lm-btn-group > .lm-btn:active, .lm-plugin .lm-control-row .lm-btn-group > button:active, .lm-plugin .lm-btn-group > .lm-btn.active, .lm-plugin .lm-control-row .lm-btn-group > button.active, - .lm-plugin .lm-btn-group-vertical > .lm-btn:hover, - .lm-plugin .lm-control-row .lm-btn-group-vertical > button:hover, - .lm-plugin .lm-btn-group-vertical > .lm-btn:focus, - .lm-plugin .lm-control-row .lm-btn-group-vertical > button:focus, - .lm-plugin .lm-btn-group-vertical > .lm-btn:active, - .lm-plugin .lm-control-row .lm-btn-group-vertical > button:active, - .lm-plugin .lm-btn-group-vertical > .lm-btn.active, - .lm-plugin .lm-control-row .lm-btn-group-vertical > button.active { - z-index: 2; } - .lm-plugin .lm-btn-group .lm-btn + .lm-btn, .lm-plugin .lm-btn-group .lm-control-row button + .lm-btn, .lm-plugin .lm-control-row .lm-btn-group button + .lm-btn, .lm-plugin .lm-btn-group .lm-control-row .lm-btn + button, .lm-plugin .lm-control-row .lm-btn-group .lm-btn + button, .lm-plugin .lm-btn-group .lm-control-row button + button, .lm-plugin .lm-control-row .lm-btn-group button + button, - .lm-plugin .lm-btn-group .lm-btn + .lm-btn-group, - .lm-plugin .lm-btn-group .lm-control-row button + .lm-btn-group, - .lm-plugin .lm-control-row .lm-btn-group button + .lm-btn-group, - .lm-plugin .lm-btn-group .lm-btn-group + .lm-btn, - .lm-plugin .lm-btn-group .lm-control-row .lm-btn-group + button, - .lm-plugin .lm-control-row .lm-btn-group .lm-btn-group + button, - .lm-plugin .lm-btn-group .lm-btn-group + .lm-btn-group { - margin-left: -1px; } - .lm-plugin .lm-btn-toolbar { - margin-left: -5px; } - .lm-plugin .lm-btn-toolbar:before, .lm-plugin .lm-btn-toolbar:after { - content: " "; - display: table; } - .lm-plugin .lm-btn-toolbar:after { - clear: both; } - .lm-plugin .lm-btn-toolbar .lm-btn, .lm-plugin .lm-btn-toolbar .lm-control-row button, .lm-plugin .lm-control-row .lm-btn-toolbar button, - .lm-plugin .lm-btn-toolbar .lm-btn-group, - .lm-plugin .lm-btn-toolbar .input-group { - float: left; } - .lm-plugin .lm-btn-toolbar > .lm-btn, .lm-plugin .lm-control-row .lm-btn-toolbar > button, - .lm-plugin .lm-btn-toolbar > .lm-btn-group, - .lm-plugin .lm-btn-toolbar > .input-group { - margin-left: 5px; } - .lm-plugin .lm-btn-group > .lm-btn:not(:first-child):not(:last-child):not(.dropdown-toggle), .lm-plugin .lm-control-row .lm-btn-group > button:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; } - .lm-plugin .lm-btn-group > .lm-btn:first-child, .lm-plugin .lm-control-row .lm-btn-group > button:first-child { - margin-left: 0; } - .lm-plugin .lm-btn-group > .lm-btn:first-child:not(:last-child):not(.dropdown-toggle), .lm-plugin .lm-control-row .lm-btn-group > button:first-child:not(:last-child):not(.dropdown-toggle) { - border-bottom-right-radius: 0; - border-top-right-radius: 0; } - .lm-plugin .lm-btn-group > .lm-btn:last-child:not(:first-child), .lm-plugin .lm-control-row .lm-btn-group > button:last-child:not(:first-child), - .lm-plugin .lm-btn-group > .dropdown-toggle:not(:first-child) { - border-bottom-left-radius: 0; - border-top-left-radius: 0; } - .lm-plugin .lm-btn-group > .lm-btn-group { - float: left; } - .lm-plugin .lm-btn-group > .lm-btn-group:not(:first-child):not(:last-child) > .lm-btn, .lm-plugin .lm-control-row .lm-btn-group > .lm-btn-group:not(:first-child):not(:last-child) > button { - border-radius: 0; } - .lm-plugin .lm-btn-group > .lm-btn-group:first-child:not(:last-child) > .lm-btn:last-child, .lm-plugin .lm-control-row .lm-btn-group > .lm-btn-group:first-child:not(:last-child) > button:last-child, - .lm-plugin .lm-btn-group > .lm-btn-group:first-child:not(:last-child) > .dropdown-toggle { - border-bottom-right-radius: 0; - border-top-right-radius: 0; } - .lm-plugin .lm-btn-group > .lm-btn-group:last-child:not(:first-child) > .lm-btn:first-child, .lm-plugin .lm-control-row .lm-btn-group > .lm-btn-group:last-child:not(:first-child) > button:first-child { - border-bottom-left-radius: 0; - border-top-left-radius: 0; } - .lm-plugin .lm-btn-group .dropdown-toggle:active, - .lm-plugin .lm-btn-group.open .dropdown-toggle { - outline: 0; } - .lm-plugin .lm-btn-group > .lm-btn + .dropdown-toggle, .lm-plugin .lm-control-row .lm-btn-group > button + .dropdown-toggle { - padding-left: 8px; - padding-right: 8px; } - .lm-plugin .lm-btn-group > .lm-btn-lg + .dropdown-toggle, .lm-plugin .lm-btn-group-lg.lm-btn-group > .lm-btn + .dropdown-toggle, .lm-plugin .lm-control-row .lm-btn-group-lg.lm-btn-group > button + .dropdown-toggle { - padding-left: 12px; - padding-right: 12px; } - .lm-plugin .lm-btn-group.open .dropdown-toggle { - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } - .lm-plugin .lm-btn-group.open .dropdown-toggle.lm-btn-link { - -webkit-box-shadow: none; - box-shadow: none; } - .lm-plugin .lm-btn .caret, .lm-plugin .lm-control-row button .caret { - margin-left: 0; } - .lm-plugin .lm-btn-lg .caret, .lm-plugin .lm-btn-group-lg > .lm-btn .caret, .lm-plugin .lm-control-row .lm-btn-group-lg > button .caret { - border-width: 5px 5px 0; - border-bottom-width: 0; } - .lm-plugin .dropup .lm-btn-lg .caret, .lm-plugin .dropup .lm-btn-group-lg > .lm-btn .caret, .lm-plugin .dropup .lm-control-row .lm-btn-group-lg > button .caret, .lm-plugin .lm-control-row .dropup .lm-btn-group-lg > button .caret { - border-width: 0 5px 5px; } - - .lm-plugin .lm-btn-group-vertical > .lm-btn, - .lm-plugin .lm-control-row .lm-btn-group-vertical > button, - .lm-plugin .lm-btn-group-vertical > .lm-btn-group, - .lm-plugin .lm-btn-group-vertical > .lm-btn-group > .lm-btn, - .lm-plugin .lm-control-row .lm-btn-group-vertical > .lm-btn-group > button { - display: block; - float: none; - width: 100%; - max-width: 100%; } - .lm-plugin .lm-btn-group-vertical > .lm-btn-group:before, .lm-plugin .lm-btn-group-vertical > .lm-btn-group:after { - content: " "; - display: table; } - .lm-plugin .lm-btn-group-vertical > .lm-btn-group:after { - clear: both; } - - .lm-plugin .lm-btn-group-vertical > .lm-btn-group > .lm-btn, - .lm-plugin .lm-control-row .lm-btn-group-vertical > .lm-btn-group > button { - float: none; } - .lm-plugin .lm-btn-group-vertical > .lm-btn + .lm-btn, .lm-plugin .lm-control-row .lm-btn-group-vertical > button + .lm-btn, .lm-plugin .lm-control-row .lm-btn-group-vertical > .lm-btn + button, .lm-plugin .lm-control-row .lm-btn-group-vertical > button + button, - .lm-plugin .lm-btn-group-vertical > .lm-btn + .lm-btn-group, - .lm-plugin .lm-control-row .lm-btn-group-vertical > button + .lm-btn-group, - .lm-plugin .lm-btn-group-vertical > .lm-btn-group + .lm-btn, - .lm-plugin .lm-control-row .lm-btn-group-vertical > .lm-btn-group + button, - .lm-plugin .lm-btn-group-vertical > .lm-btn-group + .lm-btn-group { - margin-top: -1px; - margin-left: 0; } - .lm-plugin .lm-btn-group-vertical > .lm-btn:not(:first-child):not(:last-child), .lm-plugin .lm-control-row .lm-btn-group-vertical > button:not(:first-child):not(:last-child) { - border-radius: 0; } - .lm-plugin .lm-btn-group-vertical > .lm-btn:first-child:not(:last-child), .lm-plugin .lm-control-row .lm-btn-group-vertical > button:first-child:not(:last-child) { - border-top-right-radius: 0; - border-top-left-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; } - .lm-plugin .lm-btn-group-vertical > .lm-btn:last-child:not(:first-child), .lm-plugin .lm-control-row .lm-btn-group-vertical > button:last-child:not(:first-child) { - border-top-right-radius: 0; - border-top-left-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; } - .lm-plugin .lm-btn-group-vertical > .lm-btn-group:not(:first-child):not(:last-child) > .lm-btn, .lm-plugin .lm-control-row .lm-btn-group-vertical > .lm-btn-group:not(:first-child):not(:last-child) > button { - border-radius: 0; } - .lm-plugin .lm-btn-group-vertical > .lm-btn-group:first-child:not(:last-child) > .lm-btn:last-child, .lm-plugin .lm-control-row .lm-btn-group-vertical > .lm-btn-group:first-child:not(:last-child) > button:last-child, - .lm-plugin .lm-btn-group-vertical > .lm-btn-group:first-child:not(:last-child) > .dropdown-toggle { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; } - .lm-plugin .lm-btn-group-vertical > .lm-btn-group:last-child:not(:first-child) > .lm-btn:first-child, .lm-plugin .lm-control-row .lm-btn-group-vertical > .lm-btn-group:last-child:not(:first-child) > button:first-child { - border-top-right-radius: 0; - border-top-left-radius: 0; } - .lm-plugin .lm-btn-group-justified { - display: table; - width: 100%; - table-layout: fixed; - border-collapse: separate; } - .lm-plugin .lm-btn-group-justified > .lm-btn, .lm-plugin .lm-control-row .lm-btn-group-justified > button, - .lm-plugin .lm-btn-group-justified > .lm-btn-group { - float: none; - display: table-cell; - width: 1%; } - .lm-plugin .lm-btn-group-justified > .lm-btn-group .lm-btn, .lm-plugin .lm-btn-group-justified > .lm-btn-group .lm-control-row button, .lm-plugin .lm-control-row .lm-btn-group-justified > .lm-btn-group button { - width: 100%; } - .lm-plugin .lm-btn-group-justified > .lm-btn-group .dropdown-menu { - left: auto; } - .lm-plugin [data-toggle="buttons"] > .lm-btn input[type="radio"], .lm-plugin .lm-control-row [data-toggle="buttons"] > button input[type="radio"], - .lm-plugin [data-toggle="buttons"] > .lm-btn input[type="checkbox"], - .lm-plugin .lm-control-row [data-toggle="buttons"] > button input[type="checkbox"], - .lm-plugin [data-toggle="buttons"] > .lm-btn-group > .lm-btn input[type="radio"], - .lm-plugin .lm-control-row [data-toggle="buttons"] > .lm-btn-group > button input[type="radio"], - .lm-plugin [data-toggle="buttons"] > .lm-btn-group > .lm-btn input[type="checkbox"], - .lm-plugin .lm-control-row [data-toggle="buttons"] > .lm-btn-group > button input[type="checkbox"] { - position: absolute; - clip: rect(0, 0, 0, 0); - pointer-events: none; } - .lm-plugin .input-group { - position: relative; - display: table; - border-collapse: separate; } - .lm-plugin .input-group[class*="col-"] { - float: none; - padding-left: 0; - padding-right: 0; } - .lm-plugin .input-group .lm-form-control, .lm-plugin .input-group .lm-control-row select, .lm-plugin .lm-control-row .input-group select, .lm-plugin .input-group .lm-control-row button, .lm-plugin .lm-control-row .input-group button, .lm-plugin .input-group .lm-control-row input[type=text], .lm-plugin .lm-control-row .input-group input[type=text] { - position: relative; - z-index: 2; - float: left; - width: 100%; - margin-bottom: 0; } - .lm-plugin .input-group .lm-form-control:focus, .lm-plugin .input-group .lm-control-row select:focus, .lm-plugin .lm-control-row .input-group select:focus, .lm-plugin .input-group .lm-control-row button:focus, .lm-plugin .lm-control-row .input-group button:focus, .lm-plugin .input-group .lm-control-row input:focus[type=text], .lm-plugin .lm-control-row .input-group input:focus[type=text] { - z-index: 3; } - .lm-plugin .input-group-addon, - .lm-plugin .input-group-lm-btn, .lm-plugin .input-group .lm-form-control, .lm-plugin .input-group .lm-control-row select, .lm-plugin .lm-control-row .input-group select, .lm-plugin .input-group .lm-control-row button, .lm-plugin .lm-control-row .input-group button, .lm-plugin .input-group .lm-control-row input[type=text], .lm-plugin .lm-control-row .input-group input[type=text] { - display: table-cell; } - .lm-plugin .input-group-addon:not(:first-child):not(:last-child), - .lm-plugin .input-group-lm-btn:not(:first-child):not(:last-child), - .lm-plugin .input-group .lm-form-control:not(:first-child):not(:last-child), - .lm-plugin .input-group .lm-control-row select:not(:first-child):not(:last-child), - .lm-plugin .lm-control-row .input-group select:not(:first-child):not(:last-child), - .lm-plugin .input-group .lm-control-row button:not(:first-child):not(:last-child), - .lm-plugin .lm-control-row .input-group button:not(:first-child):not(:last-child), - .lm-plugin .input-group .lm-control-row input:not(:first-child):not(:last-child)[type=text], - .lm-plugin .lm-control-row .input-group input:not(:first-child):not(:last-child)[type=text] { - border-radius: 0; } - .lm-plugin .input-group-addon, - .lm-plugin .input-group-lm-btn { - width: 1%; - white-space: nowrap; - vertical-align: middle; } - .lm-plugin .input-group-addon { - padding: 6px 12px; - font-size: 14px; - font-weight: normal; - line-height: 1; - color: #555555; - text-align: center; - background-color: #eeeeee; - border: 1px solid #ccc; - border-radius: 0; } - .lm-plugin .input-group-addon.input-sm, .lm-plugin .lm-control-row .input-group-sm > select.input-group-addon, .lm-plugin .lm-control-row .input-group-sm > button.input-group-addon, .lm-plugin .lm-control-row .input-group-sm > input.input-group-addon[type=text], - .lm-plugin .input-group-sm > .input-group-addon, - .lm-plugin .input-group-sm > .input-group-lm-btn > .input-group-addon.lm-btn, .lm-plugin .lm-control-row .input-group-sm > .input-group-lm-btn > button.input-group-addon { - padding: 5px 10px; - font-size: 12px; - border-radius: 0; } - .lm-plugin .input-group-addon.input-lg, .lm-plugin .lm-control-row .input-group-lg > select.input-group-addon, .lm-plugin .lm-control-row .input-group-lg > button.input-group-addon, .lm-plugin .lm-control-row .input-group-lg > input.input-group-addon[type=text], - .lm-plugin .input-group-lg > .input-group-addon, - .lm-plugin .input-group-lg > .input-group-lm-btn > .input-group-addon.lm-btn, .lm-plugin .lm-control-row .input-group-lg > .input-group-lm-btn > button.input-group-addon { - padding: 10px 16px; - font-size: 18px; - border-radius: 0; } - .lm-plugin .input-group-addon input[type="radio"], - .lm-plugin .input-group-addon input[type="checkbox"] { - margin-top: 0; } - .lm-plugin .input-group .lm-form-control:first-child, .lm-plugin .input-group .lm-control-row select:first-child, .lm-plugin .lm-control-row .input-group select:first-child, .lm-plugin .input-group .lm-control-row button:first-child, .lm-plugin .lm-control-row .input-group button:first-child, .lm-plugin .input-group .lm-control-row input:first-child[type=text], .lm-plugin .lm-control-row .input-group input:first-child[type=text], - .lm-plugin .input-group-addon:first-child, - .lm-plugin .input-group-lm-btn:first-child > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:first-child > button, - .lm-plugin .input-group-lm-btn:first-child > .lm-btn-group > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:first-child > .lm-btn-group > button, - .lm-plugin .input-group-lm-btn:first-child > .dropdown-toggle, - .lm-plugin .input-group-lm-btn:last-child > .lm-btn:not(:last-child):not(.dropdown-toggle), - .lm-plugin .lm-control-row .input-group-lm-btn:last-child > button:not(:last-child):not(.dropdown-toggle), - .lm-plugin .input-group-lm-btn:last-child > .lm-btn-group:not(:last-child) > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:last-child > .lm-btn-group:not(:last-child) > button { - border-bottom-right-radius: 0; - border-top-right-radius: 0; } - .lm-plugin .input-group-addon:first-child { - border-right: 0; } - .lm-plugin .input-group .lm-form-control:last-child, .lm-plugin .input-group .lm-control-row select:last-child, .lm-plugin .lm-control-row .input-group select:last-child, .lm-plugin .input-group .lm-control-row button:last-child, .lm-plugin .lm-control-row .input-group button:last-child, .lm-plugin .input-group .lm-control-row input:last-child[type=text], .lm-plugin .lm-control-row .input-group input:last-child[type=text], - .lm-plugin .input-group-addon:last-child, - .lm-plugin .input-group-lm-btn:last-child > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:last-child > button, - .lm-plugin .input-group-lm-btn:last-child > .lm-btn-group > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:last-child > .lm-btn-group > button, - .lm-plugin .input-group-lm-btn:last-child > .dropdown-toggle, - .lm-plugin .input-group-lm-btn:first-child > .lm-btn:not(:first-child), - .lm-plugin .lm-control-row .input-group-lm-btn:first-child > button:not(:first-child), - .lm-plugin .input-group-lm-btn:first-child > .lm-btn-group:not(:first-child) > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:first-child > .lm-btn-group:not(:first-child) > button { - border-bottom-left-radius: 0; - border-top-left-radius: 0; } - .lm-plugin .input-group-addon:last-child { - border-left: 0; } - .lm-plugin .input-group-lm-btn { - position: relative; - font-size: 0; - white-space: nowrap; } - .lm-plugin .input-group-lm-btn > .lm-btn, .lm-plugin .lm-control-row .input-group-lm-btn > button { - position: relative; } - .lm-plugin .input-group-lm-btn > .lm-btn + .lm-btn, .lm-plugin .lm-control-row .input-group-lm-btn > button + .lm-btn, .lm-plugin .lm-control-row .input-group-lm-btn > .lm-btn + button, .lm-plugin .lm-control-row .input-group-lm-btn > button + button { - margin-left: -1px; } - .lm-plugin .input-group-lm-btn > .lm-btn:hover, .lm-plugin .lm-control-row .input-group-lm-btn > button:hover, .lm-plugin .input-group-lm-btn > .lm-btn:focus, .lm-plugin .lm-control-row .input-group-lm-btn > button:focus, .lm-plugin .input-group-lm-btn > .lm-btn:active, .lm-plugin .lm-control-row .input-group-lm-btn > button:active { - z-index: 2; } - - .lm-plugin .input-group-lm-btn:first-child > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:first-child > button, - .lm-plugin .input-group-lm-btn:first-child > .lm-btn-group { - margin-right: -1px; } - - .lm-plugin .input-group-lm-btn:last-child > .lm-btn, - .lm-plugin .lm-control-row .input-group-lm-btn:last-child > button, - .lm-plugin .input-group-lm-btn:last-child > .lm-btn-group { - z-index: 2; - margin-left: -1px; } - .lm-plugin .label { - display: inline; - padding: .2em .6em .3em; - font-size: 75%; - font-weight: bold; - line-height: 1; - color: #fff; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - border-radius: .25em; } - .lm-plugin .label:empty { - display: none; } - .lm-btn .lm-plugin .label, .lm-plugin .lm-control-row button .lm-plugin .label { - position: relative; - top: -1px; } - .lm-plugin a.label:hover, .lm-plugin a.label:focus { - color: #fff; - text-decoration: none; - cursor: pointer; } - .lm-plugin .label-default { - background-color: #777777; } - .lm-plugin .label-default[href]:hover, .lm-plugin .label-default[href]:focus { - background-color: #5e5e5e; } - .lm-plugin .label-primary { - background-color: #337ab7; } - .lm-plugin .label-primary[href]:hover, .lm-plugin .label-primary[href]:focus { - background-color: #286090; } - .lm-plugin .label-success { - background-color: #5cb85c; } - .lm-plugin .label-success[href]:hover, .lm-plugin .label-success[href]:focus { - background-color: #449d44; } - .lm-plugin .label-info { - background-color: #5bc0de; } - .lm-plugin .label-info[href]:hover, .lm-plugin .label-info[href]:focus { - background-color: #31b0d5; } - .lm-plugin .label-warning { - background-color: #f0ad4e; } - .lm-plugin .label-warning[href]:hover, .lm-plugin .label-warning[href]:focus { - background-color: #ec971f; } - .lm-plugin .label-danger { - background-color: #d9534f; } - .lm-plugin .label-danger[href]:hover, .lm-plugin .label-danger[href]:focus { - background-color: #c9302c; } - .lm-plugin .badge { - display: inline-block; - min-width: 10px; - padding: 3px 7px; - font-size: 12px; - font-weight: bold; - color: #fff; - line-height: 1; - vertical-align: middle; - white-space: nowrap; - text-align: center; - background-color: #777777; - border-radius: 10px; } - .lm-plugin .badge:empty { - display: none; } - .lm-btn .lm-plugin .badge, .lm-plugin .lm-control-row button .lm-plugin .badge { - position: relative; - top: -1px; } - .lm-btn-xs .lm-plugin .badge, .lm-plugin .lm-btn-group-xs > .lm-btn .lm-plugin .badge, .lm-plugin .lm-control-row .lm-btn-group-xs > button .lm-plugin .badge, - .lm-btn-group-xs > .lm-btn .lm-plugin .badge, - .lm-plugin .lm-control-row .lm-btn-group-xs > button .lm-plugin .badge { - top: 0; - padding: 1px 5px; } - .list-group-item.active > .lm-plugin .badge, - .nav-pills > .active > a > .lm-plugin .badge { - color: #337ab7; - background-color: #fff; } - .list-group-item > .lm-plugin .badge { - float: right; } - .list-group-item > .lm-plugin .badge + .lm-plugin .badge { - margin-right: 5px; } - .nav-pills > li > a > .lm-plugin .badge { - margin-left: 3px; } - .lm-plugin a.badge:hover, .lm-plugin a.badge:focus { - color: #fff; - text-decoration: none; - cursor: pointer; } - .lm-plugin [class^="lm-icon-"]:before, .lm-plugin [class*=" lm-icon-"]:before { - font-family: "fontello"; - font-style: normal; - font-weight: normal; - speak: none; - display: inline-block; - text-decoration: inherit; - width: 1em; - margin-right: .2em; - text-align: center; - /* opacity: .8; */ - /* For safety - reset parent styles, that can break glyph codes*/ - font-variant: normal; - text-transform: none; - /* fix buttons height, for twitter bootstrap */ - line-height: 1em; - /* Animation center compensation - margins should be symmetric */ - /* remove if not needed */ - margin-left: .2em; - /* you can be more comfortable with increased icons size */ - /* font-size: 120%; */ - /* Font smoothing. That was taken from TWBS */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - /* Uncomment for 3D effect */ - /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ } - .lm-plugin .lm-icon-expand-layout:before { - content: "\e84a"; } - .lm-plugin .lm-icon-plus:before { - content: "\e816"; } - .lm-plugin .lm-icon-minus:before { - content: "\e819"; } - .lm-plugin .lm-icon-reset-scene:before { - content: "\e891"; } - .lm-plugin .lm-icon-ok:before { - content: "\e812"; } - .lm-plugin .lm-icon-cross:before { - content: "\e868"; } - .lm-plugin .lm-icon-off:before { - content: "\e813"; } - .lm-plugin .lm-icon-expand:before { - content: "\e885"; } - .lm-plugin .lm-icon-collapse:before { - content: "\e883"; } - .lm-plugin .lm-icon-visual-visibility:before { - content: "\e826"; } - .lm-plugin .lm-icon-abort:before { - content: "\e814"; } - .lm-plugin .lm-icon-focus-on-visual:before { - content: "\e8a3"; } - .lm-plugin .lm-icon-settings:before { - content: "\e855"; } - .lm-plugin .lm-icon-tools:before { - content: "\e856"; } - .lm-plugin .lm-icon-log:before { - content: "\e8a5"; } - .lm-plugin .lm-icon-remove:before { - content: "\e847"; } - .lm-plugin .lm-icon-help:before { - content: '\e81c'; } - .lm-plugin .lm-icon-info:before { - content: '\e81e'; } - .lm-plugin .lm-icon-left-open-big:before { - content: '\e87c'; } - .lm-plugin .lm-icon-right-open-big:before { - content: '\e87d'; } - .lm-plugin .lm-icon-left-open:before { - content: '\e874'; } - .lm-plugin .lm-icon-right-open:before { - content: '\e875'; } - .lm-plugin .lm-icon-screenshot:before { - content: "\e80f"; } - .lm-plugin .lm-icon-help:before { - content: "\e81c"; } - .lm-plugin .lm-icon-help-circle:before { - content: "\e81d"; } - .lm-plugin .lm-layout-expanded, .lm-plugin .lm-layout-standard { - left: 0; - right: 0; - top: 0; - bottom: 0; } - .lm-plugin .lm-layout-region { - overflow: hidden; - background: #2D3E50; } - .lm-plugin .lm-layout-static, .lm-plugin .lm-layout-scrollable { - position: absolute; } - .lm-plugin .lm-layout-scrollable { - overflow-y: auto; } - .lm-plugin .lm-layout-static { - overflow: hidden; } - .lm-plugin .lm-layout-main .lm-layout-static, .lm-plugin .lm-layout-bottom .lm-layout-static { - left: 0; - right: 0; - top: 0; - bottom: 0; } - .lm-plugin .lm-layout-right .lm-layout-static { - left: 0; - right: 0; - top: 0; - height: 42px; } - .lm-plugin .lm-layout-right .lm-layout-scrollable { - left: 0; - right: 0; - top: 43px; - bottom: 0; } - .lm-plugin .lm-layout-left .lm-layout-static { - left: 0; - right: 0; - bottom: 0; - top: 0; } - .lm-plugin .lm-layout-standard-outside { - position: absolute; } - .lm-plugin .lm-layout-standard-outside .lm-layout-main { - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; } - .lm-plugin .lm-layout-standard-outside .lm-layout-top { - position: absolute; - right: 0; - height: 65px; - top: -65px; - width: 50%; - border-left: 1px solid #496481; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-standard-outside .lm-layout-bottom { - position: absolute; - left: 0; - right: 0; - height: 65px; - top: -65px; - width: 50%; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-standard-outside .lm-layout-right { - position: absolute; - width: 50%; - right: 0; - bottom: -295px; - height: 295px; - border-left: 1px solid #496481; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-standard-outside .lm-layout-left { - position: absolute; - width: 50%; - left: 0; - bottom: 0; - bottom: -295px; - height: 295px; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-right .lm-layout-right { - display: none; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-right .lm-layout-left { - width: 100%; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-left .lm-layout-left { - display: none; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-left .lm-layout-right { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-top .lm-layout-top { - display: none; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-top .lm-layout-bottom { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-bottom .lm-layout-bottom { - display: none; } - .lm-plugin .lm-layout-standard-outside .lm-layout-hide-bottom .lm-layout-top { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-standard-landscape { - position: absolute; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-main { - position: absolute; - left: 290px; - right: 290px; - bottom: 98px; - top: 100px; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-top { - position: absolute; - left: 290px; - right: 290px; - height: 100px; - top: 0; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-bottom { - position: absolute; - left: 290px; - right: 290px; - height: 98px; - bottom: 0; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-right { - position: absolute; - width: 290px; - right: 0; - bottom: 0; - top: 0; - border-left: 1px solid #496481; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-left { - position: absolute; - width: 290px; - left: 0; - bottom: 0; - top: 0; - border-right: 1px solid #496481; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-right .lm-layout-right { - display: none; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-right .lm-layout-main, .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-right .lm-layout-top, .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-right .lm-layout-bottom { - right: 0; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-left .lm-layout-left { - display: none; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-left .lm-layout-main, .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-left .lm-layout-top, .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-left .lm-layout-bottom { - left: 0; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-bottom .lm-layout-bottom { - display: none; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-bottom .lm-layout-main { - bottom: 0; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-top .lm-layout-top { - display: none; } - .lm-plugin .lm-layout-standard-landscape .lm-layout-hide-top .lm-layout-main { - top: 0; } - .lm-plugin .lm-layout-standard-portrait { - position: absolute; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-main { - position: absolute; - left: 0; - right: 0; - bottom: 361px; - top: 65px; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-top { - position: absolute; - right: 0; - height: 65px; - top: 0; - width: 50%; - border-left: 1px solid #496481; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-bottom { - position: absolute; - left: 0; - right: 0; - height: 65px; - width: 50%; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-right { - position: absolute; - width: 50%; - right: 0; - bottom: 0; - height: 361px; - border-left: 1px solid #496481; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-left { - position: absolute; - width: 50%; - left: 0; - bottom: 0; - height: 361px; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-right .lm-layout-right { - display: none; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-right .lm-layout-left { - width: 100%; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-left .lm-layout-left { - display: none; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-left .lm-layout-right { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-right.lm-layout-hide-left .lm-layout-main { - bottom: 0; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-top .lm-layout-top { - display: none; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-top .lm-layout-bottom { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-bottom .lm-layout-bottom { - display: none; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-bottom .lm-layout-top { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-standard-portrait .lm-layout-hide-top.lm-layout-hide-bottom .lm-layout-main { - top: 0; } - .lm-plugin .lm-layout-expanded { - position: fixed; } - @media (orientation: landscape) { - .lm-plugin .lm-layout-expanded .lm-layout-main { - position: absolute; - left: 290px; - right: 290px; - bottom: 98px; - top: 100px; } - .lm-plugin .lm-layout-expanded .lm-layout-top { - position: absolute; - left: 290px; - right: 290px; - height: 100px; - top: 0; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-bottom { - position: absolute; - left: 290px; - right: 290px; - height: 98px; - bottom: 0; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-right { - position: absolute; - width: 290px; - right: 0; - bottom: 0; - top: 0; - border-left: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-left { - position: absolute; - width: 290px; - left: 0; - bottom: 0; - top: 0; - border-right: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-right .lm-layout-right { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-right .lm-layout-main, .lm-plugin .lm-layout-expanded .lm-layout-hide-right .lm-layout-top, .lm-plugin .lm-layout-expanded .lm-layout-hide-right .lm-layout-bottom { - right: 0; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-left .lm-layout-left { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-left .lm-layout-main, .lm-plugin .lm-layout-expanded .lm-layout-hide-left .lm-layout-top, .lm-plugin .lm-layout-expanded .lm-layout-hide-left .lm-layout-bottom { - left: 0; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-bottom .lm-layout-bottom { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-bottom .lm-layout-main { - bottom: 0; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-top .lm-layout-top { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-top .lm-layout-main { - top: 0; } } - @media (orientation: portrait) { - .lm-plugin .lm-layout-expanded .lm-layout-main { - position: absolute; - left: 0; - right: 0; - bottom: 361px; - top: 65px; } - .lm-plugin .lm-layout-expanded .lm-layout-top { - position: absolute; - right: 0; - height: 65px; - top: 0; - width: 50%; - border-left: 1px solid #496481; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-bottom { - position: absolute; - left: 0; - right: 0; - height: 65px; - width: 50%; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-right { - position: absolute; - width: 50%; - right: 0; - bottom: 0; - height: 361px; - border-left: 1px solid #496481; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-left { - position: absolute; - width: 50%; - left: 0; - bottom: 0; - height: 361px; - border-top: 1px solid #496481; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-right .lm-layout-right { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-right .lm-layout-left { - width: 100%; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-left .lm-layout-left { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-left .lm-layout-right { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-right.lm-layout-hide-left .lm-layout-main { - bottom: 0; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-top .lm-layout-top { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-top .lm-layout-bottom { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-bottom .lm-layout-bottom { - display: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-bottom .lm-layout-top { - width: 100%; - border-left: none; } - .lm-plugin .lm-layout-expanded .lm-layout-hide-top.lm-layout-hide-bottom .lm-layout-main { - top: 0; } } - .lm-plugin ::-webkit-scrollbar { - width: 10px; - height: 10px; } - .lm-plugin ::-webkit-scrollbar-track { - border-radius: 0; - background-color: #324458; } - .lm-plugin ::-webkit-scrollbar-thumb { - border-radius: 0; - background-color: #2a3a4b; } - .lm-plugin .lm-btn, .lm-plugin .lm-control-row button { - padding: 0 10px; - line-height: 32px; - border: none; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .lm-plugin .lm-btn, .lm-plugin .lm-control-row button, .lm-plugin .lm-btn:active, .lm-plugin .lm-control-row button:active, .lm-plugin .lm-btn-link:focus, .lm-plugin .lm-btn:hover, .lm-plugin .lm-control-row button:hover { - outline: none !important; } - .lm-plugin .lm-btn-icon { - height: 32px; - width: 32px; - line-height: 32px; - padding: 0; - text-align: center; } - .lm-plugin .lm-btn-link .lm-icon { - font-size: 100%; } - .lm-plugin .lm-btn-link, .lm-plugin .lm-btn-link:active, .lm-plugin .lm-btn-link:focus { - color: #EDF1F2; - text-decoration: none; } - .lm-plugin .lm-btn-link:hover { - color: #3B9AD9; - text-decoration: none; } - .lm-plugin .lm-btn-link-toggle-on { - color: #EDF1F2; } - .lm-plugin .lm-btn-link-toggle-off, .lm-plugin .lm-btn-link-toggle-off:active, .lm-plugin .lm-btn-link-toggle-off:focus { - color: #8ba5ab; } - .lm-plugin .lm-btn-link-toggle-off:hover, .lm-plugin .lm-btn-link-toggle-on:hover { - color: #3B9AD9; } - .lm-plugin .lm-btn-remove, .lm-plugin .lm-btn-remove:active, .lm-plugin .lm-btn-remove:focus { - color: #EDF1F2; - background: #BF3A31; } - .lm-plugin .lm-btn-remove:hover { - color: #3B9AD9; - background: #b5372e; } - .lm-plugin .lm-btn-remove[disabled], .lm-plugin .lm-btn-remove[disabled]:hover, - .lm-plugin .lm-btn-remove[disabled]:active, .lm-plugin .lm-btn-remove[disabled]:focus { - color: #eaeff0; } - .lm-plugin .lm-btn-action, .lm-plugin .lm-btn-action:active, .lm-plugin .lm-btn-action:focus { - color: #EDF1F2; - background: #283848; } - .lm-plugin .lm-btn-action:hover { - color: #3B9AD9; - background: #243140; } - .lm-plugin .lm-btn-action[disabled], .lm-plugin .lm-btn-action[disabled]:hover, - .lm-plugin .lm-btn-action[disabled]:active, .lm-plugin .lm-btn-action[disabled]:focus { - color: #eaeff0; } - .lm-plugin .lm-btn-commit-on, .lm-plugin .lm-btn-commit-on:active, .lm-plugin .lm-btn-commit-on:focus { - color: #ffffff; - background: #293949; } - .lm-plugin .lm-btn-commit-on:hover { - color: #3B9AD9; - background: #253341; } - .lm-plugin .lm-btn-commit-on[disabled], .lm-plugin .lm-btn-commit-on[disabled]:hover, - .lm-plugin .lm-btn-commit-on[disabled]:active, .lm-plugin .lm-btn-commit-on[disabled]:focus { - color: #fcfcfc; } - .lm-plugin .lm-btn-commit-off, .lm-plugin .lm-btn-commit-off:active, .lm-plugin .lm-btn-commit-off:focus { - color: #EDF1F2; - background: #263443; } - .lm-plugin .lm-btn-commit-off:hover { - color: #3B9AD9; - background: #212e3b; } - .lm-plugin .lm-btn-commit-off[disabled], .lm-plugin .lm-btn-commit-off[disabled]:hover, - .lm-plugin .lm-btn-commit-off[disabled]:active, .lm-plugin .lm-btn-commit-off[disabled]:focus { - color: #eaeff0; } - .lm-plugin .lm-btn-remove:hover { - color: #ffffff; } - .lm-plugin .lm-btn-commit-on:hover { - color: #cccccc; } - .lm-plugin .lm-btn-action { - height: 32px; - line-height: 32px; } - .lm-plugin .lm-form-control, .lm-plugin .lm-control-row select, .lm-plugin .lm-control-row button, .lm-plugin .lm-control-row input[type=text] { - width: 100%; - background: #283848; - color: #EDF1F2; - border: none !important; - padding: 0 10px; - line-height: 30px; - height: 32px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - box-shadow: none !important; } - .lm-plugin .lm-form-control:hover, .lm-plugin .lm-control-row select:hover, .lm-plugin .lm-control-row button:hover, .lm-plugin .lm-control-row input:hover[type=text] { - color: #3B9AD9; - background-color: #324458; - border: none; - outline-offset: -1px; - outline: 1px solid #4d6a89; } - .lm-plugin .lm-form-control:active, .lm-plugin .lm-control-row select:active, .lm-plugin .lm-control-row button:active, .lm-plugin .lm-control-row input:active[type=text], .lm-plugin .lm-form-control:focus, .lm-plugin .lm-control-row select:focus, .lm-plugin .lm-control-row button:focus, .lm-plugin .lm-control-row input:focus[type=text] { - color: #EDF1F2; - background-color: #283848; - border: none; - outline-offset: 0; - outline: none; } - .lm-plugin .lm-btn-commit { - text-align: right; - padding-top: 0; - padding-bottom: 0; - padding-right: 10px; - padding-left: 0; - line-height: 32px; - border: none; - overflow: hidden; } - .lm-plugin .lm-btn-commit .lm-icon { - display: block-inline; - line-height: 32px; - margin-right: 10px; - width: 32px; - text-align: center; - float: left; } - .lm-plugin select.lm-form-control, .lm-plugin .lm-control-row select { - background: none; - background-color: #283848; - background-size: 8px 12px; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAMAAACzvE1FAAAADFBMVEUzMzMzMzMzMzMzMzMKAG/3AAAAA3RSTlMAf4C/aSLHAAAAPElEQVR42q3NMQ4AIAgEQTn//2cLdRKppSGzBYwzVXvznNWs8C58CiussPJj8h6NwgorrKRdTvuV9v16Afn0AYFOB7aYAAAAAElFTkSuQmCC); - background-repeat: no-repeat; - background-position: right 10px top 10px; } - .lm-plugin select.lm-form-control:-moz-focusring, .lm-plugin .lm-control-row select:-moz-focusring { - color: transparent; - text-shadow: 0 0 0 #EDF1F2; } - .lm-plugin .lm-control-row { - position: relative; - height: 32px; - background: #2D3E50; - margin-top: 1px; } - .lm-plugin .lm-control-row > span { - line-height: 32px; - display: block; - width: 120px; - text-align: right; - padding: 0 10px; - color: #c1ced2; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-control-row > div:nth-child(2) { - background: #283848; - position: absolute; - left: 120px; - top: 0; - right: 0; - bottom: 0; } - .lm-plugin .lm-control-group { - position: relative; } - .lm-plugin .lm-toggle-button .lm-icon { - display: inline-block; - margin-right: 6px; } - .lm-plugin .lm-toggle-button > div > button:hover { - border-color: #324458 !important; - border: none; - outline-offset: -1px !important; - outline: 1px solid #4d6a89 !important; } - .lm-plugin .lm-slider > div > div:first-child { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - width: 100%; - padding-right: 50px; - display: table; } - .lm-plugin .lm-slider > div > div:first-child > div { - height: 32px; - display: table-cell; - vertical-align: middle; - padding: 0 14px; } - .lm-plugin .lm-slider > div > div:last-child { - position: absolute; - height: 32px; - right: 0; - width: 50px; - top: 0; - bottom: 0; } - .lm-plugin .lm-slider input[type=text] { - text-align: right; } - .lm-plugin .lm-slider input[type=range] { - width: 100%; } - .lm-plugin .lm-toggle-color-picker button { - border: 10px solid #283848 !important; - margin: 0; - text-align: center; - padding-right: 10px; - padding-left: 10px; } - .lm-plugin .lm-toggle-color-picker button:hover { - border-color: #324458 !important; - border: none; - outline-offset: -1px !important; - outline: 1px solid #4d6a89 !important; } - .lm-plugin .lm-toggle-color-picker .lm-color-picker { - position: absolute; - z-index: 100000; - background: #2D3E50; - border-top: 1px solid #2D3E50; - padding-bottom: 5px; - width: 100%; } - .lm-plugin .lm-toggle-color-picker-above .lm-color-picker { - top: -85px; - height: 85px; } - .lm-plugin .lm-toggle-color-picker-below .lm-color-picker { - top: 32px; - height: 80px; } - .lm-plugin .lm-control-subgroup { - margin-top: 1px; } - .lm-plugin .lm-control-subgroup .lm-control-row { - margin-left: 10px !important; } - .lm-plugin .lm-control-subgroup .lm-control-row > span { - width: 110px !important; } - .lm-plugin .lm-control-subgroup .lm-control-row > div:nth-child(2) { - left: 110px !important; } - .lm-plugin .lm-conrol-group-expander { - display: block; - position: absolute; - line-height: 32px; - padding: 0; - left: 0; - top: 0; - width: 120px; - text-align: left; } - .lm-plugin .lm-conrol-group-expander .lm-icon { - line-height: 29px; - width: 31px; - text-align: center; - display: inline-block; - font-size: 100%; } - .lm-plugin .lm-plugin-layout_controls { - position: absolute; - left: 10px; - top: 10px; } - .lm-plugin .lm-plugin-layout_controls > button:first-child { - margin-right: 6px; } - .lm-plugin .lm-empty-control { - display: none; } - .lm-plugin .lm-control .lm-btn-block, .lm-plugin .lm-control .lm-control-row button, .lm-plugin .lm-control-row .lm-control button { - margin-bottom: 0px; - margin-top: 0px; } - .lm-plugin .lm-row-text > div { - line-height: 32px; - text-align: center; } - .lm-plugin .lm-slider-base { - position: relative; - height: 14px; - padding: 5px 0; - width: 100%; - border-radius: 6px; - box-sizing: border-box; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } - .lm-plugin .lm-slider-base * { - box-sizing: border-box; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } - .lm-plugin .lm-slider-base-rail { - position: absolute; - width: 100%; - background-color: #496481; - height: 4px; - border-radius: 2px; } - .lm-plugin .lm-slider-base-track { - position: absolute; - left: 0; - height: 4px; - border-radius: 6px; - background-color: tint(#EDF1F2, 60%); } - .lm-plugin .lm-slider-base-handle { - position: absolute; - margin-left: -11px; - margin-top: -9px; - width: 22px; - height: 22px; - cursor: pointer; - border-radius: 50%; - background-color: #EDF1F2; - border: 4px solid #496481; } - .lm-plugin .lm-slider-base-handle:hover { - background-color: #3B9AD9; } - .lm-plugin .lm-slider-base-mark { - position: absolute; - top: 18px; - left: 0; - width: 100%; - font-size: 12px; } - .lm-plugin .lm-slider-base-mark-text { - position: absolute; - display: inline-block; - vertical-align: middle; - text-align: center; - cursor: pointer; - color: #999; } - .lm-plugin .lm-slider-base-mark-text-active { - color: #666; } - .lm-plugin .lm-slider-base-step { - position: absolute; - width: 100%; - height: 4px; - background: transparent; } - .lm-plugin .lm-slider-base-dot { - position: absolute; - bottom: -2px; - margin-left: -4px; - width: 8px; - height: 8px; - border: 2px solid #e9e9e9; - background-color: #fff; - cursor: pointer; - border-radius: 50%; - vertical-align: middle; } - .lm-plugin .lm-slider-base-dot:first-child { - margin-left: -4px; } - .lm-plugin .lm-slider-base-dot:last-child { - margin-left: -4px; } - .lm-plugin .lm-slider-base-dot-active { - border-color: tint(#EDF1F2, 50%); } - .lm-plugin .lm-slider-base-disabled { - background-color: #e9e9e9; } - .lm-plugin .lm-slider-base-disabled .lm-slider-base-track { - background-color: #ccc; } - .lm-plugin .lm-slider-base-disabled .lm-slider-base-handle, .lm-plugin .lm-slider-base-disabled .lm-slider-base-dot { - border-color: #ccc; - background-color: #fff; - cursor: not-allowed; } - .lm-plugin .lm-slider-base-disabled .lm-slider-base-mark-text, .lm-plugin .lm-slider-base-disabled .lm-slider-base-dot { - cursor: not-allowed !important; } - .lm-plugin .lm-slider-base-vertical { - width: 14px; - height: 100%; - padding: 0 5px; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-rail { - height: 100%; - width: 4px; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-track { - left: 5px; - bottom: 0; - width: 4px; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-handle { - margin-left: -5px; - margin-bottom: -7px; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-mark { - top: 0; - left: 18px; - height: 100%; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-step { - height: 100%; - width: 4px; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-dot { - left: 2px; - margin-bottom: -4px; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-dot:first-child { - margin-bottom: -4px; } - .lm-plugin .lm-slider-base-vertical .lm-slider-base-dot:last-child { - margin-bottom: -4px; } - .lm-plugin .lm-panel-header .lm-panel-expander { - display: block; - width: 100%; - text-align: left; } - .lm-plugin .lm-panel-header { - height: 32px; - border-color: #496481; - position: relative; } - .lm-plugin .lm-panel-header .lm-panel-expander-wrapper { - position: absolute; - top: 0; - left: 0; - right: 64px; } - .lm-plugin .lm-panel-header .lm-panel-expander-wrapper button { - display: block; - width: 100%; - text-align: left; - height: 32px; - line-height: 32px; - border: none; - font-weight: bold; - padding-left: 0; - background: #263443; } - .lm-plugin .lm-panel-header .lm-panel-expander-wrapper button .lm-icon { - display: inline-block; - margin-right: 10px; - width: 32px; - text-align: center; } - .lm-plugin .lm-panel-header .lm-panel-expander-wrapper button:hover { - background: #263443; } - .lm-plugin .lm-panel-header .lm-panel-description-standalone { - width: 64px; } - .lm-plugin .lm-panel-header .lm-panel-description-standalone > .lm-icon { - margin-left: 32px; } - .lm-plugin .lm-panel-header .lm-panel-description-with-action { - width: 32px; - margin-right: 32px; } - .lm-plugin .lm-panel-header .lm-panel-description { - color: #EDF1F2; - float: right; - background: #263443; } - .lm-plugin .lm-panel-header .lm-panel-description > .lm-icon { - display: block; - width: 32px; - height: 32px; - line-height: 32px; - text-align: center; - font-size: 70%; - cursor: default; - background: #263443; - color: #3c4e53; } - .lm-plugin .lm-panel-header .lm-panel-description .lm-panel-description-content { - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; - color: #EDF1F2; - display: none; - position: absolute; - left: 0; - width: 100%; - background: #4d6a89; - min-height: 32px; - z-index: 1000000; - padding: 6px 10px 6px 42px; - text-align: left; } - .lm-plugin .lm-panel-header .lm-panel-description .lm-panel-description-content > .lm-icon { - position: absolute; - width: 32px; - height: 32px; - line-height: 32px; - text-align: center; - font-size: 80%; - cursor: default; - top: 0; - left: 0; } - .lm-plugin .lm-panel-header .lm-panel-description:hover { - color: #3B9AD9; } - .lm-plugin .lm-panel-header .lm-panel-description:hover > .lm-icon { - color: #3B9AD9; } - .lm-plugin .lm-panel-header .lm-panel-description:hover .lm-panel-description-content { - display: block; } - .lm-plugin .lm-panel-body { - background: #394e65; } - .lm-plugin .lm-panel { - margin-bottom: 10px; } - .lm-plugin .lm-transform-view { - padding-top: 10px; } - .lm-plugin .lm-expandable-group-color-stripe { - position: absolute; - left: 0; - top: 30px; - width: 120px; - height: 2px; } - .lm-plugin .lm-description { - padding: 10px; - font-size: 85%; - background: #2D3E50; - text-align: center; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - font-weight: light; - cursor: default; } - .lm-plugin .lm-description:not(:first-child) { - border-top: 1px solid #394e65; } - .lm-plugin .lm-color-picker input { - color: black !important; } - .lm-plugin .lm-no-webgl { - position: absolute; - width: 100%; - height: 100%; - left: 0; - top: 0; - display: table; - text-align: center; } - .lm-plugin .lm-no-webgl > div { - display: table-cell; - vertical-align: middle; - text-align: center; - width: 100%; - height: 100%; } - .lm-plugin .lm-no-webgl > div b { - font-size: 120%; } - .lm-plugin .lm-loader-lm-btn-file { - position: relative; - overflow: hidden; } - .lm-plugin .lm-loader-lm-btn-file input[type=file] { - position: absolute; - top: 0; - right: 0; - min-width: 100%; - min-height: 100%; - font-size: 100px; - text-align: right; - filter: alpha(opacity=0); - opacity: 0; - outline: none; - background: white; - cursor: inherit; - display: block; } - .lm-plugin .lm-entity-tree { - overflow: hidden; - position: absolute; - bottom: 0; - left: 0; - right: 0; - top: 0; - padding-top: 10px; - background: #394e65; } - .lm-plugin .lm-entity-tree .lm-entity-tree-children { - overflow-x: hidden; - overflow-y: auto; - position: absolute; - bottom: 0; - left: 0; - right: 0; - top: 43px; - padding: 10px 0; } - .lm-plugin .lm-entity-store-header { - height: 33px; - position: relative; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-entity-store-header > span { - margin-left: 6px; - display: inline-block; - line-height: 32px; - font-weight: bold; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-entity-store-header button { - display: block !important; - height: 32px !important; - margin: 0 !important; - line-height: 32px !important; - border: none !important; - position: absolute; - top: 0; } - .lm-plugin .lm-entity-store-root { - overflow-x: hidden; - overflow-y: auto; - position: absolute; - bottom: 0; - left: 0; - top: 33px; - right: 0; } - .lm-plugin .lm-entity-tree-entry { - height: 33px; - position: relative; - border-bottom: 1px solid #394e65; } - .lm-plugin .lm-entity-tree-entry-current { - background: #263443 !important; } - .lm-plugin .lm-entity-tree-entry-current .lm-entity-tree-entry-label { - color: #FFFFFF; - font-weight: bold; } - .lm-plugin .lm-entity-tree-entry-current .lm-entity-tree-entry-label .lm-entity-tree-entry-label-tag { - font-weight: normal; } - .lm-plugin .lm-entity-tree-entry-current .lm-entity-tree-entry-label:hover { - color: #3B9AD9; } - .lm-plugin .lm-entity-tree-entry-current-path { - background: #293949 !important; } - .lm-plugin .lm-entity-tree-entry-current-path .lm-entity-tree-entry-label { - color: #f2f2f2; } - .lm-plugin .lm-entity-tree-entry-current-path .lm-entity-tree-entry-label:hover { - color: #3B9AD9; } - .lm-plugin .lm-entity-tree-entry button, .lm-plugin .lm-entity-tree-entry > div { - display: block !important; - height: 32px !important; - margin: 0 !important; - line-height: 32px !important; - border: none !important; - position: absolute; - top: 0; } - .lm-plugin .lm-entity-tree-entry-toggle-group { - width: 32px; - height: 32px; - padding: 0; - left: 0; } - .lm-plugin .lm-entity-tree-entry-toggle-visible { - width: 32px; - right: 0; - padding: 0 !important; - font-size: 80%; } - .lm-plugin .lm-entity-tree-entry-toggle-visible-full, .lm-plugin .lm-entity-tree-entry-toggle-visible-full:focus, .lm-plugin .lm-entity-tree-entry-toggle-visible-full:active { - color: #EDF1F2; } - .lm-plugin .lm-entity-tree-entry-toggle-visible-partial, .lm-plugin .lm-entity-tree-entry-toggle-visible-partial:focus, .lm-plugin .lm-entity-tree-entry-toggle-visible-partial:active { - color: #8ba5ab; } - .lm-plugin .lm-entity-tree-entry-toggle-visible-none, .lm-plugin .lm-entity-tree-entry-toggle-visible-none:focus, .lm-plugin .lm-entity-tree-entry-toggle-visible-none:active { - color: #3c4e53; } - .lm-plugin .lm-entity-tree-entry-remove { - width: 32px; - height: 32px; - right: 32px; - padding: 0 !important; - text-align: center; - font-size: 80%; - color: #3c4e53; } - .lm-plugin .lm-entity-tree-entry-body { - position: absolute; - left: 32px; - border-radius: 0 0 0 8px; - right: 0; - background: #2D3E50; } - .lm-plugin .lm-entity-tree-entry .lm-entity-badge { - width: 32px; - position: absolute; - height: 32px; - left: 0; - top: 0; - border-radius: 0 8px 0 8px; } - .lm-plugin .lm-entity-tree-entry-label-wrap { - right: 64px; - overflow: hidden; - left: 32px; - height: 32px; - position: absolute; } - .lm-plugin .lm-entity-tree-entry-label { - position: absolute; - right: 0; - top: 0; - left: 0; - text-align: left !important; - width: 100%; - padding: 0 10px !important; } - .lm-plugin .lm-entity-tree-entry-label-tag { - color: #b2c3c7; - font-size: 70%; - display: inline-block; - margin-left: 6px; } - .lm-plugin .lm-entity-tree-children-wrap { - padding-left: 8px; } - .lm-plugin .lm-entity-tree-root > .lm-entity-tree-entry { - background: #2D3E50; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-entity-tree-root > .lm-entity-tree-entry .lm-entity-badge { - border-top-right-radius: 0; } - .lm-plugin .lm-entity-tree-root > .lm-entity-tree-entry .lm-entity-tree-entry-label { - font-weight: bold; } - .lm-plugin .lm-entity-tree-root > .lm-entity-tree-entry .lm-entity-tree-entry-toggle-group { - display: none !important; } - .lm-plugin .lm-entity-tree-root > .lm-entity-tree-entry .lm-entity-tree-entry-body { - left: 24px !important; } - .lm-plugin .lm-entity-tree-root > .lm-entity-tree-children-wrap { - margin-top: 10px; - padding-left: 0 !important; } - .lm-plugin .lm-panel .lm-entity-tree-entry-toggle-visible { - position: absolute; - top: 0; - right: 0; - height: 32px; - font-size: 100%; - background: #2D3E50; } - .lm-plugin .lm-layout-hide-right .lm-entity-info { - display: none; } - .lm-plugin .lm-entity-info { - position: absolute; - right: 0; - bottom: 0; - left: 0; - top: 0; - padding-top: 10px; - background: #394e65; } - .lm-plugin .lm-entity-info .lm-entity-badge { - position: absolute; - width: 32px; - height: 32px; - left: 0; - top: 0; - border-bottom: 1px solid #496481; } - .lm-plugin .lm-entity-info > div { - position: relative; - height: 32px; - line-height: 32px; - background: #2D3E50; - border-bottom: 1px solid #496481; - padding: 0 42px; - text-align: center; } - .lm-plugin .lm-entity-info > div > span { - font-weight: bold; } - .lm-plugin .lm-entity-info > div > span > span { - display: inline-block; - margin-left: 6px; - font-size: 80%; - color: #b2c3c7; - font-weight: normal; } - .lm-plugin .lm-entity-info .lm-remove-entity { - position: absolute; - right: 0; - top: 0; } - .lm-plugin .lm-entity-badge { - font-weight: bold; - color: #ccd4e0; - text-align: center; - display: table; - cursor: default; } - .lm-plugin .lm-entity-badge > div { - margin: auto; - display: inline-block; - display: table-cell; - vertical-align: middle; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-entity-badge-Root { - background: #2D3E50; } - .lm-plugin .lm-entity-badge-Group { - background: #d67118; } - .lm-plugin .lm-entity-badge-Data { - background: #6d8082; } - .lm-plugin .lm-entity-badge-Object { - background: #25a25a; } - .lm-plugin .lm-entity-badge-Visual { - background: #258cd1; } - .lm-plugin .lm-entity-badge-Selection { - background: #bf2718; } - .lm-plugin .lm-entity-badge-Action { - background: #22303d; } - .lm-plugin .lm-entity-badge-Behaviour { - background: #804399; } - .lm-plugin .lm-entity-badge-Root { - background-repeat: no-repeat; - background-position: center; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAACKUExURQAAAM4+K84/LM4+K5BhopJboCue1XmKi5RbpSud1R2tcolpRx2scys8Sis8Sn6SlOCFOiqYzhUYMDRPYSue1n6SlMiDTR6ncbVfNd+EOeCEOeCEOeCEORYZMMk/LH6RkxUcMhUYMSs8S32Rkyye1BUZL9+FOVpORWRSRCw8SxYYMB6tcxYZMSw9S+ECnyoAAAArdFJOUwB5/uoyc/FX9DjdS5SzyPT+acsS/fwdWEmk1NidrGb6bq+HgJY7eFVH955mjSdVAAAAn0lEQVQ4y93TyxaCIBCA4alQpFQsSs1Ku997/9drRtoxwV5Ww/m/BXAOAENc8hTonRb+3sn86OkrLfNPVgd6Ox55ezWb8KLUtr+mvLg2kjpAyguxLprbI6ORFVESobjbDSdE0ouSZrPvRQuO2BYbFGbxJmGcQ/wE9sP8nFbuNayoqS9jxT0ECey7f51E5O24Qh0uT3/HO8b+DqDUIH/SF4XSDWWIL+vnAAAAAElFTkSuQmCC); } - .lm-plugin .lm-entity-splash .lm-entity-splash-general { - padding: 6px 10px 6px 66px; - position: relative; - background: #263443; - margin-bottom: 10px; } - .lm-plugin .lm-entity-splash .lm-entity-splash-general .lm-icon { - display: block; - width: 32px; - height: 32px; - line-height: 32px; - position: absolute; - text-align: center; - left: 24px; - top: 0; - font-size: 80%; } - .lm-plugin .lm-entity-splash .lm-entity-splash-general > div { - position: absolute; - width: 56px; - left: 0; - top: 0; - bottom: 0; - background: #2D3E50; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class { - margin-bottom: 1px; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class > div:first-child { - background: #263443; - line-height: 32px; - padding-left: 66px; - font-weight: bold; - position: relative; - cursor: pointer; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class > div:first-child:hover { - color: #3B9AD9; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class > div:first-child > span { - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; - cursor: pointer; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class > div:first-child > div:first-child { - position: absolute; - width: 24px; - height: 32px; - left: 0; - top: 0; - background: #2D3E50; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class > div:first-child > div:nth-child(2) { - position: absolute; - width: 32px; - height: 32px; - left: 24px; - top: 0; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class > div:nth-child(2) { - padding: 6px 10px 6px 66px; - margin-top: 1px; - background: #2D3E50; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class-expanded > div:nth-child(2) { - display: block; } - .lm-plugin .lm-entity-splash .lm-entity-splash-class-collapsed > div:nth-child(2) { - display: none; } - .lm-plugin .lm-task-state { - line-height: 32px; } - .lm-plugin .lm-task-state > span { - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-overlay { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - z-index: 1000; } - .lm-plugin .lm-overlay .lm-overlay-background { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - background: transparent; } - .lm-plugin .lm-overlay .lm-overlay-content-wrap { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - display: block; - width: 100%; - height: 100%; } - .lm-plugin .lm-overlay .lm-overlay-content { - text-align: center; } - .lm-plugin .lm-overlay .lm-overlay-content > div { - padding-top: 64px; } - .lm-plugin .lm-overlay .lm-overlay-content > div .lm-task-state { - text-align: center; } - .lm-plugin .lm-overlay .lm-overlay-content > div .lm-task-state > div { - height: 32px; - margin-top: 10px; - position: relative; - text-align: center; - width: 100%; } - .lm-plugin .lm-overlay .lm-overlay-content > div .lm-task-state > div > div { - height: 32px; - line-height: 32px; - display: inline-block; - background: #2D3E50; - padding: 0 10px; - font-weight: bold; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-overlay .lm-overlay-content > div .lm-task-state > div > button { - display: inline-block; - margin-top: -3px; - font-size: 140%; } - .lm-plugin .lm-background-tasks { - position: absolute; - left: 0; - bottom: 0; - z-index: 1000; } - .lm-plugin .lm-background-tasks .lm-task-state > div { - height: 32px; - margin-top: 1px; - position: relative; - width: 100%; - background: #2D3E50; } - .lm-plugin .lm-background-tasks .lm-task-state > div > div { - height: 32px; - line-height: 32px; - display: inline-block; - padding: 0 10px; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-background-tasks .lm-task-state > div > button { - display: inline-block; - margin-top: -3px; - font-size: 140%; } - .lm-plugin .lm-viewport { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - background: black; } - .lm-plugin .lm-viewport .lm-btn-link { - background: rgba(0, 0, 0, 0.2); } - .lm-plugin .lm-viewport-expanded { - position: fixed; - z-index: 1000; } - .lm-plugin .lm-viewport-host3d { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - -webkit-user-select: none; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-touch-callout: none; } - .lm-plugin .lm-viewport-controls { - position: absolute; - right: 10px; - top: 10px; } - .lm-plugin .lm-viewport-controls-buttons { - text-align: right; } - .lm-plugin .lm-viewport-controls-buttons > button { - padding: 0; - text-align: center; - width: 32px; } - .lm-plugin .lm-viewport-controls-buttons > button:last-child { - margin-left: 10px; } - .lm-plugin .lm-viewport-controls-buttons .lm-btn-link, .lm-plugin .lm-viewport-controls-buttons .lm-btn-link-toggle-on { - color: #eee; } - .lm-plugin .lm-viewport-controls-buttons .lm-btn-link-toggle-off { - color: #8ba5ab; } - .lm-plugin .lm-viewport-controls-buttons .lm-btn-link:hover { - color: #3B9AD9; } - .lm-plugin .lm-viewport-controls-scene-options { - width: 290px; - background: #394e65; } - .lm-plugin .lm-highlight-info { - color: #3B9AD9; - padding: 6px 10px; - background: #2D3E50; - position: absolute; - top: 10px; - left: 10px; - text-align: left; - min-height: 32px; - max-width: 95%; - z-index: 10000; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-highlight-info-additional { - font-size: 85%; - display: inline-block; - color: #1c6392; } - .lm-plugin .lm-log-wrap { - position: absolute; - right: 0; - top: 0; - left: 0; - bottom: 0; - overflow: hidden; } - .lm-plugin .lm-log { - position: absolute; - right: -20px; - top: 0; - left: 0; - bottom: 0; - overflow-y: scroll; - overflow-x: hidden; - font-size: 90%; - background: #394e65; } - .lm-plugin .lm-log { - color: #dee5e7; } - .lm-plugin .lm-log ul { - padding: 0; - margin: 0; } - .lm-plugin .lm-log li { - clear: both; - margin: 0; - background: #2D3E50; - position: relative; } - .lm-plugin .lm-log li:not(:last-child) { - border-bottom: 1px solid #496481; } - .lm-plugin .lm-log .lm-log-entry { - margin-left: 110px; - background: #304255; - padding: 6px 25px 6px 10px; } - .lm-plugin .lm-log .lm-log-timestamp { - padding: 7px 10px 5px 10px; - float: left; - text-align: right; - width: 110px; - color: #b2c3c7; - font-size: 90%; } - .lm-plugin .lm-log .lm-log-timestamp small { - font-size: 90%; } - .lm-plugin .lm-log .label { - margin-top: -3px; - font-size: 7pt; } - .lm-plugin .lm-log-entry-badge { - position: absolute; - left: 0; - top: 0; - bottom: 0; - width: 6px; } - .lm-plugin .lm-log-entry-message { - background: #0CCA5D; } - .lm-plugin .lm-log-entry-info { - background: #5E3673; } - .lm-plugin .lm-log-entry-error { - background: #FD354B; } - .lm-plugin .lm-log-entry-warning { - background: #FCC937; } - .lm-plugin .lm-transformer .lm-entity-badge { - position: absolute; - top: 0; - right: 0; - height: 32px; - line-height: 32px; - width: 32px; } - .lm-plugin .lm-layout-right { - background: #394e65; } - .lm-plugin .lm-transformer-wrapper { - position: relative; } - .lm-plugin .lm-transformer-wrapper .lm-entity-badge { - left: 0; - top: 0; } - .lm-plugin .lm-transformer-wrapper:first-child .lm-panel-description-content { - top: 33px; } - .lm-plugin .lm-transformer-wrapper:not(:first-child) .lm-panel-description-content { - bottom: 33px; } - .lm-plugin .lm-toast-container { - position: absolute; - max-width: 100%; - bottom: 10px; - right: 10px; - margin-left: 10px; - z-index: 1001; } - .lm-plugin .lm-toast-container .lm-toast-entry { - color: #EDF1F2; - background: #394e65; - position: relative; - min-height: 32px; - margin-top: 10px; - border: 1px solid #496481; - display: table; } - .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-title { - height: 100%; - line-height: 32px; - padding: 0 10px; - background: #2D3E50; - font-weight: bold; - display: table-cell; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - font-weight: light; - cursor: pointer; } - .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-message { - padding: 6px 42px 6px 10px; - display: table-cell; } - .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-message a { - text-decoration: none; - color: #ffffff; - font-weight: bold; } - .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-message a:hover { - text-decoration: underline; - color: #cccccc; } - .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-message a:active, .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-message a:focus { - color: #ffffff; - outline-offset: 0; - outline: none; } - .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-hide { - position: absolute; - width: 42px; - right: 0; - top: 0; - bottom: 0; } - .lm-plugin .lm-toast-container .lm-toast-entry .lm-toast-hide .lm-btn-icon { - position: absolute; - top: 0; - right: 0; - left: 0; - bottom: 0; - width: 100%; - text-align: right; - padding-right: 5px; } - .lm-plugin .lm-help-row { - position: relative; - height: 32px; - background: #2D3E50; - margin-top: 1px; - display: table; - width: 100%; } - .lm-plugin .lm-help-row > span { - width: 120px; - text-align: right; - padding: 6px 10px; - color: #c1ced2; - display: table-cell; - font-weight: bold; - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; } - .lm-plugin .lm-help-row > div { - background: #283848; - position: relative; - padding: 6px 10px; - display: table-cell; } - .lm-plugin .lm-logo { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - display: table; - width: 100%; - height: 100%; } - .lm-plugin .lm-logo > div { - display: table-cell; - vertical-align: middle; - text-align: center; } - .lm-plugin .lm-logo > div > div { - display: inline-block; - position: relative; - width: 50%; - max-width: 450px; - height: 130px; } - .lm-plugin .lm-logo > div > div > div { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; } - .lm-plugin .lm-logo > div > div > div:first-child { - background: rgba(0, 0, 0, 0.75); } - .lm-plugin .lm-logo-image { - -webkit-user-select: none; - /* Chrome/Safari */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* IE10+ */ - /* Rules below not implemented in browsers yet */ - -o-user-select: none; - user-select: none; - cursor: default; - margin: 20px; - background-repeat: no-repeat; - background-position: center; - background-size: contain; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAABSCAMAAAASJ/28AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAACuUExURQAAAP7+/v///////6upo////////84/LP7+/v7+/v///////////////7Jod/7+/v///////x5eU/7+/h9TTf///y6e1B4nO/7+/pRcpSue1pRcpX6Skys8Siue1f///yk4RxUYMOCFOR2tcsdJPn+SlM4+K9+BOdJRL84+Kyud1uCFOR2tc3+SlB6sch6tch2tcrfBw////5RcpX+SlCw9S+CFOhYZMR6tcyye1o20WrIAAAAydFJOUwC5VEEKn3z/c9bHFIRoG5jyNB77NCY+lObZ+I3E6VY7bNvX6jSxcLdQ6PGYhJNeb8aMIUgcaQAABuVJREFUeNrt3Oly2zYQAGASBGnxMknTtJmjkZvmcNK67TBOHL//i5XiJRy74AHImk6wfzKREMn6vLgWUBxncdw4NnTi4fHBImj5PVpBTT8rqOtnBbfGx8dHK2jE7+2l1dDyo45zbUG0/O6+31oSLb/vVnBNUNnPCur6WUFdPyuo6/ebnYq1/eyCUM/v08W9FdLyu7CCmn6/tiCNu6B4g7ezfr+0oNd0QbT8Vgi6YfqyHzANpwiwNuTYJjEMqPRz7i9WC4ZN8LKAu2aKGutn0bGNbxZQ6Ue3CC4BLDJyEsAGSf6iORUg4/dR8vvrj6sNgksA66asTgIYwU2yUwGq/X7+3CK4DLDhAeOqMgLYFFCLOD8R4JzfJsFNXXjXuGYAs9kWBgHn/QbBL5PgpxNNIsYA8xj8kU4D+DDv1wt+WCN4XkBoGvGaU2fgR0dav0yAqwXPBVj3f4RyA3+YYMwC3n+moyDgpyF4LkB/6Kh7aQope+CdUcD7Hz9GwYPf7dHvamixVfBsgBhQ0D8eGAVs/UZBxG+z4NkAh0wrY3nN1D1sErDz6wUfML+tgmcDHMc64e1J/6jrGAQc/DpB3G+j4PkA98NsIhQ3+kc9FeA+cMO8zEM38egSwM8/WME7zG+b4KKFdDr+OF7ahduEKRdiP9zvfNd1s7RSAI7rPa6zVdPkjAHGQc0uJLN4HpBygvQW89skuAQwmRLOb+DgtmRxcvyIIcEB07G3cm/VxQ4FTHPhrcuEKgFv3oiCQx8G/LYIrgNMsy6ips64qISPmLsBIWnithNFVGGAtLdgCxW0nmYWEDB2gd9eWCkA33z7xgu+H3IQ9HOcf46C14sE1wHOj4HUPaQdnZKxbHKCAI5Vl0SaQnwHBoxDMP/rAgVs/WBBxG+9oGFAGgl9qgqbkiCAlVRXjY6rawAQ8WtfoUIAOz9A0Lm9Qj/tSkHDgK7A1ZHmFQw4ehGhkho6MOA0Aud+uq8Kkk1jbURBwMEPElTEOkGzgCmwi2/zJkIAiVBXzaYpBAIk47Qxzbw0GKeUAAKkr74hgpfmBI0CxjlU4StKtujCwgxzxliuHSqpfY1LBhw6cO6xr12LdTE2Ay85QUdX8MvlqQGTpoYKfD5bdOFgEq6umrJPSYBDAgpDRJELKciNgVsE764RQdDPKGCbUOCLVWzRhYOp+g1xTtkUK2BAFy5ip0JdjJ+F1wvePT3BgrCfUUBPLg2Mk2sCA44qXRffcyOiCEiR4oMwDIjrQEHwzznB1q8T/FsURPyMAiZQfbR/IkIAPSZ/fK5ILQIWwL6FHQZSZCeyTvD26QkW/Hz5AgtpFz4kOgxfOQI4VK8OXTzmurMEmDIzNLR3S7C98BrBwQ8QNLQXVgOGTVaA0X74GAE8/nXHj3EiYICddcR8Q7mYsFxw8nv63VkqaBKwbvCoEMBjXTXkG4qACXIEMAK6eDVmqSDj14lNgv/SlwKsQyywDBxHvp0nLKqRDPTWZ+BSQd7v5mYSVPkZ7sK7FQXVsXQ4TCOu8MGRMVA+By34rg+eiSwRFPy+vh4FlX4vM4moAPlz9GNhQWznYRXqHT+7wKdy84Ki3/PzIKj2M7yMiTYApixggrYbjzupvMjkBkfkXHhOUPYbBGf8jAISbCGtBGTvEjHFValdBK9jBrBx9YPeTFALMn5Xo18vOBcbAcFUo/mCQVAuEjC32VxFu+GBvHKgGmvmzACigu8/YH6t4NVpAFNky+Hjl04VgMx9SrIgU8MYqPEfUxe/GwMLqvye350oA7FNb1XOvxpQKJ1u9NbKdsHY6riUKULpDpLifiAkCPi9XuO3DbAd0AnSsvSAgmCmBiTyFAK1o9N87ZLD7y8mbjmaxksAAcHDAKjltw2wXbBE2JFILu0VSI4VVIWCSlmpoStmuslrdu7xnEWAkqC+30ZAj7+SQQpmTC/5tS5NysalShin2ndRzHR1x8vBbSL3jupb+oKgwu/1Mr+NgIcN2HQyUflNOAnF7YAWkeNfd212ZXQGZuFY2W5boO02f2469z0RXlDbrwWsIzQqFPBw/JtnqeeRpBXLUz7jmtrfkcNzh0GqJvMwSwGhk3Xh5H72m0qT4CsD+SdspMTYo4DMgVhT+vxHqDKmp4U76hgEbIEi/loCgRfW+DdbRkEzfk4aKGLopPsA+nFikrlR5GZEXtFQL/Gjw3PA7aKif+nZr+7g7YokGi6FhJlc3ar6f6f4HkYvKPu92+L3f4242Bebv6tyEPzF/TSDvrJ+moLWTzusn15cY372/1NdKdj5PVu/rYLWT0+Q779frd9KQT7/rN9qQeunHdZPc0X91frpxXiCZP30BK2fnqD10xO0fpqC1s/GCeI/6y9FSRCu10QAAAAASUVORK5CYII=); } - .lm-plugin .lm-plugin-content { - color: #EDF1F2; } diff --git a/frontend/src/css/style.scss b/frontend/src/css/style.scss index f3a1888fe..3bcd97fd3 100644 --- a/frontend/src/css/style.scss +++ b/frontend/src/css/style.scss @@ -21,7 +21,7 @@ @import "_social.scss"; @import "_spectra.scss"; @import "_blockquotes.scss"; -@import "_litemol.scss"; +@import "_molstar.scss"; @import "_favit.scss"; @import "_lineage.scss"; @import "_scope_report.scss"; diff --git a/frontend/src/index.js b/frontend/src/index.js index 9d9227653..87c13d9f6 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -92,12 +92,12 @@ document.addEventListener("DOMContentLoaded", () => { initSearch(fields, operators, labels) break } - case "litemol": { - // Lazy load LiteMol only when the structure section becomes visible + case "molstar": { + // Lazy load Mol* only when the structure section becomes visible const pdbIds = JSON.parse(element.dataset.pdbIds || "[]") if (!pdbIds || pdbIds.length === 0) { - console.warn("LiteMol init: No PDB IDs provided") + console.warn("Mol* init: No PDB IDs provided") break } @@ -106,17 +106,17 @@ document.addEventListener("DOMContentLoaded", () => { (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { - // Dynamically import LiteMol bundle only when needed - import("./my-litemol.js") + // Dynamically import Mol* bundle only when needed + import("./my-molstar.js") .then((module) => { const initPDB = module.default initPDB(pdbIds) }) .catch((error) => { - console.error("Failed to load LiteMol:", error) + console.error("Failed to load Mol*:", error) if (window.Sentry) { window.Sentry.captureException(error, { - tags: { component: "litemol-lazy-load" }, + tags: { component: "molstar-lazy-load" }, }) } diff --git a/frontend/src/js/pdb/LiteMol-plugin.js b/frontend/src/js/pdb/LiteMol-plugin.js deleted file mode 100644 index fab2ccc24..000000000 --- a/frontend/src/js/pdb/LiteMol-plugin.js +++ /dev/null @@ -1,867 +0,0 @@ -var __LiteMol_Plugin=function(){"use strict";/*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE - * @version 3.2.1 - */ -var e=function(e){"use strict";function t(e){return typeof e==="function"||typeof e==="object"&&e!==null}function r(e){return typeof e==="function"}function n(e){return typeof e==="object"&&e!==null}var i;if(!Array.isArray){i=function(e){return Object.prototype.toString.call(e)==="[object Array]"}}else{i=Array.isArray}var a=i;var o=0;var s;var u;var l=function e(t,r){w[o]=t;w[o+1]=r;o+=2;if(o===2){if(u){u(C)}else{E()}}};function c(e){u=e}function f(e){l=e}var h=typeof window!=="undefined"?window:undefined;var d=h||{};var p=d.MutationObserver||d.WebKitMutationObserver;var m=typeof self==="undefined"&&typeof process!=="undefined"&&{}.toString.call(process)==="[object process]";var v=typeof Uint8ClampedArray!=="undefined"&&typeof importScripts!=="undefined"&&typeof MessageChannel!=="undefined";function y(){return function(){process.nextTick(C)}}function g(){return function(){s(C)}}function b(){var e=0;var t=new p(C);var r=document.createTextNode("");t.observe(r,{characterData:true});return function(){r.data=e=++e%2}}function x(){var e=new MessageChannel;e.port1.onmessage=C;return function(){e.port2.postMessage(0)}}function _(){return function(){setTimeout(C,1)}}var w=new Array(1e3);function C(){for(var e=0;et?1:e=R&&n<=Ri}function F(e){return e.indexOf("(module.js:")!==-1||e.indexOf("(node.js:")!==-1}function V(){if(!A){return}try{throw new Error}catch(n){var e=n.stack.split("\n");var t=e[0].indexOf("@")>0?e[1]:e[2];var r=O(t);if(!r){return}k=r[0];return r[1]}}function O(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t){return[t[1],Number(t[2])]}var r=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(r){return[r[1],Number(r[2])]}var n=/.*@(.+):(\d+)$/.exec(e);if(n){return[n[1],Number(n[2])]}}var U=d.EmptyError=function(){this.message="Sequence contains no elements.";Error.call(this)};U.prototype=Object.create(Error.prototype);U.prototype.name="EmptyError";var N=d.ObjectDisposedError=function(){this.message="Object has been disposed";Error.call(this)};N.prototype=Object.create(Error.prototype);N.prototype.name="ObjectDisposedError";var z=d.ArgumentOutOfRangeError=function(){this.message="Argument out of range";Error.call(this)};z.prototype=Object.create(Error.prototype);z.prototype.name="ArgumentOutOfRangeError";var H=d.NotSupportedError=function(e){this.message=e||"This operation is not supported";Error.call(this)};H.prototype=Object.create(Error.prototype);H.prototype.name="NotSupportedError";var j=d.NotImplementedError=function(e){this.message=e||"This operation is not implemented";Error.call(this)};j.prototype=Object.create(Error.prototype);j.prototype.name="NotImplementedError";var G=d.helpers.notImplemented=function(){throw new j};var W=d.helpers.notSupported=function(){throw new H};var q=typeof Symbol==="function"&&Symbol.iterator||"_es6shim_iterator_";if(h.Set&&typeof(new h.Set)["@@iterator"]==="function"){q="@@iterator"}var X=d.doneEnumerator={done:true,value:r};var Y=d.helpers.isIterable=function(e){return e&&e[q]!==r};var K=d.helpers.isArrayLike=function(e){return e&&e.length!==r};d.helpers.iterator=q;var Q=d.internals.bindCallback=function(e,t,r){if(typeof t==="undefined"){return e}switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}};var Z=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],J=Z.length;var $="[object Arguments]",ee="[object Array]",te="[object Boolean]",re="[object Date]",ne="[object Error]",ie="[object Function]",ae="[object Map]",oe="[object Number]",se="[object Object]",ue="[object RegExp]",le="[object Set]",ce="[object String]",fe="[object WeakMap]";var he="[object ArrayBuffer]",de="[object Float32Array]",pe="[object Float64Array]",me="[object Int8Array]",ve="[object Int16Array]",ye="[object Int32Array]",ge="[object Uint8Array]",be="[object Uint8ClampedArray]",xe="[object Uint16Array]",_e="[object Uint32Array]";var we={};we[de]=we[pe]=we[me]=we[ve]=we[ye]=we[ge]=we[be]=we[xe]=we[_e]=true;we[$]=we[ee]=we[he]=we[te]=we[re]=we[ne]=we[ie]=we[ae]=we[oe]=we[se]=we[ue]=we[le]=we[ce]=we[fe]=false;var Ce=Object.prototype,Ee=Ce.hasOwnProperty,Se=Ce.toString,Te=Math.pow(2,53)-1;var Me=Object.keys||function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=r.length;return function(i){if(typeof i!=="object"&&(typeof i!=="function"||i===null)){throw new TypeError("Object.keys called on non-object")}var a=[],o,s;for(o in i){if(e.call(i,o)){a.push(o)}}if(t){for(s=0;s-1&&e%1===0&&e<=Te}var De=function(){try{Object({toString:0}+"")}catch(e){return function(){return false}}return function(e){return typeof e.toString!=="function"&&typeof(e+"")==="string"}}();function Be(e){return ke(e)&&Ie(e.length)&&!!we[Se.call(e)]}var Le=Array.isArray||function(e){return ke(e)&&Ie(e.length)&&Se.call(e)===ee};function Fe(e,t){var r=-1,n=e.length;while(++ru)){return false}while(++s0){var e=t.dequeue();!e.isCancelled()&&e.invoke()}}je(n,e);function n(){e.call(this)}n.prototype.schedule=function(e,n){var i=new ot(this,e,n,this.now());if(!t){t=new Ct(4);t.enqueue(i);var a=T(r)();t=null;if(a===E){M(a.e)}}else{t.enqueue(i)}return i.disposable};n.prototype.scheduleRequired=function(){return!t};return n}(st);var dt=st.currentThread=new ht;var pt=d.internals.SchedulePeriodicRecursive=function(){function e(e){return function t(r,n){n(0,e._period);var i=T(e._action)(e._state);if(i===E){e._cancel.dispose();M(i.e)}e._state=i}}function t(e,t,r,n){this._scheduler=e;this._state=t;this._period=r;this._action=n}t.prototype.start=function(){var t=new tt;this._cancel=t;t.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,e(this)));return t};return t}();var mt,vt;var yt=function(){var e,t=p;if(!!h.setTimeout){e=h.setTimeout;t=h.clearTimeout}else if(!!h.WScript){e=function(e,t){h.WScript.Sleep(t);e()}}else{throw new H}return{setTimeout:e,clearTimeout:t}}();var gt=yt.setTimeout,bt=yt.clearTimeout;(function(){var e=1,t={},r=false;vt=function(e){delete t[e]};function n(e){if(r){gt(function(){n(e)},0)}else{var i=t[e];if(i){r=true;var a=T(i)();vt(e);r=false;if(a===E){M(a.e)}}}}var i=new RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var a=typeof(a=s&&c&&s.setImmediate)=="function"&&!i.test(a)&&a;function o(){if(!h.postMessage||h.importScripts){return false}var e=false,t=h.onmessage;h.onmessage=function(){e=true};h.postMessage("","*");h.onmessage=t;return e}if(w(a)){mt=function(r){var i=e++;t[i]=r;a(function(){n(i)});return i}}else if(typeof process!=="undefined"&&{}.toString.call(process)==="[object process]"){mt=function(r){var i=e++;t[i]=r;process.nextTick(function(){n(i)});return i}}else if(o()){var u="ms.rx.schedule"+Math.random();var l=function(e){if(typeof e.data==="string"&&e.data.substring(0,u.length)===u){n(e.data.substring(u.length))}};h.addEventListener("message",l,false);mt=function(r){var n=e++;t[n]=r;h.postMessage(u+n,"*");return n}}else if(!!h.MessageChannel){var f=new h.MessageChannel;f.port1.onmessage=function(e){n(e.data)};mt=function(r){var n=e++;t[n]=r;f.port2.postMessage(n);return n}}else if("document"in h&&"onreadystatechange"in h.document.createElement("script")){mt=function(r){var i=h.document.createElement("script");var a=e++;t[a]=r;i.onreadystatechange=function(){n(a);i.onreadystatechange=null;i.parentNode.removeChild(i);i=null};h.document.documentElement.appendChild(i);return a}}else{mt=function(r){var i=e++;t[i]=r;gt(function(){n(i)},0);return i}}})();var xt=function(e){je(t,e);function t(){e.call(this)}function r(e,t,r,n){return function i(){e.setDisposable(Ke._fixup(t(r,n)))}}function n(e){this._id=e;this.isDisposed=false}n.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=true;vt(this._id)}};function i(e){this._id=e;this.isDisposed=false}i.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=true;bt(this._id)}};t.prototype.schedule=function(e,t){var i=new tt,a=mt(r(i,t,this,e));return new nt(i,new n(a))};t.prototype._scheduleFuture=function(e,t,n){if(t===0){return this.schedule(e,n)}var a=new tt,o=gt(r(a,n,this,e),t);return new nt(a,new i(o))};function a(e,t,r){return function(){t(e,r)}}t.prototype.scheduleLongRunning=function(e,t){var r=Qe(p);mt(a(e,t,r));return r};return t}(st);var _t=st["default"]=st.async=new xt;function wt(e,t){this.id=e;this.value=t}wt.prototype.compareTo=function(e){var t=this.value.compareTo(e.value);t===0&&(t=this.id-e.id);return t};var Ct=d.internals.PriorityQueue=function(e){this.items=new Array(e);this.length=0};var Et=Ct.prototype;Et.isHigherPriority=function(e,t){return this.items[e].compareTo(this.items[t])<0};Et.percolate=function(e){if(e>=this.length||e<0){return}var t=e-1>>1;if(t<0||t===e){return}if(this.isHigherPriority(e,t)){var r=this.items[e];this.items[e]=this.items[t];this.items[t]=r;this.percolate(t)}};Et.heapify=function(e){+e||(e=0);if(e>=this.length||e<0){return}var t=2*e+1,r=2*e+2,n=e;if(t0){r=e.queue.shift()}else{e.isAcquired=false;return}var n=T(r)();if(n===E){e.queue=[];e.hasFaulted=true;return M(n.e)}t(e)}t.prototype.ensureActive=function(){var e=false;if(!this.hasFaulted&&this.queue.length>0){e=!this.isAcquired;this.isAcquired=true}e&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,a))};t.prototype.dispose=function(){e.prototype.dispose.call(this);this.disposable.dispose()};return t}(Bt);var Ut=d.ObservableBase=function(e){je(n,e);function t(e){return e&&w(e.dispose)?e:w(e)?Qe(e):Ze}function r(e,r){var n=r[0],i=r[1];var a=T(i.subscribeCore).call(i,n);if(a===E&&!n.fail(E.e)){M(E.e)}n.setDisposable(t(a))}function n(){e.call(this)}n.prototype._subscribe=function(e){var t=new Ci(e),n=[t,this];if(dt.scheduleRequired()){dt.schedule(n,r)}else{r(null,n)}return t};n.prototype.subscribeCore=G;return n}(Vt);var Nt=d.FlatMapObservable=function(e){je(t,e);function t(t,r,n,i){this.resultSelector=w(n)?n:null;this.selector=Q(w(r)?r:function(){return r},i,3);this.source=t;e.call(this)}t.prototype.subscribeCore=function(e){return this.source.subscribe(new r(e,this.selector,this.resultSelector,this))};je(r,Bt);function r(e,t,r,n){this.i=0;this.selector=t;this.resultSelector=r;this.source=n;this.o=e;Bt.call(this)}r.prototype._wrapResult=function(e,t,r){return this.resultSelector?e.map(function(e,n){return this.resultSelector(t,e,r,n)},this):e};r.prototype.next=function(e){var t=this.i++;var r=T(this.selector)(e,t,this.source);if(r===E){return this.o.onError(r.e)}_(r)&&(r=Wn(r));(K(r)||Y(r))&&(r=Vt.from(r));this.o.onNext(this._wrapResult(r,e,t))};r.prototype.error=function(e){this.o.onError(e)};r.prototype.completed=function(){this.o.onCompleted()};return t}(Ut);var zt=d.internals.Enumerable=function(){};function Ht(e){this._s=e;this.isDisposed=false}Ht.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=true;this._s.isDisposed=true}};var jt=function(e){je(t,e);function t(t){this.sources=t;e.call(this)}function r(e,t){if(e.isDisposed){return}var r=T(e.e.next).call(e.e);if(r===E){return e.o.onError(r.e)}if(r.done){return e.o.onCompleted()}var i=r.value;_(i)&&(i=Wn(i));var a=new tt;e.subscription.setDisposable(a);a.setDisposable(i.subscribe(new n(e,t)))}t.prototype.subscribeCore=function(e){var t=new rt;var n={isDisposed:false,o:e,subscription:t,e:this.sources[q]()};var i=dt.scheduleRecursive(n,r);return new it([t,i,new Ht(n)])};function n(e,t){this._state=e;this._recurse=t;Bt.call(this)}je(n,Bt);n.prototype.next=function(e){this._state.o.onNext(e)};n.prototype.error=function(e){this._state.o.onError(e)};n.prototype.completed=function(){this._recurse(this._state)};return t}(Ut);zt.prototype.concat=function(){return new jt(this)};var Gt=function(e){function t(t){this.sources=t;e.call(this)}je(t,e);function r(e,t){if(e.isDisposed){return}var r=T(e.e.next).call(e.e);if(r===E){return e.o.onError(r.e)}if(r.done){return e.lastError!==null?e.o.onError(e.lastError):e.o.onCompleted()}var i=r.value;_(i)&&(i=Wn(i));var a=new tt;e.subscription.setDisposable(a);a.setDisposable(i.subscribe(new n(e,t)))}t.prototype.subscribeCore=function(e){var t=new rt;var n={isDisposed:false,e:this.sources[q](),subscription:t,lastError:null,o:e};var i=dt.scheduleRecursive(n,r);return new it([t,i,new Ht(n)])};function n(e,t){this._state=e;this._recurse=t;Bt.call(this)}je(n,Bt);n.prototype.next=function(e){this._state.o.onNext(e)};n.prototype.error=function(e){this._state.lastError=e;this._recurse(this._state)};n.prototype.completed=function(){this._state.o.onCompleted()};return t}(Ut);zt.prototype.catchError=function(){return new Gt(this)};var Wt=function(e){je(t,e);function t(e,t){this.v=e;this.c=t==null?-1:t}t.prototype[q]=function(){return new r(this)};function r(e){this.v=e.v;this.l=e.c}r.prototype.next=function(){if(this.l===0){return X}if(this.l>0){this.l--}return{done:false,value:this.v}};return t}(zt);var qt=zt.repeat=function(e,t){return new Wt(e,t)};var Xt=function(e){je(t,e);function t(e,t,r){this.s=e;this.fn=t?Q(t,r,3):null}t.prototype[q]=function(){return new r(this)};function r(e){this.i=-1;this.s=e.s;this.l=this.s.length;this.fn=e.fn}r.prototype.next=function(){return++this.irr){return rr}return t}var hr=Vt.from=function(e,t,r,n){if(e==null){throw new Error("iterable cannot be null.")}if(t&&!w(t)){throw new Error("mapFn when provided must be a function")}if(t){var i=Q(t,r,2)}lt(n)||(n=dt);return new tr(e,i,n)};var dr=function(e){je(t,e);function t(t,r){this._args=t;this._scheduler=r;e.call(this)}function r(e,t){var r=t.length;return function n(i,a){if(i0){e.onNext(t);r>0&&r--}if(r===0){return e.onCompleted()}n(r)}return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount,r)};Vt.repeat=function(e,t,r){lt(r)||(r=dt);return new _r(e,t,r)};var Cr=function(e){je(t,e);function t(t,r){this._value=t;this._scheduler=r;e.call(this)}t.prototype.subscribeCore=function(e){var t=[this._value,e];return this._scheduler===ft?r(null,t):this._scheduler.schedule(t,r)};function r(e,t){var r=t[0],n=t[1];n.onNext(r);n.onCompleted() -;return Ze}return t}(Ut);var Er=Vt["return"]=Vt.just=function(e,t){lt(t)||(t=ft);return new Cr(e,t)};var Sr=function(e){je(t,e);function t(t,r){this._error=t;this._scheduler=r;e.call(this)}t.prototype.subscribeCore=function(e){var t=[this._error,e];return this._scheduler===ft?r(null,t):this._scheduler.schedule(t,r)};function r(e,t){var r=t[0],n=t[1];n.onError(r);return Ze}return t}(Ut);var Tr=Vt["throw"]=function(e,t){lt(t)||(t=ft);return new Sr(e,t)};var Mr=function(e){je(t,e);function t(t,r){this.source=t;this._fn=r;e.call(this)}t.prototype.subscribeCore=function(e){var t=new tt,r=new rt;r.setDisposable(t);t.setDisposable(this.source.subscribe(new Ar(e,r,this._fn)));return r};return t}(Ut);var Ar=function(e){je(t,e);function t(t,r,n){this._o=t;this._s=r;this._fn=n;e.call(this)}t.prototype.next=function(e){this._o.onNext(e)};t.prototype.completed=function(){return this._o.onCompleted()};t.prototype.error=function(e){var t=T(this._fn)(e);if(t===E){return this._o.onError(t.e)}_(t)&&(t=Wn(t));var r=new tt;this._s.setDisposable(r);r.setDisposable(t.subscribe(this._o))};return t}(Bt);Ft["catch"]=function(e){return w(e)?new Mr(this,e):Pr([this,e])};var Pr=Vt["catch"]=function(){var e;if(Array.isArray(arguments[0])){e=arguments[0]}else{var t=arguments.length;e=new Array(t);for(var r=0;r0){this.parent.handleSubscribe(this.parent.q.shift())}else{this.parent.activeCount--;this.parent.done&&this.parent.activeCount===0&&this.parent.o.onCompleted()}};return t}(Bt);Ft.merge=function(e){return typeof e!=="number"?Nr(this,e):new Or(this,e)};var Nr=Vt.merge=function(){var e,t=[],r,n=arguments.length;if(!arguments[0]){e=ft;for(r=1;r0}function n(e){return e.shift()}function i(e){return function(t,r){return r!==e}}t.prototype.next=function(e){this._q[this._i].push(e);if(this._q.every(r)){var t=this._q.map(n);var a=T(this._p._cb).apply(null,t);if(a===E){return this._o.onError(a.e)}this._o.onNext(a)}else if(this._d.filter(i(this._i)).every(m)){this._o.onCompleted()}};t.prototype.error=function(e){this._o.onError(e)};t.prototype.completed=function(){this._d[this._i]=true;this._d.every(m)&&this._o.onCompleted()};return t}(Bt);Ft.zip=function(){if(arguments.length===0){throw new Error("invalid arguments")}var e=arguments.length,t=new Array(e);for(var r=0;r0}function n(e){return e.shift()}function i(e){return function(t,r){return r!==e}}t.prototype.next=function(e){this._s.q[this._i].push(e);if(this._s.q.every(r)){var t=this._s.q.map(n),a=T(this._s.cb).apply(null,t);if(a===E){return this._s.o.onError(a.e)}this._s.o.onNext(a)}else if(this._s.done.filter(i(this._i)).every(m)){this._s.o.onCompleted()}};t.prototype.error=function(e){this._s.o.onError(e)};t.prototype.completed=function(){this._s.done[this._i]=true;this._s.done.every(m)&&this._s.o.onCompleted()};return t}(Bt);Ft.zipIterable=function(){if(arguments.length===0){throw new Error("invalid arguments")}var e=arguments.length,t=new Array(e);for(var r=0;rthis._c&&this._o.onNext(this._q.shift())};t.prototype.error=function(e){this._o.onError(e)};t.prototype.completed=function(){this._o.onCompleted()};return t}(Bt);Ft.skipLast=function(e){if(e<0){throw new z}return new wn(this,e)};Ft.startWith=function(){var e,t,r=0;if(!!arguments.length&<(arguments[0])){t=arguments[0];r=1}else{t=ft}for(var n=[],i=r,a=arguments.length;ithis._c&&this._q.shift()};t.prototype.error=function(e){this._o.onError(e)};t.prototype.completed=function(){while(this._q.length>0){this._o.onNext(this._q.shift())}this._o.onCompleted()};return t}(Bt);Ft.takeLast=function(e){if(e<0){throw new z}var t=this;return new wi(function(r){return t.subscribe(new En(r,e))},t)};Ft.flatMapConcat=Ft.concatMap=function(e,t,r){return new Nt(this,e,t,r).merge(1)};var Sn=function(e){je(t,e);function t(t,r,n){this.source=t;this.selector=Q(r,n,3);e.call(this)}function r(e,t){return function(r,n,i){return e.call(this,t.selector(r,n,i),n,i)}}t.prototype.internalMap=function(e,n){return new t(this.source,r(e,this),n)};t.prototype.subscribeCore=function(e){return this.source.subscribe(new n(e,this.selector,this))};je(n,Bt);function n(e,t,r){this.o=e;this.selector=t;this.source=r;this.i=0;Bt.call(this)}n.prototype.next=function(e){var t=T(this.selector)(e,this.i++,this.source);if(t===E){return this.o.onError(t.e)}this.o.onNext(t)};n.prototype.error=function(e){this.o.onError(e)};n.prototype.completed=function(){this.o.onCompleted()};return t}(Ut);Ft.map=Ft.select=function(e,t){var r=typeof e==="function"?e:function(){return e};return this instanceof Sn?this.internalMap(r,t):new Sn(this,r,t)};function Tn(e,t){return function n(i){var a=i;for(var o=0;o0){this._o.onNext(e);this._r<=0&&this._o.onCompleted()}};r.prototype.error=function(e){this._o.onError(e)};r.prototype.completed=function(){this._o.onCompleted()};return t}(Ut);Ft.take=function(e,t){if(e<0){throw new z}if(e===0){return er(t)}return new Rn(this,e)};var kn=function(e){je(t,e);function t(t,r){this.source=t;this._fn=r;e.call(this)}t.prototype.subscribeCore=function(e){return this.source.subscribe(new In(e,this))};return t}(Ut);var In=function(e){je(t,e);function t(t,r){this._o=t;this._p=r;this._i=0;this._r=true;e.call(this)}t.prototype.next=function(e){if(this._r){this._r=T(this._p._fn)(e,this._i++,this._p);if(this._r===E){return this._o.onError(this._r.e)}}if(this._r){this._o.onNext(e)}else{this._o.onCompleted()}};t.prototype.error=function(e){this._o.onError(e)};t.prototype.completed=function(){this._o.onCompleted()};return t}(Bt);Ft.takeWhile=function(e,t){var r=Q(e,t,3);return new kn(this,r)};var Dn=function(e){je(t,e);function t(t,r,n){this.source=t;this.predicate=Q(r,n,3);e.call(this)}t.prototype.subscribeCore=function(e){return this.source.subscribe(new n(e,this.predicate,this))};function r(e,t){return function(r,n,i){return t.predicate(r,n,i)&&e.call(this,r,n,i)}}t.prototype.internalFilter=function(e,n){return new t(this.source,r(e,this),n)};je(n,Bt);function n(e,t,r){this.o=e;this.predicate=t;this.source=r;this.i=0;Bt.call(this)}n.prototype.next=function(e){var t=T(this.predicate)(e,this.i++,this.source);if(t===E){return this.o.onError(t.e)}t&&this.o.onNext(e)};n.prototype.error=function(e){this.o.onError(e)};n.prototype.completed=function(){this.o.onCompleted()};return t}(Ut);Ft.filter=Ft.where=function(e,t){return this instanceof Dn?this.internalFilter(e,t):new Dn(this,e,t)};function Bn(e,t,r,n){var i=new Ti;n.push(Ln(i,t,r));e.apply(t,n);return i.asObservable()}function Ln(e,t,r){return function n(){var i=arguments.length,a=new Array(i);for(var o=0;o0){var o=r.now();i=new Date(i.getTime()+a);i.getTime()<=o&&(i=new Date(o+a))}n.onNext(e);t(e+1,new Date(i))})})}function Jn(e,t,r){return e===t?new wi(function(e){return r.schedulePeriodic(0,t,function(t){e.onNext(t);return t+1})}):Zt(function(){return Zn(new Date(r.now()+e),t,r)})}var $n=Vt.interval=function(e,t){return Jn(e,e,lt(t)?t:_t)};var ei=Vt.timer=function(e,t,n){var i;lt(n)||(n=_t);if(t!=null&&typeof t==="number"){i=t}else if(lt(t)){n=t}if((e instanceof Date||typeof e==="number")&&i===r){return Qn(e,n)}if(e instanceof Date&&i!==r){return Zn(e,t,n)}return Jn(e,i,n)};function ti(e,t,r){return new wi(function(n){var i=false,a=new rt,o=null,s=[],u=false,l;l=e.materialize().timestamp(r).subscribe(function(e){var l,c;if(e.value.kind==="E"){s=[];s.push(e);o=e.value.error;c=!u}else{s.push({value:e.value,timestamp:e.timestamp+t});c=!i;i=true}if(c){if(o!==null){n.onError(o)}else{l=new tt;a.setDisposable(l);l.setDisposable(r.scheduleRecursiveFuture(null,t,function(e,t){var a,l,c,f;if(o!==null){return}u=true;do{c=null;if(s.length>0&&s[0].timestamp-r.now()<=0){c=s.shift().value}if(c!==null){c.accept(n)}}while(c!==null);f=false;l=0;if(s.length>0){f=true;l=Math.max(0,s[0].timestamp-r.now())}else{i=false}a=o;u=false;if(a!==null){n.onError(a)}else if(f){t(null,l)}}))}}});return new nt(l,a)},e)}function ri(e,t,r){return Zt(function(){return ti(e,t-r.now(),r)})}function ni(e,t,r){var n,i;if(w(t)){i=t}else{n=t;i=r}return new wi(function(t){var r=new Xe,a=false,o=new rt;function s(){o.setDisposable(e.subscribe(function(e){var n=T(i)(e);if(n===E){return t.onError(n.e)}var a=new tt;r.add(a);a.setDisposable(n.subscribe(function(){t.onNext(e);r.remove(a);u()},function(e){t.onError(e)},function(){t.onNext(e);r.remove(a);u()}))},function(e){t.onError(e)},function(){a=true;o.dispose();u()}))}function u(){a&&r.length===0&&t.onCompleted()}if(!n){s()}else{o.setDisposable(n.subscribe(s,function(e){t.onError(e)},s))}return new nt(o,r)},e)}Ft.delay=function(){var e=arguments[0];if(typeof e==="number"||e instanceof Date){var t=e,r=arguments[1];lt(r)||(r=_t);return t instanceof Date?ri(this,t,r):ti(this,t,r)}else if(Vt.isObservable(e)||w(e)){return ni(this,e,arguments[1])}else{throw new Error("Invalid arguments")}};var ii=function(e){je(t,e);function t(t,r,n){lt(n)||(n=_t);this.source=t;this._dt=r;this._s=n;e.call(this)}t.prototype.subscribeCore=function(e){var t=new rt;return new nt(this.source.subscribe(new ai(e,this._dt,this._s,t)),t)};return t}(Ut);var ai=function(e){je(t,e);function t(t,r,n,i){this._o=t;this._d=r;this._scheduler=n;this._c=i;this._v=null;this._hv=false;this._id=0;e.call(this)}function r(e,t){t.self._hv&&t.self._id===t.currentId&&t.self._o.onNext(t.x);t.self._hv=false}t.prototype.next=function(e){this._hv=true;this._v=e;var t=++this._id,r=new tt;this._c.setDisposable(r);r.setDisposable(this._scheduler.scheduleFuture(this,this._d,function(r,n){n._hv&&n._id===t&&n._o.onNext(e);n._hv=false}))};t.prototype.error=function(e){this._c.dispose();this._o.onError(e);this._hv=false;this._id++};t.prototype.completed=function(){this._c.dispose();this._hv&&this._o.onNext(this._v);this._o.onCompleted();this._hv=false;this._id++};return t}(Bt);function oi(e,t){return new wi(function(r){var n,i=false,a=new rt,o=0;var s=e.subscribe(function(e){var s=T(t)(e);if(s===E){return r.onError(s.e)}_(s)&&(s=Wn(s));i=true;n=e;o++;var u=o,l=new tt;a.setDisposable(l);l.setDisposable(s.subscribe(function(){i&&o===u&&r.onNext(n);i=false;l.dispose()},function(e){r.onError(e)},function(){i&&o===u&&r.onNext(n);i=false;l.dispose()}))},function(e){a.dispose();r.onError(e);i=false;o++},function(){a.dispose();i&&r.onNext(n);r.onCompleted();i=false;o++});return new nt(s,a)},e)}Ft.debounce=function(){if(w(arguments[0])){return oi(this,arguments[0])}else if(typeof arguments[0]==="number"){return new ii(this,arguments[0],arguments[1])}else{throw new Error("Invalid arguments")}};var si=function(e){je(t,e);function t(t,r){this.source=t;this._s=r;e.call(this)}t.prototype.subscribeCore=function(e){return this.source.subscribe(new ui(e,this._s))};return t}(Ut);var ui=function(e){je(t,e);function t(t,r){this._o=t;this._s=r;e.call(this)}t.prototype.next=function(e){this._o.onNext({value:e,timestamp:this._s.now()})};t.prototype.error=function(e){this._o.onError(e)};t.prototype.completed=function(){this._o.onCompleted()};return t}(Bt);Ft.timestamp=function(e){lt(e)||(e=_t);return new si(this,e)};var li=function(e){je(t,e);function t(t,r){this.source=t;this._sampler=r;e.call(this)}t.prototype.subscribeCore=function(e){var t={o:e,atEnd:false,value:null,hasValue:false,sourceSubscription:new tt};t.sourceSubscription.setDisposable(this.source.subscribe(new fi(t)));return new nt(t.sourceSubscription,this._sampler.subscribe(new ci(t)))};return t}(Ut);var ci=function(e){je(t,e);function t(t){this._s=t;e.call(this)}t.prototype._handleMessage=function(){if(this._s.hasValue){this._s.hasValue=false;this._s.o.onNext(this._s.value)}this._s.atEnd&&this._s.o.onCompleted()};t.prototype.next=function(){this._handleMessage()};t.prototype.error=function(e){this._s.onError(e)};t.prototype.completed=function(){this._handleMessage()};return t}(Bt);var fi=function(e){je(t,e);function t(t){this._s=t;e.call(this)}t.prototype.next=function(e){this._s.hasValue=true;this._s.value=e};t.prototype.error=function(e){this._s.o.onError(e)};t.prototype.completed=function(){this._s.atEnd=true;this._s.sourceSubscription.dispose()};return t}(Bt);Ft.sample=function(e,t){lt(t)||(t=_t);return typeof e==="number"?new li(this,$n(e,t)):new li(this,e)};var hi=d.TimeoutError=function(e){this.message=e||"Timeout has occurred";this.name="TimeoutError";Error.call(this)};hi.prototype=Object.create(Error.prototype);function di(e,t,r,n){if(w(t)){n=r;r=t;t=yr()}Vt.isObservable(n)||(n=Tr(new hi));return new wi(function(i){var a=new rt,o=new rt,s=new tt;a.setDisposable(s);var u=0,l=false;function c(e){var t=u,r=new tt;function s(){l=t===u;return l}o.setDisposable(r);r.setDisposable(e.subscribe(function(){s()&&a.setDisposable(n.subscribe(i));r.dispose()},function(e){s()&&i.onError(e)},function(){s()&&a.setDisposable(n.subscribe(i))}))}c(t);function f(){var e=!l;if(e){u++}return e}s.setDisposable(e.subscribe(function(e){if(f()){i.onNext(e);var t=T(r)(e);if(t===E){return i.onError(t.e)}c(_(t)?Wn(t):t)}},function(e){f()&&i.onError(e)},function(){f()&&i.onCompleted()}));return new nt(a,o)},e)}function pi(e,t,r,n){if(lt(r)){n=r;r=Tr(new hi)}if(r instanceof Error){r=Tr(r)}lt(n)||(n=_t);Vt.isObservable(r)||(r=Tr(new hi));return new wi(function(i){var a=0,o=new tt,s=new rt,u=false,l=new rt;s.setDisposable(o);function c(){var e=a;l.setDisposable(n.scheduleFuture(null,t,function(){u=a===e;if(u){_(r)&&(r=Wn(r));s.setDisposable(r.subscribe(i))}}))}c();o.setDisposable(e.subscribe(function(e){if(!u){a++;i.onNext(e);c()}},function(e){if(!u){a++;i.onError(e)}},function(){if(!u){a++;i.onCompleted()}}));return new nt(s,l)},e)}Ft.timeout=function(){var e=arguments[0];if(e instanceof Date||typeof e==="number"){return pi(this,e,arguments[1],arguments[2])}else if(Vt.isObservable(e)||w(e)){return di(this,e,arguments[1],arguments[2])}else{throw new Error("Invalid arguments")}};Ft.throttle=function(e,t){lt(t)||(t=_t);var r=+e||0;if(r<=0){throw new RangeError("windowDuration cannot be less or equal zero.")}var n=this;return new wi(function(e){var i=0;return n.subscribe(function(n){var a=t.now();if(i===0||a-i>=r){i=a;e.onNext(n)}},function(t){e.onError(t)},function(){e.onCompleted()})},n)};var mi=function(e){je(t,e);function t(t,r){this.source=t;this.controller=new Si;this.paused=true;if(r&&r.subscribe){this.pauser=this.controller.merge(r)}else{this.pauser=this.controller}e.call(this)}t.prototype._subscribe=function(e){var t=this.source.publish(),r=t.subscribe(e),n=Ze;var i=this.pauser.startWith(!this.paused).distinctUntilChanged().subscribe(function(e){if(e){n=t.connect()}else{n.dispose();n=Ze}});return new it([r,n,i])};t.prototype.pause=function(){this.paused=true;this.controller.onNext(false)};t.prototype.resume=function(){this.paused=false;this.controller.onNext(true)};return t}(Vt);Ft.pausable=function(e){return new mi(this,e)};function vi(e,t,r){return new wi(function(n){var i=[false,false],a=false,o=false,s=new Array(2),u;function l(e,t){s[t]=e;i[t]=true;if(a||(a=i.every(m))){if(u){return n.onError(u)}var l=T(r).apply(null,s);if(l===E){return n.onError(l.e)}n.onNext(l)}o&&s[1]&&n.onCompleted()}return new nt(e.subscribe(function(e){l(e,0)},function(e){if(s[1]){n.onError(e)}else{u=e}},function(){o=true;s[1]&&n.onCompleted()}),t.subscribe(function(e){l(e,1)},function(e){n.onError(e)},function(){o=true;l(true,1)}))},e)}var yi=function(e){je(t,e);function t(t,r){this.source=t;this.controller=new Si;this.paused=true;if(r&&r.subscribe){this.pauser=this.controller.merge(r)}else{this.pauser=this.controller}e.call(this)}t.prototype._subscribe=function(e){var t=[],n;function i(){while(t.length>0){e.onNext(t.shift())}}var a=vi(this.source,this.pauser.startWith(!this.paused).distinctUntilChanged(),function(e,t){return{data:e,shouldFire:t}}).subscribe(function(a){if(n!==r&&a.shouldFire!==n){n=a.shouldFire;if(a.shouldFire){i()}}else{n=a.shouldFire;if(a.shouldFire){e.onNext(a.data)}else{t.push(a.data)}}},function(t){i();e.onError(t)},function(){i();e.onCompleted()});return a};t.prototype.pause=function(){this.paused=true;this.controller.onNext(false)};t.prototype.resume=function(){this.paused=false;this.controller.onNext(true)};return t}(Vt);Ft.pausableBuffered=function(e){return new yi(this,e)};var gi=function(e){je(t,e);function t(t,r,n){e.call(this);this.subject=new bi(r,n);this.source=t.multicast(this.subject).refCount()}t.prototype._subscribe=function(e){return this.source.subscribe(e)};t.prototype.request=function(e){return this.subject.request(e==null?-1:e)};return t}(Vt);var bi=function(e){je(t,e);function t(t,r){t==null&&(t=true);e.call(this);this.subject=new Si;this.enableQueue=t;this.queue=t?[]:null;this.requestedCount=0;this.requestedDisposable=null;this.error=null;this.hasFailed=false;this.hasCompleted=false;this.scheduler=r||dt}Ge(t.prototype,It,{_subscribe:function(e){return this.subject.subscribe(e)},onCompleted:function(){this.hasCompleted=true;if(!this.enableQueue||this.queue.length===0){this.subject.onCompleted();this.disposeCurrentRequest()}else{this.queue.push(St.createOnCompleted())}},onError:function(e){this.hasFailed=true;this.error=e;if(!this.enableQueue||this.queue.length===0){this.subject.onError(e);this.disposeCurrentRequest()}else{this.queue.push(St.createOnError(e))}},onNext:function(e){if(this.requestedCount<=0){this.enableQueue&&this.queue.push(St.createOnNext(e))}else{this.requestedCount--===0&&this.disposeCurrentRequest();this.subject.onNext(e)}},_processRequest:function(e){if(this.enableQueue){while(this.queue.length>0&&(e>0||this.queue[0].kind!=="N")){var t=this.queue.shift();t.accept(this.subject);if(t.kind==="N"){e--}else{this.disposeCurrentRequest();this.queue=[]}}}return e},request:function(e){this.disposeCurrentRequest();var t=this;this.requestedDisposable=this.scheduler.schedule(e,function(e,r){var n=t._processRequest(r);var i=t.hasCompleted||t.hasFailed;if(!i&&n>0){t.requestedCount=n;return Qe(function(){t.requestedCount=0})}});return this.requestedDisposable},disposeCurrentRequest:function(){if(this.requestedDisposable){this.requestedDisposable.dispose();this.requestedDisposable=null}}});return t}(Vt);Ft.controlled=function(e,t){if(e&<(e)){t=e;e=true}if(e==null){e=true}return new gi(this,e,t)};Ft.pipe=function(e){var t=this.pausableBuffered();function r(){t.resume()}e.addListener("drain",r);t.subscribe(function(r){!e.write(r)&&t.pause()},function(t){e.emit("error",t)},function(){!e._isStdio&&e.end();e.removeListener("drain",r)});t.resume();return e};var xi=function(e){je(t,e);function t(t,r){this._o=t;this._xform=r;e.call(this)}t.prototype.next=function(e){var t=T(this._xform["@@transducer/step"]).call(this._xform,this._o,e);if(t===E){this._o.onError(t.e)}};t.prototype.error=function(e){this._o.onError(e)};t.prototype.completed=function(){this._xform["@@transducer/result"](this._o)};return t}(Bt);function _i(e){return{"@@transducer/init":function(){return e},"@@transducer/step":function(e,t){return e.onNext(t)},"@@transducer/result":function(e){return e.onCompleted()}}}Ft.transduce=function(e){var t=this;return new wi(function(r){var n=e(_i(r));return t.subscribe(new xi(r,n))},t)};var wi=d.AnonymousObservable=function(e){je(n,e);function t(e){return e&&w(e.dispose)?e:w(e)?Qe(e):Ze}function r(e,r){var n=r[0],i=r[1];var a=T(i.__subscribe).call(i,n);if(a===E&&!n.fail(E.e)){M(E.e)}n.setDisposable(t(a))}function n(t,r){this.source=r;this.__subscribe=t;e.call(this)}n.prototype._subscribe=function(e){var t=new Ci(e),n=[t,this];if(dt.scheduleRequired()){dt.schedule(n,r)}else{r(null,n)}return t};return n}(Vt);var Ci=function(e){je(t,e);function t(t){e.call(this);this.observer=t;this.m=new tt}var r=t.prototype;r.next=function(e){var t=T(this.observer.onNext).call(this.observer,e);if(t===E){this.dispose();M(t.e)}};r.error=function(e){var t=T(this.observer.onError).call(this.observer,e);this.dispose();t===E&&M(t.e)};r.completed=function(){var e=T(this.observer.onCompleted).call(this.observer);this.dispose();e===E&&M(e.e)};r.setDisposable=function(e){this.m.setDisposable(e)};r.getDisposable=function(){return this.m.getDisposable()};r.dispose=function(){e.prototype.dispose.call(this);this.m.dispose()};return t}(Bt);var Ei=function(e,t){this._s=e;this._o=t};Ei.prototype.dispose=function(){if(!this._s.isDisposed&&this._o!==null){var e=this._s.observers.indexOf(this._o);this._s.observers.splice(e,1);this._o=null}};var Si=d.Subject=function(e){je(t,e);function t(){e.call(this);this.isDisposed=false;this.isStopped=false;this.observers=[];this.hasError=false}Ge(t.prototype,It.prototype,{_subscribe:function(e){$e(this);if(!this.isStopped){this.observers.push(e);return new Ei(this,e)}if(this.hasError){e.onError(this.error);return Ze}e.onCompleted();return Ze},hasObservers:function(){$e(this);return this.observers.length>0},onCompleted:function(){$e(this);if(!this.isStopped){this.isStopped=true;for(var e=0,t=C(this.observers),r=t.length;e0},onCompleted:function(){var e,t;$e(this);if(!this.isStopped){this.isStopped=true;var r=C(this.observers),t=r.length;if(this.hasValue){for(e=0;e0},onCompleted:function(){$e(this);if(this.isStopped){return}this.isStopped=true;for(var e=0,t=C(this.observers),r=t.length;e0},_trim:function(e){while(this.q.length>this.bufferSize){this.q.shift()}while(this.q.length>0&&e-this.q[0].interval>this.windowSize){this.q.shift()}},onNext:function(e){$e(this);if(this.isStopped){return}var t=this.scheduler.now();this.q.push({interval:t,value:e});this._trim(t);for(var r=0,n=C(this.observers),i=n.length;r=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;e.current[e.currentIndex++]=r;e.current[e.currentIndex++]=n;e.current[e.currentIndex++]=i;return e.elementCount++}e.add4=r;function n(e,t,r,n){if(e.currentIndex>=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;e.current[e.currentIndex++]=r;e.current[e.currentIndex++]=n;return e.elementCount++}e.add3=n;function i(e,t,r){if(e.currentIndex>=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;e.current[e.currentIndex++]=r;return e.elementCount++}e.add2=i;function a(e,t){if(e.currentIndex>=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;return e.elementCount++}e.add=a;function o(e){var t=e.creator(e.elementSize*e.elementCount),r=(e.parts.length-1)*e.chunkSize,n=0,i;if(e.parts.length>1){if(e.parts[0].buffer){for(var a=0;a=e.chunkSize){t.set(e.current,e.chunkSize*(e.parts.length-1))}else{for(var a=0;a9||a<0)return i*n|0;else n=10*n+a|0}return i*n}e.parseInt=r;function n(e,t,n,i){if(t.charCodeAt(n)===43)n++;return e*Math.pow(10,r(t,n,i))}function i(e,t,r){while(t=0&&u<10){a=a*10+u;++t}else if(u===-2){++t;while(t=0&&u<10){o=10*o+u;s=10*s;++t}else if(u===53||u===21){return n(i*(a+o/s),e,t+1,r)}else{return i*(a+o/s)}}return i*(a+o/s)}else if(u===53||u===21){return n(i*a,e,t+1,r)}else break}return i*a}e.parseFloat=a})(t=e.FastNumberParsers||(e.FastNumberParsers={}))})(t=e.Utils||(e.Utils={}))})(a||(a={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under MIT License, See LICENSE file for more info. - */ -var a;(function(e){var t;(function(e){var t=[];(function(){var e="";for(var r=0;r<512;r++){t[r]=e;e=e+" "}})();var r;(function(e){function r(e){if(e===void 0){e=512}return{chunkData:[],chunkOffset:0,chunkCapacity:e,data:[]}}e.create=r;function n(e){if(!e.data.length){if(e.chunkData.length===e.chunkOffset)return e.chunkData.join("");return e.chunkData.splice(0,e.chunkOffset).join("")}if(e.chunkOffset>0){e.data[e.data.length]=e.chunkData.splice(0,e.chunkOffset).join("")}return e.data.join("")}e.asString=n;function i(e,t){a(e);for(var r=0,n=e.data;r0){if(e.chunkData.length===e.chunkOffset)e.data[e.data.length]=e.chunkData.join("");else e.data[e.data.length]=e.chunkData.splice(0,e.chunkOffset).join("");e.chunkOffset=0}}function o(e){u(e,"\n")}e.newline=o;function s(e,r){u(e,t[r])}e.whitespace=s;function u(e,t){if(t===undefined||t===null){return}if(e.chunkOffset===e.chunkCapacity){e.data[e.data.length]=e.chunkData.join("");e.chunkOffset=0}e.chunkData[e.chunkOffset++]=t}e.write=u;function l(e,t){if(e.chunkOffset===e.chunkCapacity){e.data[e.data.length]=e.chunkData.join("");e.chunkOffset=0}e.chunkData[e.chunkOffset++]=t}e.writeSafe=l;function c(e,r,n){if(r===undefined||r===null){u(e,t[n])}var i=n-r.length;if(i>0)u(e,t[i]);u(e,r)}e.writePadLeft=c;function f(e,r,n){if(r===undefined||r===null){u(e,t[n])}var i=n-r.length;u(e,r);if(i>0)u(e,t[i])}e.writePadRight=f;function h(e,t){u(e,""+t)}e.writeInteger=h;function d(e,r,n){var i=""+r;var a=n-i.length;if(a>0)u(e,t[a]);u(e,i)}e.writeIntegerPadLeft=d;function p(e,r,n){var i=""+r;var a=n-i.length;u(e,i);if(a>0)u(e,t[a])}e.writeIntegerPadRight=p;function m(e,t,r){u(e,""+Math.round(r*t)/r)}e.writeFloat=m;function v(e,r,n,i){var a=""+Math.round(n*r)/n;var o=i-a.length;if(o>0)u(e,t[o]);u(e,a)}e.writeFloatPadLeft=v;function y(e,r,n,i){var a=""+Math.round(n*r)/n;var o=i-a.length;u(e,a);if(o>0)u(e,t[o])}e.writeFloatPadRight=y})(r=e.StringWriter||(e.StringWriter={}))})(t=e.Utils||(e.Utils={}))})(a||(a={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under MIT License, See LICENSE file for more info. - */ -var a;(function(e){"use strict";var t=function(){function e(){this.isDefined=false}e.prototype.getString=function(e){return null};e.prototype.getInteger=function(e){return 0};e.prototype.getFloat=function(e){return 0};e.prototype.getValuePresence=function(e){return 1};e.prototype.areValuesEqual=function(e,t){return true};e.prototype.stringEquals=function(e,t){return t===null};return e}();e.UndefinedColumn=new t;var r;(function(e){function t(e,t,r,n,i){var a=[];for(var o=1;o<=r;o++){var s=[];for(var u=1;u<=n;u++){s[u-1]=e.getColumn(t+"["+o+"]["+u+"]").getFloat(i)}a[o-1]=s}return a}e.getMatrix=t;function r(e,t,r,n,i){var a=[];for(var o=1;o<=r;o++){a[o-1]=e.getColumn(t+"["+o+"]").getFloat(i)}return a}e.getVector=r})(r=e.Category||(e.Category={}))})(a||(a={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under MIT License, See LICENSE file for more info. - */ -var a;(function(e){"use strict";var t;(function(e){function t(e,t){if(t===void 0){t=-1}return new r(e,t)}e.error=t;function i(e,t){if(t===void 0){t=[]}return new n(e,t)}e.success=i})(t=e.ParserResult||(e.ParserResult={}));var r=function(){function e(e,t){this.message=e;this.line=t;this.isError=true}e.prototype.toString=function(){if(this.line>=0){return"[Line "+this.line+"] "+this.message}return this.message};return e}();e.ParserError=r;var n=function(){function e(e,t){this.result=e;this.warnings=t;this.isError=false}return e}();e.ParserSuccess=n})(a||(a={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under MIT License, See LICENSE file for more info. - */ -/* - * Copyright (c) 2016 - now David Sehnal, licensed under MIT License, See LICENSE file for more info. - */ -var a;(function(e){var t;(function(t){"use strict";var r;(function(e){function t(){return Object.create(null)}e.create=t;function r(e,t){if(t.length>6)return t;var r=e[t];if(r!==void 0)return r;e[t]=t;return t}e.get=r})(r||(r={}));var n=function(){function e(e){this.dataBlocks=[];this.data=e}e.prototype.toJSON=function(){return this.dataBlocks.map(function(e){return e.toJSON()})};return e}();t.File=n;var i=function(){function e(e,t){this.header=t;this.data=e;this.categoryList=[];this.additionalData={};this.categoryMap=new Map}Object.defineProperty(e.prototype,"categories",{get:function(){return this.categoryList},enumerable:true,configurable:true});e.prototype.getCategory=function(e){return this.categoryMap.get(e)};e.prototype.addCategory=function(e){this.categoryList[this.categoryList.length]=e;this.categoryMap.set(e.name,e)};e.prototype.toJSON=function(){return{id:this.header,categories:this.categoryList.map(function(e){return e.toJSON()}),additionalData:this.additionalData}};return e}();t.DataBlock=i;var a=function(){function t(e,t,r,n,i,a,o){this.name=t;this.tokens=a;this.data=e;this.startIndex=r;this.endIndex=n;this.columnCount=i.length;this.rowCount=o/i.length|0;this.columnIndices=new Map;this.columnNameList=[];for(var s=0;s=e.tokensLenMinus2){t(e)}e.tokens[e.count++]=r;e.tokens[e.count++]=n}e.addToken=r;function n(e){return{tokensLenMinus2:e-2|0,count:0,tokens:new Int32Array(e)}}e.create=n})(r||(r={}));function n(e){while(e.position=e.length){e.currentTokenType=6;return}e.currentTokenStart=e.position;e.currentTokenEnd=e.position;e.isEscaped=false;var r=e.data.charCodeAt(e.position);switch(r){case 35:o(e);e.currentTokenType=5;break;case 34:case 39:i(e,r);e.currentTokenType=3;break;case 59:if(t===10||t===13){a(e)}else{n(e)}e.currentTokenType=3;break;default:n(e);if(e.isEscaped){e.currentTokenType=3}else if(e.data.charCodeAt(e.currentTokenStart)===95){e.currentTokenType=4}else if(e.currentTokenEnd-e.currentTokenStart>=5&&e.data.charCodeAt(e.currentTokenStart+4)===95){if(u(e))e.currentTokenType=0;else if(l(e))e.currentTokenType=1;else if(c(e))e.currentTokenType=2;else e.currentTokenType=3}else{e.currentTokenType=3}break}}function v(e){m(e);while(e.currentTokenType===5)m(e)}function y(e){return{data:e,length:e.length,position:0,currentTokenStart:0,currentTokenEnd:0,currentTokenType:6,currentLineNumber:1,isEscaped:false}}function g(e,n){var i=e.currentTokenStart,a=h(e),o=d(e,a),s,u=[],l=r.create(512),c=0,m=true;while(m){if(e.currentTokenType!==4||!f(e,i,a)){m=false;break}s=p(e);v(e);if(e.currentTokenType!==3){return{hasError:true,errorLine:e.currentLineNumber,errorMessage:"Expected value."}}u[u.length]=s;r.addToken(l,e.currentTokenStart,e.currentTokenEnd);c++;v(e)}n.addCategory(new t.Category(n.data,o,i,e.currentTokenStart,u,l.tokens,c));return{hasError:false,errorLine:0,errorMessage:""}}function b(e,n){var i=e.currentTokenStart,a=e.currentLineNumber;v(e);var o=d(e,h(e)),s=[],u=r.create(o==="_atom_site"?n.data.length/1.85|0:1024),l=0;while(e.currentTokenType===4){s[s.length]=p(e);v(e)}while(e.currentTokenType===3){r.addToken(u,e.currentTokenStart,e.currentTokenEnd);l++;v(e)}if(l%s.length!==0){return{hasError:true,errorLine:e.currentLineNumber,errorMessage:"The number of values for loop starting at line "+a+" is not a multiple of the number of columns."}}n.addCategory(new t.Category(n.data,o,i,e.currentTokenStart,s,u.tokens,l));return{hasError:false,errorLine:0,errorMessage:""}}function x(t,r){return e.ParserResult.error(r,t)}function _(t){return e.ParserResult.success(t)}function w(e){var r=y(e),n,i,a=new t.File(e),o=new t.DataBlock(e,"default"),s=new t.DataBlock(e,"empty"),u=false,l;v(r);while(r.currentTokenType!==6){var c=r.currentTokenType;if(c===0){if(u){return x(r.currentLineNumber,"Unexpected data block inside a save frame.")}if(o.categories.length>0){a.dataBlocks.push(o)}o=new t.DataBlock(e,e.substring(r.currentTokenStart+5,r.currentTokenEnd));v(r)}else if(c===1){i=e.substring(r.currentTokenStart+5,r.currentTokenEnd);if(i.length===0){if(s.categories.length>0){l=o.additionalData["saveFrames"];if(!l){l=[];o.additionalData["saveFrames"]=l}l[l.length]=s}u=false}else{if(u){return x(r.currentLineNumber,"Save frames cannot be nested.")}u=true;s=new t.DataBlock(e,i)}v(r)}else if(c===2){n=b(r,u?s:o);if(n.hasError){return x(n.errorLine,n.errorMessage)}}else if(c===4){n=g(r,u?s:o);if(n.hasError){return x(n.errorLine,n.errorMessage)}}else{return x(r.currentLineNumber,"Unexpected token. Expected data_, loop_, or data name.")}}if(u){return x(r.currentLineNumber,"Unfinished save frame (`"+s.header+"`).")}if(o.categories.length>0){a.dataBlocks.push(o)}return _(a)}function C(e){return w(e)}t.parse=C})(t=e.Text||(e.Text={}))})(a||(a={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under MIT License, See LICENSE file for more info. - */ -var a;(function(e){var t;(function(t){"use strict";var r=e.Utils.StringWriter;var n=function(){function e(){this.writer=r.create();this.encoded=false;this.dataBlockCreated=false}e.prototype.startDataBlock=function(e){this.dataBlockCreated=true;r.write(this.writer,"data_"+(e||"").replace(/[ \n\t]/g,"").toUpperCase()+"\n#\n")};e.prototype.writeCategory=function(e,t){if(this.encoded){throw new Error("The writer contents have already been encoded, no more writing.")}if(!this.dataBlockCreated){throw new Error("No data block created.")}var r=!t||!t.length?[e(void 0)]:t.map(function(t){return e(t)});var n=r.filter(function(e){return e&&e.count>0});if(!n.length)return;var i=n.reduce(function(e,t){return e+(t.count===void 0?1:t.count)},0);if(!i)return;else if(i===1){a(n[0],this.writer)}else{o(n,this.writer)}};e.prototype.encode=function(){this.encoded=true};e.prototype.flush=function(e){r.writeTo(this.writer,e)};return e}();t.Writer=n;function i(e){return!!e&&e.indexOf("\n")>=0}function a(e,t){var n=e.desc.fields;var a=e.data;var o=n.reduce(function(e,t){return Math.max(e,t.name.length)},0)+e.desc.name.length+5;for(var s=0,u=n;s, MIT License, Copyright (c) 2016 - */ -function t(e,t){var r={};for(var n=0;n, MIT License, Copyright (c) 2016 - */ -function t(e){var t=new ArrayBuffer(r(e));var i=new DataView(t);var a=new Uint8Array(t);n(e,i,a,0);return a}e.encode=t;function r(t){var n=typeof t;if(n==="string"){var i=e.utf8ByteCount(t);if(i<32){return 1+i}if(i<256){return 2+i}if(i<65536){return 3+i}if(i<4294967296){return 5+i}}if(t instanceof Uint8Array){var a=t.byteLength;if(a<256){return 2+a}if(a<65536){return 3+a}if(a<4294967296){return 5+a}}if(n==="number"){if(Math.floor(t)!==t)return 9;if(t>=0){if(t<128)return 1;if(t<256)return 2;if(t<65536)return 3;if(t<4294967296)return 5;throw new Error("Number too big 0x"+t.toString(16))}if(t>=-32)return 1;if(t>=-128)return 2;if(t>=-32768)return 3;if(t>=-2147483648)return 5;throw new Error("Number too small -0x"+t.toString(16).substr(1))}if(n==="boolean"||t===null||t===void 0)return 1;if(n==="object"){var o,s=0;if(Array.isArray(t)){o=t.length;for(var u=0;u=0){if(t<128){r.setUint8(a,t);return 1}if(t<256){r.setUint8(a,204);r.setUint8(a+1,t);return 2}if(t<65536){r.setUint8(a,205);r.setUint16(a+1,t);return 3}if(t<4294967296){r.setUint8(a,206);r.setUint32(a+1,t);return 5}throw new Error("Number too big 0x"+t.toString(16))}if(t>=-32){r.setInt8(a,t);return 1}if(t>=-128){r.setUint8(a,208);r.setInt8(a+1,t);return 2}if(t>=-32768){r.setUint8(a,209);r.setInt16(a+1,t);return 3}if(t>=-2147483648){r.setUint8(a,210);r.setInt32(a+1,t);return 5}throw new Error("Number too small -0x"+(-t).toString(16).substr(1))}if(t===null||t===undefined){r.setUint8(a,192);return 1}if(o==="boolean"){r.setUint8(a,t?195:194);return 1}if(o==="object"){var c,f=0;var h=Array.isArray(t);var d=void 0;if(h){c=t.length}else{d=Object.keys(t);c=d.length}if(c<16){r.setUint8(a,c|(h?144:128));f=1}else if(c<65536){r.setUint8(a,h?220:222);r.setUint16(a+1,c);f=3}else if(c<4294967296){r.setUint8(a,h?221:223);r.setUint32(a+1,c);f=5}if(h){for(var p=0;p, MIT License, Copyright (c) 2016 - */ -function t(e,t,r){var n=e.byteLength;for(var i=0,a=r.length;i>>0&127|0;continue}if(o<2048){e[t++]=o>>>6&31|192;e[t++]=o>>>0&63|128;continue}if(o<65536){e[t++]=o>>>12&15|224;e[t++]=o>>>6&63|128;e[t++]=o>>>0&63|128;continue}if(o<1114112){e[t++]=o>>>18&7|240;e[t++]=o>>>12&63|128;e[t++]=o>>>6&63|128;e[t++]=o>>>0&63|128;continue}throw new Error("bad codepoint "+o)}}e.utf8Write=t;var r=function(){var e=[];for(var t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();function n(e){throw new Error(e)}function i(e,t,i){var a=r;var o=void 0,s=[],u=512,l=0;for(var c=t,f=t+i;c0){o[o.length]=s.slice(0,l).join("")}return o.join("")}e.utf8Read=i;function a(e){var t=0;for(var r=0,i=e.length;r, MIT License, Copyright (c) 2016 - */ -function t(e){var t=e.data;for(var n=e.encoding.length-1;n>=0;n--){t=r.decodeStep(t,e.encoding[n])}return t}e.decode=t;var r;(function(e){function r(e,t){switch(t.kind){case"ByteArray":{switch(t.type){case 4:return e;case 1:return o(e);case 2:return l(e);case 5:return c(e);case 3:return f(e);case 6:return h(e);case 32:return d(e);case 33:return p(e);default:throw new Error("Unsupported ByteArray type.")}}case"FixedPoint":return m(e,t);case"IntervalQuantization":return v(e,t);case"RunLength":return y(e,t);case"Delta":return g(e,t);case"IntegerPacking":return _(e,t);case"StringArray":return w(e,t)}}e.decodeStep=r;function n(e,t){switch(e){case 1:return new Int8Array(t);case 2:return new Int16Array(t);case 3:return new Int32Array(t);case 4:return new Uint8Array(t);case 5:return new Uint16Array(t);case 6:return new Uint32Array(t);default:throw new Error("Unsupported integer data type.")}}function i(e,t){switch(e){case 32:return new Float32Array(t);case 33:return new Float64Array(t);default:throw new Error("Unsupported floating data type.")}}var a=function(){var e=new ArrayBuffer(2);var t=new Uint8Array(e);var r=new Uint16Array(e);t[0]=170;t[1]=187;if(r[0]===48042)return true;return false}();function o(e){return new Int8Array(e.buffer,e.byteOffset)}function s(e,t){var r=new ArrayBuffer(e.length);var n=new Uint8Array(r);for(var i=0,a=e.length;i, MIT License, Copyright (c) 2016 - */ -var r=function(){function e(e){this.providers=e}e.prototype.and=function(t){return new e(this.providers.concat([t]))};e.prototype.encode=function(e){var t=[];for(var r=0,n=this.providers;r=n)l[c]=i;else l[c]=Math.round((h-r)/u)|0}return{encodings:[{kind:"IntervalQuantization",min:r,max:n,numSteps:i,srcType:o}],data:l}}function h(e,t,r,n){if(n===void 0){n=Int32Array}return function(i){return f(i,e,t,r,n)}}r.intervalQuantizaiton=h;function d(e){var r=t.Encoding.getDataType(e);if(r===void 0){e=new Int32Array(e);r=3}if(!e.length){return{encodings:[{kind:"RunLength",srcType:r,srcSize:0}],data:new Int32Array(0)}}var n=2;for(var i=1,a=e.length;i0){n+=Math.ceil(o/t);if(o%t===0)n+=1}else{n+=Math.ceil(o/r);if(o%r===0)n+=1}}return n}function y(e){var t=m(e);var r=t?v(e,127):v(e,255);var n=t?v(e,32767):v(e,65535);if(e.length*4=0){while(l>=r){a[o]=r;++o;l-=r}}else{while(l<=n){a[o]=n;++o;l-=n}}a[o]=l;++o}var c=u(a);return{encodings:[{kind:"IntegerPacking",byteCount:t.bytesPerElement,isUnsigned:!t.isSigned,srcSize:i},c.encodings[0]],data:c.data}}function b(e){if(!(e instanceof Int32Array)){throw new Error("Integer packing can only be applied to Int32 data.")}var t=y(e);if(t.bytesPerElement===4){return u(e)}return g(e,t)}r.integerPacking=b;function x(t){var n=Object.create(null);var i=[];var a=0;var o=e.Utils.ChunkedArray.create(function(e){return new Int32Array(e)},1024,1);var s=new Int32Array(t.length);e.Utils.ChunkedArray.add(o,0);var u=0;for(var l=0,c=t;lt[r])return false}return true}function n(n){var i=[0,3];try{var a=new Uint8Array(n);var o=t.MessagePack.decode(a);if(!r(i,o.version.match(/(\d)\.(\d)\.\d/).slice(1))){return e.ParserResult.error("Unsupported format version. Current "+o.version+", required "+i.join(".")+".")}var s=new t.File(o);return e.ParserResult.success(s)}catch(t){return e.ParserResult.error(""+t)}}t.parse=n})(t=e.Binary||(e.Binary={}))})(a||(a={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under MIT License, See LICENSE file for more info. - */ -var a;(function(e){var t;(function(e){"use strict";function t(t,r,n){var i,a=false;if(t.typedArray){i=new t.typedArray(n)}else{a=true;i=new Array(n)}var o=new Uint8Array(n);var s=t.presence;var u=t.number?t.number:t.string;var l=true;var c=0;for(var f=0,h=r;f0});if(!i.length)return;var a=i.reduce(function(e,t){return e+t.count},0);if(!a)return;var o=i[0];var s={name:o.desc.name,columns:[],rowCount:a};var u=i.map(function(e){return{data:e.data,count:e.count}});for(var l=0,c=o.desc.fields;l0?1:+e}}e.log=function(){console.log.apply(console,arguments)};e.warn=function(){console.warn.apply(console,arguments)};e.error=function(){console.error.apply(console,arguments)};e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};e.CullFaceNone=0;e.CullFaceBack=1;e.CullFaceFront=2;e.CullFaceFrontBack=3;e.FrontFaceDirectionCW=0;e.FrontFaceDirectionCCW=1;e.BasicShadowMap=0;e.PCFShadowMap=1;e.PCFSoftShadowMap=2;e.FrontSide=0;e.BackSide=1;e.DoubleSide=2;e.NoShading=0;e.FlatShading=1;e.SmoothShading=2;e.NoColors=0;e.FaceColors=1;e.VertexColors=2;e.NoBlending=0;e.NormalBlending=1;e.AdditiveBlending=2;e.SubtractiveBlending=3;e.MultiplyBlending=4;e.CustomBlending=5;e.AddEquation=100;e.SubtractEquation=101;e.ReverseSubtractEquation=102;e.MinEquation=103;e.MaxEquation=104;e.ZeroFactor=200;e.OneFactor=201;e.SrcColorFactor=202;e.OneMinusSrcColorFactor=203;e.SrcAlphaFactor=204;e.OneMinusSrcAlphaFactor=205;e.DstAlphaFactor=206;e.OneMinusDstAlphaFactor=207;e.DstColorFactor=208;e.OneMinusDstColorFactor=209;e.SrcAlphaSaturateFactor=210;e.MultiplyOperation=0;e.MixOperation=1;e.AddOperation=2;e.UVMapping=300;e.CubeReflectionMapping=301;e.CubeRefractionMapping=302;e.EquirectangularReflectionMapping=303;e.EquirectangularRefractionMapping=304;e.SphericalReflectionMapping=305;e.RepeatWrapping=1e3;e.ClampToEdgeWrapping=1001;e.MirroredRepeatWrapping=1002;e.NearestFilter=1003;e.NearestMipMapNearestFilter=1004;e.NearestMipMapLinearFilter=1005;e.LinearFilter=1006;e.LinearMipMapNearestFilter=1007;e.LinearMipMapLinearFilter=1008;e.UnsignedByteType=1009;e.ByteType=1010;e.ShortType=1011;e.UnsignedShortType=1012;e.IntType=1013;e.UnsignedIntType=1014;e.FloatType=1015;e.HalfFloatType=1025;e.UnsignedShort4444Type=1016;e.UnsignedShort5551Type=1017;e.UnsignedShort565Type=1018;e.AlphaFormat=1019;e.RGBFormat=1020;e.RGBAFormat=1021;e.LuminanceFormat=1022;e.LuminanceAlphaFormat=1023;e.RGBEFormat=e.RGBAFormat;e.RGB_S3TC_DXT1_Format=2001;e.RGBA_S3TC_DXT1_Format=2002;e.RGBA_S3TC_DXT3_Format=2003;e.RGBA_S3TC_DXT5_Format=2004;e.RGB_PVRTC_4BPPV1_Format=2100;e.RGB_PVRTC_2BPPV1_Format=2101;e.RGBA_PVRTC_4BPPV1_Format=2102;e.RGBA_PVRTC_2BPPV1_Format=2103;e.Projector=function(){e.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js.");this.projectVector=function(t,r){e.warn("THREE.Projector: .projectVector() is now vector.project().");t.project(r)};this.unprojectVector=function(t,r){e.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");t.unproject(r)};this.pickingRay=function(t,r){e.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}};e.CanvasRenderer=function(){e.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js");this.domElement=document.createElement("canvas");this.clear=function(){};this.render=function(){};this.setClearColor=function(){};this.setSize=function(){}};e.Color=function(e){if(arguments.length===3){return this.setRGB(arguments[0],arguments[1],arguments[2])}return this.set(e)};e.Color.prototype={constructor:e.Color,r:1,g:1,b:1,set:function(t){if(t instanceof e.Color){this.copy(t)}else if(typeof t==="number"){this.setHex(t)}else if(typeof t==="string"){this.setStyle(t)}return this},setHex:function(e){e=Math.floor(e);this.r=(e>>16&255)/255;this.g=(e>>8&255)/255;this.b=(e&255)/255;return this},setRGB:function(e,t,r){this.r=e;this.g=t;this.b=r;return this},setHSL:function(e,t,r){if(t===0){this.r=this.g=this.b=r}else{var n=function(e,t,r){if(r<0)r+=1;if(r>1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*6*(2/3-r);return e};var i=r<=.5?r*(1+t):r+t-r*t;var a=2*r-i;this.r=n(a,i,e+1/3);this.g=n(a,i,e);this.b=n(a,i,e-1/3)}return this},setStyle:function(t){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(t)){var r=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(t);this.r=Math.min(255,parseInt(r[1],10))/255;this.g=Math.min(255,parseInt(r[2],10))/255;this.b=Math.min(255,parseInt(r[3],10))/255;return this}if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(t)){var r=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(t);this.r=Math.min(100,parseInt(r[1],10))/100;this.g=Math.min(100,parseInt(r[2],10))/100;this.b=Math.min(100,parseInt(r[3],10))/100;return this}if(/^\#([0-9a-f]{6})$/i.test(t)){var r=/^\#([0-9a-f]{6})$/i.exec(t);this.setHex(parseInt(r[1],16));return this}if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(t)){var r=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t);this.setHex(parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3],16));return this}if(/^(\w+)$/i.test(t)){this.setHex(e.ColorKeywords[t]);return this}},copy:function(e){this.r=e.r;this.g=e.g;this.b=e.b;return this},copyGammaToLinear:function(e,t){if(t===undefined)t=2;this.r=Math.pow(e.r,t);this.g=Math.pow(e.g,t);this.b=Math.pow(e.b,t);return this},copyLinearToGamma:function(e,t){if(t===undefined)t=2;var r=t>0?1/t:1;this.r=Math.pow(e.r,r);this.g=Math.pow(e.g,r);this.b=Math.pow(e.b,r);return this},convertGammaToLinear:function(){var e=this.r,t=this.g,r=this.b;this.r=e*e;this.g=t*t;this.b=r*r;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t=e||{h:0,s:0,l:0};var r=this.r,n=this.g,i=this.b;var a=Math.max(r,n,i);var o=Math.min(r,n,i);var s,u;var l=(o+a)/2;if(o===a){s=0;u=0}else{var c=a-o;u=l<=.5?c/(a+o):c/(2-a-o);switch(a){case r:s=(n-i)/c+(n0){h=.5/Math.sqrt(f+1);this._w=.25/h;this._x=(l-s)*h;this._y=(i-u)*h;this._z=(a-n)*h}else if(r>o&&r>c){h=2*Math.sqrt(1+r-o-c);this._w=(l-s)/h;this._x=.25*h;this._y=(n+a)/h;this._z=(i+u)/h}else if(o>c){h=2*Math.sqrt(1+o-r-c);this._w=(i-u)/h;this._x=(n+a)/h;this._y=.25*h;this._z=(s+l)/h}else{h=2*Math.sqrt(1+c-r-o);this._w=(a-n)/h;this._x=(i+u)/h;this._y=(s+l)/h;this._z=.25*h}this.onChangeCallback();return this},setFromUnitVectors:function(){var t,r;var n=1e-6;return function(i,a){if(t===undefined)t=new e.Vector3;r=i.dot(a)+1;if(rMath.abs(i.z)){t.set(-i.y,i.x,0)}else{t.set(0,-i.z,i.y)}}else{t.crossVectors(i,a)}this._x=t.x;this._y=t.y;this._z=t.z;this._w=r;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();if(e===0){this._x=0;this._y=0;this._z=0;this._w=1}else{e=1/e;this._x=this._x*e;this._y=this._y*e;this._z=this._z*e;this._w=this._w*e}this.onChangeCallback();return this},multiply:function(t,r){if(r!==undefined){e.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.");return this.multiplyQuaternions(t,r)}return this.multiplyQuaternions(this,t)},multiplyQuaternions:function(e,t){var r=e._x,n=e._y,i=e._z,a=e._w;var o=t._x,s=t._y,u=t._z,l=t._w;this._x=r*l+a*o+n*u-i*s;this._y=n*l+a*s+i*o-r*u;this._z=i*l+a*u+r*s-n*o;this._w=a*l-r*o-n*s-i*u;this.onChangeCallback();return this},multiplyVector3:function(t){e.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");return t.applyQuaternion(this)},slerp:function(e,t){if(t===0)return this;if(t===1)return this.copy(e);var r=this._x,n=this._y,i=this._z,a=this._w;var o=a*e._w+r*e._x+n*e._y+i*e._z;if(o<0){this._w=-e._w;this._x=-e._x;this._y=-e._y;this._z=-e._z;o=-o}else{this.copy(e)}if(o>=1){this._w=a;this._x=r;this._y=n;this._z=i;return this}var s=Math.acos(o);var u=Math.sqrt(1-o*o);if(Math.abs(u)<.001){this._w=.5*(a+this._w);this._x=.5*(r+this._x);this._y=.5*(n+this._y);this._z=.5*(i+this._z);return this}var l=Math.sin((1-t)*s)/u,c=Math.sin(t*s)/u;this._w=a*l+this._w*c;this._x=r*l+this._x*c;this._y=n*l+this._y*c;this._z=i*l+this._z*c;this.onChangeCallback();return this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){if(t===undefined)t=0;this._x=e[t];this._y=e[t+1];this._z=e[t+2];this._w=e[t+3];this.onChangeCallback();return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this._x;e[t+1]=this._y;e[t+2]=this._z;e[t+3]=this._w;return e},onChange:function(e){this.onChangeCallback=e;return this},onChangeCallback:function(){},clone:function(){return new e.Quaternion(this._x,this._y,this._z,this._w)}};e.Quaternion.slerp=function(e,t,r,n){return r.copy(e).slerp(t,n)};e.Vector2=function(e,t){this.x=e||0;this.y=t||0};e.Vector2.prototype={constructor:e.Vector2,set:function(e,t){this.x=e;this.y=t;return this},setX:function(e){this.x=e;return this},setY:function(e){this.y=e;return this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},copy:function(e){this.x=e.x;this.y=e.y;return this},add:function(t,r){if(r!==undefined){e.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");return this.addVectors(t,r)}this.x+=t.x;this.y+=t.y;return this},addScalar:function(e){this.x+=e;this.y+=e;return this},addVectors:function(e,t){this.x=e.x+t.x;this.y=e.y+t.y;return this},sub:function(t,r){if(r!==undefined){e.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");return this.subVectors(t,r)}this.x-=t.x;this.y-=t.y;return this},subScalar:function(e){this.x-=e;this.y-=e;return this},subVectors:function(e,t){this.x=e.x-t.x;this.y=e.y-t.y;return this},multiply:function(e){this.x*=e.x;this.y*=e.y;return this},multiplyScalar:function(e){this.x*=e;this.y*=e;return this},divide:function(e){this.x/=e.x;this.y/=e.y;return this},divideScalar:function(e){if(e!==0){var t=1/e;this.x*=t;this.y*=t}else{this.x=0;this.y=0}return this},min:function(e){if(this.x>e.x){this.x=e.x}if(this.y>e.y){this.y=e.y}return this},max:function(e){if(this.xt.x){this.x=t.x}if(this.yt.y){this.y=t.y}return this},clampScalar:function(){var t,r;return function(n,i){if(t===undefined){t=new e.Vector2;r=new e.Vector2}t.set(n,n);r.set(i,i);return this.clamp(t,r)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},setLength:function(e){var t=this.length();if(t!==0&&e!==t){this.multiplyScalar(e/t)}return this},lerp:function(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;return this},lerpVectors:function(e,t,r){this.subVectors(t,e).multiplyScalar(r).add(e);return this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){if(t===undefined)t=0;this.x=e[t];this.y=e[t+1];return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this.x;e[t+1]=this.y;return e},fromAttribute:function(e,t,r){if(r===undefined)r=0;t=t*e.itemSize+r;this.x=e.array[t];this.y=e.array[t+1];return this},clone:function(){return new e.Vector2(this.x,this.y)}};e.Vector3=function(e,t,r){this.x=e||0;this.y=t||0;this.z=r||0};e.Vector3.prototype={constructor:e.Vector3,set:function(e,t,r){this.x=e;this.y=t;this.z=r;return this},setX:function(e){this.x=e;return this},setY:function(e){this.y=e;return this},setZ:function(e){this.z=e;return this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},copy:function(e){this.x=e.x;this.y=e.y;this.z=e.z;return this},add:function(t,r){if(r!==undefined){e.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");return this.addVectors(t,r)}this.x+=t.x;this.y+=t.y;this.z+=t.z;return this},addScalar:function(e){this.x+=e;this.y+=e;this.z+=e;return this},addVectors:function(e,t){this.x=e.x+t.x;this.y=e.y+t.y;this.z=e.z+t.z;return this},sub:function(t,r){if(r!==undefined){e.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");return this.subVectors(t,r)}this.x-=t.x;this.y-=t.y;this.z-=t.z;return this},subScalar:function(e){this.x-=e;this.y-=e;this.z-=e;return this},subVectors:function(e,t){this.x=e.x-t.x;this.y=e.y-t.y;this.z=e.z-t.z;return this},multiply:function(t,r){if(r!==undefined){e.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.");return this.multiplyVectors(t,r)}this.x*=t.x;this.y*=t.y;this.z*=t.z;return this},multiplyScalar:function(e){this.x*=e;this.y*=e;this.z*=e;return this},multiplyVectors:function(e,t){this.x=e.x*t.x;this.y=e.y*t.y;this.z=e.z*t.z;return this},applyEuler:function(){var t;return function(r){if(r instanceof e.Euler===false){e.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.")}if(t===undefined)t=new e.Quaternion;this.applyQuaternion(t.setFromEuler(r));return this}}(),applyAxisAngle:function(){var t;return function(r,n){if(t===undefined)t=new e.Quaternion;this.applyQuaternion(t.setFromAxisAngle(r,n));return this}}(),applyMatrix3:function(e){var t=this.x;var r=this.y;var n=this.z;var i=e.elements;this.x=i[0]*t+i[3]*r+i[6]*n;this.y=i[1]*t+i[4]*r+i[7]*n;this.z=i[2]*t+i[5]*r+i[8]*n;return this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z;var i=e.elements;this.x=i[0]*t+i[4]*r+i[8]*n+i[12];this.y=i[1]*t+i[5]*r+i[9]*n+i[13];this.z=i[2]*t+i[6]*r+i[10]*n+i[14];return this},applyProjection:function(e){var t=this.x,r=this.y,n=this.z;var i=e.elements;var a=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*a;this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*a;this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*a;return this},applyQuaternion:function(e){var t=this.x;var r=this.y;var n=this.z;var i=e.x;var a=e.y;var o=e.z;var s=e.w;var u=s*t+a*n-o*r;var l=s*r+o*t-i*n;var c=s*n+i*r-a*t;var f=-i*t-a*r-o*n;this.x=u*s+f*-i+l*-o-c*-a;this.y=l*s+f*-a+c*-i-u*-o;this.z=c*s+f*-o+u*-a-l*-i;return this},project:function(){var t;return function(r){if(t===undefined)t=new e.Matrix4;t.multiplyMatrices(r.projectionMatrix,t.getInverse(r.matrixWorld));return this.applyProjection(t)}}(),unproject:function(){var t;return function(r){if(t===undefined)t=new e.Matrix4;t.multiplyMatrices(r.matrixWorld,t.getInverse(r.projectionMatrix));return this.applyProjection(t)}}(),transformDirection:function(e){var t=this.x,r=this.y,n=this.z;var i=e.elements;this.x=i[0]*t+i[4]*r+i[8]*n;this.y=i[1]*t+i[5]*r+i[9]*n;this.z=i[2]*t+i[6]*r+i[10]*n;this.normalize();return this},divide:function(e){this.x/=e.x;this.y/=e.y;this.z/=e.z;return this},divideScalar:function(e){if(e!==0){var t=1/e;this.x*=t;this.y*=t;this.z*=t}else{this.x=0;this.y=0;this.z=0}return this},min:function(e){if(this.x>e.x){this.x=e.x}if(this.y>e.y){this.y=e.y}if(this.z>e.z){this.z=e.z}return this},max:function(e){if(this.xt.x){this.x=t.x}if(this.yt.y){this.y=t.y}if(this.zt.z){this.z=t.z}return this},clampScalar:function(){var t,r;return function(n,i){if(t===undefined){t=new e.Vector3;r=new e.Vector3}t.set(n,n,n);r.set(i,i,i);return this.clamp(t,r)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();if(t!==0&&e!==t){this.multiplyScalar(e/t)}return this},lerp:function(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;this.z+=(e.z-this.z)*t;return this},lerpVectors:function(e,t,r){this.subVectors(t,e).multiplyScalar(r).add(e);return this},cross:function(t,r){if(r!==undefined){e.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.");return this.crossVectors(t,r)}var n=this.x,i=this.y,a=this.z;this.x=i*t.z-a*t.y;this.y=a*t.x-n*t.z;this.z=n*t.y-i*t.x;return this},crossVectors:function(e,t){var r=e.x,n=e.y,i=e.z;var a=t.x,o=t.y,s=t.z;this.x=n*s-i*o;this.y=i*a-r*s;this.z=r*o-n*a;return this},projectOnVector:function(){var t,r;return function(n){if(t===undefined)t=new e.Vector3;t.copy(n).normalize();r=this.dot(t);return this.copy(t).multiplyScalar(r)}}(),projectOnPlane:function(){var t;return function(r){if(t===undefined)t=new e.Vector3;t.copy(this).projectOnVector(r);return this.sub(t)}}(),reflect:function(){var t;return function(r){if(t===undefined)t=new e.Vector3;return this.sub(t.copy(r).multiplyScalar(2*this.dot(r)))}}(),angleTo:function(t){var r=this.dot(t)/(this.length()*t.length());return Math.acos(e.Math.clamp(r,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x;var r=this.y-e.y;var n=this.z-e.z;return t*t+r*r+n*n},setEulerFromRotationMatrix:function(t,r){e.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(t,r){e.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){e.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){e.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,r){e.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(t,r)},setFromMatrixPosition:function(e){this.x=e.elements[12];this.y=e.elements[13];this.z=e.elements[14];return this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length();var r=this.set(e.elements[4],e.elements[5],e.elements[6]).length();var n=this.set(e.elements[8],e.elements[9],e.elements[10]).length();this.x=t;this.y=r;this.z=n;return this},setFromMatrixColumn:function(e,t){var r=e*4;var n=t.elements;this.x=n[r];this.y=n[r+1];this.z=n[r+2];return this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){if(t===undefined)t=0;this.x=e[t];this.y=e[t+1];this.z=e[t+2];return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this.x;e[t+1]=this.y;e[t+2]=this.z;return e},fromAttribute:function(e,t,r){if(r===undefined)r=0;t=t*e.itemSize+r;this.x=e.array[t];this.y=e.array[t+1];this.z=e.array[t+2];return this},clone:function(){return new e.Vector3(this.x,this.y,this.z)}};e.Vector4=function(e,t,r,n){this.x=e||0;this.y=t||0;this.z=r||0;this.w=n!==undefined?n:1};e.Vector4.prototype={constructor:e.Vector4,set:function(e,t,r,n){this.x=e;this.y=t;this.z=r;this.w=n;return this},setX:function(e){this.x=e;return this},setY:function(e){this.y=e;return this},setZ:function(e){this.z=e;return this},setW:function(e){this.w=e;return this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},copy:function(e){this.x=e.x;this.y=e.y;this.z=e.z;this.w=e.w!==undefined?e.w:1;return this},add:function(t,r){if(r!==undefined){e.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");return this.addVectors(t,r)}this.x+=t.x;this.y+=t.y;this.z+=t.z;this.w+=t.w;return this},addScalar:function(e){this.x+=e;this.y+=e;this.z+=e;this.w+=e;return this},addVectors:function(e,t){this.x=e.x+t.x;this.y=e.y+t.y;this.z=e.z+t.z;this.w=e.w+t.w;return this},sub:function(t,r){if(r!==undefined){e.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");return this.subVectors(t,r)}this.x-=t.x;this.y-=t.y;this.z-=t.z;this.w-=t.w;return this},subScalar:function(e){this.x-=e;this.y-=e;this.z-=e;this.w-=e;return this},subVectors:function(e,t){this.x=e.x-t.x;this.y=e.y-t.y;this.z=e.z-t.z;this.w=e.w-t.w;return this},multiplyScalar:function(e){this.x*=e;this.y*=e;this.z*=e;this.w*=e;return this},applyMatrix4:function(e){var t=this.x;var r=this.y;var n=this.z;var i=this.w;var a=e.elements;this.x=a[0]*t+a[4]*r+a[8]*n+a[12]*i;this.y=a[1]*t+a[5]*r+a[9]*n+a[13]*i;this.z=a[2]*t+a[6]*r+a[10]*n+a[14]*i;this.w=a[3]*t+a[7]*r+a[11]*n+a[15]*i;return this},divideScalar:function(e){if(e!==0){var t=1/e;this.x*=t;this.y*=t;this.z*=t;this.w*=t}else{this.x=0;this.y=0;this.z=0;this.w=1}return this},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);if(t<1e-4){this.x=1;this.y=0;this.z=0}else{this.x=e.x/t;this.y=e.y/t;this.z=e.z/t}return this},setAxisAngleFromRotationMatrix:function(e){var t,r,n,i,a=.01,o=.1,s=e.elements,u=s[0],l=s[4],c=s[8],f=s[1],h=s[5],d=s[9],p=s[2],m=s[6],v=s[10];if(Math.abs(l-f)g&&y>b){if(yb){if(ge.x){this.x=e.x}if(this.y>e.y){this.y=e.y}if(this.z>e.z){this.z=e.z}if(this.w>e.w){this.w=e.w}return this},max:function(e){if(this.xt.x){this.x=t.x}if(this.yt.y){this.y=t.y}if(this.zt.z){this.z=t.z}if(this.wt.w){this.w=t.w}return this},clampScalar:function(){var t,r;return function(n,i){if(t===undefined){t=new e.Vector4;r=new e.Vector4}t.set(n,n,n,n);r.set(i,i,i,i) -;return this.clamp(t,r)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();if(t!==0&&e!==t){this.multiplyScalar(e/t)}return this},lerp:function(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;this.z+=(e.z-this.z)*t;this.w+=(e.w-this.w)*t;return this},lerpVectors:function(e,t,r){this.subVectors(t,e).multiplyScalar(r).add(e);return this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){if(t===undefined)t=0;this.x=e[t];this.y=e[t+1];this.z=e[t+2];this.w=e[t+3];return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this.x;e[t+1]=this.y;e[t+2]=this.z;e[t+3]=this.w;return e},fromAttribute:function(e,t,r){if(r===undefined)r=0;t=t*e.itemSize+r;this.x=e.array[t];this.y=e.array[t+1];this.z=e.array[t+2];this.w=e.array[t+3];return this},clone:function(){return new e.Vector4(this.x,this.y,this.z,this.w)}};e.Euler=function(t,r,n,i){this._x=t||0;this._y=r||0;this._z=n||0;this._order=i||e.Euler.DefaultOrder};e.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];e.Euler.DefaultOrder="XYZ";e.Euler.prototype={constructor:e.Euler,_x:0,_y:0,_z:0,_order:e.Euler.DefaultOrder,get x(){return this._x},set x(e){this._x=e;this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e;this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e;this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e;this.onChangeCallback()},set:function(e,t,r,n){this._x=e;this._y=t;this._z=r;this._order=n||this._order;this.onChangeCallback();return this},copy:function(e){this._x=e._x;this._y=e._y;this._z=e._z;this._order=e._order;this.onChangeCallback();return this},setFromRotationMatrix:function(t,r,n){var i=e.Math.clamp;var a=t.elements;var o=a[0],s=a[4],u=a[8];var l=a[1],c=a[5],f=a[9];var h=a[2],d=a[6],p=a[10];r=r||this._order;if(r==="XYZ"){this._y=Math.asin(i(u,-1,1));if(Math.abs(u)<.99999){this._x=Math.atan2(-f,p);this._z=Math.atan2(-s,o)}else{this._x=Math.atan2(d,c);this._z=0}}else if(r==="YXZ"){this._x=Math.asin(-i(f,-1,1));if(Math.abs(f)<.99999){this._y=Math.atan2(u,p);this._z=Math.atan2(l,c)}else{this._y=Math.atan2(-h,o);this._z=0}}else if(r==="ZXY"){this._x=Math.asin(i(d,-1,1));if(Math.abs(d)<.99999){this._y=Math.atan2(-h,p);this._z=Math.atan2(-s,c)}else{this._y=0;this._z=Math.atan2(l,o)}}else if(r==="ZYX"){this._y=Math.asin(-i(h,-1,1));if(Math.abs(h)<.99999){this._x=Math.atan2(d,p);this._z=Math.atan2(l,o)}else{this._x=0;this._z=Math.atan2(-s,c)}}else if(r==="YZX"){this._z=Math.asin(i(l,-1,1));if(Math.abs(l)<.99999){this._x=Math.atan2(-f,c);this._y=Math.atan2(-h,o)}else{this._x=0;this._y=Math.atan2(u,p)}}else if(r==="XZY"){this._z=Math.asin(-i(s,-1,1));if(Math.abs(s)<.99999){this._x=Math.atan2(d,c);this._y=Math.atan2(u,o)}else{this._x=Math.atan2(-f,p);this._y=0}}else{e.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+r)}this._order=r;if(n!==false)this.onChangeCallback();return this},setFromQuaternion:function(){var t;return function(r,n,i){if(t===undefined)t=new e.Matrix4;t.makeRotationFromQuaternion(r);this.setFromRotationMatrix(t,n,i);return this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var t=new e.Quaternion;return function(e){t.setFromEuler(this);this.setFromQuaternion(t,e)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){this._x=e[0];this._y=e[1];this._z=e[2];if(e[3]!==undefined)this._order=e[3];this.onChangeCallback();return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this._x;e[t+1]=this._y;e[t+2]=this._z;e[t+3]=this._order;return e},toVector3:function(t){if(t){return t.set(this._x,this._y,this._z)}else{return new e.Vector3(this._x,this._y,this._z)}},onChange:function(e){this.onChangeCallback=e;return this},onChangeCallback:function(){},clone:function(){return new e.Euler(this._x,this._y,this._z,this._order)}};e.Line3=function(t,r){this.start=t!==undefined?t:new e.Vector3;this.end=r!==undefined?r:new e.Vector3};e.Line3.prototype={constructor:e.Line3,set:function(e,t){this.start.copy(e);this.end.copy(t);return this},copy:function(e){this.start.copy(e.start);this.end.copy(e.end);return this},center:function(t){var r=t||new e.Vector3;return r.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){var r=t||new e.Vector3;return r.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,r){var n=r||new e.Vector3;return this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new e.Vector3;var r=new e.Vector3;return function(n,i){t.subVectors(n,this.start);r.subVectors(this.end,this.start);var a=r.dot(r);var o=r.dot(t);var s=o/a;if(i){s=e.Math.clamp(s,0,1)}return s}}(),closestPointToPoint:function(t,r,n){var i=this.closestPointToPointParameter(t,r);var a=n||new e.Vector3;return this.delta(a).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){this.start.applyMatrix4(e);this.end.applyMatrix4(e);return this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},clone:function(){return(new e.Line3).copy(this)}};e.Box2=function(t,r){this.min=t!==undefined?t:new e.Vector2(Infinity,Infinity);this.max=r!==undefined?r:new e.Vector2(-Infinity,-Infinity)};e.Box2.prototype={constructor:e.Box2,set:function(e,t){this.min.copy(e);this.max.copy(t);return this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;tthis.max.x||e.ythis.max.y){return false}return true},containsBox:function(e){if(this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y){return true}return false},getParameter:function(t,r){var n=r||new e.Vector2;return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(e){if(e.max.xthis.max.x||e.max.ythis.max.y){return false}return true},clampPoint:function(t,r){var n=r||new e.Vector2;return n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new e.Vector2;return function(e){var r=t.copy(e).clamp(this.min,this.max);return r.sub(e).length()}}(),intersect:function(e){this.min.max(e.min);this.max.min(e.max);return this},union:function(e){this.min.min(e.min);this.max.max(e.max);return this},translate:function(e){this.min.add(e);this.max.add(e);return this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new e.Box2).copy(this)}};e.Box3=function(t,r){this.min=t!==undefined?t:new e.Vector3(Infinity,Infinity,Infinity);this.max=r!==undefined?r:new e.Vector3(-Infinity,-Infinity,-Infinity)};e.Box3.prototype={constructor:e.Box3,set:function(e,t){this.min.copy(e);this.max.copy(t);return this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z){return false}return true},containsBox:function(e){if(this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z){return true}return false},getParameter:function(t,r){var n=r||new e.Vector3;return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){if(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z){return false}return true},clampPoint:function(t,r){var n=r||new e.Vector3;return n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new e.Vector3;return function(e){var r=t.copy(e).clamp(this.min,this.max);return r.sub(e).length()}}(),getBoundingSphere:function(){var t=new e.Vector3;return function(r){var n=r||new e.Sphere;n.center=this.center();n.radius=this.size(t).length()*.5;return n}}(),intersect:function(e){this.min.max(e.min);this.max.min(e.max);return this},union:function(e){this.min.min(e.min);this.max.max(e.max);return this},applyMatrix4:function(){var t=[new e.Vector3,new e.Vector3,new e.Vector3,new e.Vector3,new e.Vector3,new e.Vector3,new e.Vector3,new e.Vector3];return function(e){t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e);t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e);t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e);t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e);t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e);t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e);t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e);t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e);this.makeEmpty();this.setFromPoints(t);return this}}(),translate:function(e){this.min.add(e);this.max.add(e);return this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new e.Box3).copy(this)}};e.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);if(arguments.length>0){e.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}};e.Matrix3.prototype={constructor:e.Matrix3,set:function(e,t,r,n,i,a,o,s,u){var l=this.elements;l[0]=e;l[3]=t;l[6]=r;l[1]=n;l[4]=i;l[7]=a;l[2]=o;l[5]=s;l[8]=u;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(e){var t=e.elements;this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]);return this},multiplyVector3:function(t){e.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return t.applyMatrix3(this)},multiplyVector3Array:function(t){e.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(t)},applyToVector3Array:function(){var t=new e.Vector3;return function(e,r,n){if(r===undefined)r=0;if(n===undefined)n=e.length;for(var i=0,a=r;i0){e.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}};e.Matrix4.prototype={constructor:e.Matrix4,set:function(e,t,r,n,i,a,o,s,u,l,c,f,h,d,p,m){var v=this.elements;v[0]=e;v[4]=t;v[8]=r;v[12]=n;v[1]=i;v[5]=a;v[9]=o;v[13]=s;v[2]=u;v[6]=l;v[10]=c;v[14]=f;v[3]=h;v[7]=d;v[11]=p;v[15]=m;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(e){this.elements.set(e.elements);return this},extractPosition:function(t){e.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(t)},copyPosition:function(e){var t=this.elements;var r=e.elements;t[12]=r[12];t[13]=r[13];t[14]=r[14];return this},extractBasis:function(e,t,r){var n=this.elements;e.set(n[0],n[1],n[2]);t.set(n[4],n[5],n[6]);r.set(n[8],n[9],n[10]);return this},makeBasis:function(e,t,r){this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1);return this},extractRotation:function(){var t=new e.Vector3;return function(e){var r=this.elements;var n=e.elements;var i=1/t.set(n[0],n[1],n[2]).length();var a=1/t.set(n[4],n[5],n[6]).length();var o=1/t.set(n[8],n[9],n[10]).length();r[0]=n[0]*i;r[1]=n[1]*i;r[2]=n[2]*i;r[4]=n[4]*a;r[5]=n[5]*a;r[6]=n[6]*a;r[8]=n[8]*o;r[9]=n[9]*o;r[10]=n[10]*o;return this}}(),makeRotationFromEuler:function(t){if(t instanceof e.Euler===false){e.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.")}var r=this.elements;var n=t.x,i=t.y,a=t.z;var o=Math.cos(n),s=Math.sin(n);var u=Math.cos(i),l=Math.sin(i);var c=Math.cos(a),f=Math.sin(a);if(t.order==="XYZ"){var h=o*c,d=o*f,p=s*c,m=s*f;r[0]=u*c;r[4]=-u*f;r[8]=l;r[1]=d+p*l;r[5]=h-m*l;r[9]=-s*u;r[2]=m-h*l;r[6]=p+d*l;r[10]=o*u}else if(t.order==="YXZ"){var v=u*c,y=u*f,g=l*c,b=l*f;r[0]=v+b*s;r[4]=g*s-y;r[8]=o*l;r[1]=o*f;r[5]=o*c;r[9]=-s;r[2]=y*s-g;r[6]=b+v*s;r[10]=o*u}else if(t.order==="ZXY"){var v=u*c,y=u*f,g=l*c,b=l*f;r[0]=v-b*s;r[4]=-o*f;r[8]=g+y*s;r[1]=y+g*s;r[5]=o*c;r[9]=b-v*s;r[2]=-o*l;r[6]=s;r[10]=o*u}else if(t.order==="ZYX"){var h=o*c,d=o*f,p=s*c,m=s*f;r[0]=u*c;r[4]=p*l-d;r[8]=h*l+m;r[1]=u*f;r[5]=m*l+h;r[9]=d*l-p;r[2]=-l;r[6]=s*u;r[10]=o*u}else if(t.order==="YZX"){var x=o*u,_=o*l,w=s*u,C=s*l;r[0]=u*c;r[4]=C-x*f;r[8]=w*f+_;r[1]=f;r[5]=o*c;r[9]=-s*c;r[2]=-l*c;r[6]=_*f+w;r[10]=x-C*f}else if(t.order==="XZY"){var x=o*u,_=o*l,w=s*u,C=s*l;r[0]=u*c;r[4]=-f;r[8]=l*c;r[1]=x*f+C;r[5]=o*c;r[9]=_*f-w;r[2]=w*f-_;r[6]=s*c;r[10]=C*f+x}r[3]=0;r[7]=0;r[11]=0;r[12]=0;r[13]=0;r[14]=0;r[15]=1;return this},setRotationFromQuaternion:function(t){e.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(t)},makeRotationFromQuaternion:function(e){var t=this.elements;var r=e.x,n=e.y,i=e.z,a=e.w;var o=r+r,s=n+n,u=i+i;var l=r*o,c=r*s,f=r*u;var h=n*s,d=n*u,p=i*u;var m=a*o,v=a*s,y=a*u;t[0]=1-(h+p);t[4]=c-y;t[8]=f+v;t[1]=c+y;t[5]=1-(l+p);t[9]=d-m;t[2]=f-v;t[6]=d+m;t[10]=1-(l+h);t[3]=0;t[7]=0;t[11]=0;t[12]=0;t[13]=0;t[14]=0;t[15]=1;return this},lookAt:function(){var t=new e.Vector3;var r=new e.Vector3;var n=new e.Vector3;return function(e,i,a){var o=this.elements;n.subVectors(e,i).normalize();if(n.length()===0){n.z=1}t.crossVectors(a,n).normalize();if(t.length()===0){n.x+=1e-4;t.crossVectors(a,n).normalize()}r.crossVectors(n,t);o[0]=t.x;o[4]=r.x;o[8]=n.x;o[1]=t.y;o[5]=r.y;o[9]=n.y;o[2]=t.z;o[6]=r.z;o[10]=n.z;return this}}(),multiply:function(t,r){if(r!==undefined){e.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.");return this.multiplyMatrices(t,r)}return this.multiplyMatrices(this,t)},multiplyMatrices:function(e,t){var r=e.elements;var n=t.elements;var i=this.elements;var a=r[0],o=r[4],s=r[8],u=r[12];var l=r[1],c=r[5],f=r[9],h=r[13];var d=r[2],p=r[6],m=r[10],v=r[14];var y=r[3],g=r[7],b=r[11],x=r[15];var _=n[0],w=n[4],C=n[8],E=n[12];var S=n[1],T=n[5],M=n[9],A=n[13];var P=n[2],R=n[6],k=n[10],I=n[14];var D=n[3],B=n[7],L=n[11],F=n[15];i[0]=a*_+o*S+s*P+u*D;i[4]=a*w+o*T+s*R+u*B;i[8]=a*C+o*M+s*k+u*L;i[12]=a*E+o*A+s*I+u*F;i[1]=l*_+c*S+f*P+h*D;i[5]=l*w+c*T+f*R+h*B;i[9]=l*C+c*M+f*k+h*L;i[13]=l*E+c*A+f*I+h*F;i[2]=d*_+p*S+m*P+v*D;i[6]=d*w+p*T+m*R+v*B;i[10]=d*C+p*M+m*k+v*L;i[14]=d*E+p*A+m*I+v*F;i[3]=y*_+g*S+b*P+x*D;i[7]=y*w+g*T+b*R+x*B;i[11]=y*C+g*M+b*k+x*L;i[15]=y*E+g*A+b*I+x*F;return this},multiplyToArray:function(e,t,r){var n=this.elements;this.multiplyMatrices(e,t);r[0]=n[0];r[1]=n[1];r[2]=n[2];r[3]=n[3];r[4]=n[4];r[5]=n[5];r[6]=n[6];r[7]=n[7];r[8]=n[8];r[9]=n[9];r[10]=n[10];r[11]=n[11];r[12]=n[12];r[13]=n[13];r[14]=n[14];r[15]=n[15];return this},multiplyScalar:function(e){var t=this.elements;t[0]*=e;t[4]*=e;t[8]*=e;t[12]*=e;t[1]*=e;t[5]*=e;t[9]*=e;t[13]*=e;t[2]*=e;t[6]*=e;t[10]*=e;t[14]*=e;t[3]*=e;t[7]*=e;t[11]*=e;t[15]*=e;return this},multiplyVector3:function(t){e.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return t.applyProjection(this)},multiplyVector4:function(t){e.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return t.applyMatrix4(this)},multiplyVector3Array:function(t){e.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(t)},applyToVector3Array:function(){var t=new e.Vector3;return function(e,r,n){if(r===undefined)r=0;if(n===undefined)n=e.length;for(var i=0,a=r;i0){d=u*c-l;p=u*l-c;v=s*h;if(d>=0){if(p>=-v){if(p<=v){var y=1/h;d*=y;p*=y;m=d*(d+u*p+2*l)+p*(u*d+p+2*c)+f}else{p=s;d=Math.max(0,-(u*p+l));m=-d*d+p*(p+2*c)+f}}else{p=-s;d=Math.max(0,-(u*p+l));m=-d*d+p*(p+2*c)+f}}else{if(p<=-v){d=Math.max(0,-(-u*s+l));p=d>0?-s:Math.min(Math.max(-s,-c),s);m=-d*d+p*(p+2*c)+f}else if(p<=v){d=0;p=Math.min(Math.max(-s,-c),s);m=p*(p+2*c)+f}else{d=Math.max(0,-(u*s+l));p=d>0?s:Math.min(Math.max(-s,-c),s);m=-d*d+p*(p+2*c)+f}}}else{p=u>0?-s:s;d=Math.max(0,-(u*p+l));m=-d*d+p*(p+2*c)+f}if(a){a.copy(this.direction).multiplyScalar(d).add(this.origin)}if(o){o.copy(r).multiplyScalar(p).add(t)}return m}}(),isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},intersectSphere:function(){var t=new e.Vector3;return function(e,r){t.subVectors(e.center,this.origin);var n=t.dot(this.direction);var i=t.dot(t)-n*n;var a=e.radius*e.radius;if(i>a)return null;var o=Math.sqrt(a-i);var s=n-o;var u=n+o;if(s<0&&u<0)return null;if(s<0)return this.at(u,r);return this.at(s,r)}}(),isIntersectionPlane:function(e){var t=e.distanceToPoint(this.origin);if(t===0){return true}var r=e.normal.dot(this.direction);if(r*t<0){return true}return false},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(t==0){if(e.distanceToPoint(this.origin)==0){return 0}return null}var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null},intersectPlane:function(e,t){var r=this.distanceToPlane(e);if(r===null){return null}return this.at(r,t)},isIntersectionBox:function(){var t=new e.Vector3;return function(e){return this.intersectBox(e,t)!==null}}(),intersectBox:function(e,t){var r,n,i,a,o,s;var u=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z;var f=this.origin;if(u>=0){r=(e.min.x-f.x)*u;n=(e.max.x-f.x)*u}else{r=(e.max.x-f.x)*u;n=(e.min.x-f.x)*u}if(l>=0){i=(e.min.y-f.y)*l;a=(e.max.y-f.y)*l}else{i=(e.max.y-f.y)*l;a=(e.min.y-f.y)*l}if(r>a||i>n)return null;if(i>r||r!==r)r=i;if(a=0){o=(e.min.z-f.z)*c;s=(e.max.z-f.z)*c}else{o=(e.max.z-f.z)*c;s=(e.min.z-f.z)*c}if(r>s||o>n)return null;if(o>r||r!==r)r=o;if(s=0?r:n,t)},intersectTriangle:function(){var t=new e.Vector3;var r=new e.Vector3;var n=new e.Vector3;var i=new e.Vector3;return function(e,a,o,s,u){r.subVectors(a,e);n.subVectors(o,e);i.crossVectors(r,n);var l=this.direction.dot(i);var c;if(l>0){if(s)return null;c=1}else if(l<0){c=-1;l=-l}else{return null}t.subVectors(this.origin,e);var f=c*this.direction.dot(n.crossVectors(t,n));if(f<0){return null}var h=c*this.direction.dot(r.cross(t));if(h<0){return null}if(f+h>l){return null}var d=-c*t.dot(i);if(d<0){return null}return this.at(d/l,u)}}(),applyMatrix4:function(e){this.direction.add(this.origin).applyMatrix4(e);this.origin.applyMatrix4(e);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},clone:function(){return(new e.Ray).copy(this)}};e.Sphere=function(t,r){this.center=t!==undefined?t:new e.Vector3;this.radius=r!==undefined?r:0};e.Sphere.prototype={constructor:e.Sphere,set:function(e,t){this.center.copy(e);this.radius=t;return this},setFromPoints:function(){var t=new e.Box3;return function(e,r){var n=this.center;if(r!==undefined){n.copy(r)}else{t.setFromPoints(e).center(n)}var i=0;for(var a=0,o=e.length;athis.radius*this.radius){i.sub(this.center).normalize();i.multiplyScalar(this.radius).add(this.center)}return i},getBoundingBox:function(t){var r=t||new e.Box3;r.set(this.center,this.center);r.expandByScalar(this.radius);return r},applyMatrix4:function(e){this.center.applyMatrix4(e);this.radius=this.radius*e.getMaxScaleOnAxis();return this},translate:function(e){this.center.add(e);return this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return(new e.Sphere).copy(this)}};e.Frustum=function(t,r,n,i,a,o){this.planes=[t!==undefined?t:new e.Plane,r!==undefined?r:new e.Plane,n!==undefined?n:new e.Plane,i!==undefined?i:new e.Plane,a!==undefined?a:new e.Plane,o!==undefined?o:new e.Plane]};e.Frustum.prototype={constructor:e.Frustum,set:function(e,t,r,n,i,a){var o=this.planes;o[0].copy(e);o[1].copy(t);o[2].copy(r);o[3].copy(n);o[4].copy(i);o[5].copy(a);return this},copy:function(e){var t=this.planes;for(var r=0;r<6;r++){t[r].copy(e.planes[r])}return this},setFromMatrix:function(e){var t=this.planes;var r=e.elements;var n=r[0],i=r[1],a=r[2],o=r[3];var s=r[4],u=r[5],l=r[6],c=r[7];var f=r[8],h=r[9],d=r[10],p=r[11];var m=r[12],v=r[13],y=r[14],g=r[15];t[0].setComponents(o-n,c-s,p-f,g-m).normalize();t[1].setComponents(o+n,c+s,p+f,g+m).normalize();t[2].setComponents(o+i,c+u,p+h,g+v).normalize();t[3].setComponents(o-i,c-u,p-h,g-v).normalize();t[4].setComponents(o-a,c-l,p-d,g-y).normalize();t[5].setComponents(o+a,c+l,p+d,g+y).normalize();return this},intersectsObject:function(){var t=new e.Sphere;return function(e){var r=e.geometry;if(r.boundingSphere===null)r.computeBoundingSphere();t.copy(r.boundingSphere);t.applyMatrix4(e.matrixWorld);return this.intersectsSphere(t)}}(),intersectsSphere:function(e){var t=this.planes;var r=e.center;var n=-e.radius;for(var i=0;i<6;i++){var a=t[i].distanceToPoint(r);if(a0?e.min.x:e.max.x;r.x=a.normal.x>0?e.max.x:e.min.x;t.y=a.normal.y>0?e.min.y:e.max.y;r.y=a.normal.y>0?e.max.y:e.min.y;t.z=a.normal.z>0?e.min.z:e.max.z;r.z=a.normal.z>0?e.max.z:e.min.z;var o=a.distanceToPoint(t);var s=a.distanceToPoint(r);if(o<0&&s<0){return false}}return true}}(),containsPoint:function(e){var t=this.planes;for(var r=0;r<6;r++){if(t[r].distanceToPoint(e)<0){return false}}return true},clone:function(){return(new e.Frustum).copy(this)}};e.Plane=function(t,r){this.normal=t!==undefined?t:new e.Vector3(1,0,0);this.constant=r!==undefined?r:0};e.Plane.prototype={constructor:e.Plane,set:function(e,t){this.normal.copy(e);this.constant=t;return this},setComponents:function(e,t,r,n){this.normal.set(e,t,r);this.constant=n;return this},setFromNormalAndCoplanarPoint:function(e,t){this.normal.copy(e);this.constant=-t.dot(this.normal);return this},setFromCoplanarPoints:function(){var t=new e.Vector3;var r=new e.Vector3;return function(e,n,i){var a=t.subVectors(i,n).cross(r.subVectors(e,n)).normalize();this.setFromNormalAndCoplanarPoint(a,e);return this}}(),copy:function(e){this.normal.copy(e.normal);this.constant=e.constant;return this},normalize:function(){var e=1/this.normal.length();this.normal.multiplyScalar(e);this.constant*=e;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(t,r){var n=this.distanceToPoint(t);var i=r||new e.Vector3;return i.copy(this.normal).multiplyScalar(n)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start);var r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0},intersectLine:function(){var t=new e.Vector3;return function(r,n){var i=n||new e.Vector3;var a=r.delta(t);var o=this.normal.dot(a);if(o==0){if(this.distanceToPoint(r.start)==0){return i.copy(r.start)}return undefined}var s=-(r.start.dot(this.normal)+this.constant)/o;if(s<0||s>1){return undefined}return i.copy(a).multiplyScalar(s).add(r.start)}}(),coplanarPoint:function(t){var r=t||new e.Vector3;return r.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new e.Vector3;var r=new e.Vector3;var n=new e.Matrix3;return function(e,i){var a=i||n.getNormalMatrix(e);var o=t.copy(this.normal).applyMatrix3(a);var s=this.coplanarPoint(r);s.applyMatrix4(e);this.setFromNormalAndCoplanarPoint(o,s);return this}}(),translate:function(e){this.constant=this.constant-e.dot(this.normal);return this},equals:function(e){return e.normal.equals(this.normal)&&e.constant==this.constant},clone:function(){return(new e.Plane).copy(this)}};e.Math={generateUUID:function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");var t=new Array(36);var r=0,n;return function(){for(var i=0;i<36;i++){if(i==8||i==13||i==18||i==23){t[i]="-"}else if(i==14){t[i]="4"}else{if(r<=2)r=33554432+Math.random()*16777216|0;n=r&15;r=r>>4;t[i]=e[i==19?n&3|8:n]}}return t.join("")}}(),clamp:function(e,t,r){return er?r:e},clampBottom:function(e,t){return e=r)return 1;e=(e-t)/(r-t);return e*e*(3-2*e)},smootherstep:function(e,t,r){if(e<=t)return 0;if(e>=r)return 1;e=(e-t)/(r-t);return e*e*e*(e*(e*6-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(e,t){return Math.floor(this.randFloat(e,t))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}(),isPowerOfTwo:function(e){return(e&e-1)===0&&e!==0},nextPowerOfTwo:function(e){e--;e|=e>>1;e|=e>>2;e|=e>>4;e|=e>>8;e|=e>>16;e++;return e}};e.Spline=function(t){this.points=t;var r=[],n={x:0,y:0,z:0},i,a,o,s,u,l,c,f,h;this.initFromArray=function(e){this.points=[];for(var t=0;tthis.points.length-2?this.points.length-1:a+1;r[3]=a>this.points.length-3?this.points.length-1:a+2;l=this.points[r[0]];c=this.points[r[1]];f=this.points[r[2]];h=this.points[r[3]];s=o*o;u=o*s;n.x=d(l.x,c.x,f.x,h.x,o,s,u);n.y=d(l.y,c.y,f.y,h.y,o,s,u);n.z=d(l.z,c.z,f.z,h.z,o,s,u);return n};this.getControlPointsArray=function(){var e,t,r=this.points.length,n=[];for(e=0;e0){return o.multiplyScalar(1/Math.sqrt(s))}return o.set(0,0,0)}}();e.Triangle.barycoordFromPoint=function(){var t=new e.Vector3;var r=new e.Vector3;var n=new e.Vector3;return function(i,a,o,s,u){t.subVectors(s,a);r.subVectors(o,a);n.subVectors(i,a);var l=t.dot(t);var c=t.dot(r);var f=t.dot(n);var h=r.dot(r);var d=r.dot(n);var p=l*h-c*c;var m=u||new e.Vector3;if(p==0){return m.set(-2,-1,-1)}var v=1/p;var y=(h*f-c*d)*v;var g=(l*d-c*f)*v;return m.set(1-y-g,g,y)}}();e.Triangle.containsPoint=function(){var t=new e.Vector3;return function(r,n,i,a){var o=e.Triangle.barycoordFromPoint(r,n,i,a,t);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}();e.Triangle.prototype={constructor:e.Triangle,set:function(e,t,r){this.a.copy(e);this.b.copy(t);this.c.copy(r);return this},setFromPointsAndIndices:function(e,t,r,n){this.a.copy(e[t]);this.b.copy(e[r]);this.c.copy(e[n]);return this},copy:function(e){this.a.copy(e.a);this.b.copy(e.b);this.c.copy(e.c);return this},area:function(){var t=new e.Vector3;var r=new e.Vector3;return function(){t.subVectors(this.c,this.b);r.subVectors(this.a,this.b);return t.cross(r).length()*.5}}(),midpoint:function(t){var r=t||new e.Vector3;return r.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return e.Triangle.normal(this.a,this.b,this.c,t)},plane:function(t){var r=t||new e.Plane;return r.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,r){return e.Triangle.barycoordFromPoint(t,this.a,this.b,this.c,r)},containsPoint:function(t){return e.Triangle.containsPoint(t,this.a,this.b,this.c)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)},clone:function(){return(new e.Triangle).copy(this)}};e.Clock=function(e){this.autoStart=e!==undefined?e:true;this.startTime=0;this.oldTime=0;this.elapsedTime=0;this.running=false};e.Clock.prototype={constructor:e.Clock,start:function(){this.startTime=self.performance!==undefined&&self.performance.now!==undefined?self.performance.now():Date.now();this.oldTime=this.startTime;this.running=true},stop:function(){this.getElapsedTime();this.running=false},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running){this.start()}if(this.running){var t=self.performance!==undefined&&self.performance.now!==undefined?self.performance.now():Date.now();e=.001*(t-this.oldTime);this.oldTime=t;this.elapsedTime+=e}return e}};e.EventDispatcher=function(){};e.EventDispatcher.prototype={constructor:e.EventDispatcher,apply:function(t){t.addEventListener=e.EventDispatcher.prototype.addEventListener;t.hasEventListener=e.EventDispatcher.prototype.hasEventListener;t.removeEventListener=e.EventDispatcher.prototype.removeEventListener;t.dispatchEvent=e.EventDispatcher.prototype.dispatchEvent},addEventListener:function(e,t){if(this._listeners===undefined)this._listeners={};var r=this._listeners;if(r[e]===undefined){r[e]=[]}if(r[e].indexOf(t)===-1){r[e].push(t)}},hasEventListener:function(e,t){if(this._listeners===undefined)return false;var r=this._listeners;if(r[e]!==undefined&&r[e].indexOf(t)!==-1){return true}return false},removeEventListener:function(e,t){if(this._listeners===undefined)return;var r=this._listeners;var n=r[e];if(n!==undefined){var i=n.indexOf(t);if(i!==-1){n.splice(i,1)}}},dispatchEvent:function(e){if(this._listeners===undefined)return;var t=this._listeners;var r=t[e.type];if(r!==undefined){e.target=this;var n=[];var i=r.length;for(var a=0;a1){for(var r=0;r1){for(var t=0;t0){r.children=[];for(var i=0;i0;var u=i[0].vertexNormals.length==3;var l=new Float32Array(i.length*3*3);this.addAttribute("position",new e.BufferAttribute(l,3));var c=new Float32Array(i.length*3*3);this.addAttribute("normal",new e.BufferAttribute(c,3));if(o!==e.NoColors){var f=new Float32Array(i.length*3*3);this.addAttribute("color",new e.BufferAttribute(f,3))}if(s===true){var h=new Float32Array(i.length*3*2);this.addAttribute("uv",new e.BufferAttribute(h,2))}for(var d=0,p=0,m=0;d0?this.offsets:[{start:0,count:p.length,index:0}];for(var v=0,y=m.length;vu.index+e){var b={start:a,count:0,index:o};s.push(b);u=b;for(var x=0;x<6;x+=2){var _=f[x+1];if(_>-1&&_0){e.data.offsets=JSON.parse(JSON.stringify(r))}if(n!==null){e.data.boundingSphere={center:n.center.toArray(),radius:n.radius}}return e},clone:function(){var t=new e.BufferGeometry;for(var r in this.attributes){var n=this.attributes[r];t.addAttribute(r,n.clone())}for(var i=0,a=this.offsets.length;i0){for(var f=0;f0){e+=t[r].distanceTo(t[r-1])}this.lineDistances[r]=e}},computeBoundingBox:function(){if(this.boundingBox===null){this.boundingBox=new e.Box3}this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){if(this.boundingSphere===null){this.boundingSphere=new e.Sphere}this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,r,n){if(t instanceof e.Geometry===false){e.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);return}var i,a=this.vertices.length,o=this.vertices,s=t.vertices,u=this.faces,l=t.faces,c=this.faceVertexUvs[0],f=t.faceVertexUvs[0];if(n===undefined)n=0;if(r!==undefined){i=(new e.Matrix3).getNormalMatrix(r)}for(var h=0,d=s.length;h=0;s--){var v=d[s];this.faces.splice(v,1);for(f=0,h=this.faceVertexUvs.length;f0;var g=d.vertexNormals.length>0;var b=d.color.r!==1||d.color.g!==1||d.color.b!==1;var x=d.vertexColors.length>0;var _=0;_=S(_,0,0);_=S(_,1,p);_=S(_,2,m);_=S(_,3,v);_=S(_,4,y);_=S(_,5,g);_=S(_,6,b);_=S(_,7,x);o.push(_);o.push(d.a,d.b,d.c);if(v){var w=this.faceVertexUvs[0][i];o.push(A(w[0]),A(w[1]),A(w[2]))}if(y){o.push(T(d.normal))}if(g){var C=d.vertexNormals;o.push(T(C[0]),T(C[1]),T(C[2]))}if(b){o.push(M(d.color))}if(x){var E=d.vertexColors;o.push(M(E[0]),M(E[1]),M(E[2]))}}function S(e,t,r){return r?e|1<0)e.data.colors=l;if(f.length>0)e.data.uvs=[f];e.data.faces=o;return e},clone:function(){var t=new e.Geometry;var r=this.vertices;for(var n=0,i=r.length;n1?t.skinWeights[i+1]:0;var u=r>2?t.skinWeights[i+2]:0;var l=r>3?t.skinWeights[i+3]:0;n.skinWeights.push(new e.Vector4(o,s,u,l))}}if(t.skinIndices){for(var i=0,a=t.skinIndices.length;i1?t.skinIndices[i+1]:0;var h=r>2?t.skinIndices[i+2]:0;var d=r>3?t.skinIndices[i+3]:0;n.skinIndices.push(new e.Vector4(c,f,h,d))}}n.bones=t.bones;if(n.bones&&n.bones.length>0&&(n.skinWeights.length!==n.skinIndices.length||n.skinIndices.length!==n.vertices.length)){e.warn("THREE.JSONLoader: When skinning, number of vertices ("+n.vertices.length+"), skinIndices ("+n.skinIndices.length+"), and skinWeights ("+n.skinWeights.length+") should match.")}n.animation=t.animation;n.animations=t.animations}function s(r){if(t.morphTargets!==undefined){var i,a,o,s,u,l;for(i=0,a=t.morphTargets.length;i0){var a=new e.LoadingManager(r);var o=new e.ImageLoader(a);o.setCrossOrigin(this.crossOrigin);var s=function(e){n.manager.itemStart(e);return o.load(e,function(){n.manager.itemEnd(e)})};for(var u=0,l=t.length;us)continue;var T=r.origin.distanceTo(h);if(Ti.far)continue;a.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:w,offsetIndex:g,face:null,faceIndex:null,object:this})}}}else{var v=p.position.array;for(var w=0;ws)continue;var T=r.origin.distanceTo(h);if(Ti.far)continue;a.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else if(u instanceof e.Geometry){var M=u.vertices;var A=M.length;for(var w=0;ws)continue;var T=r.origin.distanceTo(h);if(Ti.far)continue;a.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}}();e.Line.prototype.clone=function(t){if(t===undefined)t=new e.Line(this.geometry,this.material,this.mode);e.Object3D.prototype.clone.call(this,t);return t};e.Mesh=function(t,r){e.Object3D.call(this);this.type="Mesh";this.geometry=t!==undefined?t:new e.Geometry;this.material=r!==undefined?r:new e.MeshBasicMaterial({color:Math.random()*16777215});this.updateMorphTargets()};e.Mesh.prototype=Object.create(e.Object3D.prototype);e.Mesh.prototype.constructor=e.Mesh;e.Mesh.prototype.updateMorphTargets=function(){if(this.geometry.morphTargets!==undefined&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;es.far)continue;u.push({distance:M,point:T,face:new e.Face3(h,d,p,e.Triangle.normal(i,a,o)),faceIndex:null,object:this})}}}else{var y=f.position.array;for(var E=0,A=0,S=y.length;Es.far)continue;u.push({distance:M,point:T,face:new e.Face3(h,d,p,e.Triangle.normal(i,a,o)),faceIndex:null,object:this})}}}else if(l instanceof e.Geometry){var P=this.material instanceof e.MeshFaceMaterial;var R=P===true?this.material.materials:null;var h,d,p;var m=s.precision;var k=l.vertices;for(var I=0,D=l.faces.length;Is.far)continue;u.push({distance:M,point:T,face:B,faceIndex:I,object:this})}}}}();e.Mesh.prototype.clone=function(t,r){if(t===undefined)t=new e.Mesh(this.geometry,this.material);e.Object3D.prototype.clone.call(this,t,r);return t};e.Bone=function(t){e.Object3D.call(this);this.type="Bone";this.skin=t};e.Bone.prototype=Object.create(e.Object3D.prototype);e.Bone.prototype.constructor=e.Bone;e.Skeleton=function(t,r,n){this.useVertexTexture=n!==undefined?n:true;this.identityMatrix=new e.Matrix4;t=t||[];this.bones=t.slice(0);if(this.useVertexTexture){var i;if(this.bones.length>256)i=64;else if(this.bones.length>64)i=32;else if(this.bones.length>16)i=16;else i=8;this.boneTextureWidth=i;this.boneTextureHeight=i;this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4);this.boneTexture=new e.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,e.RGBAFormat,e.FloatType);this.boneTexture.minFilter=e.NearestFilter;this.boneTexture.magFilter=e.NearestFilter;this.boneTexture.generateMipmaps=false;this.boneTexture.flipY=false}else{this.boneMatrices=new Float32Array(16*this.bones.length)}if(r===undefined){this.calculateInverses()}else{if(this.bones.length===r.length){this.boneInverses=r.slice(0)}else{e.warn("THREE.Skeleton bonInverses is the wrong length.");this.boneInverses=[];for(var a=0,o=this.bones.length;a1){var u=s[1];if(!r[u])r[u]={start:Infinity,end:-Infinity};var l=r[u];if(il.end)l.end=i;if(!t)t=u}}e.firstAnimation=t};e.MorphAnimMesh.prototype.setAnimationLabel=function(e,t,r){if(!this.geometry.animations)this.geometry.animations={};this.geometry.animations[e]={start:t,end:r}};e.MorphAnimMesh.prototype.playAnimation=function(t,r){var n=this.geometry.animations[t];if(n){this.setFrameRange(n.start,n.end);this.duration=1e3*((n.end-n.start)/r);this.time=0}else{e.warn("THREE.MorphAnimMesh: animation["+t+"] undefined in .playAnimation()")}};e.MorphAnimMesh.prototype.updateAnimation=function(t){var r=this.duration/this.length;this.time+=this.direction*t;if(this.mirroredLoop){if(this.time>this.duration||this.time<0){this.direction*=-1;if(this.time>this.duration){this.time=this.duration;this.directionBackwards=true}if(this.time<0){this.time=0;this.directionBackwards=false}}}else{this.time=this.time%this.duration;if(this.time<0)this.time+=this.duration}var n=this.startKeyframe+e.Math.clamp(Math.floor(this.time/r),0,this.length-1);if(n!==this.currentKeyframe){this.morphTargetInfluences[this.lastKeyframe]=0;this.morphTargetInfluences[this.currentKeyframe]=1;this.morphTargetInfluences[n]=0;this.lastKeyframe=this.currentKeyframe;this.currentKeyframe=n}var i=this.time%r/r;if(this.directionBackwards){i=1-i}this.morphTargetInfluences[this.currentKeyframe]=i;this.morphTargetInfluences[this.lastKeyframe]=1-i};e.MorphAnimMesh.prototype.interpolateTargets=function(e,t,r){var n=this.morphTargetInfluences;for(var i=0,a=n.length;i-1)n[e]=1-r;if(t>-1)n[t]=r};e.MorphAnimMesh.prototype.clone=function(t){if(t===undefined)t=new e.MorphAnimMesh(this.geometry,this.material);t.duration=this.duration;t.mirroredLoop=this.mirroredLoop;t.time=this.time;t.lastKeyframe=this.lastKeyframe;t.currentKeyframe=this.currentKeyframe;t.direction=this.direction;t.directionBackwards=this.directionBackwards;e.Mesh.prototype.clone.call(this,t);return t};e.LOD=function(){e.Object3D.call(this);this.objects=[]};e.LOD.prototype=Object.create(e.Object3D.prototype);e.LOD.prototype.constructor=e.LOD;e.LOD.prototype.addLevel=function(e,t){if(t===undefined)t=0;t=Math.abs(t);for(var r=0;r1){t.setFromMatrixPosition(e.matrixWorld);r.setFromMatrixPosition(this.matrixWorld);var n=t.distanceTo(r);this.objects[0].object.visible=true;for(var i=1,a=this.objects.length;i=this.objects[i].distance){this.objects[i-1].object.visible=false;this.objects[i].object.visible=true}else{break}}for(;ithis.scale.x){return}r.push({distance:n,point:this.position,face:null,object:this})}}();e.Sprite.prototype.clone=function(t){if(t===undefined)t=new e.Sprite(this.material);e.Object3D.prototype.clone.call(this,t);return t};e.Particle=e.Sprite;e.LensFlare=function(t,r,n,i,a){e.Object3D.call(this);this.lensFlares=[];this.positionScreen=new e.Vector3;this.customUpdateCallback=undefined;if(t!==undefined){this.add(t,r,n,i,a)}};e.LensFlare.prototype=Object.create(e.Object3D.prototype);e.LensFlare.prototype.constructor=e.LensFlare;e.LensFlare.prototype.add=function(t,r,n,i,a,o){if(r===undefined)r=-1;if(n===undefined)n=0;if(o===undefined)o=1;if(a===undefined)a=new e.Color(16777215);if(i===undefined)i=e.NormalBlending;n=Math.min(n,Math.max(0,n));this.lensFlares.push({texture:t,size:r,distance:n,x:0,y:0,z:0,scale:1,rotation:1,opacity:o,color:a,blending:i})};e.LensFlare.prototype.updateLensFlares=function(){var e,t=this.lensFlares.length;var r;var n=-this.positionScreen.x*2;var i=-this.positionScreen.y*2;for(e=0;e 0.0 ) {\n\t return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n\t}\n\treturn 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\n";e.ShaderChunk["alphatest_fragment"]="#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n";e.ShaderChunk["lights_lambert_vertex"]="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack += ambientLightColor;\n\n#endif\n";e.ShaderChunk["map_particle_pars_fragment"]="#ifdef USE_MAP\n\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n\n#endif\n";e.ShaderChunk["default_vertex"]="#ifdef USE_SKINNING\n\n\tvec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n\tvec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n";e.ShaderChunk["map_pars_fragment"]="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif";e.ShaderChunk["skinnormal_vertex"]="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n";e.ShaderChunk["logdepthbuf_pars_vertex"]="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif";e.ShaderChunk["lightmap_pars_vertex"]="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif" -;e.ShaderChunk["lights_phong_fragment"]="#ifndef FLAT_SHADED\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n\t#endif\n\n#else\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\ttotalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\ttotalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\ttotalDiffuseLight += hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\n#ifdef METAL\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n";e.ShaderChunk["fog_pars_fragment"]="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif";e.ShaderChunk["morphnormal_vertex"]="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif";e.ShaderChunk["envmap_pars_fragment"]="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif\n";e.ShaderChunk["logdepthbuf_fragment"]="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif";e.ShaderChunk["normalmap_pars_fragment"]="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n";e.ShaderChunk["lights_phong_pars_vertex"]="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n";e.ShaderChunk["lightmap_pars_fragment"]="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif";e.ShaderChunk["shadowmap_vertex"]="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif";e.ShaderChunk["lights_phong_vertex"]="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif";e.ShaderChunk["map_fragment"]="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\n\tdiffuseColor *= texelColor;\n\n#endif";e.ShaderChunk["lightmap_vertex"]="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif";e.ShaderChunk["map_particle_fragment"]="#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n";e.ShaderChunk["color_pars_fragment"]="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n";e.ShaderChunk["color_vertex"]="#ifdef USE_COLOR\n\n\tvColor.xyz = inputToLinear( color.xyz );\n\n#endif";e.ShaderChunk["skinning_vertex"]="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n\n#endif\n";e.ShaderChunk["envmap_pars_vertex"]="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\n#endif\n";e.ShaderChunk["linear_to_gamma_fragment"]="\n\toutgoingLight = linearToOutput( outgoingLight );\n";e.ShaderChunk["color_pars_vertex"]="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif";e.ShaderChunk["lights_lambert_pars_vertex"]="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n";e.ShaderChunk["map_pars_vertex"]="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n";e.ShaderChunk["envmap_fragment"]="#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n";e.ShaderChunk["specularmap_pars_fragment"]="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif";e.ShaderChunk["logdepthbuf_vertex"]="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif";e.ShaderChunk["morphtarget_pars_vertex"]="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif";e.ShaderChunk["specularmap_fragment"]="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif";e.ShaderChunk["fog_fragment"]="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n\t\tfogFactor = whiteCompliment( fogFactor );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif";e.ShaderChunk["bumpmap_pars_fragment"]="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n";e.ShaderChunk["defaultnormal_vertex"]="#ifdef USE_SKINNING\n\n\tvec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n\tvec3 objectNormal = morphedNormal;\n\n#else\n\n\tvec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n";e.ShaderChunk["lights_phong_pars_fragment"]="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n";e.ShaderChunk["skinbase_vertex"]="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif";e.ShaderChunk["map_vertex"]="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif";e.ShaderChunk["lightmap_fragment"]="#ifdef USE_LIGHTMAP\n\n\toutgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif";e.ShaderChunk["shadowmap_pars_vertex"]="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif";e.ShaderChunk["color_fragment"]="#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif";e.ShaderChunk["morphtarget_vertex"]="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif";e.ShaderChunk["envmap_vertex"]="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t#else\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t#endif\n\n#endif\n";e.ShaderChunk["shadowmap_fragment"]="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t// NOTE: I am unsure if this is correct in linear space. -bhouston, Dec 29, 2014\n\tshadowColor = inputToLinear( shadowColor );\n\n\toutgoingLight = outgoingLight * shadowColor;\n\n#endif\n";e.ShaderChunk["worldpos_vertex"]="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#elif defined( USE_MORPHTARGETS )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif\n";e.ShaderChunk["shadowmap_pars_fragment"]="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif" -;e.ShaderChunk["skinning_pars_vertex"]="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n";e.ShaderChunk["logdepthbuf_pars_fragment"]="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif";e.ShaderChunk["alphamap_fragment"]="#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";e.ShaderChunk["alphamap_pars_fragment"]="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n";e.UniformsUtils={merge:function(e){var t={};for(var r=0;r dashSize ) {","\t\tdiscard;","\t}","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",e.ShaderChunk["logdepthbuf_fragment"],e.ShaderChunk["color_fragment"],"\toutgoingLight = diffuseColor.rgb;",e.ShaderChunk["fog_fragment"],"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[e.ShaderChunk["common"],e.ShaderChunk["morphtarget_pars_vertex"],e.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",e.ShaderChunk["morphtarget_vertex"],e.ShaderChunk["default_vertex"],e.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;",e.ShaderChunk["common"],e.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {",e.ShaderChunk["logdepthbuf_fragment"],"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;","\t#else","\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;","\t#endif","\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );","\tgl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",e.ShaderChunk["common"],e.ShaderChunk["morphtarget_pars_vertex"],e.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {","\tvNormal = normalize( normalMatrix * normal );",e.ShaderChunk["morphtarget_vertex"],e.ShaderChunk["default_vertex"],e.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;",e.ShaderChunk["common"],e.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",e.ShaderChunk["logdepthbuf_fragment"],"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",e.ShaderChunk["common"],e.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",e.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;",e.ShaderChunk["common"],e.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",e.ShaderChunk["logdepthbuf_fragment"],"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",e.ShaderChunk["common"],e.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",e.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","uniform float tFlip;","varying vec3 vWorldPosition;",e.ShaderChunk["common"],e.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","vec3 direction = normalize( vWorldPosition );","vec2 sampleUV;","sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );","sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","gl_FragColor = texture2D( tEquirect, sampleUV );",e.ShaderChunk["logdepthbuf_fragment"],"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[e.ShaderChunk["common"],e.ShaderChunk["morphtarget_pars_vertex"],e.ShaderChunk["skinning_pars_vertex"],e.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",e.ShaderChunk["skinbase_vertex"],e.ShaderChunk["morphtarget_vertex"],e.ShaderChunk["skinning_vertex"],e.ShaderChunk["default_vertex"],e.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:[e.ShaderChunk["common"],e.ShaderChunk["logdepthbuf_pars_fragment"],"vec4 pack_depth( const in float depth ) {","\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );","\tres -= res.xxyz * bit_mask;","\treturn res;","}","void main() {",e.ShaderChunk["logdepthbuf_fragment"],"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );","\t#else","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );","\t#endif","}"].join("\n")}};e.WebGLRenderer=function(t){t=t||{};var r=t.canvas!==undefined?t.canvas:document.createElement("canvas"),n=t.context!==undefined?t.context:null,i=1,a=t.precision!==undefined?t.precision:"highp",o=t.alpha!==undefined?t.alpha:false,s=t.depth!==undefined?t.depth:true,u=t.stencil!==undefined?t.stencil:true,l=t.antialias!==undefined?t.antialias:false,c=t.premultipliedAlpha!==undefined?t.premultipliedAlpha:true,f=t.preserveDrawingBuffer!==undefined?t.preserveDrawingBuffer:false,h=t.logarithmicDepthBuffer!==undefined?t.logarithmicDepthBuffer:false,d=new e.Color(0),p=0;var m=[];var v={};var y=[];var g=[];var b=[];var x=[];var _=[];this.domElement=r;this.context=null;this.autoClear=true;this.autoClearColor=true;this.autoClearDepth=true;this.autoClearStencil=true;this.sortObjects=true;this.gammaFactor=2;this.gammaInput=false;this.gammaOutput=false;this.shadowMapEnabled=false;this.shadowMapType=e.PCFShadowMap;this.shadowMapCullFace=e.CullFaceFront;this.shadowMapDebug=false;this.shadowMapCascade=false;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=true;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var w=this,C=[],E=null,S=null,T=-1,M="",A=null,P=0,R=0,k=0,I=r.width,D=r.height,B=0,L=0,F=new e.Frustum,V=new e.Matrix4,O=new e.Vector3,U=new e.Vector3,N=true,z={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};var H;var j=function(e){e.preventDefault();K();Y();v={}};try{var G={alpha:o,depth:s,stencil:u,antialias:l,premultipliedAlpha:c,preserveDrawingBuffer:f};H=n||r.getContext("webgl",G)||r.getContext("experimental-webgl",G);if(H===null){if(r.getContext("webgl")!==null){throw"Error creating WebGL context with your selected attributes."}else{throw"Error creating WebGL context."}}r.addEventListener("webglcontextlost",j,false)}catch(t){e.error("THREE.WebGLRenderer: "+t)}this.dispose=function(){r.removeEventListener("webglcontextlost",j,false)};var W=new e.WebGLState(H,Rt);if(H.getShaderPrecisionFormat===undefined){H.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}}var q=new e.WebGLExtensions(H);q.get("OES_texture_float");q.get("OES_texture_float_linear");q.get("OES_texture_half_float");q.get("OES_texture_half_float_linear");q.get("OES_standard_derivatives");if(h){q.get("EXT_frag_depth")}var X=function(e,t,r,n){if(c===true){e*=n;t*=n;r*=n}H.clearColor(e,t,r,n)};var Y=function(){H.clearColor(0,0,0,1);H.clearDepth(1);H.clearStencil(0);H.enable(H.DEPTH_TEST);H.depthFunc(H.LEQUAL);H.frontFace(H.CCW);H.cullFace(H.BACK);H.enable(H.CULL_FACE);H.enable(H.BLEND);H.blendEquation(H.FUNC_ADD);H.blendFunc(H.SRC_ALPHA,H.ONE_MINUS_SRC_ALPHA);H.viewport(R,k,I,D);X(d.r,d.g,d.b,p)};var K=function(){E=null;A=null;M="";T=-1;N=true;W.reset()};Y();this.context=H;this.state=W;var Q=H.getParameter(H.MAX_TEXTURE_IMAGE_UNITS);var Z=H.getParameter(H.MAX_VERTEX_TEXTURE_IMAGE_UNITS);var J=H.getParameter(H.MAX_TEXTURE_SIZE);var $=H.getParameter(H.MAX_CUBE_MAP_TEXTURE_SIZE);var ee=Z>0;var te=ee&&q.get("OES_texture_float");var re=H.getShaderPrecisionFormat(H.VERTEX_SHADER,H.HIGH_FLOAT);var ne=H.getShaderPrecisionFormat(H.VERTEX_SHADER,H.MEDIUM_FLOAT);var ie=H.getShaderPrecisionFormat(H.FRAGMENT_SHADER,H.HIGH_FLOAT);var ae=H.getShaderPrecisionFormat(H.FRAGMENT_SHADER,H.MEDIUM_FLOAT);var oe=function(){var e;return function(){if(e!==undefined){return e}e=[];if(q.get("WEBGL_compressed_texture_pvrtc")||q.get("WEBGL_compressed_texture_s3tc")){var t=H.getParameter(H.COMPRESSED_TEXTURE_FORMATS);for(var r=0;r0&&ie.precision>0;var ue=ne.precision>0&&ae.precision>0;if(a==="highp"&&!se){if(ue){a="mediump";e.warn("THREE.WebGLRenderer: highp not supported, using mediump.")}else{a="lowp";e.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")}}if(a==="mediump"&&!ue){a="lowp";e.warn("THREE.WebGLRenderer: mediump not supported, using lowp.")}var le=new e.ShadowMapPlugin(this,m,v,y);var ce=new e.SpritePlugin(this,x);var fe=new e.LensFlarePlugin(this,_);this.getContext=function(){return H};this.forceContextLoss=function(){q.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return ee};this.supportsFloatTextures=function(){return q.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return q.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return q.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return q.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return q.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return q.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var e;return function(){if(e!==undefined){return e}var t=q.get("EXT_texture_filter_anisotropic");e=t!==null?H.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0;return e}}();this.getPrecision=function(){return a};this.getPixelRatio=function(){return i};this.setPixelRatio=function(e){i=e};this.setSize=function(e,t,n){r.width=e*i;r.height=t*i;if(n!==false){r.style.width=e+"px";r.style.height=t+"px"}this.setViewport(0,0,e,t)};this.setViewport=function(e,t,r,n){R=e*i;k=t*i;I=r*i;D=n*i;H.viewport(R,k,I,D)};this.setScissor=function(e,t,r,n){H.scissor(e*i,t*i,r*i,n*i)};this.enableScissorTest=function(e){e?H.enable(H.SCISSOR_TEST):H.disable(H.SCISSOR_TEST)};this.getClearColor=function(){return d};this.setClearColor=function(e,t){d.set(e);p=t!==undefined?t:1;X(d.r,d.g,d.b,p)};this.getClearAlpha=function(){return p};this.setClearAlpha=function(e){p=e;X(d.r,d.g,d.b,p)};this.clear=function(e,t,r){var n=0;if(e===undefined||e)n|=H.COLOR_BUFFER_BIT;if(t===undefined||t)n|=H.DEPTH_BUFFER_BIT;if(r===undefined||r)n|=H.STENCIL_BUFFER_BIT;H.clear(n)};this.clearColor=function(){H.clear(H.COLOR_BUFFER_BIT)};this.clearDepth=function(){H.clear(H.DEPTH_BUFFER_BIT)};this.clearStencil=function(){H.clear(H.STENCIL_BUFFER_BIT)};this.clearTarget=function(e,t,r,n){this.setRenderTarget(e);this.clear(t,r,n)};this.resetGLState=K;function he(e){e.__webglVertexBuffer=H.createBuffer();e.__webglColorBuffer=H.createBuffer();w.info.memory.geometries++}function de(e){e.__webglVertexBuffer=H.createBuffer();e.__webglColorBuffer=H.createBuffer();e.__webglLineDistanceBuffer=H.createBuffer();w.info.memory.geometries++}function pe(e){e.__webglVertexBuffer=H.createBuffer();e.__webglNormalBuffer=H.createBuffer();e.__webglTangentBuffer=H.createBuffer();e.__webglColorBuffer=H.createBuffer();e.__webglUVBuffer=H.createBuffer();e.__webglUV2Buffer=H.createBuffer();e.__webglSkinIndicesBuffer=H.createBuffer();e.__webglSkinWeightsBuffer=H.createBuffer();e.__webglFaceBuffer=H.createBuffer();e.__webglLineBuffer=H.createBuffer();var t=e.numMorphTargets;if(t){e.__webglMorphTargetsBuffers=[];for(var r=0,n=t;r1){e.__uv2Array=new Float32Array(i*2)}if(r.hasTangents){e.__tangentArray=new Float32Array(i*4)}if(t.geometry.skinWeights.length&&t.geometry.skinIndices.length){e.__skinIndexArray=new Float32Array(i*4);e.__skinWeightArray=new Float32Array(i*4)}var u=q.get("OES_element_index_uint")!==null&&a>21845?Uint32Array:Uint16Array;e.__typeArray=u;e.__faceArray=new u(a*3);e.__lineArray=new u(o*2);var l=e.numMorphTargets;if(l){e.__morphTargetsArrays=[];for(var c=0,f=l;c0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglSkinIndicesBuffer);H.bufferData(H.ARRAY_BUFFER,de,n);H.bindBuffer(H.ARRAY_BUFFER,t.__webglSkinWeightsBuffer);H.bufferData(H.ARRAY_BUFFER,pe,n)}}if(Me){for(s=0,u=ke.length;s0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglColorBuffer);H.bufferData(H.ARRAY_BUFFER,he,n)}}if(Te&&_e.hasTangents){for(s=0,u=ke.length;s0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglUVBuffer);H.bufferData(H.ARRAY_BUFFER,ue,n)}}if(Ee&&Be){for(s=0,u=ke.length;s0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglUV2Buffer);H.bufferData(H.ARRAY_BUFFER,le,n)}}if(Ce){for(s=0,u=ke.length;s=0){var f=i[l];if(f!==undefined){var h=f.itemSize;H.bindBuffer(H.ARRAY_BUFFER,f.buffer);W.enableAttribute(c);H.vertexAttribPointer(c,h,H.FLOAT,false,0,n*h*4)}else if(e.defaultAttributeValues!==undefined){if(e.defaultAttributeValues[l].length===2){H.vertexAttrib2fv(c,e.defaultAttributeValues[l])}else if(e.defaultAttributeValues[l].length===3){H.vertexAttrib3fv(c,e.defaultAttributeValues[l])}}}}W.disableUnusedAttributes()}this.renderBufferDirect=function(t,r,n,a,o,s){if(a.visible===false)return;Ze(s);var u=at(t,r,n,a,s);var l=false,c=a.wireframe?1:0,f="direct_"+o.id+"_"+u.id+"_"+c;if(f!==M){M=f;l=true}if(l){W.initAttributes()}if(s instanceof e.Mesh){var h=a.wireframe===true?H.LINES:H.TRIANGLES;var d=o.attributes.index;if(d){var p,m;if(d.array instanceof Uint32Array&&q.get("OES_element_index_uint")){p=H.UNSIGNED_INT;m=4}else{p=H.UNSIGNED_SHORT;m=2}var v=o.offsets;if(v.length===0){if(l){Be(a,u,o,0);H.bindBuffer(H.ELEMENT_ARRAY_BUFFER,d.buffer)}H.drawElements(h,d.array.length,p,0);w.info.render.calls++;w.info.render.vertices+=d.array.length;w.info.render.faces+=d.array.length/3}else{l=true;for(var y=0,g=v.length;y1)l=true;for(var y=0,g=v.length;y1)l=true;for(var y=0,g=v.length;y=0){if(c){H.bindBuffer(H.ARRAY_BUFFER,o.__webglVertexBuffer);W.enableAttribute(l.position);H.vertexAttribPointer(l.position,3,H.FLOAT,false,0,0)}}else{if(s.morphTargetBase){Le(a,o,s)}}if(c){if(o.__webglCustomAttributesList){for(var d=0,p=o.__webglCustomAttributesList.length;d=0){H.bindBuffer(H.ARRAY_BUFFER,m.buffer);W.enableAttribute(l[m.buffer.belongsToAttribute]);H.vertexAttribPointer(l[m.buffer.belongsToAttribute],m.size,H.FLOAT,false,0,0)}}}if(l.color>=0){if(s.geometry.colors.length>0||s.geometry.faces.length>0){H.bindBuffer(H.ARRAY_BUFFER,o.__webglColorBuffer);W.enableAttribute(l.color);H.vertexAttribPointer(l.color,3,H.FLOAT,false,0,0)}else if(a.defaultAttributeValues!==undefined){H.vertexAttrib3fv(l.color,a.defaultAttributeValues.color)}}if(l.normal>=0){H.bindBuffer(H.ARRAY_BUFFER,o.__webglNormalBuffer);W.enableAttribute(l.normal);H.vertexAttribPointer(l.normal,3,H.FLOAT,false,0,0)}if(l.tangent>=0){H.bindBuffer(H.ARRAY_BUFFER,o.__webglTangentBuffer);W.enableAttribute(l.tangent);H.vertexAttribPointer(l.tangent,4,H.FLOAT,false,0,0)}if(l.uv>=0){if(s.geometry.faceVertexUvs[0]){H.bindBuffer(H.ARRAY_BUFFER,o.__webglUVBuffer);W.enableAttribute(l.uv);H.vertexAttribPointer(l.uv,2,H.FLOAT,false,0,0)}else if(a.defaultAttributeValues!==undefined){H.vertexAttrib2fv(l.uv,a.defaultAttributeValues.uv)}}if(l.uv2>=0){if(s.geometry.faceVertexUvs[1]){H.bindBuffer(H.ARRAY_BUFFER,o.__webglUV2Buffer);W.enableAttribute(l.uv2);H.vertexAttribPointer(l.uv2,2,H.FLOAT,false,0,0)}else if(a.defaultAttributeValues!==undefined){H.vertexAttrib2fv(l.uv2,a.defaultAttributeValues.uv2)}}if(a.skinning&&l.skinIndex>=0&&l.skinWeight>=0){H.bindBuffer(H.ARRAY_BUFFER,o.__webglSkinIndicesBuffer);W.enableAttribute(l.skinIndex);H.vertexAttribPointer(l.skinIndex,4,H.FLOAT,false,0,0);H.bindBuffer(H.ARRAY_BUFFER,o.__webglSkinWeightsBuffer);W.enableAttribute(l.skinWeight);H.vertexAttribPointer(l.skinWeight,4,H.FLOAT,false,0,0)}if(l.lineDistance>=0){H.bindBuffer(H.ARRAY_BUFFER,o.__webglLineDistanceBuffer);W.enableAttribute(l.lineDistance);H.vertexAttribPointer(l.lineDistance,1,H.FLOAT,false,0,0)}}W.disableUnusedAttributes();if(s instanceof e.Mesh){var v=o.__typeArray===Uint32Array?H.UNSIGNED_INT:H.UNSIGNED_SHORT;if(a.wireframe){W.setLineWidth(a.wireframeLinewidth*i);if(c)H.bindBuffer(H.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer);H.drawElements(H.LINES,o.__webglLineCount,v,0)}else{if(c)H.bindBuffer(H.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer);H.drawElements(H.TRIANGLES,o.__webglFaceCount,v,0)}w.info.render.calls++;w.info.render.vertices+=o.__webglFaceCount;w.info.render.faces+=o.__webglFaceCount/3}else if(s instanceof e.Line){var y=s.mode===e.LineStrip?H.LINE_STRIP:H.LINES;W.setLineWidth(a.linewidth*i);H.drawArrays(y,0,o.__webglLineCount);w.info.render.calls++}else if(s instanceof e.PointCloud){H.drawArrays(H.POINTS,0,o.__webglParticleCount);w.info.render.calls++;w.info.render.points+=o.__webglParticleCount}};function Le(e,t,r){var n=e.program.attributes;if(r.morphTargetBase!==-1&&n.position>=0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[r.morphTargetBase]);W.enableAttribute(n.position);H.vertexAttribPointer(n.position,3,H.FLOAT,false,0,0)}else if(n.position>=0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglVertexBuffer);W.enableAttribute(n.position);H.vertexAttribPointer(n.position,3,H.FLOAT,false,0,0)}if(r.morphTargetForcedOrder.length){var i=0;var a=r.morphTargetForcedOrder;var o=r.morphTargetInfluences;var s;while(i=0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[a[i]]);W.enableAttribute(s);H.vertexAttribPointer(s,3,H.FLOAT,false,0,0)}s=n["morphNormal"+i];if(s>=0&&e.morphNormals){H.bindBuffer(H.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[a[i]]);W.enableAttribute(s);H.vertexAttribPointer(s,3,H.FLOAT,false,0,0)}r.__webglMorphTargetInfluences[i]=o[a[i]];i++}}else{var u=[];var o=r.morphTargetInfluences;var l=r.geometry.morphTargets;if(o.length>l.length){console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array.");o.length=l.length}for(var c=0,f=o.length;ce.numSupportedMorphTargets){u.sort(Oe);u.length=e.numSupportedMorphTargets}else if(u.length>e.numSupportedMorphNormals){u.sort(Oe)}else if(u.length===0){u.push([0,0])}var s;for(var i=0,d=e.numSupportedMorphTargets;i=0){H.bindBuffer(H.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[p]);W.enableAttribute(s);H.vertexAttribPointer(s,3,H.FLOAT,false,0,0)}s=n["morphNormal"+i];if(s>=0&&e.morphNormals){H.bindBuffer(H.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[p]);W.enableAttribute(s);H.vertexAttribPointer(s,3,H.FLOAT,false,0,0)}r.__webglMorphTargetInfluences[i]=o[p]}else{r.__webglMorphTargetInfluences[i]=0}}}if(e.program.uniforms.morphTargetInfluences!==null){H.uniform1fv(e.program.uniforms.morphTargetInfluences,r.__webglMorphTargetInfluences)}}function Fe(e,t){if(e.object.renderOrder!==t.object.renderOrder){return e.object.renderOrder-t.object.renderOrder}else if(e.material.id!==t.material.id){return e.material.id-t.material.id}else if(e.z!==t.z){return e.z-t.z}else{return e.id-t.id}}function Ve(e,t){if(e.object.renderOrder!==t.object.renderOrder){return e.object.renderOrder-t.object.renderOrder}if(e.z!==t.z){return t.z-e.z}else{return e.id-t.id}}function Oe(e,t){return t[0]-e[0]}this.render=function(t,r,n,i){if(r instanceof e.Camera===false){e.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}var a=t.fog;M="";T=-1;A=null;N=true;if(t.autoUpdate===true)t.updateMatrixWorld();if(r.parent===undefined)r.updateMatrixWorld();t.traverse(function(t){if(t instanceof e.SkinnedMesh){t.skeleton.update()}});r.matrixWorldInverse.getInverse(r.matrixWorld);V.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse);F.setFromMatrix(V);m.length=0;g.length=0;b.length=0;x.length=0;_.length=0;Ue(t);if(w.sortObjects===true){g.sort(Fe);b.sort(Ve)}le.render(t,r);w.info.render.calls=0;w.info.render.vertices=0;w.info.render.faces=0;w.info.render.points=0;this.setRenderTarget(n);if(this.autoClear||i){this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil)}for(var o=0,s=y.length;or){i[d].counter+=1;n=i[d].hash+"_"+i[d].counter;if(!(n in u)){s={id:qe++,faces3:[],materialIndex:d,vertices:0,numMorphTargets:a,numMorphNormals:o};u[n]=s;l.push(s)}}u[n].faces3.push(c);u[n].vertices+=3}return l}function Ye(t,r){var n=t.material,i=false;if(We[r.id]===undefined||r.groupsNeedUpdate===true){delete v[t.id];We[r.id]=Xe(r,n instanceof e.MeshFaceMaterial);r.groupsNeedUpdate=false}var a=We[r.id];for(var o=0,s=a.length;o=0;r--){if(e[r].object===t){e.splice(r,1)}}}var rt={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};function nt(t,r,n,i){t.addEventListener("dispose",be);var o=rt[t.type];if(o){var s=e.ShaderLib[o];t.__webglShader={uniforms:e.UniformsUtils.clone(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader}}else{t.__webglShader={uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}}var u=It(r);var l=Dt(r);var c=kt(i);var f={precision:a,supportsVertexTextures:ee,map:!!t.map,envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,lightMap:!!t.lightMap,bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,combine:t.combine,vertexColors:t.vertexColors,fog:n,useFog:t.fog,fogExp:n instanceof e.FogExp2,flatShading:t.shading===e.FlatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:h,skinning:t.skinning,maxBones:c,useVertexTexture:te&&i&&i.skeleton&&i.skeleton.useVertexTexture,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:w.maxMorphTargets,maxMorphNormals:w.maxMorphNormals,maxDirLights:u.directional,maxPointLights:u.point,maxSpotLights:u.spot,maxHemiLights:u.hemi,maxShadows:l,shadowMapEnabled:w.shadowMapEnabled&&i.receiveShadow&&l>0,shadowMapType:w.shadowMapType,shadowMapDebug:w.shadowMapDebug,shadowMapCascade:w.shadowMapCascade,alphaTest:t.alphaTest,metal:t.metal,wrapAround:t.wrapAround,doubleSided:t.side===e.DoubleSide,flipSided:t.side===e.BackSide};var d=[];if(o){d.push(o)}else{d.push(t.fragmentShader);d.push(t.vertexShader)}if(t.defines!==undefined){for(var p in t.defines){d.push(p);d.push(t.defines[p])}}for(var p in f){d.push(p);d.push(f[p])}var m=d.join();var v;for(var y=0,g=C.length;y=0){t.numSupportedMorphTargets++}}}if(t.morphNormals){t.numSupportedMorphNormals=0;var _,E="morphNormal";for(S=0;S=0){t.numSupportedMorphNormals++}}}t.uniformsList=[];for(var T in t.__webglShader.uniforms){var M=t.program.uniforms[T];if(M){t.uniformsList.push([t.__webglShader.uniforms[T],M])}}}function it(t){if(t.transparent===true){W.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha)}else{W.setBlending(e.NoBlending)}W.setDepthTest(t.depthTest);W.setDepthWrite(t.depthWrite);W.setColorWrite(t.colorWrite);W.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function at(t,r,n,i,a){P=0;if(i.needsUpdate){if(i.program)Ee(i);nt(i,r,n,a);i.needsUpdate=false}if(i.morphTargets){if(!a.__webglMorphTargetInfluences){a.__webglMorphTargetInfluences=new Float32Array(w.maxMorphTargets)}}var o=false;var s=false;var u=false;var l=i.program,c=l.uniforms,f=i.__webglShader.uniforms;if(l.id!==E){H.useProgram(l.program);E=l.id;o=true;s=true;u=true}if(i.id!==T){if(T===-1)u=true;T=i.id;s=true}if(o||t!==A){H.uniformMatrix4fv(c.projectionMatrix,false,t.projectionMatrix.elements);if(h){H.uniform1f(c.logDepthBufFC,2/(Math.log(t.far+1)/Math.LN2))}if(t!==A)A=t;if(i instanceof e.ShaderMaterial||i instanceof e.MeshPhongMaterial||i.envMap){if(c.cameraPosition!==null){O.setFromMatrixPosition(t.matrixWorld) -;H.uniform3f(c.cameraPosition,O.x,O.y,O.z)}}if(i instanceof e.MeshPhongMaterial||i instanceof e.MeshLambertMaterial||i instanceof e.MeshBasicMaterial||i instanceof e.ShaderMaterial||i.skinning){if(c.viewMatrix!==null){H.uniformMatrix4fv(c.viewMatrix,false,t.matrixWorldInverse.elements)}}}if(i.skinning){if(a.bindMatrix&&c.bindMatrix!==null){H.uniformMatrix4fv(c.bindMatrix,false,a.bindMatrix.elements)}if(a.bindMatrixInverse&&c.bindMatrixInverse!==null){H.uniformMatrix4fv(c.bindMatrixInverse,false,a.bindMatrixInverse.elements)}if(te&&a.skeleton&&a.skeleton.useVertexTexture){if(c.boneTexture!==null){var d=yt();H.uniform1i(c.boneTexture,d);w.setTexture(a.skeleton.boneTexture,d)}if(c.boneTextureWidth!==null){H.uniform1i(c.boneTextureWidth,a.skeleton.boneTextureWidth)}if(c.boneTextureHeight!==null){H.uniform1i(c.boneTextureHeight,a.skeleton.boneTextureHeight)}}else if(a.skeleton&&a.skeleton.boneMatrices){if(c.boneGlobalMatrices!==null){H.uniformMatrix4fv(c.boneGlobalMatrices,false,a.skeleton.boneMatrices)}}}if(s){if(n&&i.fog){ct(f,n)}if(i instanceof e.MeshPhongMaterial||i instanceof e.MeshLambertMaterial||i.lights){if(N){u=true;_t(r);N=false}if(u){dt(f,z);pt(f,true)}else{pt(f,false)}}if(i instanceof e.MeshBasicMaterial||i instanceof e.MeshLambertMaterial||i instanceof e.MeshPhongMaterial){ot(f,i)}if(i instanceof e.LineBasicMaterial){st(f,i)}else if(i instanceof e.LineDashedMaterial){st(f,i);ut(f,i)}else if(i instanceof e.PointCloudMaterial){lt(f,i)}else if(i instanceof e.MeshPhongMaterial){ft(f,i)}else if(i instanceof e.MeshLambertMaterial){ht(f,i)}else if(i instanceof e.MeshDepthMaterial){f.mNear.value=t.near;f.mFar.value=t.far;f.opacity.value=i.opacity}else if(i instanceof e.MeshNormalMaterial){f.opacity.value=i.opacity}if(a.receiveShadow&&!i._shadowPass){mt(f,r)}gt(i.uniformsList)}vt(c,a);if(c.modelMatrix!==null){H.uniformMatrix4fv(c.modelMatrix,false,a.matrixWorld.elements)}return l}function ot(t,r){t.opacity.value=r.opacity;t.diffuse.value=r.color;t.map.value=r.map;t.lightMap.value=r.lightMap;t.specularMap.value=r.specularMap;t.alphaMap.value=r.alphaMap;if(r.bumpMap){t.bumpMap.value=r.bumpMap;t.bumpScale.value=r.bumpScale}if(r.normalMap){t.normalMap.value=r.normalMap;t.normalScale.value.copy(r.normalScale)}var n;if(r.map){n=r.map}else if(r.specularMap){n=r.specularMap}else if(r.normalMap){n=r.normalMap}else if(r.bumpMap){n=r.bumpMap}else if(r.alphaMap){n=r.alphaMap}if(n!==undefined){var i=n.offset;var a=n.repeat;t.offsetRepeat.value.set(i.x,i.y,a.x,a.y)}t.envMap.value=r.envMap;t.flipEnvMap.value=r.envMap instanceof e.WebGLRenderTargetCube?1:-1;t.reflectivity.value=r.reflectivity;t.refractionRatio.value=r.refractionRatio}function st(e,t){e.diffuse.value=t.color;e.opacity.value=t.opacity}function ut(e,t){e.dashSize.value=t.dashSize;e.totalSize.value=t.dashSize+t.gapSize;e.scale.value=t.scale}function lt(e,t){e.psColor.value=t.color;e.opacity.value=t.opacity;e.size.value=t.size;e.scale.value=r.height/2;e.map.value=t.map;if(t.map!==null){var n=t.map.offset;var i=t.map.repeat;e.offsetRepeat.value.set(n.x,n.y,i.x,i.y)}}function ct(t,r){t.fogColor.value=r.color;if(r instanceof e.Fog){t.fogNear.value=r.near;t.fogFar.value=r.far}else if(r instanceof e.FogExp2){t.fogDensity.value=r.density}}function ft(e,t){e.shininess.value=t.shininess;e.emissive.value=t.emissive;e.specular.value=t.specular;if(t.wrapAround){e.wrapRGB.value.copy(t.wrapRGB)}}function ht(e,t){e.emissive.value=t.emissive;if(t.wrapAround){e.wrapRGB.value.copy(t.wrapRGB)}}function dt(e,t){e.ambientLightColor.value=t.ambient;e.directionalLightColor.value=t.directional.colors;e.directionalLightDirection.value=t.directional.positions;e.pointLightColor.value=t.point.colors;e.pointLightPosition.value=t.point.positions;e.pointLightDistance.value=t.point.distances;e.pointLightDecay.value=t.point.decays;e.spotLightColor.value=t.spot.colors;e.spotLightPosition.value=t.spot.positions;e.spotLightDistance.value=t.spot.distances;e.spotLightDirection.value=t.spot.directions;e.spotLightAngleCos.value=t.spot.anglesCos;e.spotLightExponent.value=t.spot.exponents;e.spotLightDecay.value=t.spot.decays;e.hemisphereLightSkyColor.value=t.hemi.skyColors;e.hemisphereLightGroundColor.value=t.hemi.groundColors;e.hemisphereLightDirection.value=t.hemi.positions}function pt(e,t){e.ambientLightColor.needsUpdate=t;e.directionalLightColor.needsUpdate=t;e.directionalLightDirection.needsUpdate=t;e.pointLightColor.needsUpdate=t;e.pointLightPosition.needsUpdate=t;e.pointLightDistance.needsUpdate=t;e.pointLightDecay.needsUpdate=t;e.spotLightColor.needsUpdate=t;e.spotLightPosition.needsUpdate=t;e.spotLightDistance.needsUpdate=t;e.spotLightDirection.needsUpdate=t;e.spotLightAngleCos.needsUpdate=t;e.spotLightExponent.needsUpdate=t;e.spotLightDecay.needsUpdate=t;e.hemisphereLightSkyColor.needsUpdate=t;e.hemisphereLightGroundColor.needsUpdate=t;e.hemisphereLightDirection.needsUpdate=t}function mt(t,r){if(t.shadowMatrix){var n=0;for(var i=0,a=r.length;i=Q){e.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+Q)}P+=1;return t}function gt(t){var r,n,i;for(var a=0,o=t.length;a1||r.__currentAnisotropy){H.texParameterf(t,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r.anisotropy,w.getMaxAnisotropy()));r.__currentAnisotropy=r.anisotropy}}}this.uploadTexture=function(t){if(t.__webglInit===undefined){t.__webglInit=true;t.addEventListener("dispose",ye);t.__webglTexture=H.createTexture();w.info.memory.textures++}H.bindTexture(H.TEXTURE_2D,t.__webglTexture);H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,t.flipY);H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha);H.pixelStorei(H.UNPACK_ALIGNMENT,t.unpackAlignment);t.image=Ct(t.image,J);var r=t.image,n=e.Math.isPowerOfTwo(r.width)&&e.Math.isPowerOfTwo(r.height),i=Rt(t.format),a=Rt(t.type);wt(H.TEXTURE_2D,t,n);var o,s=t.mipmaps;if(t instanceof e.DataTexture){if(s.length>0&&n){for(var u=0,l=s.length;u-1){H.compressedTexImage2D(H.TEXTURE_2D,u,i,o.width,o.height,0,o.data)}else{e.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()")}}else{H.texImage2D(H.TEXTURE_2D,u,i,o.width,o.height,0,i,a,o.data)}}}else{if(s.length>0&&n){for(var u=0,l=s.length;ur||t.height>r){var n=r/Math.max(t.width,t.height);var i=document.createElement("canvas");i.width=Math.floor(t.width*n);i.height=Math.floor(t.height*n);var a=i.getContext("2d");a.drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height);e.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height,t);return i}return t}function Et(t,r){if(t.image.length===6){if(t.needsUpdate){if(!t.image.__webglTextureCube){t.addEventListener("dispose",ye);t.image.__webglTextureCube=H.createTexture();w.info.memory.textures++}H.activeTexture(H.TEXTURE0+r);H.bindTexture(H.TEXTURE_CUBE_MAP,t.image.__webglTextureCube);H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,t.flipY);var n=t instanceof e.CompressedTexture;var i=t.image[0]instanceof e.DataTexture;var a=[];for(var o=0;o<6;o++){if(w.autoScaleCubemaps&&!n&&!i){a[o]=Ct(t.image[o],$)}else{a[o]=i?t.image[o].image:t.image[o]}}var s=a[0],u=e.Math.isPowerOfTwo(s.width)&&e.Math.isPowerOfTwo(s.height),l=Rt(t.format),c=Rt(t.type);wt(H.TEXTURE_CUBE_MAP,t,u);for(var o=0;o<6;o++){if(!n){if(i){H.texImage2D(H.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,l,a[o].width,a[o].height,0,l,c,a[o].data)}else{H.texImage2D(H.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,l,l,c,a[o])}}else{var f,h=a[o].mipmaps;for(var d=0,p=h.length;d-1){H.compressedTexImage2D(H.TEXTURE_CUBE_MAP_POSITIVE_X+o,d,l,f.width,f.height,0,f.data)}else{e.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()")}}else{H.texImage2D(H.TEXTURE_CUBE_MAP_POSITIVE_X+o,d,l,f.width,f.height,0,l,c,f.data)}}}}if(t.generateMipmaps&&u){H.generateMipmap(H.TEXTURE_CUBE_MAP)}t.needsUpdate=false;if(t.onUpdate)t.onUpdate()}else{H.activeTexture(H.TEXTURE0+r);H.bindTexture(H.TEXTURE_CUBE_MAP,t.image.__webglTextureCube)}}}function St(e,t){H.activeTexture(H.TEXTURE0+t);H.bindTexture(H.TEXTURE_CUBE_MAP,e.__webglTexture)}function Tt(e,t,r){H.bindFramebuffer(H.FRAMEBUFFER,e);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,r,t.__webglTexture,0)}function Mt(e,t){H.bindRenderbuffer(H.RENDERBUFFER,e);if(t.depthBuffer&&!t.stencilBuffer){H.renderbufferStorage(H.RENDERBUFFER,H.DEPTH_COMPONENT16,t.width,t.height);H.framebufferRenderbuffer(H.FRAMEBUFFER,H.DEPTH_ATTACHMENT,H.RENDERBUFFER,e)}else if(t.depthBuffer&&t.stencilBuffer){H.renderbufferStorage(H.RENDERBUFFER,H.DEPTH_STENCIL,t.width,t.height);H.framebufferRenderbuffer(H.FRAMEBUFFER,H.DEPTH_STENCIL_ATTACHMENT,H.RENDERBUFFER,e)}else{H.renderbufferStorage(H.RENDERBUFFER,H.RGBA4,t.width,t.height)}}this.setRenderTarget=function(t){var r=t instanceof e.WebGLRenderTargetCube;if(t&&t.__webglFramebuffer===undefined){if(t.depthBuffer===undefined)t.depthBuffer=true;if(t.stencilBuffer===undefined)t.stencilBuffer=true;t.addEventListener("dispose",ge);t.__webglTexture=H.createTexture();w.info.memory.textures++;var n=e.Math.isPowerOfTwo(t.width)&&e.Math.isPowerOfTwo(t.height),i=Rt(t.format),a=Rt(t.type);if(r){t.__webglFramebuffer=[];t.__webglRenderbuffer=[];H.bindTexture(H.TEXTURE_CUBE_MAP,t.__webglTexture);wt(H.TEXTURE_CUBE_MAP,t,n);for(var o=0;o<6;o++){t.__webglFramebuffer[o]=H.createFramebuffer();t.__webglRenderbuffer[o]=H.createRenderbuffer();H.texImage2D(H.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,i,t.width,t.height,0,i,a,null);Tt(t.__webglFramebuffer[o],t,H.TEXTURE_CUBE_MAP_POSITIVE_X+o);Mt(t.__webglRenderbuffer[o],t)}if(n)H.generateMipmap(H.TEXTURE_CUBE_MAP)}else{t.__webglFramebuffer=H.createFramebuffer();if(t.shareDepthFrom){t.__webglRenderbuffer=t.shareDepthFrom.__webglRenderbuffer}else{t.__webglRenderbuffer=H.createRenderbuffer()}H.bindTexture(H.TEXTURE_2D,t.__webglTexture);wt(H.TEXTURE_2D,t,n);H.texImage2D(H.TEXTURE_2D,0,i,t.width,t.height,0,i,a,null);Tt(t.__webglFramebuffer,t,H.TEXTURE_2D);if(t.shareDepthFrom){if(t.depthBuffer&&!t.stencilBuffer){H.framebufferRenderbuffer(H.FRAMEBUFFER,H.DEPTH_ATTACHMENT,H.RENDERBUFFER,t.__webglRenderbuffer)}else if(t.depthBuffer&&t.stencilBuffer){H.framebufferRenderbuffer(H.FRAMEBUFFER,H.DEPTH_STENCIL_ATTACHMENT,H.RENDERBUFFER,t.__webglRenderbuffer)}}else{Mt(t.__webglRenderbuffer,t)}if(n)H.generateMipmap(H.TEXTURE_2D)}if(r){H.bindTexture(H.TEXTURE_CUBE_MAP,null)}else{H.bindTexture(H.TEXTURE_2D,null)}H.bindRenderbuffer(H.RENDERBUFFER,null);H.bindFramebuffer(H.FRAMEBUFFER,null)}var s,u,l,c,f;if(t){if(r){s=t.__webglFramebuffer[t.activeCubeFace]}else{s=t.__webglFramebuffer}u=t.width;l=t.height;c=0;f=0}else{s=null;u=I;l=D;c=R;f=k}if(s!==S){H.bindFramebuffer(H.FRAMEBUFFER,s);H.viewport(c,f,u,l);S=s}B=u;L=l};this.readRenderTargetPixels=function(t,r,n,i,a,o){if(!(t instanceof e.WebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}if(t.__webglFramebuffer){if(t.format!==e.RGBAFormat){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");return}var s=false;if(t.__webglFramebuffer!==S){H.bindFramebuffer(H.FRAMEBUFFER,t.__webglFramebuffer);s=true}if(H.checkFramebufferStatus(H.FRAMEBUFFER)===H.FRAMEBUFFER_COMPLETE){H.readPixels(r,n,i,a,H.RGBA,H.UNSIGNED_BYTE,o)}else{console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}if(s){H.bindFramebuffer(H.FRAMEBUFFER,S)}}};function At(t){if(t instanceof e.WebGLRenderTargetCube){H.bindTexture(H.TEXTURE_CUBE_MAP,t.__webglTexture);H.generateMipmap(H.TEXTURE_CUBE_MAP);H.bindTexture(H.TEXTURE_CUBE_MAP,null)}else{H.bindTexture(H.TEXTURE_2D,t.__webglTexture);H.generateMipmap(H.TEXTURE_2D);H.bindTexture(H.TEXTURE_2D,null)}}function Pt(t){if(t===e.NearestFilter||t===e.NearestMipMapNearestFilter||t===e.NearestMipMapLinearFilter){return H.NEAREST}return H.LINEAR}function Rt(t){var r;if(t===e.RepeatWrapping)return H.REPEAT;if(t===e.ClampToEdgeWrapping)return H.CLAMP_TO_EDGE;if(t===e.MirroredRepeatWrapping)return H.MIRRORED_REPEAT;if(t===e.NearestFilter)return H.NEAREST;if(t===e.NearestMipMapNearestFilter)return H.NEAREST_MIPMAP_NEAREST;if(t===e.NearestMipMapLinearFilter)return H.NEAREST_MIPMAP_LINEAR;if(t===e.LinearFilter)return H.LINEAR;if(t===e.LinearMipMapNearestFilter)return H.LINEAR_MIPMAP_NEAREST;if(t===e.LinearMipMapLinearFilter)return H.LINEAR_MIPMAP_LINEAR;if(t===e.UnsignedByteType)return H.UNSIGNED_BYTE;if(t===e.UnsignedShort4444Type)return H.UNSIGNED_SHORT_4_4_4_4;if(t===e.UnsignedShort5551Type)return H.UNSIGNED_SHORT_5_5_5_1;if(t===e.UnsignedShort565Type)return H.UNSIGNED_SHORT_5_6_5;if(t===e.ByteType)return H.BYTE;if(t===e.ShortType)return H.SHORT;if(t===e.UnsignedShortType)return H.UNSIGNED_SHORT;if(t===e.IntType)return H.INT;if(t===e.UnsignedIntType)return H.UNSIGNED_INT;if(t===e.FloatType)return H.FLOAT;r=q.get("OES_texture_half_float");if(r!==null){if(t===e.HalfFloatType)return r.HALF_FLOAT_OES}if(t===e.AlphaFormat)return H.ALPHA;if(t===e.RGBFormat)return H.RGB;if(t===e.RGBAFormat)return H.RGBA;if(t===e.LuminanceFormat)return H.LUMINANCE;if(t===e.LuminanceAlphaFormat)return H.LUMINANCE_ALPHA;if(t===e.AddEquation)return H.FUNC_ADD;if(t===e.SubtractEquation)return H.FUNC_SUBTRACT;if(t===e.ReverseSubtractEquation)return H.FUNC_REVERSE_SUBTRACT;if(t===e.ZeroFactor)return H.ZERO;if(t===e.OneFactor)return H.ONE;if(t===e.SrcColorFactor)return H.SRC_COLOR;if(t===e.OneMinusSrcColorFactor)return H.ONE_MINUS_SRC_COLOR;if(t===e.SrcAlphaFactor)return H.SRC_ALPHA;if(t===e.OneMinusSrcAlphaFactor)return H.ONE_MINUS_SRC_ALPHA;if(t===e.DstAlphaFactor)return H.DST_ALPHA;if(t===e.OneMinusDstAlphaFactor)return H.ONE_MINUS_DST_ALPHA;if(t===e.DstColorFactor)return H.DST_COLOR;if(t===e.OneMinusDstColorFactor)return H.ONE_MINUS_DST_COLOR;if(t===e.SrcAlphaSaturateFactor)return H.SRC_ALPHA_SATURATE;r=q.get("WEBGL_compressed_texture_s3tc");if(r!==null){if(t===e.RGB_S3TC_DXT1_Format)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===e.RGBA_S3TC_DXT1_Format)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===e.RGBA_S3TC_DXT3_Format)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===e.RGBA_S3TC_DXT5_Format)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}r=q.get("WEBGL_compressed_texture_pvrtc");if(r!==null){if(t===e.RGB_PVRTC_4BPPV1_Format)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===e.RGB_PVRTC_2BPPV1_Format)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===e.RGBA_PVRTC_4BPPV1_Format)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===e.RGBA_PVRTC_2BPPV1_Format)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}r=q.get("EXT_blend_minmax");if(r!==null){if(t===e.MinEquation)return r.MIN_EXT;if(t===e.MaxEquation)return r.MAX_EXT}return 0}function kt(t){if(te&&t&&t.skeleton&&t.skeleton.useVertexTexture){return 1024}else{var r=H.getParameter(H.MAX_VERTEX_UNIFORM_VECTORS);var n=Math.floor((r-20)/4);var i=n;if(t!==undefined&&t instanceof e.SkinnedMesh){i=Math.min(t.skeleton.bones.length,i);if(i0?a.gammaFactor:1;var w=r(f);var C=c.createProgram();var E,S;if(s instanceof e.RawShaderMaterial){E="";S=""}else{E=["precision "+u.precision+" float;","precision "+u.precision+" int;",w,u.supportsVertexTextures?"#define VERTEX_TEXTURES":"",l.gammaInput?"#define GAMMA_INPUT":"",l.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+_,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,"#define MAX_BONES "+u.maxBones,u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+b:"",u.lightMap?"#define USE_LIGHTMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.skinning?"#define USE_SKINNING":"",u.useVertexTexture?"#define BONE_TEXTURE":"",u.morphTargets?"#define USE_MORPHTARGETS":"",u.morphNormals?"#define USE_MORPHNORMALS":"",u.wrapAround?"#define WRAP_AROUND":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+y:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",u.sizeAttenuation?"#define USE_SIZEATTENUATION":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","attribute vec2 uv2;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",""].join("\n");S=[u.bumpMap||u.normalMap||u.flatShading?"#extension GL_OES_standard_derivatives : enable":"","precision "+u.precision+" float;","precision "+u.precision+" int;",w,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,u.alphaTest?"#define ALPHATEST "+u.alphaTest:"",l.gammaInput?"#define GAMMA_INPUT":"",l.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+_,u.useFog&&u.fog?"#define USE_FOG":"",u.useFog&&u.fogExp?"#define FOG_EXP2":"",u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+g:"",u.envMap?"#define "+b:"",u.envMap?"#define "+x:"",u.lightMap?"#define USE_LIGHTMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.metal?"#define METAL":"",u.wrapAround?"#define WRAP_AROUND":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+y:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].join("\n")}var T=new e.WebGLShader(c,c.VERTEX_SHADER,E+p);var M=new e.WebGLShader(c,c.FRAGMENT_SHADER,S+m);c.attachShader(C,T);c.attachShader(C,M);if(v!==undefined){c.bindAttribLocation(C,0,v)}c.linkProgram(C);var A=c.getProgramInfoLog(C);if(c.getProgramParameter(C,c.LINK_STATUS)===false){e.error("THREE.WebGLProgram: shader error: "+c.getError(),"gl.VALIDATE_STATUS",c.getProgramParameter(C,c.VALIDATE_STATUS),"gl.getPRogramInfoLog",A)}if(A!==""){}c.deleteShader(T);c.deleteShader(M) -;var P=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","modelMatrix","cameraPosition","morphTargetInfluences","bindMatrix","bindMatrixInverse"];if(u.useVertexTexture){P.push("boneTexture");P.push("boneTextureWidth");P.push("boneTextureHeight")}else{P.push("boneGlobalMatrices")}if(u.logarithmicDepthBuffer){P.push("logDepthBufFC")}for(var R in h){P.push(R)}this.uniforms=n(c,C,P);P=["position","normal","uv","uv2","tangent","color","skinIndex","skinWeight","lineDistance"];for(var k=0;k0;var r;if(l){r={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")}}else{r={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["precision mediump float;","uniform lowp int renderType;","uniform sampler2D map;","uniform sampler2D occlusionMap;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;","visibility = ( 1.0 - visibility / 4.0 );","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * visibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")}}o=d(r);s={vertex:n.getAttribLocation(o,"position"),uv:n.getAttribLocation(o,"uv")};u={renderType:n.getUniformLocation(o,"renderType"),map:n.getUniformLocation(o,"map"),occlusionMap:n.getUniformLocation(o,"occlusionMap"),opacity:n.getUniformLocation(o,"opacity"),color:n.getUniformLocation(o,"color"),scale:n.getUniformLocation(o,"scale"),rotation:n.getUniformLocation(o,"rotation"),screenPosition:n.getUniformLocation(o,"screenPosition")}};this.render=function(d,p,m,v){if(r.length===0)return;var y=new e.Vector3;var g=v/m,b=m*.5,x=v*.5;var _=16/v,w=new e.Vector2(_*g,_);var C=new e.Vector3(1,1,0),E=new e.Vector2(1,1);if(o===undefined){h()}n.useProgram(o);n.enableVertexAttribArray(s.vertex);n.enableVertexAttribArray(s.uv);n.uniform1i(u.occlusionMap,0);n.uniform1i(u.map,1);n.bindBuffer(n.ARRAY_BUFFER,i);n.vertexAttribPointer(s.vertex,2,n.FLOAT,false,2*8,0);n.vertexAttribPointer(s.uv,2,n.FLOAT,false,2*8,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,a);n.disable(n.CULL_FACE);n.depthMask(false);for(var S=0,T=r.length;S0&&E.x0&&E.y.001&&R.scale>.001){C.x=R.x;C.y=R.y;C.z=R.z;_=R.size*R.scale/v;w.x=_*g;w.y=_;n.uniform3f(u.screenPosition,C.x,C.y,C.z);n.uniform2f(u.scale,w.x,w.y);n.uniform1f(u.rotation,R.rotation);n.uniform1f(u.opacity,R.opacity);n.uniform3f(u.color,R.color.r,R.color.g,R.color.b);t.state.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst);t.setTexture(R.texture,1);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0)}}}}n.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(true);t.resetGLState()};function d(e){var r=n.createProgram();var i=n.createShader(n.FRAGMENT_SHADER);var a=n.createShader(n.VERTEX_SHADER);var o="precision "+t.getPrecision()+" float;\n";n.shaderSource(i,o+e.fragmentShader);n.shaderSource(a,o+e.vertexShader);n.compileShader(i);n.compileShader(a);n.attachShader(r,i);n.attachShader(r,a);n.linkProgram(r);return r}};e.ShadowMapPlugin=function(t,r,n,i){var a=t.context;var o,s,u,l,c=new e.Frustum,f=new e.Matrix4,h=new e.Vector3,d=new e.Vector3,p=new e.Vector3,m=[];var v=e.ShaderLib["depthRGBA"];var y=e.UniformsUtils.clone(v.uniforms);o=new e.ShaderMaterial({uniforms:y,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader});s=new e.ShaderMaterial({uniforms:y,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,morphTargets:true});u=new e.ShaderMaterial({uniforms:y,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,skinning:true});l=new e.ShaderMaterial({uniforms:y,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,morphTargets:true,skinning:true});o._shadowPass=true;s._shadowPass=true;u._shadowPass=true;l._shadowPass=true;this.render=function(n,h){if(t.shadowMapEnabled===false)return;var d,v,y,C,E,S,T,M,A,P,R,k,I,D=[],B=0,L=null;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);if(t.shadowMapCullFace===e.CullFaceFront){a.cullFace(a.FRONT)}else{a.cullFace(a.BACK)}t.state.setDepthTest(true);for(d=0,v=r.length;d0&&N.morphTargets;H=k instanceof e.SkinnedMesh&&N.skinning;if(k.customDepthMaterial){P=k.customDepthMaterial}else if(H){P=z?l:u}else if(z){P=s}else{P=o}t.setMaterialFaces(N);if(A instanceof e.BufferGeometry){t.renderBufferDirect(M,r,L,P,A,k)}else{t.renderBuffer(M,r,L,P,A,k)}}for(y=0,C=i.length;yd.x)d.x=o.x;if(o.yd.y)d.y=o.y;if(o.zd.z)d.z=o.z}r.left=h.x;r.right=d.x;r.top=d.y;r.bottom=h.y;r.updateProjectionMatrix()}function w(t){return t.material instanceof e.MeshFaceMaterial?t.material.materials[0]:t.material}};e.SpritePlugin=function(t,r){var n=t.context;var i,a;var o,s,u;var l;var c=new e.Vector3;var f=new e.Quaternion;var h=new e.Vector3;var d=function(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]);var r=new Uint16Array([0,1,2,0,2,3]);i=n.createBuffer();a=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i);n.bufferData(n.ARRAY_BUFFER,t,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,a);n.bufferData(n.ELEMENT_ARRAY_BUFFER,r,n.STATIC_DRAW);o=p();s={position:n.getAttribLocation(o,"position"),uv:n.getAttribLocation(o,"uv")};u={uvOffset:n.getUniformLocation(o,"uvOffset"),uvScale:n.getUniformLocation(o,"uvScale"),rotation:n.getUniformLocation(o,"rotation"),scale:n.getUniformLocation(o,"scale"),color:n.getUniformLocation(o,"color"),map:n.getUniformLocation(o,"map"),opacity:n.getUniformLocation(o,"opacity"),modelViewMatrix:n.getUniformLocation(o,"modelViewMatrix"),projectionMatrix:n.getUniformLocation(o,"projectionMatrix"),fogType:n.getUniformLocation(o,"fogType"),fogDensity:n.getUniformLocation(o,"fogDensity"),fogNear:n.getUniformLocation(o,"fogNear"),fogFar:n.getUniformLocation(o,"fogFar"),fogColor:n.getUniformLocation(o,"fogColor"),alphaTest:n.getUniformLocation(o,"alphaTest")};var c=document.createElement("canvas");c.width=8;c.height=8;var f=c.getContext("2d");f.fillStyle="white";f.fillRect(0,0,8,8);l=new e.Texture(c);l.needsUpdate=true};this.render=function(p,v){if(r.length===0)return;if(o===undefined){d()}n.useProgram(o);n.enableVertexAttribArray(s.position);n.enableVertexAttribArray(s.uv);n.disable(n.CULL_FACE);n.enable(n.BLEND);n.bindBuffer(n.ARRAY_BUFFER,i);n.vertexAttribPointer(s.position,2,n.FLOAT,false,2*8,0);n.vertexAttribPointer(s.uv,2,n.FLOAT,false,2*8,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,a);n.uniformMatrix4fv(u.projectionMatrix,false,v.projectionMatrix.elements);n.activeTexture(n.TEXTURE0);n.uniform1i(u.map,0);var y=0;var g=0;var b=p.fog;if(b){n.uniform3f(u.fogColor,b.color.r,b.color.g,b.color.b);if(b instanceof e.Fog){n.uniform1f(u.fogNear,b.near);n.uniform1f(u.fogFar,b.far);n.uniform1i(u.fogType,1);y=1;g=1}else if(b instanceof e.FogExp2){n.uniform1f(u.fogDensity,b.density);n.uniform1i(u.fogType,2);y=2;g=2}}else{n.uniform1i(u.fogType,0);y=0;g=0}for(var x=0,_=r.length;x<_;x++){var w=r[x];w._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,w.matrixWorld);w.z=-w._modelViewMatrix.elements[14]}r.sort(m);var C=[];for(var x=0,_=r.length;x<_;x++){var w=r[x];var E=w.material;n.uniform1f(u.alphaTest,E.alphaTest);n.uniformMatrix4fv(u.modelViewMatrix,false,w._modelViewMatrix.elements);w.matrixWorld.decompose(c,f,h);C[0]=h.x;C[1]=h.y;var S=0;if(p.fog&&E.fog){S=g}if(y!==S){n.uniform1i(u.fogType,S);y=S}if(E.map!==null){n.uniform2f(u.uvOffset,E.map.offset.x,E.map.offset.y);n.uniform2f(u.uvScale,E.map.repeat.x,E.map.repeat.y)}else{n.uniform2f(u.uvOffset,0,0);n.uniform2f(u.uvScale,1,1)}n.uniform1f(u.opacity,E.opacity);n.uniform3f(u.color,E.color.r,E.color.g,E.color.b);n.uniform1f(u.rotation,E.rotation);n.uniform2fv(u.scale,C);t.state.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst);t.state.setDepthTest(E.depthTest);t.state.setDepthWrite(E.depthWrite);if(E.map&&E.map.image&&E.map.image.width){t.setTexture(E.map,0)}else{t.setTexture(l,0)}n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0)}n.enable(n.CULL_FACE);t.resetGLState()};function p(){var e=n.createProgram();var r=n.createShader(n.VERTEX_SHADER);var i=n.createShader(n.FRAGMENT_SHADER);n.shaderSource(r,["precision "+t.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n"));n.shaderSource(i,["precision "+t.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n"));n.compileShader(r);n.compileShader(i);n.attachShader(e,r);n.attachShader(e,i);n.linkProgram(e);return e}function m(e,t){if(e.z!==t.z){return t.z-e.z}else{return t.id-e.id}}};e.GeometryUtils={merge:function(t,r,n){e.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;if(r instanceof e.Mesh){r.matrixAutoUpdate&&r.updateMatrix();i=r.matrix;r=r.geometry}t.merge(r,i,n)},center:function(t){e.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return t.center()}};e.ImageUtils={crossOrigin:undefined,loadTexture:function(t,r,n,i){var a=new e.ImageLoader;a.crossOrigin=this.crossOrigin;var o=new e.Texture(undefined,r);a.load(t,function(e){o.image=e;o.needsUpdate=true;if(n)n(o)},undefined,function(e){if(i)i(e)});o.sourceFile=t;return o},loadTextureCube:function(t,r,n,i){var a=[];var o=new e.ImageLoader;o.crossOrigin=this.crossOrigin;var s=new e.CubeTexture(a,r);s.flipY=false;var u=0;var l=function(e){o.load(t[e],function(t){s.images[e]=t;u+=1;if(u===6){s.needsUpdate=true;if(n)n(s)}},undefined,i)};for(var c=0,f=t.length;co-1?o-1:d+1;var v=h-1<0?0:h-1;var y=h+1>a-1?a-1:h+1;var g=[];var b=[0,0,l[(d*a+h)*4]/255*t];g.push([-1,0,l[(d*a+v)*4]/255*t]);g.push([-1,-1,l[(p*a+v)*4]/255*t]);g.push([0,-1,l[(p*a+h)*4]/255*t]);g.push([1,-1,l[(p*a+y)*4]/255*t]);g.push([1,0,l[(d*a+y)*4]/255*t]);g.push([1,1,l[(m*a+y)*4]/255*t]);g.push([0,1,l[(m*a+h)*4]/255*t]);g.push([-1,1,l[(m*a+v)*4]/255*t]);var x=[];var _=g.length;for(var w=0;w<_;w++){var C=g[w];var E=g[(w+1)%_];C=n(C,b);E=n(E,b);x.push(i(r(C,E)))}var S=[0,0,0];for(var w=0;w0){for(c=0;c2;){if(d--<=0){e.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");if(r)return u;return o}l=c;if(h<=l)l=0;c=l+1;if(h<=c)c=0;f=c+1;if(h<=f)f=0;if(a(t,l,c,f,h,s)){var p,m,v,y,g;p=s[l];m=s[c];v=s[f];o.push([t[p],t[m],t[v]]);u.push([s[l],s[c],s[f]]);for(y=c,g=c+1;g(c-u)*(d-l)-(f-l)*(h-u))return false;var v,y,g,b,x,_;var w,C,E,S,T,M;var A,P,R;v=h-c;y=d-f;g=u-h;b=l-d;x=c-u;_=f-l;for(s=0;s=-r&&P>=-r&&A>=-r)return false}return true};t.Triangulate=n;t.Triangulate.area=i;return t})(e.FontUtils);self._typeface_js={faces:e.FontUtils.faces,loadFace:e.FontUtils.loadFace};e.typeface_js=self._typeface_js;e.Audio=function(t){e.Object3D.call(this);this.type="Audio";this.context=t.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=false;this.startTime=0;this.isPlaying=false};e.Audio.prototype=Object.create(e.Object3D.prototype);e.Audio.prototype.constructor=e.Audio;e.Audio.prototype.load=function(e){var t=this;var r=new XMLHttpRequest;r.open("GET",e,true);r.responseType="arraybuffer";r.onload=function(e){t.context.decodeAudioData(this.response,function(e){t.source.buffer=e;if(t.autoplay)t.play()})};r.send();return this};e.Audio.prototype.play=function(){if(this.isPlaying===true){e.warn("THREE.Audio: Audio is already playing.");return}var t=this.context.createBufferSource();t.buffer=this.source.buffer;t.loop=this.source.loop;t.onended=this.source.onended;t.connect(this.panner);t.start(0,this.startTime);this.isPlaying=true;this.source=t};e.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime};e.Audio.prototype.stop=function(){this.source.stop();this.startTime=0};e.Audio.prototype.onEnded=function(){this.isPlaying=false};e.Audio.prototype.setLoop=function(e){this.source.loop=e};e.Audio.prototype.setRefDistance=function(e){this.panner.refDistance=e};e.Audio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e};e.Audio.prototype.setVolume=function(e){this.gain.gain.value=e};e.Audio.prototype.updateMatrixWorld=function(){var t=new e.Vector3;return function(r){e.Object3D.prototype.updateMatrixWorld.call(this,r);t.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(t.x,t.y,t.z)}}();e.AudioListener=function(){e.Object3D.call(this);this.type="AudioListener";this.context=new(window.AudioContext||window.webkitAudioContext)};e.AudioListener.prototype=Object.create(e.Object3D.prototype);e.AudioListener.prototype.constructor=e.AudioListener;e.AudioListener.prototype.updateMatrixWorld=function(){var t=new e.Vector3;var r=new e.Quaternion;var n=new e.Vector3;var i=new e.Vector3;var a=new e.Vector3;var o=new e.Vector3;return function(s){e.Object3D.prototype.updateMatrixWorld.call(this,s);var u=this.context.listener;var l=this.up;this.matrixWorld.decompose(t,r,n);i.set(0,0,-1).applyQuaternion(r);a.subVectors(t,o);u.setPosition(t.x,t.y,t.z);u.setOrientation(i.x,i.y,i.z,l.x,l.y,l.z);u.setVelocity(a.x,a.y,a.z);o.copy(t)}}();e.Curve=function(){};e.Curve.prototype.getPoint=function(t){e.warn("THREE.Curve: Warning, getPoint() not implemented!");return null};e.Curve.prototype.getPointAt=function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)};e.Curve.prototype.getPoints=function(e){if(!e)e=5;var t,r=[];for(t=0;t<=e;t++){r.push(this.getPoint(t/e))}return r};e.Curve.prototype.getSpacedPoints=function(e){if(!e)e=5;var t,r=[];for(t=0;t<=e;t++){r.push(this.getPointAt(t/e))}return r};e.Curve.prototype.getLength=function(){var e=this.getLengths();return e[e.length-1]};e.Curve.prototype.getLengths=function(e){if(!e)e=this.__arcLengthDivisions?this.__arcLengthDivisions:200;if(this.cacheArcLengths&&this.cacheArcLengths.length==e+1&&!this.needsUpdate){return this.cacheArcLengths}this.needsUpdate=false;var t=[];var r,n=this.getPoint(0);var i,a=0;t.push(0);for(i=1;i<=e;i++){r=this.getPoint(i/e);a+=r.distanceTo(n);t.push(a) -;n=r}this.cacheArcLengths=t;return t};e.Curve.prototype.updateArcLengths=function(){this.needsUpdate=true;this.getLengths()};e.Curve.prototype.getUtoTmapping=function(e,t){var r=this.getLengths();var n=0,i=r.length;var a;if(t){a=t}else{a=e*r[i-1]}var o=0,s=i-1,u;while(o<=s){n=Math.floor(o+(s-o)/2);u=r[n]-a;if(u<0){o=n+1}else if(u>0){s=n-1}else{s=n;break}}n=s;if(r[n]==a){var l=n/(i-1);return l}var c=r[n];var f=r[n+1];var h=f-c;var d=(a-c)/h;var l=(n+d)/(i-1);return l};e.Curve.prototype.getTangent=function(e){var t=1e-4;var r=e-t;var n=e+t;if(r<0)r=0;if(n>1)n=1;var i=this.getPoint(r);var a=this.getPoint(n);var o=a.clone().sub(i);return o.normalize()};e.Curve.prototype.getTangentAt=function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)};e.Curve.Utils={tangentQuadraticBezier:function(e,t,r,n){return 2*(1-e)*(r-t)+2*e*(n-r)},tangentCubicBezier:function(e,t,r,n,i){return-3*t*(1-e)*(1-e)+3*r*(1-e)*(1-e)-6*e*r*(1-e)+6*e*n*(1-e)-3*e*e*n+3*e*e*i},tangentSpline:function(e,t,r,n,i){var a=6*e*e-6*e;var o=3*e*e-4*e+1;var s=-6*e*e+6*e;var u=3*e*e-2*e;return a+o+s+u},interpolate:function(e,t,r,n,i){var a=(r-e)*.5;var o=(n-t)*.5;var s=i*i;var u=i*s;return(2*t-2*r+a+o)*u+(-3*t+3*r-2*a-o)*s+a*i+t}};e.Curve.create=function(t,r){t.prototype=Object.create(e.Curve.prototype);t.prototype.constructor=t;t.prototype.getPoint=r;return t};e.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=false};e.CurvePath.prototype=Object.create(e.Curve.prototype);e.CurvePath.prototype.constructor=e.CurvePath;e.CurvePath.prototype.add=function(e){this.curves.push(e)};e.CurvePath.prototype.checkConnection=function(){};e.CurvePath.prototype.closePath=function(){var t=this.curves[0].getPoint(0);var r=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(r)){this.curves.push(new e.LineCurve(r,t))}};e.CurvePath.prototype.getPoint=function(e){var t=e*this.getLength();var r=this.getCurveLengths();var n=0,i,a;while(n=t){i=r[n]-t;a=this.curves[n];var o=1-i/a.getLength();return a.getPointAt(o)}n++}return null};e.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]};e.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length){return this.cacheLengths}var e=[],t=0;var r,n=this.curves.length;for(r=0;rr)r=u.x;else if(u.xn)n=u.y;else if(u.yi)i=u.z;else if(u.z0){y=n[n.length-1];m=y.x;v=y.y}else{y=this.actions[i-1].args;m=y[y.length-2];v=y[y.length-1]}for(g=1;g<=t;g++){b=g/t;x=e.Shape.Utils.b2(b,m,d,l);_=e.Shape.Utils.b2(b,v,p,c);n.push(new e.Vector2(x,_))}break;case e.PathActions.BEZIER_CURVE_TO:l=u[4];c=u[5];d=u[0];p=u[1];f=u[2];h=u[3];if(n.length>0){y=n[n.length-1];m=y.x;v=y.y}else{y=this.actions[i-1].args;m=y[y.length-2];v=y[y.length-1]}for(g=1;g<=t;g++){b=g/t;x=e.Shape.Utils.b3(b,m,d,f,l);_=e.Shape.Utils.b3(b,v,p,h,c);n.push(new e.Vector2(x,_))}break;case e.PathActions.CSPLINE_THRU:y=this.actions[i-1].args;var w=new e.Vector2(y[y.length-2],y[y.length-1]);var C=[w];var E=t*u[0].length;C=C.concat(u[0]);var S=new e.SplineCurve(C);for(g=1;g<=E;g++){n.push(S.getPointAt(g/E))}break;case e.PathActions.ARC:var T=u[0],M=u[1],A=u[2],P=u[3],R=u[4],k=!!u[5];var I=R-P;var D;var B=t*2;for(g=1;g<=B;g++){b=g/B;if(!k){b=1-b}D=P+b*I;x=T+A*Math.cos(D);_=M+A*Math.sin(D);n.push(new e.Vector2(x,_))}break;case e.PathActions.ELLIPSE:var T=u[0],M=u[1],L=u[2],F=u[3],P=u[4],R=u[5],k=!!u[6];var I=R-P;var D;var B=t*2;for(g=1;g<=B;g++){b=g/B;if(!k){b=1-b}D=P+b*I;x=T+L*Math.cos(D);_=M+F*Math.sin(D);n.push(new e.Vector2(x,_))}break}}var V=n[n.length-1];var O=1e-10;if(Math.abs(V.x-n[0].x)r){if(c<0){s=t[o];l=-l;u=t[a];c=-c}if(e.yu.y)continue;if(e.y==s.y){if(e.x==s.x)return true}else{var f=c*(e.x-s.x)-l*(e.y-s.y);if(f==0)return true;if(f<0)continue;i=!i}}else{if(e.y!=s.y)continue;if(u.x<=e.x&&e.x<=s.x||s.x<=e.x&&e.x<=u.x)return true}}return i}var o=n(this.actions);if(o.length==0)return[];if(r===true)return i(o);var s,u,l,c=[];if(o.length==1){u=o[0];l=new e.Shape;l.actions=u.actions;l.curves=u.curves;c.push(l);return c}var f=!e.Shape.Utils.isClockWise(o[0].getPoints());f=t?!f:f;var h=[];var d=[];var p=[];var m=0;var v;d[m]=undefined;p[m]=[];var y,g;for(y=0,g=o.length;y1){var b=false;var x=[];for(var _=0,w=d.length;_0){if(!b)p=h}}var A,P,R;for(y=0,g=d.length;yo){var m;if(d>0){if(p<0||p>d)return[];m=c*f-l*h;if(m<0||m>d)return[]}else{if(p>0||p0||mT)return[];if(_==T){if(a)return[];return[b]}if(w<=T)return[b,x];return[b,E]}}}function a(e,t,r,n){var i=1e-10;var a=t.x-e.x,o=t.y-e.y;var s=r.x-e.x,u=r.y-e.y;var l=n.x-e.x,c=n.y-e.y;var f=a*u-o*s;var h=a*c-o*l;if(Math.abs(f)>i){var d=l*u-c*s;if(f>0){return h>=0&&d>=0}else{return h>=0||d>=0}}else{return h>0}}function o(e,t){var r=e.concat();var n;function o(e,t){var i=r.length-1;var o=e-1;if(o<0)o=i;var s=e+1;if(s>i)s=0;var u=a(r[e],r[o],r[s],n[t]);if(!u){return false}var l=n.length-1;var c=t-1;if(c<0)c=l;var f=t+1;if(f>l)f=0;u=a(n[t],n[c],n[f],r[e]);if(!u){return false}return true}function s(e,t){var n,a,o;for(n=0;n0)return true}return false}var u=[];function l(e,r){var n,a,o,s,l;for(n=0;n0)return true}}return false}var c,f,h,d,p,m,v=[],y,g,b,x;for(var _=0,w=t.length;_0){E--;if(E<0){console.log("Infinite Loop! Holes left:"+u.length+", Probably Hole outside Shape!");break}for(f=C;f=0)break;v[m]=true}if(c>=0)break}}return r}var s,u,l,c,f,h,d={};var p=t.concat();for(var m=0,v=r.length;mr.length-2?r.length-1:i+1];var l=r[i>r.length-3?r.length-1:i+2];var c=new e.Vector2;c.x=e.Curve.Utils.interpolate(o.x,s.x,u.x,l.x,a);c.y=e.Curve.Utils.interpolate(o.y,s.y,u.y,l.y,a);return c};e.EllipseCurve=function(e,t,r,n,i,a,o){this.aX=e;this.aY=t;this.xRadius=r;this.yRadius=n;this.aStartAngle=i;this.aEndAngle=a;this.aClockwise=o};e.EllipseCurve.prototype=Object.create(e.Curve.prototype);e.EllipseCurve.prototype.constructor=e.EllipseCurve;e.EllipseCurve.prototype.getPoint=function(t){var r=this.aEndAngle-this.aStartAngle;if(r<0)r+=Math.PI*2;if(r>Math.PI*2)r-=Math.PI*2;var n;if(this.aClockwise===true){n=this.aEndAngle+(1-t)*(Math.PI*2-r)}else{n=this.aStartAngle+t*r}var i=new e.Vector2;i.x=this.aX+this.xRadius*Math.cos(n);i.y=this.aY+this.yRadius*Math.sin(n);return i};e.ArcCurve=function(t,r,n,i,a,o){e.EllipseCurve.call(this,t,r,n,n,i,a,o)};e.ArcCurve.prototype=Object.create(e.EllipseCurve.prototype);e.ArcCurve.prototype.constructor=e.ArcCurve;e.LineCurve3=e.Curve.create(function(e,t){this.v1=e;this.v2=t},function(t){var r=new e.Vector3;r.subVectors(this.v2,this.v1);r.multiplyScalar(t);r.add(this.v1);return r});e.QuadraticBezierCurve3=e.Curve.create(function(e,t,r){this.v0=e;this.v1=t;this.v2=r},function(t){var r=new e.Vector3;r.x=e.Shape.Utils.b2(t,this.v0.x,this.v1.x,this.v2.x);r.y=e.Shape.Utils.b2(t,this.v0.y,this.v1.y,this.v2.y);r.z=e.Shape.Utils.b2(t,this.v0.z,this.v1.z,this.v2.z);return r});e.CubicBezierCurve3=e.Curve.create(function(e,t,r,n){this.v0=e;this.v1=t;this.v2=r;this.v3=n},function(t){var r=new e.Vector3;r.x=e.Shape.Utils.b3(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x);r.y=e.Shape.Utils.b3(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y);r.z=e.Shape.Utils.b3(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return r});e.SplineCurve3=e.Curve.create(function(e){this.points=e==undefined?[]:e},function(t){var r=this.points;var n=(r.length-1)*t;var i=Math.floor(n);var a=n-i;var o=r[i==0?i:i-1];var s=r[i];var u=r[i>r.length-2?r.length-1:i+1];var l=r[i>r.length-3?r.length-1:i+2];var c=new e.Vector3;c.x=e.Curve.Utils.interpolate(o.x,s.x,u.x,l.x,a);c.y=e.Curve.Utils.interpolate(o.y,s.y,u.y,l.y,a);c.z=e.Curve.Utils.interpolate(o.z,s.z,u.z,l.z,a);return c});e.ClosedSplineCurve3=e.Curve.create(function(e){this.points=e==undefined?[]:e},function(t){var r=this.points;var n=(r.length-0)*t;var i=Math.floor(n);var a=n-i;i+=i>0?0:(Math.floor(Math.abs(i)/r.length)+1)*r.length;var o=r[(i-1)%r.length];var s=r[i%r.length];var u=r[(i+1)%r.length];var l=r[(i+2)%r.length];var c=new e.Vector3;c.x=e.Curve.Utils.interpolate(o.x,s.x,u.x,l.x,a);c.y=e.Curve.Utils.interpolate(o.y,s.y,u.y,l.y,a);c.z=e.Curve.Utils.interpolate(o.z,s.z,u.z,l.z,a);return c});e.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){e.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){e.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){e.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(t){if(t.initialized===true)return t;for(var r=0;ru.index){u=l;l=this.getNextKeyWith(s,e,l.index+1)}a.prevKey[s]=u;a.nextKey[s]=l}}},resetBlendWeights:function(){for(var e=0,t=this.hierarchy.length;ee.length-2?a:a+1;r[3]=a>e.length-3?a:a+2;c=e[r[0]];f=e[r[1]];h=e[r[2]];d=e[r[3]];u=s*s;l=s*u;n[0]=o(c[0],f[0],h[0],d[0],s,u,l);n[1]=o(c[1],f[1],h[1],d[1],s,u,l);n[2]=o(c[2],f[2],h[2],d[2],s,u,l);return n};var o=function(e,t,r,n,i,a,o){var s=(r-e)*.5,u=(n-t)*.5;return(2*(t-r)+s+u)*o+(-3*(t-r)-2*s-u)*a+s*i+t};return function(o){if(this.isPlaying===false)return;this.currentTime+=o*this.timeScale;if(this.weight===0)return;var s=this.data.length;if(this.currentTime>s||this.currentTime<0){if(this.loop){this.currentTime%=s;if(this.currentTime<0)this.currentTime+=s;this.reset()}else{this.stop()}}for(var u=0,l=this.hierarchy.length;u0&&v.time<=this.currentTime||this.timeScale<0&&m.time>=this.currentTime){m=this.data.hierarchy[u].keys[0];v=this.getNextKeyWith(p,u,1);while(v.timem.index){m=v;v=this.getNextKeyWith(p,u,v.index+1)}f.prevKey[p]=m;f.nextKey[p]=v}var y=(this.currentTime-m.time)/(v.time-m.time);var g=m[p];var b=v[p];if(y<0)y=0;if(y>1)y=1;if(p==="pos"){if(this.interpolationType===e.AnimationHandler.LINEAR){n.x=g[0]+(b[0]-g[0])*y;n.y=g[1]+(b[1]-g[1])*y;n.z=g[2]+(b[2]-g[2])*y;var x=this.weight/(this.weight+h.positionWeight);c.position.lerp(n,x);h.positionWeight+=this.weight}else if(this.interpolationType===e.AnimationHandler.CATMULLROM||this.interpolationType===e.AnimationHandler.CATMULLROM_FORWARD){t[0]=this.getPrevKeyWith("pos",u,m.index-1)["pos"];t[1]=g;t[2]=b;t[3]=this.getNextKeyWith("pos",u,v.index+1)["pos"];y=y*.33+.33;var _=a(t,y);var x=this.weight/(this.weight+h.positionWeight);h.positionWeight+=this.weight;var w=c.position;w.x=w.x+(_[0]-w.x)*x;w.y=w.y+(_[1]-w.y)*x;w.z=w.z+(_[2]-w.z)*x;if(this.interpolationType===e.AnimationHandler.CATMULLROM_FORWARD){var C=a(t,y*1.01);r.set(C[0],C[1],C[2]);r.sub(w);r.y=0;r.normalize();var E=Math.atan2(r.x,r.z);c.rotation.set(0,E,0)}}}else if(p==="rot"){e.Quaternion.slerp(g,b,i,y);if(h.quaternionWeight===0){c.quaternion.copy(i);h.quaternionWeight=this.weight}else{var x=this.weight/(this.weight+h.quaternionWeight);e.Quaternion.slerp(c.quaternion,i,c.quaternion,x);h.quaternionWeight+=this.weight}}else if(p==="scl"){n.x=g[0]+(b[0]-g[0])*y;n.y=g[1]+(b[1]-g[1])*y;n.z=g[2]+(b[2]-g[2])*y;var x=this.weight/(this.weight+h.scaleWeight);c.scale.lerp(n,x);h.scaleWeight+=this.weight}}}return true}}(),getNextKeyWith:function(t,r,n){var i=this.data.hierarchy[r].keys;if(this.interpolationType===e.AnimationHandler.CATMULLROM||this.interpolationType===e.AnimationHandler.CATMULLROM_FORWARD){n=n0?n:0}else{n=n>=0?n:n+i.length}for(;n>=0;n--){if(i[n][t]!==undefined){return i[n]}}return this.data.hierarchy[r].keys[i.length-1]}};e.KeyFrameAnimation=function(t){this.root=t.node;this.data=e.AnimationHandler.init(t);this.hierarchy=e.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=false;this.isPaused=true;this.loop=true;for(var r=0,n=this.hierarchy.length;rt){this.currentTime%=t}this.currentTime=Math.min(this.currentTime,t);for(var r=0,n=this.hierarchy.length;ru.index){u=l;l=o[u.index+1]}s.prevKey=u;s.nextKey=l}if(l.time>=this.currentTime){u.interpolate(l,this.currentTime)}else{u.interpolate(l,l.time)}this.data.hierarchy[r].node.updateMatrix();i.matrixWorldNeedsUpdate=true}}},getNextKeyWith:function(e,t,r){var n=this.data.hierarchy[t].keys;r=r%n.length;for(;r=0?r:r+n.length;for(;r>=0;r--){if(n[r].hasTarget(e)){return n[r]}}return n[n.length-1]}};e.MorphAnimation=function(e){this.mesh=e;this.frames=e.morphTargetInfluences.length;this.currentTime=0;this.duration=1e3;this.loop=true;this.lastFrame=0;this.currentFrame=0;this.isPlaying=false};e.MorphAnimation.prototype={constructor:e.MorphAnimation,play:function(){this.isPlaying=true},pause:function(){this.isPlaying=false},update:function(e){if(this.isPlaying===false)return;this.currentTime+=e;if(this.loop===true&&this.currentTime>this.duration){this.currentTime%=this.duration}this.currentTime=Math.min(this.currentTime,this.duration);var t=this.duration/this.frames;var r=Math.floor(this.currentTime/t);var n=this.mesh.morphTargetInfluences;if(r!=this.currentFrame){n[this.lastFrame]=0;n[this.currentFrame]=1;n[r]=0;this.lastFrame=this.currentFrame;this.currentFrame=r}n[r]=this.currentTime%t/t;n[this.lastFrame]=1-n[r]}};e.BoxGeometry=function(t,r,n,i,a,o){e.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:t,height:r,depth:n,widthSegments:i,heightSegments:a,depthSegments:o};this.widthSegments=i||1;this.heightSegments=a||1;this.depthSegments=o||1;var s=this;var u=t/2;var l=r/2;var c=n/2;f("z","y",-1,-1,n,r,u,0);f("z","y",1,-1,n,r,-u,1);f("x","z",1,1,t,n,l,2);f("x","z",1,-1,t,n,-l,3);f("x","y",1,-1,t,r,c,4);f("x","y",-1,-1,t,r,-c,5);function f(t,r,n,i,a,o,u,l){var c,f,h,d=s.widthSegments,p=s.heightSegments,m=a/2,v=o/2,y=s.vertices.length;if(t==="x"&&r==="y"||t==="y"&&r==="x"){c="z"}else if(t==="x"&&r==="z"||t==="z"&&r==="x"){c="y";p=s.depthSegments}else if(t==="z"&&r==="y"||t==="y"&&r==="z"){c="x";d=s.depthSegments}var g=d+1,b=p+1,x=a/d,_=o/p,w=new e.Vector3;w[c]=u>0?1:-1;for(h=0;h0){this.vertices.push(new e.Vector3(0,l,0));for(c=0;c0){this.vertices.push(new e.Vector3(0,-l,0));for(c=0;ci){var p=Math.sqrt(h);var m=Math.sqrt(c*c+f*f);var v=r.x-l/p;var y=r.y+u/p;var g=n.x-f/m;var b=n.y+c/m;var x=((g-v)*f-(b-y)*c)/(u*f-l*c);a=v+u*x-t.x;o=y+l*x-t.y;var _=a*a+o*o;if(_<=2){return new e.Vector2(a,o)}else{s=Math.sqrt(_/2)}}else{var w=false;if(u>i){if(c>i){w=true}}else{if(u<-i){if(c<-i){w=true}}else{if(Math.sign(l)==Math.sign(f)){w=true}}}if(w){a=-l;o=u;s=Math.sqrt(h)}else{a=u;o=l;s=Math.sqrt(h/2)}}return new e.Vector2(a/s,o/s)}var z=[];for(var H=0,j=R.length,G=j-1,W=H+1;H=0;I--){B=I/o;L=i*(1-B);D=a*Math.sin(B*Math.PI/2);for(H=0,j=R.length;H=0){r=H;n=H-1;if(n<0)n=e.length-1;var i=0,a=l+o*2;for(i=0;i65535?Uint32Array:Uint16Array)(s*u*6);for(var g=0;gh){u.normalize();f=Math.acos(e.Math.clamp(a[y-1].dot(a[y]),-1,1));o[y].applyMatrix4(l.makeRotationAxis(u,f))}s[y].crossVectors(a[y],o[y])}if(n){f=Math.acos(e.Math.clamp(o[0].dot(o[c-1]),-1,1));f/=c-1;if(a[0].dot(u.crossVectors(o[0],o[c-1]))>0){f=-f}for(y=1;y.9&&x<.1){if(v<.2)m[0].x+=1;if(y<.2)m[1].x+=1;if(g<.2)m[2].x+=1}}for(var o=0,s=this.vertices.length;o.99999){this.quaternion.set(0,0,0,1)}else if(e.y<-.99999){this.quaternion.set(1,0,0,0)}else{t.set(e.z,0,-e.x).normalize();r=Math.acos(e.y);this.quaternion.setFromAxisAngle(t,r)}}}();e.ArrowHelper.prototype.setLength=function(e,t,r){if(t===undefined)t=.2*e;if(r===undefined)r=.2*t;this.line.scale.set(1,e-t,1);this.line.updateMatrix();this.cone.scale.set(r,t,r);this.cone.position.y=e;this.cone.updateMatrix()};e.ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e);this.cone.material.color.set(e)};e.BoxHelper=function(t){var r=new e.BufferGeometry;r.addAttribute("position",new e.BufferAttribute(new Float32Array(72),3));e.Line.call(this,r,new e.LineBasicMaterial({color:16776960}),e.LinePieces);if(t!==undefined){this.update(t)}};e.BoxHelper.prototype=Object.create(e.Line.prototype);e.BoxHelper.prototype.constructor=e.BoxHelper;e.BoxHelper.prototype.update=function(e){var t=e.geometry;if(t.boundingBox===null){t.computeBoundingBox()}var r=t.boundingBox.min;var n=t.boundingBox.max;var i=this.geometry.attributes.position.array;i[0]=n.x;i[1]=n.y;i[2]=n.z;i[3]=r.x;i[4]=n.y;i[5]=n.z;i[6]=r.x;i[7]=n.y;i[8]=n.z;i[9]=r.x;i[10]=r.y;i[11]=n.z;i[12]=r.x;i[13]=r.y;i[14]=n.z;i[15]=n.x;i[16]=r.y;i[17]=n.z;i[18]=n.x;i[19]=r.y;i[20]=n.z;i[21]=n.x;i[22]=n.y;i[23]=n.z;i[24]=n.x;i[25]=n.y;i[26]=r.z;i[27]=r.x;i[28]=n.y;i[29]=r.z;i[30]=r.x;i[31]=n.y;i[32]=r.z;i[33]=r.x;i[34]=r.y;i[35]=r.z;i[36]=r.x;i[37]=r.y;i[38]=r.z;i[39]=n.x;i[40]=r.y;i[41]=r.z;i[42]=n.x;i[43]=r.y;i[44]=r.z;i[45]=n.x;i[46]=n.y;i[47]=r.z;i[48]=n.x;i[49]=n.y;i[50]=n.z;i[51]=n.x;i[52]=n.y;i[53]=r.z;i[54]=r.x;i[55]=n.y;i[56]=n.z;i[57]=r.x;i[58]=n.y;i[59]=r.z;i[60]=r.x;i[61]=r.y;i[62]=n.z;i[63]=r.x;i[64]=r.y;i[65]=r.z;i[66]=n.x;i[67]=r.y;i[68]=n.z;i[69]=n.x;i[70]=r.y;i[71]=r.z;this.geometry.attributes.position.needsUpdate=true;this.geometry.computeBoundingSphere();this.matrix=e.matrixWorld;this.matrixAutoUpdate=false};e.BoundingBoxHelper=function(t,r){var n=r!==undefined?r:8947848;this.object=t;this.box=new e.Box3;e.Mesh.call(this,new e.BoxGeometry(1,1,1),new e.MeshBasicMaterial({color:n,wireframe:true}))};e.BoundingBoxHelper.prototype=Object.create(e.Mesh.prototype);e.BoundingBoxHelper.prototype.constructor=e.BoundingBoxHelper;e.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)};e.CameraHelper=function(t){var r=new e.Geometry;var n=new e.LineBasicMaterial({color:16777215,vertexColors:e.FaceColors});var i={};var a=16755200;var o=16711680;var s=43775;var u=16777215;var l=3355443;c("n1","n2",a);c("n2","n4",a);c("n4","n3",a);c("n3","n1",a);c("f1","f2",a);c("f2","f4",a);c("f4","f3",a);c("f3","f1",a);c("n1","f1",a);c("n2","f2",a);c("n3","f3",a);c("n4","f4",a);c("p","n1",o);c("p","n2",o);c("p","n3",o);c("p","n4",o);c("u1","u2",s);c("u2","u3",s);c("u3","u1",s);c("c","t",u);c("p","c",l);c("cn1","cn2",l);c("cn3","cn4",l);c("cf1","cf2",l);c("cf3","cf4",l);function c(e,t,r){f(e,r);f(t,r)}function f(t,n){r.vertices.push(new e.Vector3);r.colors.push(new e.Color(n));if(i[t]===undefined){i[t]=[]}i[t].push(r.vertices.length-1)}e.Line.call(this,r,n,e.LinePieces);this.camera=t;this.matrix=t.matrixWorld;this.matrixAutoUpdate=false;this.pointMap=i;this.update()};e.CameraHelper.prototype=Object.create(e.Line.prototype);e.CameraHelper.prototype.constructor=e.CameraHelper;e.CameraHelper.prototype.update=function(){var t,r;var n=new e.Vector3;var i=new e.Camera;var a=function(e,a,o,s){n.set(a,o,s).unproject(i);var u=r[e];if(u!==undefined){for(var l=0,c=u.length;l1){var l=u[1];if(!n[l])n[l]={start:Infinity,end:-Infinity};var c=n[l];if(ac.end)c.end=a;if(!r)r=l}}for(var l in n){var c=n[l];this.createAnimation(l,c.start,c.end,e)}this.firstAnimation=r};e.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];if(t){t.direction=1;t.directionBackwards=false}};e.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];if(t){t.direction=-1;t.directionBackwards=true}};e.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var r=this.animationsMap[e];if(r){r.fps=t;r.duration=(r.end-r.start)/r.fps}};e.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var r=this.animationsMap[e];if(r){r.duration=t;r.fps=(r.end-r.start)/r.duration}};e.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var r=this.animationsMap[e];if(r){r.weight=t}};e.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var r=this.animationsMap[e];if(r){r.time=t}};e.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0;var r=this.animationsMap[e];if(r){t=r.time}return t};e.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1;var r=this.animationsMap[e];if(r){t=r.duration}return t};e.MorphBlendMesh.prototype.playAnimation=function(t){var r=this.animationsMap[t];if(r){r.time=0;r.active=true}else{e.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")}};e.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];if(t){t.active=false}};e.MorphBlendMesh.prototype.update=function(t){for(var r=0,n=this.animationsList.length;ri.duration||i.time<0){i.direction*=-1;if(i.time>i.duration){i.time=i.duration;i.directionBackwards=true}if(i.time<0){i.time=0;i.directionBackwards=false}}}else{i.time=i.time%i.duration;if(i.time<0)i.time+=i.duration}var o=i.startFrame+e.Math.clamp(Math.floor(i.time/a),0,i.length-1);var s=i.weight;if(o!==i.currentFrame){this.morphTargetInfluences[i.lastFrame]=0;this.morphTargetInfluences[i.currentFrame]=1*s;this.morphTargetInfluences[o]=0;i.lastFrame=i.currentFrame;i.currentFrame=o}var u=i.time%a/a;if(i.directionBackwards)u=1-u;this.morphTargetInfluences[i.currentFrame]=u*s;this.morphTargetInfluences[i.lastFrame]=(1-u)*s}};(function(){var e=0;var t=/MSIE (\d+\.\d+);/.test(navigator.userAgent);var r=!!navigator.userAgent.match(/Trident\/7.0/);var n=navigator.userAgent.indexOf("rv:11.0");if(t)e=new Number(RegExp.$1);if(navigator.appVersion.indexOf("MSIE 10")!=-1)e=10;if(r&&n!=-1)e=11;if(e>0){HTMLElement.prototype.getBoundingClientRect=function(){var e=HTMLElement.prototype.getBoundingClientRect;return function(){try{return e.apply(this,arguments)}catch(e){return{left:"",right:"",top:"",bottom:""}}}}()}})();return e}();/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -/* - -BSD License - -For Immutable JS software - -Copyright (c) 2014-2015, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -var u;(function(e,t){u=t()})({},function(){"use strict";var e=Array.prototype.slice;function t(e,t){if(t){e.prototype=Object.create(t.prototype)}e.prototype.constructor=e}function r(e){return o(e)?e:X(e)}t(n,r);function n(e){return s(e)?e:Y(e)}t(i,r);function i(e){return u(e)?e:K(e)}t(a,r);function a(e){return o(e)&&!l(e)?e:Q(e)}function o(e){return!!(e&&e[f])}function s(e){return!!(e&&e[h])}function u(e){return!!(e&&e[d])}function l(e){return s(e)||u(e)}function c(e){return!!(e&&e[p])}r.isIterable=o;r.isKeyed=s;r.isIndexed=u;r.isAssociative=l;r.isOrdered=c;r.Keyed=n;r.Indexed=i;r.Set=a;var f="@@__IMMUTABLE_ITERABLE__@@";var h="@@__IMMUTABLE_KEYED__@@";var d="@@__IMMUTABLE_INDEXED__@@";var p="@@__IMMUTABLE_ORDERED__@@";var m="delete";var v=5;var y=1<>>0;if(""+r!==t||r===4294967295){return NaN}t=r}return t<0?T(e)+t:t}function A(){return true}function P(e,t,r){return(e===0||r!==undefined&&e<=-r)&&(t===undefined||r!==undefined&&t>=r)}function R(e,t){return I(e,t,0)}function k(e,t){return I(e,t,t)}function I(e,t,r){return e===undefined?r:e<0?Math.max(0,t+e):t===undefined?e:Math.min(t,e)}var D=0;var B=1;var L=2;var F=typeof Symbol==="function"&&Symbol.iterator;var V="@@iterator";var O=F||V;function U(e){this.next=e}U.prototype.toString=function(){return"[Iterator]"};U.KEYS=D;U.VALUES=B;U.ENTRIES=L;U.prototype.inspect=U.prototype.toSource=function(){return this.toString()};U.prototype[O]=function(){return this};function N(e,t,r,n){var i=e===0?t:e===1?r:[t,r];n?n.value=i:n={value:i,done:false};return n}function z(){return{value:undefined,done:true}}function H(e){return!!W(e)}function j(e){return e&&typeof e.next==="function"}function G(e){var t=W(e);return t&&t.call(e)}function W(e){var t=e&&(F&&e[F]||e[V]);if(typeof t==="function"){return t}}function q(e){return e&&typeof e.length==="number"}t(X,r);function X(e){return e===null||e===undefined?ie():o(e)?e.toSeq():se(e)}X.of=function(){return X(arguments)};X.prototype.toSeq=function(){return this};X.prototype.toString=function(){return this.__toString("Seq {","}")};X.prototype.cacheResult=function(){if(!this._cache&&this.__iterateUncached){this._cache=this.entrySeq().toArray();this.size=this._cache.length}return this};X.prototype.__iterate=function(e,t){return le(this,e,t,true)};X.prototype.__iterator=function(e,t){return ce(this,e,t,true)};t(Y,X);function Y(e){return e===null||e===undefined?ie().toKeyedSeq():o(e)?s(e)?e.toSeq():e.fromEntrySeq():ae(e)}Y.prototype.toKeyedSeq=function(){return this};t(K,X);function K(e){return e===null||e===undefined?ie():!o(e)?oe(e):s(e)?e.entrySeq():e.toIndexedSeq()}K.of=function(){return K(arguments)};K.prototype.toIndexedSeq=function(){return this};K.prototype.toString=function(){return this.__toString("Seq [","]")};K.prototype.__iterate=function(e,t){return le(this,e,t,false)};K.prototype.__iterator=function(e,t){return ce(this,e,t,false)};t(Q,X);function Q(e){return(e===null||e===undefined?ie():!o(e)?oe(e):s(e)?e.entrySeq():e).toSetSeq()}Q.of=function(){return Q(arguments)};Q.prototype.toSetSeq=function(){return this};X.isSeq=re;X.Keyed=Y;X.Set=Q;X.Indexed=K;var Z="@@__IMMUTABLE_SEQ__@@";X.prototype[Z]=true;t(J,K);function J(e){this._array=e;this.size=e.length}J.prototype.get=function(e,t){return this.has(e)?this._array[M(this,e)]:t};J.prototype.__iterate=function(e,t){var r=this._array;var n=r.length-1;for(var i=0;i<=n;i++){if(e(r[t?n-i:i],i,this)===false){return i+1}}return i};J.prototype.__iterator=function(e,t){var r=this._array;var n=r.length-1;var i=0;return new U(function(){return i>n?z():N(e,i,r[t?n-i++:i++])})};t($,Y);function $(e){var t=Object.keys(e);this._object=e;this._keys=t;this.size=t.length}$.prototype.get=function(e,t){if(t!==undefined&&!this.has(e)){return t}return this._object[e]};$.prototype.has=function(e){return this._object.hasOwnProperty(e)};$.prototype.__iterate=function(e,t){var r=this._object;var n=this._keys;var i=n.length-1;for(var a=0;a<=i;a++){var o=n[t?i-a:a];if(e(r[o],o,this)===false){return a+1}}return a};$.prototype.__iterator=function(e,t){var r=this._object;var n=this._keys;var i=n.length-1;var a=0;return new U(function(){var o=n[t?i-a:a];return a++>i?z():N(e,o,r[o])})};$.prototype[p]=true;t(ee,K);function ee(e){this._iterable=e;this.size=e.length||e.size}ee.prototype.__iterateUncached=function(e,t){if(t){return this.cacheResult().__iterate(e,t)}var r=this._iterable;var n=G(r);var i=0;if(j(n)){var a;while(!(a=n.next()).done){if(e(a.value,i++,this)===false){break}}}return i};ee.prototype.__iteratorUncached=function(e,t){if(t){return this.cacheResult().__iterator(e,t)}var r=this._iterable;var n=G(r);if(!j(n)){return new U(z)}var i=0;return new U(function(){var t=n.next();return t.done?t:N(e,i++,t.value)})};t(te,K);function te(e){this._iterator=e;this._iteratorCache=[]}te.prototype.__iterateUncached=function(e,t){if(t){return this.cacheResult().__iterate(e,t)}var r=this._iterator;var n=this._iteratorCache;var i=0;while(i=n.length){var t=r.next();if(t.done){return t}n[i]=t.value}return N(e,i,n[i++])})};function re(e){return!!(e&&e[Z])}var ne;function ie(){return ne||(ne=new J([]))}function ae(e){var t=Array.isArray(e)?new J(e).fromEntrySeq():j(e)?new te(e).fromEntrySeq():H(e)?new ee(e).fromEntrySeq():typeof e==="object"?new $(e):undefined;if(!t){throw new TypeError("Expected Array or iterable object of [k, v] entries, "+"or keyed object: "+e)}return t}function oe(e){var t=ue(e);if(!t){throw new TypeError("Expected Array or iterable object of values: "+e)}return t}function se(e){var t=ue(e)||typeof e==="object"&&new $(e);if(!t){throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e)}return t}function ue(e){return q(e)?new J(e):j(e)?new te(e):H(e)?new ee(e):undefined}function le(e,t,r,n){var i=e._cache;if(i){var a=i.length-1;for(var o=0;o<=a;o++){var s=i[r?a-o:o];if(t(s[1],n?s[0]:o,e)===false){return o+1}}return o}return e.__iterateUncached(t,r)}function ce(e,t,r,n){var i=e._cache;if(i){var a=i.length-1;var o=0;return new U(function(){var e=i[r?a-o:o];return o++>a?z():N(t,n?e[0]:o-1,e[1])})}return e.__iteratorUncached(t,r)}function fe(e,t){return t?he(t,e,"",{"":e}):de(e)}function he(e,t,r,n){if(Array.isArray(t)){return e.call(n,r,K(t).map(function(r,n){return he(e,r,n,t)}))}if(pe(t)){return e.call(n,r,Y(t).map(function(r,n){return he(e,r,n,t)}))}return t}function de(e){if(Array.isArray(e)){return K(e).map(de).toList()}if(pe(e)){return Y(e).map(de).toMap()}return e}function pe(e){return e&&(e.constructor===Object||e.constructor===undefined)}function me(e,t){if(e===t||e!==e&&t!==t){return true}if(!e||!t){return false}if(typeof e.valueOf==="function"&&typeof t.valueOf==="function"){e=e.valueOf();t=t.valueOf();if(e===t||e!==e&&t!==t){return true}if(!e||!t){return false}}if(typeof e.equals==="function"&&typeof t.equals==="function"&&e.equals(t)){return true}return false}function ve(e,t){if(e===t){return true}if(!o(t)||e.size!==undefined&&t.size!==undefined&&e.size!==t.size||e.__hash!==undefined&&t.__hash!==undefined&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||c(e)!==c(t)){return false}if(e.size===0&&t.size===0){return true}var r=!l(e);if(c(e)){var n=e.entries();return t.every(function(e,t){var i=n.next().value;return i&&me(i[1],e)&&(r||me(i[0],t))})&&n.next().done}var i=false;if(e.size===undefined){if(t.size===undefined){if(typeof e.cacheResult==="function"){e.cacheResult()}}else{i=true;var a=e;e=t;t=a}}var f=true;var h=t.__iterate(function(t,n){if(r?!e.has(t):i?!me(t,e.get(n,b)):!me(e.get(n,b),t)){f=false;return false}});return f&&e.size===h}t(ye,K);function ye(e,t){if(!(this instanceof ye)){return new ye(e,t)}this._value=e;this.size=t===undefined?Infinity:Math.max(0,t);if(this.size===0){if(ge){return ge}ge=this}}ye.prototype.toString=function(){if(this.size===0){return"Repeat []"}return"Repeat [ "+this._value+" "+this.size+" times ]"};ye.prototype.get=function(e,t){return this.has(e)?this._value:t};ye.prototype.includes=function(e){return me(this._value,e)};ye.prototype.slice=function(e,t){var r=this.size;return P(e,t,r)?this:new ye(this._value,k(t,r)-R(e,r))};ye.prototype.reverse=function(){return this};ye.prototype.indexOf=function(e){if(me(this._value,e)){return 0}return-1};ye.prototype.lastIndexOf=function(e){if(me(this._value,e)){return this.size}return-1};ye.prototype.__iterate=function(e,t){for(var r=0;r=0&&t=0&&rr?z():N(e,a++,o)})};xe.prototype.equals=function(e){return e instanceof xe?this._start===e._start&&this._end===e._end&&this._step===e._step:ve(this,e)};var _e;t(we,r);function we(){throw TypeError("Abstract")}t(Ce,we);function Ce(){}t(Ee,we);function Ee(){}t(Se,we);function Se(){}we.Keyed=Ce;we.Indexed=Ee;we.Set=Se;var Te=typeof Math.imul==="function"&&Math.imul(4294967295,2)===-2?Math.imul:function e(t,r){t=t|0;r=r|0;var n=t&65535;var i=r&65535;return n*i+((t>>>16)*i+n*(r>>>16)<<16>>>0)|0};function Me(e){return e>>>1&1073741824|e&3221225471}function Ae(e){if(e===false||e===null||e===undefined){return 0}if(typeof e.valueOf==="function"){e=e.valueOf();if(e===false||e===null||e===undefined){return 0}}if(e===true){return 1}var t=typeof e;if(t==="number"){var r=e|0;if(r!==e){r^=e*4294967295}while(e>4294967295){e/=4294967295;r^=e}return Me(r)}if(t==="string"){return e.length>Ue?Pe(e):Re(e)}if(typeof e.hashCode==="function"){return e.hashCode()}if(t==="object"){return ke(e)}if(typeof e.toString==="function"){return Re(e.toString())}throw new Error("Value type "+t+" cannot be hashed.")}function Pe(e){var t=He[e];if(t===undefined){t=Re(e);if(ze===Ne){ze=0;He={}}ze++;He[e]=t}return t}function Re(e){var t=0;for(var r=0;r0){switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}}var Le=typeof WeakMap==="function";var Fe;if(Le){Fe=new WeakMap}var Ve=0;var Oe="__immutablehash__";if(typeof Symbol==="function"){Oe=Symbol(Oe)}var Ue=16;var Ne=255;var ze=0;var He={};function je(e){be(e!==Infinity,"Cannot perform this action with an infinite size.")}t(Ge,Ce);function Ge(e){return e===null||e===undefined?it():We(e)&&!c(e)?e:it().withMutations(function(t){var r=n(e);je(r.size);r.forEach(function(e,r){return t.set(r,e)})})}Ge.of=function(){var t=e.call(arguments,0);return it().withMutations(function(e){for(var r=0;r=t.length){throw new Error("Missing value for key: "+t[r])}e.set(t[r],t[r+1])}})};Ge.prototype.toString=function(){return this.__toString("Map {","}")};Ge.prototype.get=function(e,t){return this._root?this._root.get(0,undefined,e,t):t};Ge.prototype.set=function(e,t){return at(this,e,t)};Ge.prototype.setIn=function(e,t){return this.updateIn(e,b,function(){return t})};Ge.prototype.remove=function(e){return at(this,e,b)};Ge.prototype.deleteIn=function(e){return this.updateIn(e,function(){return b})};Ge.prototype.update=function(e,t,r){return arguments.length===1?e(this):this.updateIn([e],t,r)};Ge.prototype.updateIn=function(e,t,r){if(!r){r=t;t=undefined}var n=vt(this,_r(e),t,r);return n===b?undefined:n};Ge.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._root=null;this.__hash=undefined;this.__altered=true;return this}return it()};Ge.prototype.merge=function(){return ht(this,undefined,arguments)};Ge.prototype.mergeWith=function(t){var r=e.call(arguments,1);return ht(this,t,r)};Ge.prototype.mergeIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,it(),function(e){return typeof e.merge==="function"?e.merge.apply(e,r):r[r.length-1]})};Ge.prototype.mergeDeep=function(){return ht(this,dt,arguments)};Ge.prototype.mergeDeepWith=function(t){var r=e.call(arguments,1);return ht(this,pt(t),r)};Ge.prototype.mergeDeepIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,it(),function(e){return typeof e.mergeDeep==="function"?e.mergeDeep.apply(e,r):r[r.length-1]})};Ge.prototype.sort=function(e){return zt(cr(this,e))};Ge.prototype.sortBy=function(e,t){return zt(cr(this,t,e))};Ge.prototype.withMutations=function(e){var t=this.asMutable();e(t);return t.wasAltered()?t.__ensureOwner(this.__ownerID):this};Ge.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new E)};Ge.prototype.asImmutable=function(){return this.__ensureOwner()};Ge.prototype.wasAltered=function(){return this.__altered};Ge.prototype.__iterator=function(e,t){return new $e(this,e,t)};Ge.prototype.__iterate=function(e,t){var r=this;var n=0;this._root&&this._root.iterate(function(t){n++;return e(t[1],t[0],r)},t);return n};Ge.prototype.__ensureOwner=function(e){if(e===this.__ownerID){return this}if(!e){this.__ownerID=e;this.__altered=false;return this}return rt(this.size,this._root,e,this.__hash)};function We(e){return!!(e&&e[qe])}Ge.isMap=We;var qe="@@__IMMUTABLE_MAP__@@";var Xe=Ge.prototype;Xe[qe]=true;Xe[m]=Xe.remove;Xe.removeIn=Xe.deleteIn;function Ye(e,t){this.ownerID=e;this.entries=t}Ye.prototype.get=function(e,t,r,n){var i=this.entries;for(var a=0,o=i.length;a=_t){return lt(e,u,n,i)}var h=e&&e===this.ownerID;var d=h?u:S(u);if(f){if(s){l===c-1?d.pop():d[l]=d.pop()}else{d[l]=[n,i]}}else{d.push([n,i])}if(h){this.entries=d;return this}return new Ye(e,d)};function Ke(e,t,r){this.ownerID=e;this.bitmap=t;this.nodes=r}Ke.prototype.get=function(e,t,r,n){if(t===undefined){t=Ae(r)}var i=1<<((e===0?t:t>>>e)&g);var a=this.bitmap;return(a&i)===0?n:this.nodes[yt(a&i-1)].get(e+v,t,r,n)};Ke.prototype.update=function(e,t,r,n,i,a,o){if(r===undefined){r=Ae(n)}var s=(t===0?r:r>>>t)&g;var u=1<=wt){return ft(e,h,l,s,p)}if(c&&!p&&h.length===2&&st(h[f^1])){return h[f^1]}if(c&&p&&h.length===1&&st(p)){return p}var m=e&&e===this.ownerID;var y=c?p?l:l^u:l|u;var x=c?p?gt(h,f,p,m):xt(h,f,m):bt(h,f,p,m);if(m){this.bitmap=y;this.nodes=x;return this}return new Ke(e,y,x)};function Qe(e,t,r){this.ownerID=e;this.count=t;this.nodes=r}Qe.prototype.get=function(e,t,r,n){if(t===undefined){t=Ae(r)}var i=(e===0?t:t>>>e)&g;var a=this.nodes[i];return a?a.get(e+v,t,r,n):n};Qe.prototype.update=function(e,t,r,n,i,a,o){if(r===undefined){r=Ae(n)}var s=(t===0?r:r>>>t)&g;var u=i===b;var l=this.nodes;var c=l[s];if(u&&!c){return this}var f=ot(c,e,t+v,r,n,i,a,o);if(f===c){return this}var h=this.count;if(!c){h++}else if(!f){h--;if(h>>r)&g;var o=(r===0?n:n>>>r)&g;var s;var u=a===o?[ut(e,t,r+v,n,i)]:(s=new Je(t,n,i),a>>=1){o[s]=r&1?t[a++]:undefined}o[n]=i;return new Qe(e,a+1,o)}function ht(e,t,r){var i=[];for(var a=0;a>1&1431655765);e=(e&858993459)+(e>>2&858993459);e=e+(e>>4)&252645135;e=e+(e>>8);e=e+(e>>16);return e&127}function gt(e,t,r,n){var i=n?e:S(e);i[t]=r;return i}function bt(e,t,r,n){var i=e.length+1;if(n&&t+1===i){e[t]=r;return e}var a=new Array(i);var o=0;for(var s=0;s0&&n=0&&e>>t&g;if(n>=this.array.length){return new At([],e)}var i=n===0;var a;if(t>0){var o=this.array[n];a=o&&o.removeBefore(e,t-v,r);if(a===o&&i){return this}}if(i&&!a){return this}var s=Ft(this,e);if(!i){for(var u=0;u>>t&g;if(n>=this.array.length){return this}var i;if(t>0){var a=this.array[n];i=a&&a.removeAfter(e,t-v,r);if(i===a&&n===this.array.length-1){return this}}var o=Ft(this,e);o.array.splice(n+1);if(i){o.array[n]=i}return o};var Pt={};function Rt(e,t){var r=e._origin;var n=e._capacity;var i=Nt(n);var a=e._tail;return o(e._root,e._level,0);function o(e,t,r){return t===0?s(e,r):u(e,t,r)}function s(e,o){var s=o===i?a&&a.array:e&&e.array;var u=o>r?0:r-o;var l=n-o;if(l>y){l=y}return function(){if(u===l){return Pt}var e=t?--l:u++;return s&&s[e]}}function u(e,i,a){var s;var u=e&&e.array;var l=a>r?0:r-a>>i;var c=(n-a>>i)+1;if(c>y){c=y}return function(){do{if(s){var e=s();if(e!==Pt){return e}s=null}if(l===c){return Pt}var r=t?--c:l++;s=o(u&&u[r],i-v,a+(r<=e.size||t<0){return e.withMutations(function(e){t<0?Ot(e,t).set(0,r):Ot(e,0,t+1).set(t,r)})}t+=e._origin;var n=e._tail;var i=e._root;var a=w(_);if(t>=Nt(e._capacity)){n=Lt(n,e.__ownerID,0,t,r,a)}else{i=Lt(i,e.__ownerID,e._level,t,r,a)}if(!a.value){return e}if(e.__ownerID){e._root=i;e._tail=n;e.__hash=undefined;e.__altered=true;return e}return kt(e._origin,e._capacity,e._level,i,n)}function Lt(e,t,r,n,i,a){var o=n>>>r&g;var s=e&&o0){var l=e&&e.array[o];var c=Lt(l,t,r-v,n,i,a);if(c===l){return e}u=Ft(e,t);u.array[o]=c;return u}if(s&&e.array[o]===i){return e}C(a);u=Ft(e,t);if(i===undefined&&o===u.array.length-1){u.array.pop()}else{u.array[o]=i}return u}function Ft(e,t){if(t&&e&&t===e.ownerID){return e}return new At(e?e.array.slice():[],t)}function Vt(e,t){if(t>=Nt(e._capacity)){return e._tail}if(t<1<0){r=r.array[t>>>n&g];n-=v}return r}}function Ot(e,t,r){if(t!==undefined){t=t|0}if(r!==undefined){r=r|0}var n=e.__ownerID||new E;var i=e._origin;var a=e._capacity;var o=i+t;var s=r===undefined?a:r<0?a+r:i+r;if(o===i&&s===a){return e}if(o>=s){return e.clear()}var u=e._level;var l=e._root;var c=0;while(o+c<0){l=new At(l&&l.array.length?[undefined,l]:[],n);u+=v;c+=1<=1<f?new At([],n):d;if(d&&h>f&&ov;y-=v){var b=f>>>y&g;m=m.array[b]=Ft(m.array[b],n)}m.array[f>>>v&g]=d}if(s=h){o-=h;s-=h;u=v;l=null;p=p&&p.removeBefore(n,0,o)}else if(o>i||h>>u&g;if(x!==h>>>u&g){break}if(x){c+=(1<i){l=l.removeBefore(n,u,o-c)}if(l&&ha){a=l.size}if(!o(u)){l=l.map(function(e){return fe(e)})}n.push(l)}if(a>e.size){e=e.setSize(a)}return mt(e,t,n)}function Nt(e){return e>>v<=y&&i.size>=n.size*2){u=i.filter(function(e,t){return e!==undefined&&a!==t});s=u.toKeyedSeq().map(function(e){return e[0]}).flip().toMap();if(e.__ownerID){s.__ownerID=u.__ownerID=e.__ownerID}}else{s=n.remove(t);u=a===i.size-1?i.pop():i.set(a,undefined)}}else{if(o){if(r===i.get(a)[1]){return e}s=n;u=i.set(a,[t,r])}else{s=n.set(t,i.size);u=i.set(i.size,[t,r])}}if(e.__ownerID){e.size=s.size;e._map=s;e._list=u;e.__hash=undefined;return e}return jt(s,u)}t(Xt,Y);function Xt(e,t){this._iter=e;this._useKeys=t;this.size=e.size}Xt.prototype.get=function(e,t){return this._iter.get(e,t)};Xt.prototype.has=function(e){return this._iter.has(e)};Xt.prototype.valueSeq=function(){ -return this._iter.valueSeq()};Xt.prototype.reverse=function(){var e=this;var t=$t(this,true);if(!this._useKeys){t.valueSeq=function(){return e._iter.toSeq().reverse()}}return t};Xt.prototype.map=function(e,t){var r=this;var n=Jt(this,e,t);if(!this._useKeys){n.valueSeq=function(){return r._iter.toSeq().map(e,t)}}return n};Xt.prototype.__iterate=function(e,t){var r=this;var n;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?vr(this):0,function(i){return e(i,t?--n:n++,r)}),t)};Xt.prototype.__iterator=function(e,t){if(this._useKeys){return this._iter.__iterator(e,t)}var r=this._iter.__iterator(B,t);var n=t?vr(this):0;return new U(function(){var i=r.next();return i.done?i:N(e,t?--n:n++,i.value,i)})};Xt.prototype[p]=true;t(Yt,K);function Yt(e){this._iter=e;this.size=e.size}Yt.prototype.includes=function(e){return this._iter.includes(e)};Yt.prototype.__iterate=function(e,t){var r=this;var n=0;return this._iter.__iterate(function(t){return e(t,n++,r)},t)};Yt.prototype.__iterator=function(e,t){var r=this._iter.__iterator(B,t);var n=0;return new U(function(){var t=r.next();return t.done?t:N(e,n++,t.value,t)})};t(Kt,Q);function Kt(e){this._iter=e;this.size=e.size}Kt.prototype.has=function(e){return this._iter.includes(e)};Kt.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate(function(t){return e(t,t,r)},t)};Kt.prototype.__iterator=function(e,t){var r=this._iter.__iterator(B,t);return new U(function(){var t=r.next();return t.done?t:N(e,t.value,t.value,t)})};t(Qt,Y);function Qt(e){this._iter=e;this.size=e.size}Qt.prototype.entrySeq=function(){return this._iter.toSeq()};Qt.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate(function(t){if(t){mr(t);var n=o(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}},t)};Qt.prototype.__iterator=function(e,t){var r=this._iter.__iterator(B,t);return new U(function(){while(true){var t=r.next();if(t.done){return t}var n=t.value;if(n){mr(n);var i=o(n);return N(e,i?n.get(0):n[0],i?n.get(1):n[1],t)}}})};Yt.prototype.cacheResult=Xt.prototype.cacheResult=Kt.prototype.cacheResult=Qt.prototype.cacheResult=br;function Zt(e){var t=gr(e);t._iter=e;t.size=e.size;t.flip=function(){return e};t.reverse=function(){var t=e.reverse.apply(this);t.flip=function(){return e.reverse()};return t};t.has=function(t){return e.includes(t)};t.includes=function(t){return e.has(t)};t.cacheResult=br;t.__iterateUncached=function(t,r){var n=this;return e.__iterate(function(e,r){return t(r,e,n)!==false},r)};t.__iteratorUncached=function(t,r){if(t===L){var n=e.__iterator(t,r);return new U(function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1];e.value[1]=t}return e})}return e.__iterator(t===B?D:B,r)};return t}function Jt(e,t,r){var n=gr(e);n.size=e.size;n.has=function(t){return e.has(t)};n.get=function(n,i){var a=e.get(n,b);return a===b?i:t.call(r,a,n,e)};n.__iterateUncached=function(n,i){var a=this;return e.__iterate(function(e,i,o){return n(t.call(r,e,i,o),i,a)!==false},i)};n.__iteratorUncached=function(n,i){var a=e.__iterator(L,i);return new U(function(){var i=a.next();if(i.done){return i}var o=i.value;var s=o[0];return N(n,s,t.call(r,o[1],s,e),i)})};return n}function $t(e,t){var r=gr(e);r._iter=e;r.size=e.size;r.reverse=function(){return e};if(e.flip){r.flip=function(){var t=Zt(e);t.reverse=function(){return e.flip()};return t}}r.get=function(r,n){return e.get(t?r:-1-r,n)};r.has=function(r){return e.has(t?r:-1-r)};r.includes=function(t){return e.includes(t)};r.cacheResult=br;r.__iterate=function(t,r){var n=this;return e.__iterate(function(e,r){return t(e,r,n)},!r)};r.__iterator=function(t,r){return e.__iterator(t,!r)};return r}function er(e,t,r,n){var i=gr(e);if(n){i.has=function(n){var i=e.get(n,b);return i!==b&&!!t.call(r,i,n,e)};i.get=function(n,i){var a=e.get(n,b);return a!==b&&t.call(r,a,n,e)?a:i}}i.__iterateUncached=function(i,a){var o=this;var s=0;e.__iterate(function(e,a,u){if(t.call(r,e,a,u)){s++;return i(e,n?a:s-1,o)}},a);return s};i.__iteratorUncached=function(i,a){var o=e.__iterator(L,a);var s=0;return new U(function(){while(true){var a=o.next();if(a.done){return a}var u=a.value;var l=u[0];var c=u[1];if(t.call(r,c,l,e)){return N(i,n?l:s++,c,a)}}})};return i}function tr(e,t,r){var n=Ge().asMutable();e.__iterate(function(i,a){n.update(t.call(r,i,a,e),0,function(e){return e+1})});return n.asImmutable()}function rr(e,t,r){var n=s(e);var i=(c(e)?zt():Ge()).asMutable();e.__iterate(function(a,o){i.update(t.call(r,a,o,e),function(e){return e=e||[],e.push(n?[o,a]:a),e})});var a=yr(e);return i.map(function(t){return pr(e,a(t))})}function nr(e,t,r,n){var i=e.size;if(t!==undefined){t=t|0}if(r!==undefined){r=r|0}if(P(t,r,i)){return e}var a=R(t,i);var o=k(r,i);if(a!==a||o!==o){return nr(e.toSeq().cacheResult(),t,r,n)}var s=o-a;var u;if(s===s){u=s<0?0:s}var l=gr(e);l.size=u===0?u:e.size&&u||undefined;if(!n&&re(e)&&u>=0){l.get=function(t,r){t=M(this,t);return t>=0&&tu){return z()}var e=i.next();if(n||t===B){return e}else if(t===D){return N(t,s-1,undefined,e)}else{return N(t,s-1,e.value[1],e)}})};return l}function ir(e,t,r){var n=gr(e);n.__iterateUncached=function(n,i){var a=this;if(i){return this.cacheResult().__iterate(n,i)}var o=0;e.__iterate(function(e,i,s){return t.call(r,e,i,s)&&++o&&n(e,i,a)});return o};n.__iteratorUncached=function(n,i){var a=this;if(i){return this.cacheResult().__iterator(n,i)}var o=e.__iterator(L,i);var s=true;return new U(function(){if(!s){return z()}var e=o.next();if(e.done){return e}var i=e.value;var u=i[0];var l=i[1];if(!t.call(r,l,u,a)){s=false;return z()}return n===L?e:N(n,u,l,e)})};return n}function ar(e,t,r,n){var i=gr(e);i.__iterateUncached=function(i,a){var o=this;if(a){return this.cacheResult().__iterate(i,a)}var s=true;var u=0;e.__iterate(function(e,a,l){if(!(s&&(s=t.call(r,e,a,l)))){u++;return i(e,n?a:u-1,o)}});return u};i.__iteratorUncached=function(i,a){var o=this;if(a){return this.cacheResult().__iterator(i,a)}var s=e.__iterator(L,a);var u=true;var l=0;return new U(function(){var e,a,c;do{e=s.next();if(e.done){if(n||i===B){return e}else if(i===D){return N(i,l++,undefined,e)}else{return N(i,l++,e.value[1],e)}}var f=e.value;a=f[0];c=f[1];u&&(u=t.call(r,c,a,o))}while(u);return i===L?e:N(i,a,c,e)})};return i}function or(e,t){var r=s(e);var i=[e].concat(t).map(function(e){if(!o(e)){e=r?ae(e):oe(Array.isArray(e)?e:[e])}else if(r){e=n(e)}return e}).filter(function(e){return e.size!==0});if(i.length===0){return e}if(i.length===1){var a=i[0];if(a===e||r&&s(a)||u(e)&&u(a)){return a}}var l=new J(i);if(r){l=l.toKeyedSeq()}else if(!u(e)){l=l.toSetSeq()}l=l.flatten(true);l.size=i.reduce(function(e,t){if(e!==undefined){var r=t.size;if(r!==undefined){return e+r}}},0);return l}function sr(e,t,r){var n=gr(e);n.__iterateUncached=function(n,i){var a=0;var s=false;function u(e,l){var c=this;e.__iterate(function(e,i){if((!t||l0}function dr(e,t,n){var i=gr(e);i.size=new J(n).map(function(e){return e.size}).min();i.__iterate=function(e,t){var r=this.__iterator(B,t);var n;var i=0;while(!(n=r.next()).done){if(e(n.value,i++,this)===false){break}}return i};i.__iteratorUncached=function(e,i){var a=n.map(function(e){return e=r(e),G(i?e.reverse():e)});var o=0;var s=false;return new U(function(){var r;if(!s){r=a.map(function(e){return e.next()});s=r.some(function(e){return e.done})}if(s){return z()}return N(e,o++,t.apply(null,r.map(function(e){return e.value})))})};return i}function pr(e,t){return re(e)?t:e.constructor(t)}function mr(e){if(e!==Object(e)){throw new TypeError("Expected [K, V] tuple: "+e)}}function vr(e){je(e.size);return T(e)}function yr(e){return s(e)?n:u(e)?i:a}function gr(e){return Object.create((s(e)?Y:u(e)?K:Q).prototype)}function br(){if(this._iter.cacheResult){this._iter.cacheResult();this.size=this._iter.size;return this}else{return X.prototype.cacheResult.call(this)}}function xr(e,t){return e>t?1:e=0;r--){t={value:arguments[r],next:t}}if(this.__ownerID){this.size=e;this._head=t;this.__hash=undefined;this.__altered=true;return this}return qr(e,t)};Hr.prototype.pushAll=function(e){e=i(e);if(e.size===0){return this}je(e.size);var t=this.size;var r=this._head;e.reverse().forEach(function(e){t++;r={value:e,next:r}});if(this.__ownerID){this.size=t;this._head=r;this.__hash=undefined;this.__altered=true;return this}return qr(t,r)};Hr.prototype.pop=function(){return this.slice(1)};Hr.prototype.unshift=function(){return this.push.apply(this,arguments)};Hr.prototype.unshiftAll=function(e){return this.pushAll(e)};Hr.prototype.shift=function(){return this.pop.apply(this,arguments)};Hr.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._head=undefined;this.__hash=undefined;this.__altered=true;return this}return Yr()};Hr.prototype.slice=function(e,t){if(P(e,t,this.size)){return this}var r=R(e,this.size);var n=k(t,this.size);if(n!==this.size){return Ee.prototype.slice.call(this,e,t)}var i=this.size-r;var a=this._head;while(r--){a=a.next}if(this.__ownerID){this.size=i;this._head=a;this.__hash=undefined;this.__altered=true;return this}return qr(i,a)};Hr.prototype.__ensureOwner=function(e){if(e===this.__ownerID){return this}if(!e){this.__ownerID=e;this.__altered=false;return this}return qr(this.size,this._head,e,this.__hash)};Hr.prototype.__iterate=function(e,t){if(t){return this.reverse().__iterate(e)}var r=0;var n=this._head;while(n){if(e(n.value,r++,this)===false){break}n=n.next}return r};Hr.prototype.__iterator=function(e,t){if(t){return this.reverse().__iterator(e)}var r=0;var n=this._head;return new U(function(){if(n){var t=n.value;n=n.next;return N(e,r++,t)}return z()})};function jr(e){return!!(e&&e[Gr])}Hr.isStack=jr;var Gr="@@__IMMUTABLE_STACK__@@";var Wr=Hr.prototype;Wr[Gr]=true;Wr.withMutations=Xe.withMutations;Wr.asMutable=Xe.asMutable;Wr.asImmutable=Xe.asImmutable;Wr.wasAltered=Xe.wasAltered;function qr(e,t,r,n){var i=Object.create(Wr);i.size=e;i._head=t;i.__ownerID=r;i.__hash=n;i.__altered=false;return i}var Xr;function Yr(){return Xr||(Xr=qr(0))}function Kr(e,t){var r=function(r){e.prototype[r]=t[r]};Object.keys(t).forEach(r);Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r);return e}r.Iterator=U;Kr(r,{toArray:function(){je(this.size);var e=new Array(this.size||0);this.valueSeq().__iterate(function(t,r){e[r]=t});return e},toIndexedSeq:function(){return new Yt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&typeof e.toJS==="function"?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&typeof e.toJSON==="function"?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Xt(this,true)},toMap:function(){return Ge(this.toKeyedSeq())},toObject:function(){je(this.size);var e={};this.__iterate(function(t,r){e[r]=t});return e},toOrderedMap:function(){return zt(this.toKeyedSeq())},toOrderedSet:function(){return Fr(s(this)?this.valueSeq():this)},toSet:function(){return Ar(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Kt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Hr(s(this)?this.valueSeq():this)},toList:function(){return Et(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){if(this.size===0){return e+t}return e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return pr(this,or(this,t))},includes:function(e){return this.some(function(t){return me(t,e)})},entries:function(){return this.__iterator(L)},every:function(e,t){je(this.size);var r=true;this.__iterate(function(n,i,a){if(!e.call(t,n,i,a)){r=false;return false}});return r},filter:function(e,t){return pr(this,er(this,e,t,true))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},findEntry:function(e,t){var r;this.__iterate(function(n,i,a){if(e.call(t,n,i,a)){r=[i,n];return false}});return r},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){je(this.size);return this.__iterate(t?e.bind(t):e)},join:function(e){je(this.size);e=e!==undefined?""+e:",";var t="";var r=true;this.__iterate(function(n){r?r=false:t+=e;t+=n!==null&&n!==undefined?n.toString():""});return t},keys:function(){return this.__iterator(D)},map:function(e,t){return pr(this,Jt(this,e,t))},reduce:function(e,t,r){je(this.size);var n;var i;if(arguments.length<2){i=true}else{n=t}this.__iterate(function(t,a,o){if(i){i=false;n=t}else{n=e.call(r,n,t,a,o)}});return n},reduceRight:function(e,t,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return pr(this,$t(this,true))},slice:function(e,t){return pr(this,nr(this,e,t,true))},some:function(e,t){return!this.every(en(e),t)},sort:function(e){return pr(this,cr(this,e))},values:function(){return this.__iterator(B)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==undefined?this.size===0:!this.some(function(){return true})},count:function(e,t){return T(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return tr(this,e,t)},equals:function(e){return ve(this,e)},entrySeq:function(){var e=this;if(e._cache){return new J(e._cache)}var t=e.toSeq().map($r).toIndexedSeq();t.fromEntrySeq=function(){return e.toSeq()};return t},filterNot:function(e,t){return this.filter(en(e),t)},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},first:function(){return this.find(A)},flatMap:function(e,t){return pr(this,ur(this,e,t))},flatten:function(e){return pr(this,sr(this,e,true))},fromEntrySeq:function(){return new Qt(this)},get:function(e,t){return this.find(function(t,r){return me(r,e)},undefined,t)},getIn:function(e,t){var r=this;var n=_r(e);var i;while(!(i=n.next()).done){var a=i.value;r=r&&r.get?r.get(a,b):b;if(r===b){return t}}return r},groupBy:function(e,t){return rr(this,e,t)},has:function(e){return this.get(e,b)!==b},hasIn:function(e){return this.getIn(e,b)!==b},isSubset:function(e){e=typeof e.includes==="function"?e:r(e);return this.every(function(t){return e.includes(t)})},isSuperset:function(e){e=typeof e.isSubset==="function"?e:r(e);return e.isSubset(this)},keySeq:function(){return this.toSeq().map(Jr).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return fr(this,e)},maxBy:function(e,t){return fr(this,t,e)},min:function(e){return fr(this,e?tn(e):an)},minBy:function(e,t){return fr(this,t?tn(t):an,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return pr(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return pr(this,ar(this,e,t,true))},skipUntil:function(e,t){return this.skipWhile(en(e),t)},sortBy:function(e,t){return pr(this,cr(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return pr(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return pr(this,ir(this,e,t))},takeUntil:function(e,t){return this.takeWhile(en(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var Qr=r.prototype;Qr[f]=true;Qr[O]=Qr.values;Qr.__toJS=Qr.toArray;Qr.__toStringMapper=rn;Qr.inspect=Qr.toSource=function(){return this.toString()};Qr.chain=Qr.flatMap;Qr.contains=Qr.includes;(function(){try{Object.defineProperty(Qr,"length",{get:function(){if(!r.noLengthWarning){var e;try{throw new Error}catch(t){e=t.stack}if(e.indexOf("_wrapObject")===-1){console&&console.warn&&console.warn("iterable.length has been deprecated, "+"use iterable.size or iterable.count(). "+"This warning will become a silent error in a future version. "+e);return this.size}}}})}catch(e){}})();Kr(n,{flip:function(){return pr(this,Zt(this))},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey(function(t){return me(t,e)})},lastKeyOf:function(e){return this.findLastKey(function(t){return me(t,e)})},mapEntries:function(e,t){var r=this;var n=0;return pr(this,this.toSeq().map(function(i,a){return e.call(t,[a,i],n++,r)}).fromEntrySeq())},mapKeys:function(e,t){var r=this;return pr(this,this.toSeq().flip().map(function(n,i){return e.call(t,n,i,r)}).flip())}});var Zr=n.prototype;Zr[h]=true;Zr[O]=Qr.entries;Zr.__toJS=Qr.toObject;Zr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+rn(e)};Kr(i,{toKeyedSeq:function(){return new Xt(this,false)},filter:function(e,t){return pr(this,er(this,e,t,false))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.toKeyedSeq().keyOf(e);return t===undefined?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return t===undefined?-1:t},reverse:function(){return pr(this,$t(this,false))},slice:function(e,t){return pr(this,nr(this,e,t,false))},splice:function(e,t){var r=arguments.length;t=Math.max(t|0,0);if(r===0||r===2&&!t){return this}e=R(e,e<0?this.count():this.size);var n=this.slice(0,e);return pr(this,r===1?n:n.concat(S(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.toKeyedSeq().findLastKey(e,t);return r===undefined?-1:r},first:function(){return this.get(0)},flatten:function(e){return pr(this,sr(this,e,false))},get:function(e,t){e=M(this,e);return e<0||(this.size===Infinity||this.size!==undefined&&e>this.size)?t:this.find(function(t,r){return r===e},undefined,t)},has:function(e){e=M(this,e);return e>=0&&(this.size!==undefined?this.size===Infinity||et?-1:0}function on(e){if(e.size===Infinity){return 0}var t=c(e);var r=s(e);var n=t?1:0;var i=e.__iterate(r?t?function(e,t){n=31*n+un(Ae(e),Ae(t))|0}:function(e,t){n=n+un(Ae(e),Ae(t))|0}:t?function(e){n=31*n+Ae(e)|0}:function(e){n=n+Ae(e)|0});return sn(i,n)}function sn(e,t){t=Te(t,3432918353);t=Te(t<<15|t>>>-15,461845907);t=Te(t<<13|t>>>-13,5);t=(t+3864292196|0)^e;t=Te(t^t>>>16,2246822507);t=Te(t^t>>>13,3266489909);t=Me(t^t>>>16);return t}function un(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var ln={Iterable:r,Seq:X,Collection:we,Map:Ge,OrderedMap:zt,List:Et,Stack:Hr,Set:Ar,OrderedSet:Fr,Record:wr,Range:xe,Repeat:ye,is:me,fromJS:fe};return ln});/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */ -var l={};(function(){"use strict";function e(e){throw e}var t=void 0,r=!0,n=this;function i(e,r){var i=e.split("."),a=n;!(i[0]in a)&&a.execScript&&a.execScript("var "+i[0]);for(var o;i.length&&(o=i.shift());)!i.length&&r!==t?a[o]=r:a=a[o]?a[o]:a[o]={}}var a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function o(t,r){this.index="number"===typeof r?r:0;this.m=0;this.buffer=t instanceof(a?Uint8Array:Array)?t:new(a?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&e(Error("invalid index"));this.buffer.length<=this.index&&this.f()}o.prototype.f=function(){var e=this.buffer,t,r=e.length,n=new(a?Uint8Array:Array)(r<<1);if(a)n.set(e);else for(t=0;t>>8&255]<<16|h[e>>>16&255]<<8|h[e>>>24&255])>>32-t:h[e]>>8-t);if(8>t+a)o=o<>t-s-1&1,8===++a&&(a=0,n[i++]=h[o],o=0,i===n.length&&(n=this.f()));n[i]=o;this.buffer=n;this.m=a;this.index=i};o.prototype.finish=function(){var e=this.buffer,t=this.index,r;0u;++u){for(var l=u,c=l,f=7,l=l>>>1;l;l>>>=1)c<<=1,c|=l&1,--f;s[u]=(c<>>0}var h=s;function d(e,t,r){var n,i="number"===typeof t?t:t=0,a="number"===typeof r?r:e.length;n=-1;for(i=a&7;i--;++t)n=n>>>8^m[(n^e[t])&255];for(i=a>>3;i--;t+=8)n=n>>>8^m[(n^e[t])&255],n=n>>>8^m[(n^e[t+1])&255],n=n>>>8^m[(n^e[t+2])&255],n=n>>>8^m[(n^e[t+3])&255],n=n>>>8^m[(n^e[t+4])&255],n=n>>>8^m[(n^e[t+5])&255],n=n>>>8^m[(n^e[t+6])&255],n=n>>>8^m[(n^e[t+7])&255];return(n^4294967295)>>>0}var p=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],m=a?new Uint32Array(p):p;function v(){}v.prototype.getName=function(){return this.name};v.prototype.getData=function(){return this.data};v.prototype.Y=function(){return this.Z};i("Zlib.GunzipMember",v);i("Zlib.GunzipMember.prototype.getName",v.prototype.getName);i("Zlib.GunzipMember.prototype.getData",v.prototype.getData);i("Zlib.GunzipMember.prototype.getMtime",v.prototype.Y);function y(e){this.buffer=new(a?Uint16Array:Array)(2*e);this.length=0}y.prototype.getParent=function(e){return 2*((e-2)/4|0)};y.prototype.push=function(e,t){var r,n,i=this.buffer,a;r=this.length;i[this.length++]=t;for(i[this.length++]=e;0i[n])a=i[r],i[r]=i[n],i[n]=a,a=i[r+1],i[r+1]=i[n+1],i[n+1]=a,r=n;else break;return this.length};y.prototype.pop=function(){var e,t,r=this.buffer,n,i,a;t=r[0];e=r[1];this.length-=2;r[0]=r[this.length];r[1]=r[this.length+1];for(a=0;;){i=2*a+2;if(i>=this.length)break;i+2r[i]&&(i+=2);if(r[i]>r[a])n=r[a],r[a]=r[i],r[i]=n,n=r[a+1],r[a+1]=r[i+1],r[i+1]=n;else break;a=i}return{index:e,value:t,length:this.length}};function g(e){var t=e.length,r=0,n=Number.POSITIVE_INFINITY,i,o,s,u,l,c,f,h,d,p;for(h=0;hr&&(r=e[h]),e[h]>=1;p=s<<16|h;for(d=c;dC;C++)switch(r){case 143>=C:w.push([C+48,8]);break;case 255>=C:w.push([C-144+400,9]);break;case 279>=C:w.push([C-256+0,7]);break;case 287>=C:w.push([C-280+192,8]);break;default:e("invalid literal: "+C)}b.prototype.g=function(){var n,i,s,u,l=this.input;switch(this.k){case 0:s=0;for(u=l.length;s>>8&255;y[g++]=p&255;y[g++]=p>>>8&255;if(a)y.set(c,g),g+=c.length,y=y.subarray(0,g);else{m=0;for(v=c.length;mJ)for(;0J?J:138,re>J-3&&re=re?(ee[te++]=17,ee[te++]=re-3,ne[17]++):(ee[te++]=18,ee[te++]=re-11,ne[18]++),J-=re;else if(ee[te++]=K[Q],ne[K[Q]]++,J--,3>J)for(;0J?J:6,re>J-3&&reW;W++)z[W]=N[L[W]];for(B=19;4=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:e("invalid length: "+t)}}var n=[],i,a;for(i=3;258>=i;i++)a=t(i),n[i]=a[2]<<24|a[1]<<16|a[0];return n}(),T=a?new Uint32Array(S):S;function M(n,i){function o(t,n){var i=t.Q,a=[],o=0,s;s=T[t.length];a[o++]=s&65535;a[o++]=s>>16&255;a[o++]=s>>24;var u;switch(r){case 1===i:u=[0,i-1,0];break;case 2===i:u=[1,i-2,0];break;case 3===i:u=[2,i-3,0];break;case 4===i:u=[3,i-4,0];break;case 6>=i:u=[4,i-5,1];break;case 8>=i:u=[5,i-7,1];break;case 12>=i:u=[6,i-9,2];break;case 16>=i:u=[7,i-13,2];break;case 24>=i:u=[8,i-17,3];break;case 32>=i:u=[9,i-25,3];break;case 48>=i:u=[10,i-33,4];break;case 64>=i:u=[11,i-49,4];break;case 96>=i:u=[12,i-65,5];break;case 128>=i:u=[13,i-97,5];break;case 192>=i:u=[14,i-129,6];break;case 256>=i:u=[15,i-193,6];break;case 384>=i:u=[16,i-257,7];break;case 512>=i:u=[17,i-385,7];break;case 768>=i:u=[18,i-513,8];break;case 1024>=i:u=[19,i-769,8];break;case 1536>=i:u=[20,i-1025,9];break;case 2048>=i:u=[21,i-1537,9];break;case 3072>=i:u=[22,i-2049,10];break;case 4096>=i:u=[23,i-3073,10];break;case 6144>=i:u=[24,i-4097,11];break;case 8192>=i:u=[25,i-6145,11];break;case 12288>=i:u=[26,i-8193,12];break;case 16384>=i:u=[27,i-12289,12];break;case 24576>=i:u=[28,i-16385,13];break;case 32768>=i:u=[29,i-24577,13];break;default:e("invalid distance")}s=u;a[o++]=s[0];a[o++]=s[1];a[o++]=s[2];var l,c;l=0;for(c=a.length;l=l;)b[l++]=0;for(l=0;29>=l;)x[l++]=0}b[256]=1;s=0;for(u=i.length;s=u){m&&o(m,-1);l=0;for(c=u-s;lo&&t+oa&&(i=n,a=o);if(258===o)break}return new E(a,t-i)}function P(e,t){var r=e.length,n=new y(572),i=new(a?Uint8Array:Array)(r),o,s,u,l,c;if(!a)for(l=0;l2*i[p-1]+o[p]&&(i[p]=2*i[p-1]+o[p]),u[p]=Array(i[p]),l[p]=Array(i[p]);for(d=0;de[d]?(u[p][m]=v,l[p][m]=t,y+=2):(u[p][m]=e[d],l[p][m]=d,++d);c[p]=0;1===o[p]&&n(p)}return s}function k(e){var t=new(a?Uint16Array:Array)(e.length),r=[],n=[],i=0,o,s,u,l;o=0;for(s=e.length;o>>=1}return t}function I(e,t){this.input=e;this.b=this.c=0;this.i={};t&&(t.flags&&(this.i=t.flags),"string"===typeof t.filename&&(this.filename=t.filename),"string"===typeof t.comment&&(this.A=t.comment),t.deflateOptions&&(this.l=t.deflateOptions));this.l||(this.l={})}I.prototype.g=function(){var e,r,n,i,o,s,u,l,c=new(a?Uint8Array:Array)(32768),f=0,h=this.input,p=this.c,m=this.filename,v=this.A;c[f++]=31;c[f++]=139;c[f++]=8;e=0;this.i.fname&&(e|=L);this.i.fcomment&&(e|=F);this.i.fhcrc&&(e|=B);c[f++]=e;r=(Date.now?Date.now():+new Date)/1e3|0;c[f++]=r&255;c[f++]=r>>>8&255;c[f++]=r>>>16&255;c[f++]=r>>>24&255;c[f++]=0;c[f++]=D;if(this.i.fname!==t){u=0;for(l=m.length;u>>8&255),c[f++]=s&255;c[f++]=0}if(this.i.comment){u=0;for(l=v.length;u>>8&255),c[f++]=s&255;c[f++]=0}this.i.fhcrc&&(n=d(c,0,f)&65535,c[f++]=n&255,c[f++]=n>>>8&255);this.l.outputBuffer=c;this.l.outputIndex=f;o=new b(h,this.l);c=o.g();f=o.b;a&&(f+8>c.buffer.byteLength?(this.a=new Uint8Array(f+8),this.a.set(new Uint8Array(c.buffer)),c=this.a):c=new Uint8Array(c.buffer));i=d(h,t,t);c[f++]=i&255;c[f++]=i>>>8&255;c[f++]=i>>>16&255;c[f++]=i>>>24&255;l=h.length;c[f++]=l&255;c[f++]=l>>>8&255;c[f++]=l>>>16&255;c[f++]=l>>>24&255;this.c=p;a&&f>>=1;switch(n){case 0:var i=this.input,o=this.c,s=this.a,u=this.b,l=i.length,c=t,f=t,h=s.length,d=t;this.e=this.j=0;o+1>=l&&e(Error("invalid uncompressed block header: LEN"));c=i[o++]|i[o++]<<8;o+1>=l&&e(Error("invalid uncompressed block header: NLEN"));f=i[o++]|i[o++]<<8;c===~f&&e(Error("invalid uncompressed block header: length verify"));o+c>i.length&&e(Error("input buffer is broken"));switch(this.r){case O:for(;u+c>s.length;){d=h-u;c-=d;if(a)s.set(i.subarray(o,o+d),u),u+=d,o+=d;else for(;d--;)s[u++]=i[o++];this.b=u;s=this.f();u=this.b}break;case U:for(;u+c>s.length;)s=this.f({F:2});break;default:e(Error("invalid inflate mode"))}if(a)s.set(i.subarray(o,o+c),u),u+=c,o+=c;else for(;c--;)s[u++]=i[o++];this.c=o;this.b=u;this.a=s;break;case 1:this.s(ee,ie);break;case 2:se(this);break;default:e(Error("unknown BTYPE: "+n))}}return this.B()};var z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],H=a?new Uint16Array(z):z,j=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],G=a?new Uint16Array(j):j,W=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],q=a?new Uint8Array(W):W,X=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Y=a?new Uint16Array(X):X,K=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Q=a?new Uint8Array(K):K,Z=new(a?Uint8Array:Array)(288),J,$;J=0;for($=Z.length;J<$;++J)Z[J]=143>=J?8:255>=J?9:279>=J?7:8;var ee=g(Z),te=new(a?Uint8Array:Array)(30),re,ne;re=0;for(ne=te.length;re=s&&e(Error("input buffer is broken")),n|=a[o++]<>>r;t.e=i-r;t.c=o;return u}function oe(e,t){for(var r=e.j,n=e.e,i=e.input,a=e.c,o=i.length,s=t[0],u=t[1],l,c;n=o);)r|=i[a++]<>>16;e.j=r>>c;e.e=n-c;e.c=a;return l&65535}function se(e){function t(e,t,r){var n,i=this.J,a,o;for(o=0;oa)n>=i&&(this.b=n,r=this.f(),n=this.b),r[n++]=a;else{o=a-257;u=G[o];0=i&&(this.b=n,r=this.f(),n=this.b);for(;u--;)r[n]=r[n++-s]}for(;8<=this.e;)this.e-=8,this.c--;this.b=n};V.prototype.T=function(e,t){var r=this.a,n=this.b;this.C=e;for(var i=r.length,a,o,s,u;256!==(a=oe(this,e));)if(256>a)n>=i&&(r=this.f(),i=r.length),r[n++]=a;else{o=a-257;u=G[o];0i&&(r=this.f(),i=r.length);for(;u--;)r[n]=r[n++-s]}for(;8<=this.e;)this.e-=8,this.c--;this.b=n};V.prototype.f=function(){var e=new(a?Uint8Array:Array)(this.b-32768),t=this.b-32768,r,n,i=this.a;if(a)e.set(i.subarray(32768,e.length));else{r=0;for(n=e.length;rr;++r)i[r]=i[t+r];this.b=32768;return i};V.prototype.U=function(e){var t,r=this.input.length/this.c+1|0,n,i,o,s=this.input,u=this.a;e&&("number"===typeof e.F&&(r=e.F),"number"===typeof e.P&&(r+=e.P));2>r?(n=(s.length-this.c)/this.C[2],o=258*(n/2)|0,i=ot&&(this.a.length=t),e=this.a);return this.buffer=e};function ue(e){this.input=e;this.c=0;this.t=[];this.D=!1}ue.prototype.X=function(){this.D||this.h();return this.t.slice()};ue.prototype.h=function(){for(var n=this.input.length;this.c>>0;d(u,t,t)!==m&&e(Error("invalid CRC-32 checksum: 0x"+d(u,t,t).toString(16)+" / 0x"+m.toString(16)));i.da=o=(y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24)>>>0;(u.length&4294967295)!==o&&e(Error("invalid input size: "+(u.length&4294967295)+" / "+o));this.t.push(i);this.c=g}this.D=r;var b=this.t,x,_,w=0,C=0,E;x=0;for(_=b.length;x<_;++x)C+=b[x].data.length;if(a){E=new Uint8Array(C);for(x=0;x<_;++x)E.set(b[x].data,w),w+=b[x].data.length}else{E=[];for(x=0;x<_;++x)E[x]=b[x].data;E=Array.prototype.concat.apply([],E)}return E};i("Zlib.Gunzip",ue);i("Zlib.Gunzip.prototype.decompress",ue.prototype.h);i("Zlib.Gunzip.prototype.getMembers",ue.prototype.X);function le(e){if("string"===typeof e){var t=e.split(""),r,n;r=0;for(n=t.length;r>>0;e=t}for(var i=1,a=0,o=e.length,s,u=0;0>>0}function ce(t,r){var n,i;this.input=t;this.c=0;if(r||!(r={}))r.index&&(this.c=r.index),r.verify&&(this.$=r.verify);n=t[this.c++];i=t[this.c++];switch(n&15){case fe:this.method=fe;break;default:e(Error("unsupported compression method"))}0!==((n<<8)+i)%31&&e(Error("invalid fcheck flag:"+((n<<8)+i)%31));i&32&&e(Error("fdict flag is not supported"));this.L=new V(t,{index:this.c,bufferSize:r.bufferSize,bufferType:r.bufferType,resize:r.resize})}ce.prototype.h=function(){var t=this.input,r,n;r=this.L.h();this.c=this.L.c;this.$&&(n=(t[this.c++]<<24|t[this.c++]<<16|t[this.c++]<<8|t[this.c++])>>>0,n!==le(r)&&e(Error("invalid adler-32 checksum")));return r};var fe=8;function he(e,t){this.input=e;this.a=new(a?Uint8Array:Array)(32768);this.k=de.o;var r={},n;if((t||!(t={}))&&"number"===typeof t.compressionType)this.k=t.compressionType;for(n in t)r[n]=t[n];r.outputBuffer=this.a;this.K=new b(this.input,r)}var de=_;he.prototype.g=function(){var t,r,n,i,o,s,u,l=0;u=this.a;t=fe;switch(t){case fe:r=Math.LOG2E*Math.log(32768)-8;break;default:e(Error("invalid compression method"))}n=r<<4|t;u[l++]=n;switch(t){case fe:switch(this.k){case de.NONE:o=0;break;case de.v:o=1;break;case de.o:o=2;break;default:e(Error("unsupported compression type"))}break;default:e(Error("invalid compression method"))}i=o<<6|0;u[l++]=i|31-(256*n+i)%31;s=le(this.input);this.K.b=l;u=this.K.g();l=u.length;a&&(u=new Uint8Array(u.buffer),u.length<=l+4&&(this.a=new Uint8Array(u.length+4),this.a.set(u),u=this.a),u=u.subarray(0,l+4));u[l++]=s>>24&255;u[l++]=s>>16&255;u[l++]=s>>8&255;u[l++]=s&255;return u};function pe(e,t){var r,n,a,o;if(Object.keys)r=Object.keys(t);else for(n in r=[],a=0,t)r[a++]=n;a=0;for(o=r.length;a1){for(var p=Array(d),m=0;m1){for(var y=Array(v),g=0;g8&&x<=11),C=32,E=String.fromCharCode(C),S={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},T=!1,M=null,A={eventTypes:S,extractEvents:function(e,t,r,n){return[u(e,t,r,n),f(e,t,r,n)]}};t.exports=A},{124:124,19:19,20:20,78:78,82:82}],4:[function(e,t,r){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var i={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},a=["Webkit","ms","Moz","O"];Object.keys(i).forEach(function(e){a.forEach(function(t){i[n(t,e)]=i[e]})});var o={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:i,shorthandPropertyExpansions:o};t.exports=s},{}],5:[function(e,t,r){"use strict";var n=e(4),i=e(124),a=(e(58),e(126),e(94)),o=e(137),s=e(141),u=(e(143),s(function(e){return o(e)})),l=!1,c="cssFloat";if(i.canUseDOM){var f=document.createElement("div").style;try{f.font=""}catch(e){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var h={createMarkupForStyles:function(e,t){var r="";for(var n in e)if(e.hasOwnProperty(n)){var i=0===n.indexOf("--"),o=e[n];null!=o&&(r+=u(n)+":",r+=a(n,o,t,i)+";")}return r||null},setValueForStyles:function(e,t,r){var i=e.style;for(var o in t)if(t.hasOwnProperty(o)){var s=0===o.indexOf("--"),u=a(o,t[o],r,s);if("float"!==o&&"cssFloat"!==o||(o=c),s)i.setProperty(o,u);else if(u)i[o]=u;else{var f=l&&n.shorthandPropertyExpansions[o];if(f)for(var h in f)i[h]="";else i[o]=""}}}};t.exports=h},{124:124,126:126,137:137,141:141,143:143,4:4,58:58,94:94}],6:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=e(113),a=e(24),o=(e(138),function(){function e(t){n(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,r=this._arg;if(e&&t){e.length!==t.length&&i("24"),this._callbacks=null,this._contexts=null;for(var n=0;n8));var L=!1;C.canUseDOM&&(L=P("input")&&(!("documentMode"in document)||document.documentMode>9));var F={eventTypes:k,_allowSimulatedPassThrough:!0,_isInputEventSupported:L,extractEvents:function(e,t,r,a){var o,s,u=t?E.getNodeFromInstance(t):window;if(i(u)?B?o=c:s=f:R(u)?L?o=b:(o=v,s=m):y(u)&&(o=g),o){var l=o(e,t,r);if(l)return n(l,r,a)}s&&s(e,u,t),"topBlur"===e&&x(t,u)}};t.exports=F},{102:102,108:108,110:110,111:111,124:124,16:16,19:19,33:33,71:71,80:80}],8:[function(e,t,r){"use strict";function n(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function i(e,t,r){c.insertTreeBefore(e,t,r)}function a(e,t,r){Array.isArray(t)?s(e,t[0],t[1],r):m(e,t,r)}function o(e,t){if(Array.isArray(t)){var r=t[1];t=t[0],u(e,t,r),e.removeChild(r)}e.removeChild(t)}function s(e,t,r,n){for(var i=t;;){var a=i.nextSibling;if(m(e,i,n),i===r)break;i=a}}function u(e,t,r){for(;;){var n=t.nextSibling;if(n===r)break;e.removeChild(n)}}function l(e,t,r){var n=e.parentNode,i=e.nextSibling;i===t?r&&m(n,document.createTextNode(r),i):r?(p(i,r),u(n,i,t)):u(n,e,t)}var c=e(9),f=e(13),h=(e(33),e(58),e(93)),d=e(115),p=e(116),m=h(function(e,t,r){e.insertBefore(t,r)}),v=f.dangerouslyReplaceNodeWithMarkup,y={dangerouslyReplaceNodeWithMarkup:v,replaceDelimitedText:l,processUpdates:function(e,t){for(var r=0;r-1||o("96",e),!l.plugins[r]){t.extractEvents||o("97",e),l.plugins[r]=t;var n=t.eventTypes;for(var a in n)i(n[a],t,a)||o("98",a,e)}}}function i(e,t,r){l.eventNameDispatchConfigs.hasOwnProperty(r)&&o("99",r),l.eventNameDispatchConfigs[r]=e;var n=e.phasedRegistrationNames;if(n){for(var i in n)if(n.hasOwnProperty(i)){var s=n[i];a(s,t,r)}return!0}return!!e.registrationName&&(a(e.registrationName,t,r),!0)}function a(e,t,r){l.registrationName__module__s[e]&&o("100",e),l.registrationName__module__s[e]=t,l.registrationNameDependencies[e]=t.eventTypes[r].dependencies}var o=e(113),s=(e(138),null),u={},l={plugins:[],eventNameDispatchConfigs:{},registrationName__module__s:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){s&&o("101"),s=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];u.hasOwnProperty(r)&&u[r]===i||(u[r]&&o("102",r),u[r]=i,t=!0)}t&&n()},getPlugin__module__ForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationName__module__s[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var r=t.phasedRegistrationNames;for(var n in r)if(r.hasOwnProperty(n)){var i=l.registrationName__module__s[r[n]];if(i)return i}}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var r in t)t.hasOwnProperty(r)&&delete t[r];var n=l.registrationName__module__s;for(var i in n)n.hasOwnProperty(i)&&delete n[i]}};t.exports=l},{113:113,138:138}],18:[function(e,t,r){"use strict";function n(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function i(e){return"topMouseMove"===e||"topTouchMove"===e}function a(e){return"topMouseDown"===e||"topTouchStart"===e}function o(e,t,r,n){var i=e.type||"unknown-event";e.currentTarget=y.getNodeFromInstance(n),t?m.invokeGuardedCallbackWithCatch(i,r,e):m.invokeGuardedCallback(i,r,e),e.currentTarget=null}function s(e,t){var r=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(r))for(var i=0;i1?1-t:void 0;return this._fallbackText=i.slice(e,s),this._fallbackText}}),a.addPoolingTo(n),t.exports=n},{106:106,144:144,24:24}],21:[function(e,t,r){"use strict";var n=e(11),i=n.injection.MUST_USE_PROPERTY,a=n.injection.HAS_BOOLEAN_VALUE,o=n.injection.HAS_NUMERIC_VALUE,s=n.injection.HAS_POSITIVE_NUMERIC_VALUE,u=n.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+n.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:a,allowTransparency:0,alt:0,as:0,async:a,autoComplete:0,autoPlay:a,capture:a,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:i|a,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:a,coords:0,crossOrigin:0,data:0,dateTime:0,default:a,defer:a,dir:0,disabled:a,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:a,formTarget:0,frameBorder:0,headers:0,height:0,hidden:a,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:a,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:i|a,muted:i|a,name:0,nonce:0,noValidate:a,open:a,optimum:0,pattern:0,placeholder:0,playsInline:a,poster:0,preload:0,profile:0,radioGroup:0,readOnly:a,referrerPolicy:0,rel:0,required:a,reversed:a,role:0,rows:s,rowSpan:o,sandbox:0,scope:0,scoped:a,scrolling:0,seamless:a,selected:i|a,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:o,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:a,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};t.exports=l},{11:11}],22:[function(e,t,r){"use strict";function n(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function i(e){var t=/(=0|=2)/g,r={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return r[e]})}var a={escape:n,unescape:i};t.exports=a},{}],23:[function(e,t,r){"use strict";function n(e){null!=e.checkedLink&&null!=e.valueLink&&s("87")}function i(e){n(e),(null!=e.value||null!=e.onChange)&&s("88")}function a(e){n(e),(null!=e.checked||null!=e.onChange)&&s("89")}function o(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=e(113),u=e(64),l=e(146),c=e(121),f=l(c.isValidElement),h=(e(138),e(143),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),d={value:function(e,t,r){return!e[t]||h[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,r){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:f.func},p={},m={checkPropTypes:function(e,t,r){for(var n in d){if(d.hasOwnProperty(n))var i=d[n](t,n,e,"prop",null,u);i instanceof Error&&!(i.message in p)&&(p[i.message]=!0,o(r))}},getValue:function(e){return e.valueLink?(i(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(a(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(i(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(a(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=m},{113:113,121:121,138:138,143:143,146:146,64:64}],24:[function(e,t,r){"use strict";var n=e(113),i=(e(138),function(e){var t=this;if(t.instancePool.length){var r=t.instancePool.pop();return t.call(r,e),r}return new t(e)}),a=function(e,t){var r=this;if(r.instancePool.length){var n=r.instancePool.pop();return r.call(n,e,t),n}return new r(e,t)},o=function(e,t,r){var n=this;if(n.instancePool.length){var i=n.instancePool.pop();return n.call(i,e,t,r),i}return new n(e,t,r)},s=function(e,t,r,n){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,r,n),a}return new i(e,t,r,n)},u=function(e){var t=this;e instanceof t||n("25"),e.destructor(),t.instancePool.length=0||null!=t.is}function m(e){var t=e.type;d(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var v=e(113),y=e(144),g=e(2),b=e(5),x=e(9),_=e(10),w=e(11),C=e(12),E=e(16),S=e(17),T=e(25),M=e(32),A=e(33),P=e(38),R=e(39),k=e(40),I=e(43),D=(e(58),e(61)),B=e(68),L=(e(130),e(95)),F=(e(138),e(110),e(142),e(108)),V=(e(119),e(143),M),O=E.deleteListener,U=A.getNodeFromInstance,N=T.listenTo,z=S.registrationName__module__s,H={string:!0,number:!0},j="__html",G={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},W=11,q={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},X={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Y={listing:!0,pre:!0,textarea:!0},K=y({menuitem:!0},X),Q=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Z={},J={}.hasOwnProperty,$=1;m.displayName="ReactDOMComponent",m.Mixin={mountComponent:function(e,t,r,n){this._rootNodeID=$++,this._domID=r._idCounter++,this._hostParent=t,this._hostContainerInfo=r;var a=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(f,this);break;case"input":P.mountWrapper(this,a,t),a=P.getHostProps(this,a),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(f,this);break;case"option":R.mountWrapper(this,a,t),a=R.getHostProps(this,a);break;case"select":k.mountWrapper(this,a,t),a=k.getHostProps(this,a),e.getReactMountReady().enqueue(f,this);break;case"textarea":I.mountWrapper(this,a,t),a=I.getHostProps(this,a),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(f,this)}i(this,a);var o,h;null!=t?(o=t._namespaceURI,h=t._tag):r._tag&&(o=r._namespaceURI,h=r._tag),(null==o||o===_.svg&&"foreignobject"===h)&&(o=_.html),o===_.html&&("svg"===this._tag?o=_.svg:"math"===this._tag&&(o=_.mathml)),this._namespaceURI=o;var d;if(e.useCreateElement){var p,m=r._ownerDocument;if(o===_.html)if("script"===this._tag){var v=m.createElement("div"),y=this._currentElement.type;v.innerHTML="<"+y+">",p=v.removeChild(v.firstChild)}else p=a.is?m.createElement(this._currentElement.type,a.is):m.createElement(this._currentElement.type);else p=m.createElementNS(o,this._currentElement.type);A.precacheNode(this,p),this._flags|=V.hasCachedChildNodes,this._hostParent||C.setAttributeForRoot(p),this._updateDOMProperties(null,a,e);var b=x(p);this._createInitialChildren(e,a,n,b),d=b}else{var w=this._createOpenTagMarkupAndPutListeners(e,a),E=this._createContentMarkup(e,a,n);d=!E&&X[this._tag]?w+"/>":w+">"+E+""}switch(this._tag){case"input":e.getReactMountReady().enqueue(s,this),a.autoFocus&&e.getReactMountReady().enqueue(g.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(u,this),a.autoFocus&&e.getReactMountReady().enqueue(g.focusDOMComponent,this);break;case"select":case"button":a.autoFocus&&e.getReactMountReady().enqueue(g.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(l,this)}return d},_createOpenTagMarkupAndPutListeners:function(e,t){var r="<"+this._currentElement.type;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];if(null!=i)if(z.hasOwnProperty(n))i&&a(this,n,i,e);else{"style"===n&&(i&&(i=this._previousStyleCopy=y({},t.style)),i=b.createMarkupForStyles(i,this));var o=null;null!=this._tag&&p(this._tag,t)?G.hasOwnProperty(n)||(o=C.createMarkupForCustomAttribute(n,i)):o=C.createMarkupForProperty(n,i),o&&(r+=" "+o)}}return e.renderToStaticMarkup?r:(this._hostParent||(r+=" "+C.createMarkupForRoot()),r+=" "+C.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,r){var n="",i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&(n=i.__html);else{var a=H[typeof t.children]?t.children:null,o=null!=a?null:t.children;if(null!=a)n=L(a);else if(null!=o){var s=this.mountChildren(o,e,r);n=s.join("")}}return Y[this._tag]&&"\n"===n.charAt(0)?"\n"+n:n},_createInitialChildren:function(e,t,r,n){var i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&x.queueHTML(n,i.__html);else{var a=H[typeof t.children]?t.children:null,o=null!=a?null:t.children;if(null!=a)""!==a&&x.queueText(n,a);else if(null!=o)for(var s=this.mountChildren(o,e,r),u=0;ut.end?(r=t.end,n=t.start):(r=t.start,n=t.end),i.moveToElementText(e),i.moveStart("character",r),i.setEndPoint("EndToStart",i),i.moveEnd("character",n-r),i.select()}function s(e,t){if(window.getSelection){var r=window.getSelection(),n=e[c()].length,i=Math.min(t.start,n),a=void 0===t.end?i:Math.min(t.end,n);if(!r.extend&&i>a){var o=a;a=i,i=o}var s=l(e,i),u=l(e,a);if(s&&u){var f=document.createRange();f.setStart(s.node,s.offset),r.removeAllRanges(),i>a?(r.addRange(f),r.extend(u.node,u.offset)):(f.setEnd(u.node,u.offset),r.addRange(f))}}}var u=e(124),l=e(105),c=e(106),f=u.canUseDOM&&"selection"in document&&!("getSelection"in window),h={getOffsets:f?i:a,setOffsets:f?o:s};t.exports=h},{105:105,106:106,124:124}],42:[function(e,t,r){"use strict" -;var n=e(113),i=e(144),a=e(8),o=e(9),s=e(33),u=e(95),l=(e(138),e(119),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});i(l.prototype,{mountComponent:function(e,t,r,n){var i=r._idCounter++,a=" react-text: "+i+" ";if(this._domID=i,this._hostParent=t,e.useCreateElement){var l=r._ownerDocument,c=l.createComment(a),f=l.createComment(" /react-text "),h=o(l.createDocumentFragment());return o.queueChild(h,o(c)),this._stringText&&o.queueChild(h,o(l.createTextNode(this._stringText))),o.queueChild(h,o(f)),s.precacheNode(this,c),this._closingComment=f,h}var d=u(this._stringText);return e.renderToStaticMarkup?d:"\x3c!--"+a+"--\x3e"+d+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var r=""+e;if(r!==this._stringText){this._stringText=r;var n=this.getHostNode();a.replaceDelimitedText(n[0],n[1],r)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this),r=t.nextSibling;;){if(null==r&&n("67",this._domID),8===r.nodeType&&" /react-text "===r.nodeValue){this._closingComment=r;break}r=r.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),t.exports=l},{113:113,119:119,138:138,144:144,33:33,8:8,9:9,95:95}],43:[function(e,t,r){"use strict";function n(){this._rootNodeID&&c.updateWrapper(this)}function i(e){var t=this._currentElement.props,r=s.executeOnChange(t,e);return l.asap(n,this),r}var a=e(113),o=e(144),s=e(23),u=e(33),l=e(71),c=(e(138),e(143),{getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&a("91"),o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var r=s.getValue(t),n=r;if(null==r){var o=t.defaultValue,u=t.children;null!=u&&(null!=o&&a("92"),Array.isArray(u)&&(u.length<=1||a("93"),u=u[0]),o=""+u),null==o&&(o=""),n=o}e._wrapperState={initialValue:""+n,listeners:null,onChange:i.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,r=u.getNodeFromInstance(e),n=s.getValue(t);if(null!=n){var i=""+n;i!==r.value&&(r.value=i),null==t.defaultValue&&(r.defaultValue=i)}null!=t.defaultValue&&(r.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=u.getNodeFromInstance(e),r=t.textContent;r===e._wrapperState.initialValue&&(t.value=r)}});t.exports=c},{113:113,138:138,143:143,144:144,23:23,33:33,71:71}],44:[function(e,t,r){"use strict";function n(e,t){"_hostNode"in e||u("33"),"_hostNode"in t||u("33");for(var r=0,n=e;n;n=n._hostParent)r++;for(var i=0,a=t;a;a=a._hostParent)i++;for(;r-i>0;)e=e._hostParent,r--;for(;i-r>0;)t=t._hostParent,i--;for(var o=r;o--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function i(e,t){"_hostNode"in e||u("35"),"_hostNode"in t||u("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function a(e){return"_hostNode"in e||u("36"),e._hostParent}function o(e,t,r){for(var n=[];e;)n.push(e),e=e._hostParent;var i;for(i=n.length;i-- >0;)t(n[i],"captured",r);for(i=0;i0;)r(u[l],"captured",a)}var u=e(113);e(138);t.exports={isAncestor:i,getLowestCommonAncestor:n,getParentInstance:a,traverseTwoPhase:o,traverseEnterLeave:s}},{113:113,138:138}],45:[function(e,t,r){"use strict";var n=e(121),i=e(30),a=i;n.addons&&(n.__SECRET_INJECTED_REACT_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a),t.exports=a},{121:121,30:30}],46:[function(e,t,r){"use strict";function n(){this.reinitializeTransaction()}var i=e(144),a=e(71),o=e(89),s=e(130),u={initialize:s,close:function(){h.isBatchingUpdates=!1}},l={initialize:s,close:a.flushBatchedUpdates.bind(a)},c=[l,u];i(n.prototype,o,{getTransactionWrappers:function(){return c}});var f=new n,h={isBatchingUpdates:!1,batchedUpdates:function(e,t,r,n,i,a){var o=h.isBatchingUpdates;return h.isBatchingUpdates=!0,o?e(t,r,n,i,a):f.perform(e,null,t,r,n,i,a)}};t.exports=h},{130:130,144:144,71:71,89:89}],47:[function(e,t,r){"use strict";function n(){C||(C=!0,g.EventEmitter.injectReactEventListener(y),g.EventPluginHub.injectEventPluginOrder(s),g.EventPluginUtils.injectComponentTree(h),g.EventPluginUtils.injectTreeTraversal(p),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:o,SelectEventPlugin:_,BeforeInputEventPlugin:a}),g.HostComponent.injectGenericComponentClass(f),g.HostComponent.injectTextComponentClass(m),g.DOMProperty.injectDOMPropertyConfig(i),g.DOMProperty.injectDOMPropertyConfig(l),g.DOMProperty.injectDOMPropertyConfig(x),g.EmptyComponent.injectEmptyComponentFactory(function(e){return new d(e)}),g.Updates.injectReconcileTransaction(b),g.Updates.injectBatchingStrategy(v),g.Component.injectEnvironment(c))}var i=e(1),a=e(3),o=e(7),s=e(14),u=e(15),l=e(21),c=e(27),f=e(31),h=e(33),d=e(35),p=e(44),m=e(42),v=e(46),y=e(52),g=e(55),b=e(65),x=e(73),_=e(74),w=e(75),C=!1;t.exports={inject:n}},{1:1,14:14,15:15,21:21,27:27,3:3,31:31,33:33,35:35,42:42,44:44,46:46,52:52,55:55,65:65,7:7,73:73,74:74,75:75}],48:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=n},{}],49:[function(e,t,r){"use strict";var n,i={injectEmptyComponentFactory:function(e){n=e}},a={create:function(e){return n(e)}};a.injection=i,t.exports=a},{}],50:[function(e,t,r){"use strict";function n(e,t,r){try{t(r)}catch(e){null===i&&(i=e)}}var i=null,a={invokeGuardedCallback:n,invokeGuardedCallbackWithCatch:n,rethrowCaughtError:function(){if(i){var e=i;throw i=null,e}}};t.exports=a},{}],51:[function(e,t,r){"use strict";function n(e){i.enqueueEvents(e),i.processEventQueue(!1)}var i=e(16),a={handleTopLevel:function(e,t,r,a){n(i.extractEvents(e,t,r,a))}};t.exports=a},{16:16}],52:[function(e,t,r){"use strict";function n(e){for(;e._hostParent;)e=e._hostParent;var t=f.getNodeFromInstance(e),r=t.parentNode;return f.getClosestInstanceFromNode(r)}function i(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function a(e){var t=d(e.nativeEvent),r=f.getClosestInstanceFromNode(t),i=r;do{e.ancestors.push(i),i=i&&n(i)}while(i);for(var a=0;a/,a=/^<\!\-\-/,o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return a.test(e)?e:e.replace(i," "+o.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var r=t.getAttribute(o.CHECKSUM_ATTR_NAME);return r=r&&parseInt(r,10),n(e)===r}};t.exports=o},{92:92}],60:[function(e,t,r){"use strict";function n(e,t){for(var r=Math.min(e.length,t.length),n=0;n.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var o,s=v.createElement(O,{child:t});if(e){var u=w.get(e);o=u._processChildContext(u._context)}else o=M;var c=h(r);if(c){var f=c._currentElement,p=f.props.child;if(R(p,t)){var m=c._renderedComponent.getPublicInstance(),y=n&&function(){n.call(m)};return U._updateRootComponent(c,s,o,r,y),m}U.unmountComponentAtNode(r)}var g=i(r),b=g&&!!a(g),x=l(r),_=b&&!c&&!x,C=U._renderNewRootComponent(s,r,_,o)._renderedComponent.getPublicInstance();return n&&n.call(C),C},render:function(e,t,r){return U._renderSubtreeIntoContainer(null,e,t,r)},unmountComponentAtNode:function(e){c(e)||d("40");var t=h(e);return t?(delete F[t._instance.rootID],T.batchedUpdates(u,t,e,!1),!0):(l(e),1===e.nodeType&&e.hasAttribute(I),!1)},_mountImageIntoNode:function(e,t,r,a,o){if(c(t)||d("41"),a){var s=i(t);if(C.canReuseMarkup(e,s))return void g.precacheNode(r,s);var u=s.getAttribute(C.CHECKSUM_ATTR_NAME);s.removeAttribute(C.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(C.CHECKSUM_ATTR_NAME,u);var f=e,h=n(f,l),m=" (client) "+f.substring(h-20,h+20)+"\n (server) "+l.substring(h-20,h+20);t.nodeType===B&&d("42",m)}if(t.nodeType===B&&d("43"),o.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);p.insertTreeBefore(t,e,null)}else P(t,e),g.precacheNode(r,t.firstChild)}};t.exports=U},{109:109,11:11,113:113,115:115,117:117,120:120,121:121,131:131,138:138,143:143,25:25,33:33,34:34,36:36,53:53,57:57,58:58,59:59,66:66,70:70,71:71,9:9}],61:[function(e,t,r){"use strict";function n(e,t,r){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:r,afterNode:t}}function i(e,t,r){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:h.getHostNode(e),toIndex:r,afterNode:t}}function a(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function o(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){f.processChildrenUpdates(e,t)}var c=e(113),f=e(28),h=(e(57),e(58),e(120),e(66)),d=e(26),p=(e(130),e(97)),m=(e(138),{Mixin:{_reconcilerInstantiateChildren:function(e,t,r){return d.instantiateChildren(e,t,r)},_reconcilerUpdateChildren:function(e,t,r,n,i,a){var o;return o=p(t,0),d.updateChildren(e,o,r,n,i,this,this._hostContainerInfo,a,0),o},mountChildren:function(e,t,r){var n=this._reconcilerInstantiateChildren(e,t,r);this._renderedChildren=n;var i=[],a=0;for(var o in n)if(n.hasOwnProperty(o)){var s=n[o],u=h.mountComponent(s,t,this,this._hostContainerInfo,r,0);s._mountIndex=a++,i.push(u)}return i},updateTextContent:function(e){var t=this._renderedChildren;d.unmountChildren(t,!1);for(var r in t)t.hasOwnProperty(r)&&c("118");l(this,[s(e)])},updateMarkup:function(e){var t=this._renderedChildren;d.unmountChildren(t,!1);for(var r in t)t.hasOwnProperty(r)&&c("118");l(this,[o(e)])},updateChildren:function(e,t,r){this._updateChildren(e,t,r)},_updateChildren:function(e,t,r){var n=this._renderedChildren,i={},a=[],o=this._reconcilerUpdateChildren(n,e,a,i,t,r);if(o||n){var s,c=null,f=0,d=0,p=0,m=null;for(s in o)if(o.hasOwnProperty(s)){var v=n&&n[s],y=o[s];v===y?(c=u(c,this.moveChild(v,m,f,d)),d=Math.max(v._mountIndex,d),v._mountIndex=f):(v&&(d=Math.max(v._mountIndex,d)),c=u(c,this._mountChildAtIndex(y,a[p],m,f,t,r)),p++),f++,m=h.getHostNode(y)}for(s in i)i.hasOwnProperty(s)&&(c=u(c,this._unmountChild(n[s],i[s])));c&&l(this,c),this._renderedChildren=o}},unmountChildren:function(e){var t=this._renderedChildren;d.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,r,n){if(e._mountIndex0&&n.length<20?r+" (keys: "+n.join(", ")+")":r}function a(e,t){var r=s.get(e);return r||null}var o=e(113),s=(e(120),e(57)),u=(e(58),e(71)),l=(e(138),e(143),{isMounted:function(e){var t=s.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,r){l.validateCallback(t,r);var i=a(e);if(!i)return null;i._pendingCallbacks?i._pendingCallbacks.push(t):i._pendingCallbacks=[t],n(i)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],n(e)},enqueueForceUpdate:function(e){var t=a(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,n(t))},enqueueReplaceState:function(e,t,r){var i=a(e,"replaceState");i&&(i._pendingStateQueue=[t],i._pendingReplaceState=!0,void 0!==r&&null!==r&&(l.validateCallback(r,"replaceState"),i._pendingCallbacks?i._pendingCallbacks.push(r):i._pendingCallbacks=[r]),n(i))},enqueueSetState:function(e,t){var r=a(e,"setState");r&&((r._pendingStateQueue||(r._pendingStateQueue=[])).push(t),n(r))},enqueueElementInternal:function(e,t,r){e._pendingElement=t,e._context=r,n(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&o("122",t,i(e))}});t.exports=l},{113:113,120:120,138:138,143:143,57:57,58:58,71:71}],71:[function(e,t,r){"use strict";function n(){M.ReactReconcileTransaction&&_||c("123")}function i(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=h.getPooled(),this.reconcileTransaction=M.ReactReconcileTransaction.getPooled(!0)}function a(e,t,r,i,a,o){return n(),_.batchedUpdates(e,t,r,i,a,o)}function o(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==y.length&&c("124",t,y.length),y.sort(o),g++;for(var r=0;r]/;t.exports=i},{}],96:[function(e,t,r){"use strict";function n(e){if(null==e)return null;if(1===e.nodeType)return e;var t=o.get(e);if(t)return t=s(t),t?a.getNodeFromInstance(t):null;"function"==typeof e.render?i("44"):i("45",Object.keys(e))}var i=e(113),a=(e(120),e(33)),o=e(57),s=e(103);e(138),e(143);t.exports=n},{103:103,113:113,120:120,138:138,143:143,33:33,57:57}],97:[function(e,t,r){(function(r){"use strict";function n(e,t,r,n){if(e&&"object"==typeof e){var i=e;void 0===i[r]&&null!=t&&(i[r]=t)}}function i(e,t){if(null==e)return e;var r={};return a(e,n,r),r}var a=(e(22),e(118));e(143);void 0!==r&&r.env,t.exports=i}).call(this,void 0)},{118:118,143:143,22:22}],98:[function(e,t,r){"use strict";function n(e,t,r){Array.isArray(e)?e.forEach(t,r):e&&t.call(r,e)}t.exports=n},{}],99:[function(e,t,r){"use strict";function n(e){var t,r=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===r&&(t=13):t=r,t>=32||13===t?t:0}t.exports=n},{}],100:[function(e,t,r){"use strict";function n(e){if(e.key){var t=a[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var r=i(e);return 13===r?"Enter":String.fromCharCode(r)}return"keydown"===e.type||"keyup"===e.type?o[e.keyCode]||"Unidentified":""}var i=e(99),a={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=n},{99:99}],101:[function(e,t,r){"use strict";function n(e){var t=this,r=t.nativeEvent;if(r.getModifierState)return r.getModifierState(e);var n=a[e];return!!n&&!!r[n]}function i(e){return n}var a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=i},{}],102:[function(e,t,r){"use strict";function n(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}t.exports=n},{}],103:[function(e,t,r){"use strict";function n(e){for(var t;(t=e._renderedNodeType)===i.COMPOSITE;)e=e._renderedComponent;return t===i.HOST?e._renderedComponent:t===i.EMPTY?null:void 0}var i=e(62);t.exports=n},{62:62}],104:[function(e,t,r){"use strict";function n(e){var t=e&&(i&&e[i]||e[a]);if("function"==typeof t)return t}var i="function"==typeof Symbol&&Symbol.iterator,a="@@iterator";t.exports=n},{}],105:[function(e,t,r){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function i(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function a(e,t){for(var r=n(e),a=0,o=0;r;){if(3===r.nodeType){if(o=a+r.textContent.length,a<=t&&o>=t)return{node:r,offset:t-a};a=o}r=n(i(r))}}t.exports=a},{}],106:[function(e,t,r){"use strict";function n(){return!a&&i.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var i=e(124),a=null;t.exports=n},{124:124}],107:[function(e,t,r){"use strict";function n(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r["ms"+e]="MS"+t,r["O"+e]="o"+t.toLowerCase(),r}function i(e){if(s[e])return s[e];if(!o[e])return e;var t=o[e];for(var r in t)if(t.hasOwnProperty(r)&&r in u)return s[e]=t[r];return""}var a=e(124),o={animationend:n("Animation","AnimationEnd"),animationiteration:n("Animation","AnimationIteration"),animationstart:n("Animation","AnimationStart"),transitionend:n("Transition","TransitionEnd")},s={},u={};a.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete o.animationend.animation,delete o.animationiteration.animation,delete o.animationstart.animation),"TransitionEvent"in window||delete o.transitionend.transition),t.exports=i},{124:124}],108:[function(e,t,r){"use strict";function n(e){var t=e.type,r=e.nodeName;return r&&"input"===r.toLowerCase()&&("checkbox"===t||"radio"===t)}function i(e){return e._wrapperState.valueTracker}function a(e,t){e._wrapperState.valueTracker=t}function o(e){delete e._wrapperState.valueTracker}function s(e){var t;return e&&(t=n(e)?""+e.checked:e.value),t}var u=e(33),l={_getTrackerFromNode:function(e){return i(u.getInstanceFromNode(e))},track:function(e){if(!i(e)){var t=u.getNodeFromInstance(e),r=n(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),l=""+t[r];t.hasOwnProperty(r)||"function"!=typeof s.get||"function"!=typeof s.set||(Object.defineProperty(t,r,{enumerable:s.enumerable,configurable:!0,get:function(){return s.get.call(this)},set:function(e){l=""+e,s.set.call(this,e)}}),a(e,{getValue:function(){return l},setValue:function(e){l=""+e},stopTracking:function(){o(e),delete t[r]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=i(e);if(!t)return l.track(e),!0;var r=t.getValue(),n=s(u.getNodeFromInstance(e));return n!==r&&(t.setValue(n),!0)},stopTracking:function(e){var t=i(e);t&&t.stopTracking()}};t.exports=l},{33:33}],109:[function(e,t,r){"use strict";function n(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function i(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function a(e,t){var r;if(null===e||!1===e)r=l.create(a);else if("object"==typeof e){var s=e,u=s.type;if("function"!=typeof u&&"string"!=typeof u){var h="";h+=n(s._owner),o("130",null==u?u:typeof u,h)}"string"==typeof s.type?r=c.createInternalComponent(s):i(s.type)?(r=new s.type(s),r.getHostNode||(r.getHostNode=r.getNativeNode)):r=new f(s)}else"string"==typeof e||"number"==typeof e?r=c.createInstanceForText(e):o("131",typeof e);return r._mountIndex=0,r._mountImage=null,r}var o=e(113),s=e(144),u=e(29),l=e(49),c=e(54),f=(e(122),e(138),e(143),function(e){this.construct(e)});s(f.prototype,u,{_instantiateReactComponent:a}),t.exports=a},{113:113,122:122,138:138,143:143,144:144,29:29,49:49,54:54}],110:[function(e,t,r){"use strict";function n(e,t){if(!a.canUseDOM||t&&!("addEventListener"in document))return!1;var r="on"+e,n=r in document;if(!n){var o=document.createElement("div");o.setAttribute(r,"return;"),n="function"==typeof o[r]}return!n&&i&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var i,a=e(124);a.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=n},{124:124}],111:[function(e,t,r){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!i[e.type]:"textarea"===t}var i={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=n},{}],112:[function(e,t,r){"use strict";function n(e){return'"'+i(e)+'"'}var i=e(95);t.exports=n},{95:95}],113:[function(e,t,r){"use strict";function n(e){for(var t=arguments.length-1,r="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,n=0;n]/,u=e(93),l=u(function(e,t){if(e.namespaceURI!==a.svg||"innerHTML"in e)e.innerHTML=t;else{n=n||document.createElement("div"),n.innerHTML=""+t+"";for(var r=n.firstChild;r.firstChild;)e.appendChild(r.firstChild)}});if(i.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var r=e.firstChild;1===r.data.length?e.removeChild(r):r.deleteData(0,1)}else e.innerHTML=t}),c=null}t.exports=l},{10:10,124:124,93:93}],116:[function(e,t,r){"use strict";var n=e(124),i=e(95),a=e(115),o=function(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t};n.canUseDOM&&("textContent"in document.documentElement||(o=function(e,t){if(3===e.nodeType)return void(e.nodeValue=t);a(e,i(t))})),t.exports=o},{115:115,124:124,95:95}],117:[function(e,t,r){"use strict";function n(e,t){var r=null===e||!1===e,n=null===t||!1===t;if(r||n)return r===n;var i=typeof e,a=typeof t;return"string"===i||"number"===i?"string"===a||"number"===a:"object"===a&&e.type===t.type&&e.key===t.key}t.exports=n},{}],118:[function(e,t,r){"use strict";function n(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function i(e,t,r,a){var h=typeof e;if("undefined"!==h&&"boolean"!==h||(e=null),null===e||"string"===h||"number"===h||"object"===h&&e.$$typeof===s)return r(a,e,""===t?c+n(e,0):t),1;var d,p,m=0,v=""===t?c:t+f;if(Array.isArray(e))for(var y=0;y":"<"+e+">",s[e]=!o.firstChild),s[e]?h[e]:null}var i=e(124),a=e(138),o=i.canUseDOM?document.createElement("div"):null,s={},u=[1,'"],l=[1,"","
"],c=[3,"","
"],f=[1,'',""],h={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){h[e]=f,s[e]=!0}),t.exports=n},{124:124,138:138}],135:[function(e,t,r){"use strict";function n(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],136:[function(e,t,r){"use strict";function n(e){return e.replace(i,"-$1").toLowerCase()}var i=/([A-Z])/g;t.exports=n},{}],137:[function(e,t,r){"use strict";function n(e){return i(e).replace(a,"-ms-")}var i=e(136),a=/^ms-/;t.exports=n},{136:136}],138:[function(e,t,r){"use strict";function n(e,t,r,n,a,o,s,u){if(i(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,o,s,u],f=0;l=new Error(t.replace(/%s/g,function(){return c[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var i=function(e){};t.exports=n},{}],139:[function(e,t,r){"use strict";function n(e){var t=e?e.ownerDocument||e:document,r=t.defaultView||window;return!(!e||!("function"==typeof r.Node?e instanceof r.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],140:[function(e,t,r){"use strict";function n(e){return i(e)&&3==e.nodeType}var i=e(139);t.exports=n},{139:139}],141:[function(e,t,r){"use strict";function n(e){var t={};return function(r){return t.hasOwnProperty(r)||(t[r]=e.call(this,r)),t[r]}}t.exports=n},{}],142:[function(e,t,r){"use strict";function n(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0;o=0)t._disposeHandlers.splice(r,1)},check:E,apply:A,status:function(e){if(!e)return d;h.push(e)},addStatusHandler:function(e){h.push(e)},removeStatusHandler:function(e){var t=h.indexOf(e);if(t>=0)h.splice(t,1)},data:u[e]};return t}var h=[];var d="idle";function p(e){d=e;for(var t=0;t0){var a=n.pop();var e=P[a];if(!e||e.hot._selfAccepted)continue;if(e.hot._selfDeclined){return new Error("Aborted because of self decline: "+a)}if(a===0){return}for(var o=0;o=0)continue;if(u.hot._acceptedDependencies[a]){if(!r[s])r[s]=[];i(r[s],[a]);continue}delete r[s];t.push(s);n.push(s)}}return[t,r]}function i(e,t){for(var r=0;r0){var h=g.pop();var b=P[h];if(!b)continue;var x={};var E=b.hot._disposeHandlers;for(var S=0;S=0){M.parents.splice(A,1)}}}for(var h in a){if(Object.prototype.hasOwnProperty.call(a,h)){var b=P[h];var k=a[h];for(var S=0;S=0)b.children.splice(A,1)}}}p("apply");s=w;for(var h in c){if(Object.prototype.hasOwnProperty.call(c,h)){e[h]=c[h]}}var D=null;for(var h in a){if(Object.prototype.hasOwnProperty.call(a,h)){var b=P[h];var k=a[h];var B=[];for(var y=0;y=0)continue;B.push(T)}for(var y=0;y - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -function r(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}e.exports=r},function(e,t,r){"use strict";var n=r(7);e.exports=function(e){for(var t in e){var r=e[t];if(n(r))for(var i in r){var a=r[i];n(a)||console.warn("Make sure the value of the element `"+t+"` is an object of css. You passed it `"+r+"`")}else console.warn("Make sure the value of `"+t+"` is an object of html elements. You passed it `"+r+"`")}}},function(e,t,r){"use strict";var n=r(10),i=r(14);e.exports=function(e,t){var r=n(e);return i(r,t)}},function(e,t,r){"use strict";var n=r(11),i=r(7),a=r(13);e.exports=function(e){return i(e)&&!a(e)?e:1===e.length?e[0]:n.recursive.apply(void 0,e)}},function(e,t,r){(function(e){(function(t){var r=function(e){return a(e===true,false,arguments)},n="merge";r.recursive=function(e){return a(e===true,true,arguments)};r.clone=function(e){var t=e,n=o(e),i,a;if(n==="array"){t=[];a=e.length;for(i=0;i - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var r=Array.isArray;e.exports=r},function(e,t,r){"use strict";var n=r(7),i=r(13),a=r(11),o={borderRadius:function(e){return null!==e?{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}:void 0},boxShadow:function(e){return null!==e?{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}:void 0},userSelect:function(e){return null!==e?{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}:void 0},flex:function(e){return null!==e?{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}:void 0},flexBasis:function(e){return null!==e?{WebkitFlexBasis:e,flexBasis:e}:void 0},justifyContent:function(e){return null!==e?{WebkitJustifyContent:e,justifyContent:e}:void 0},transition:function(e){return null!==e?{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}:void 0},transform:function(e){return null!==e?{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}:void 0},Absolute:function(e){if(null!==e){var t=e.split(" ");return{position:"absolute",top:t[0],right:t[1],bottom:t[2],left:t[3]}}},Extend:function(e,t){var r=t[e];return r?r:void 0}},s=function e(t,r,s){var u=a(r,o),l={};for(var c in t){var f=t[c];if(n(f)&&!i(f))l[c]=e(f,r,t);else if(u[c]){var h=u[c](f,s);for(var d in h){var p=h[d];l[d]=p}}else l[c]=f}return l};e.exports=function(e,t,r){return s(e,t,r)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(16);Object.defineProperty(t,"Alpha",{enumerable:true,get:function e(){return u(n).default}});var i=r(20);Object.defineProperty(t,"Checkboard",{enumerable:true,get:function e(){return u(i).default}});var a=r(21);Object.defineProperty(t,"Hue",{enumerable:true,get:function e(){return u(a).default}});var o=r(22);Object.defineProperty(t,"Saturation",{enumerable:true,get:function e(){return u(o).default}});var s=r(24);Object.defineProperty(t,"ColorWrap",{enumerable:true,get:function e(){return u(s).default}});function u(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Alpha=undefined;var n=function(){function e(e,t){for(var r=0;ri){o=1}else{o=Math.round(a*100/i)/100}if(n.props.a!==o){n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:o,source:"rgb"})}},n.handleMouseDown=function(e){n.handleChange(e,true);window.addEventListener("mousemove",n.handleChange);window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange);window.removeEventListener("mouseup",n.handleMouseUp)},r),p(n,i)}n(t,[{key:"classes",value:function e(){return{default:{alpha:{Absolute:"0 0 0 0",borderRadius:this.props.radius},checkboard:{Absolute:"0 0 0 0",overflow:"hidden"},gradient:{Absolute:"0 0 0 0",background:"linear-gradient(to right, rgba("+this.props.rgb.r+", "+this.props.rgb.g+", "+this.props.rgb.b+", 0) 0%, rgba("+this.props.rgb.r+", "+this.props.rgb.g+", "+this.props.rgb.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",zIndex:"2",height:"100%",margin:"0 3px"},pointer:{zIndex:"2",position:"absolute",left:this.props.rgb.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}}}}},{key:"componentWillUnmount",value:function e(){this.unbindEventListeners()}},{key:"render",value:function e(){var t=a.default.createElement("div",{style:this.styles().slider});if(this.props.pointer){t=a.default.createElement(this.props.pointer,this.props)}return a.default.createElement("div",{style:this.styles().alpha},a.default.createElement("div",{style:this.styles().checkboard},a.default.createElement(f.default,null)),a.default.createElement("div",{style:this.styles().gradient}),a.default.createElement("div",{style:this.styles().container,ref:"container",onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},a.default.createElement("div",{style:this.styles().pointer,ref:"pointer"},t)))}}]);return t}(s.default.Component);t.default=v},function(e,t,r){e.exports=r(18)},function(e,t,r){/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule shallowCompare - */ -"use strict";var n=r(19);function i(e,t,r){return!n(e.props,t)||!n(e.state,r)}e.exports=i},function(e,t){/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule shallowEqual - * @typechecks - * - */ -"use strict";var r=Object.prototype.hasOwnProperty;function n(e,t){if(e===t){return true}if(typeof e!=="object"||e===null||typeof t!=="object"||t===null){return false}var n=Object.keys(e);var i=Object.keys(t);if(n.length!==i.length){return false}var a=r.bind(t);for(var o=0;oa){u=0}else{var l=-(s*100/a)+100;u=360*l/100}if(n.props.hsl.h!==u){n.props.onChange({h:u,s:n.props.hsl.s,l:n.props.hsl.l,a:n.props.hsl.a,source:"rgb"})}}else{var u;if(o<0){u=0}else if(o>i){u=359}else{var l=o*100/i;u=360*l/100}if(n.props.hsl.h!==u){n.props.onChange({h:u,s:n.props.hsl.s,l:n.props.hsl.l,a:n.props.hsl.a,source:"rgb"})}}},n.handleMouseDown=function(e){n.handleChange(e,true);window.addEventListener("mousemove",n.handleChange);window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},r),h(n,i)}n(t,[{key:"classes",value:function e(){return{default:{hue:{Absolute:"0 0 0 0",background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{margin:"0 2px",position:"relative",height:"100%"},pointer:{zIndex:"2",position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},"direction-vertical":{hue:{background:"linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"},pointer:{left:"0",top:-(this.props.hsl.h*100/360)+100+"%"}}}}},{key:"componentWillUnmount",value:function e(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function e(){window.removeEventListener("mousemove",this.handleChange);window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function e(){var t=a.default.createElement("div",{style:this.styles().slider});if(this.props.pointer){t=a.default.createElement(this.props.pointer,this.props)}return a.default.createElement("div",{style:this.styles().hue},a.default.createElement("div",{style:this.styles().container,ref:"container",onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},a.default.createElement("div",{style:this.styles().pointer,ref:"pointer"},t)))}}]);return t}(s.default.Component);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Saturation=undefined;var n=function(){function e(e,t){for(var r=0;ri){o=i}else if(s<0){s=0}else if(s>a){s=a}var u=o*100/i;var l=-(s*100/a)+100;r.throttle(r.props.onChange,{h:r.props.hsl.h,s:u,v:l,a:r.props.hsl.a,source:"rgb"})};r.handleMouseDown=function(e){r.handleChange(e,true);window.addEventListener("mousemove",r.handleChange);window.addEventListener("mouseup",r.handleMouseUp)};r.handleMouseUp=function(){r.unbindEventListeners()};r.throttle=(0,l.default)(function(e,t){e(t)},50);return r}n(t,[{key:"classes",value:function e(){return{default:{color:{Absolute:"0 0 0 0",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{Absolute:"0 0 0 0",background:"linear-gradient(to right, #fff, rgba(255,255,255,0))"},black:{Absolute:"0 0 0 0",background:"linear-gradient(to top, #000, rgba(0,0,0,0))",boxShadow:this.props.shadow},pointer:{position:"absolute",top:-(this.props.hsv.v*100)+100+"%",left:this.props.hsv.s*100+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3), 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}}}}},{key:"componentWillUnmount",value:function e(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function e(){window.removeEventListener("mousemove",this.handleChange);window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function e(){var t=a.default.createElement("div",{style:this.styles().circle});if(this.props.pointer){t=a.default.createElement(this.props.pointer,this.props)}return a.default.createElement("div",{style:this.styles().color,ref:"container",onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},a.default.createElement("div",{style:this.styles().white},a.default.createElement("div",{style:this.styles().black}),a.default.createElement("div",{style:this.styles().pointer,ref:"pointer"},t)))}}]);return t}(s.default.Component);t.default=v},function(e,t){(function(t){/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var r="Expected a function";var n=0/0;var i="[object Symbol]";var a=/^\s+|\s+$/g;var o=/^[-+]0x[0-9a-f]+$/i;var s=/^0b[01]+$/i;var u=/^0o[0-7]+$/i;var l=parseInt;var c=typeof t=="object"&&t&&t.Object===Object&&t;var f=typeof self=="object"&&self&&self.Object===Object&&self;var h=c||f||Function("return this")();var d=Object.prototype;var p=d.toString;var m=Math.max,v=Math.min;var y=function(){return h.Date.now()};function g(e,t,n){var i,a,o,s,u,l,c=0,f=false,h=false,d=true;if(typeof e!="function"){throw new TypeError(r)}t=C(t)||0;if(x(n)){f=!!n.leading;h="maxWait"in n;o=h?m(C(n.maxWait)||0,t):o;d="trailing"in n?!!n.trailing:d}function p(t){var r=i,n=a;i=a=undefined;c=t;s=e.apply(n,r);return s}function g(e){c=e;u=setTimeout(w,t);return f?p(e):s}function b(e){var r=e-l,n=e-c,i=t-r;return h?v(i,o-n):i}function _(e){var r=e-l,n=e-c;return l===undefined||r>=t||r<0||h&&n>=o}function w(){var e=y();if(_(e)){return E(e)}u=setTimeout(w,b(e))}function E(e){u=undefined;if(d&&i){return p(e)}i=a=undefined;return s}function S(){if(u!==undefined){clearTimeout(u)}c=0;i=l=a=u=undefined}function T(){return u===undefined?s:E(y())}function M(){var e=y(),r=_(e);i=arguments;a=this;l=e;if(r){if(u===undefined){return g(l)}if(h){u=setTimeout(w,t);return p(l)}}if(u===undefined){u=setTimeout(w,t)}return s}M.cancel=S;M.flush=T;return M}function b(e,t,n){var i=true,a=true;if(typeof e!="function"){throw new TypeError(r)}if(x(n)){i="leading"in n?!!n.leading:i;a="trailing"in n?!!n.trailing:a}return g(e,t,{leading:i,maxWait:t,trailing:a})}function x(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function _(e){return!!e&&typeof e=="object"}function w(e){return typeof e=="symbol"||_(e)&&p.call(e)==i}function C(e){if(typeof e=="number"){return e}if(w(e)){return n}if(x(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=x(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=e.replace(a,"");var r=s.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):o.test(e)?n:+e}e.exports=b}).call(t,function(){return this}())},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ColorWrap=undefined;var n=Object.assign||function(e){for(var t=1;t - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var r="[object Object]";function n(e){var t=false;if(e!=null&&typeof e.toString!="function"){try{t=!!(e+"")}catch(e){}}return t}function i(e,t){return function(r){return e(t(r))}}var a=Function.prototype,o=Object.prototype;var s=a.toString;var u=o.hasOwnProperty;var l=s.call(Object);var c=o.toString;var f=i(Object.getPrototypeOf,Object);function h(e){return!!e&&typeof e=="object"}function d(e){if(!h(e)||c.call(e)!=r||n(e)){return false}var t=f(e);if(t===null){return true}var i=u.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&s.call(i)==l}e.exports=d},function(e,t){(function(t){/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var r="Expected a function";var n=0/0;var i="[object Symbol]";var a=/^\s+|\s+$/g;var o=/^[-+]0x[0-9a-f]+$/i;var s=/^0b[01]+$/i;var u=/^0o[0-7]+$/i;var l=parseInt;var c=typeof t=="object"&&t&&t.Object===Object&&t;var f=typeof self=="object"&&self&&self.Object===Object&&self;var h=c||f||Function("return this")();var d=Object.prototype;var p=d.toString;var m=Math.max,v=Math.min;var y=function(){return h.Date.now()};function g(e,t,n){var i,a,o,s,u,l,c=0,f=false,h=false,d=true;if(typeof e!="function"){throw new TypeError(r)}t=w(t)||0;if(b(n)){f=!!n.leading;h="maxWait"in n;o=h?m(w(n.maxWait)||0,t):o;d="trailing"in n?!!n.trailing:d}function p(t){var r=i,n=a;i=a=undefined;c=t;s=e.apply(n,r);return s}function g(e){c=e;u=setTimeout(C,t);return f?p(e):s}function x(e){var r=e-l,n=e-c,i=t-r;return h?v(i,o-n):i}function _(e){var r=e-l,n=e-c;return l===undefined||r>=t||r<0||h&&n>=o}function C(){var e=y();if(_(e)){return E(e)}u=setTimeout(C,x(e))}function E(e){u=undefined;if(d&&i){return p(e)}i=a=undefined;return s}function S(){if(u!==undefined){clearTimeout(u)}c=0;i=l=a=u=undefined}function T(){return u===undefined?s:E(y())}function M(){var e=y(),r=_(e);i=arguments;a=this;l=e;if(r){if(u===undefined){return g(l)}if(h){u=setTimeout(C,t);return p(l)}}if(u===undefined){u=setTimeout(C,t)}return s}M.cancel=S;M.flush=T;return M}function b(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function x(e){return!!e&&typeof e=="object"}function _(e){return typeof e=="symbol"||x(e)&&p.call(e)==i}function w(e){if(typeof e=="number"){return e}if(_(e)){return n}if(b(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=b(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=e.replace(a,"");var r=s.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):o.test(e)?n:+e}e.exports=g}).call(t,function(){return this}())},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(28);var i=a(n);function a(e){return e&&e.__esModule?e:{default:e}}t.default={simpleCheckForValidColor:function e(t){var r=["r","g","b","a","h","s","a","v"];var n=0;var i=0;for(var a=0;a=0;var i=!t&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="name");if(i){if(e==="name"&&this._a===0){return this.toName()}return this.toRgbString()}if(e==="rgb"){r=this.toRgbString()}if(e==="prgb"){r=this.toPercentageRgbString()}if(e==="hex"||e==="hex6"){r=this.toHexString()}if(e==="hex3"){r=this.toHexString(true)}if(e==="hex8"){r=this.toHex8String()}if(e==="name"){r=this.toName()}if(e==="hsl"){r=this.toHslString()}if(e==="hsv"){r=this.toHsvString()}return r||this.toHexString()},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));this._r=r._r;this._g=r._g;this._b=r._b;this.setAlpha(r._a);return this},lighten:function(){return this._applyModification(E,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(_,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(C,arguments)},spin:function(){return this._applyModification(M,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(I,arguments)},complement:function(){return this._applyCombination(A,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(P,arguments)},tetrad:function(){return this._applyCombination(R,arguments)}};h.fromRatio=function(e,t){if(typeof e=="object"){var r={};for(var n in e){if(e.hasOwnProperty(n)){if(n==="a"){r[n]=e[n]}else{r[n]=G(e[n])}}}e=r}return h(e,t)};function d(e){var t={r:0,g:0,b:0};var r=1;var n=false;var i=false;if(typeof e=="string"){e=Y(e)}if(typeof e=="object"){if(e.hasOwnProperty("r")&&e.hasOwnProperty("g")&&e.hasOwnProperty("b")){t=p(e.r,e.g,e.b);n=true;i=String(e.r).substr(-1)==="%"?"prgb":"rgb"}else if(e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("v")){e.s=G(e.s,1);e.v=G(e.v,1);t=g(e.h,e.s,e.v);n=true;i="hsv"}else if(e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("l")){e.s=G(e.s);e.l=G(e.l);t=v(e.h,e.s,e.l);n=true;i="hsl"}if(e.hasOwnProperty("a")){r=e.a}}r=V(r);return{ok:n,format:e.format||i,r:l(255,c(t.r,0)),g:l(255,c(t.g,0)),b:l(255,c(t.b,0)),a:r}}function p(e,t,r){return{r:O(e,255)*255,g:O(t,255)*255,b:O(r,255)*255}}function m(e,t,r){e=O(e,255);t=O(t,255);r=O(r,255);var n=c(e,t,r),i=l(e,t,r);var a,o,s=(n+i)/2;if(n==i){a=o=0}else{var u=n-i;o=s>.5?u/(2-n-i):u/(n+i);switch(n){case e:a=(t-r)/u+(t1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*(2/3-r)*6;return e}if(t===0){n=i=a=r}else{var s=r<.5?r*(1+t):r+t-r*t;var u=2*r-s;n=o(u,s,e+1/3);i=o(u,s,e);a=o(u,s,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function y(e,t,r){e=O(e,255);t=O(t,255);r=O(r,255);var n=c(e,t,r),i=l(e,t,r);var a,o,s=n;var u=n-i;o=n===0?0:u/n;if(n==i){a=0}else{switch(n){case e:a=(t-r)/u+(t>1)+720)%360;--t;){n.h=(n.h+i)%360;a.push(h(n))}return a}function D(e,t){t=t||6;var r=h(e).toHsv();var n=r.h,i=r.s,a=r.v;var o=[];var s=1/t;while(t--){o.push(h({h:n,s:i,v:a}));a=(a+s)%1}return o}h.mix=function(e,t,r){r=r===0?0:r||50;var n=h(e).toRgb();var i=h(t).toRgb();var a=r/100;var o=a*2-1;var s=i.a-n.a;var u;if(o*s==-1){u=o}else{u=(o+s)/(1+o*s)}u=(u+1)/2;var l=1-u;var c={r:i.r*u+n.r*l,g:i.g*u+n.g*l,b:i.b*u+n.b*l,a:i.a*a+n.a*(1-a)};return h(c)};h.readability=function(e,t){var r=h(e);var n=h(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};h.isReadable=function(e,t,r){var n=h.readability(e,t);var i,a;a=false;i=K(r);switch(i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};h.mostReadable=function(e,t,r){var n=null;var i=0;var a;var o,s,u;r=r||{};o=r.includeFallbackColors;s=r.level;u=r.size;for(var l=0;li){i=a;n=h(t[l])}}if(h.isReadable(e,n,{level:s,size:u})||!o){return n}else{r.includeFallbackColors=false;return h.mostReadable(e,["#fff","#000"],r)}};var B=h.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var L=h.hexNames=F(B);function F(e){var t={};for(var r in e){if(e.hasOwnProperty(r)){t[e[r]]=r}}return t}function V(e){e=parseFloat(e);if(isNaN(e)||e<0||e>1){e=1}return e}function O(e,t){if(z(e)){e="100%"}var r=H(e);e=l(t,c(0,parseFloat(e)));if(r){e=parseInt(e*t,10)/100}if(s.abs(e-t)<1e-6){return 1}return e%t/parseFloat(t)}function U(e){return l(1,c(0,e))}function N(e){return parseInt(e,16)}function z(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function H(e){return typeof e==="string"&&e.indexOf("%")!=-1}function j(e){return e.length==1?"0"+e:""+e}function G(e,t){t=t||100;if(e<=1){e=e*t+"%"}return e}function W(e){return Math.round(parseFloat(e)*255).toString(16)}function q(e){return N(e)/255}var X=function(){var e="[-\\+]?\\d+%?";var t="[-\\+]?\\d*\\.\\d+%?";var r="(?:"+t+")|(?:"+e+")";var n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";var i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Y(e){e=e.replace(i,"").replace(a,"").toLowerCase();var t=false;if(B[e]){e=B[e];t=true}else if(e=="transparent"){return{r:0,g:0,b:0,a:0,format:"name"}}var r;if(r=X.rgb.exec(e)){return{r:r[1],g:r[2],b:r[3]}}if(r=X.rgba.exec(e)){return{r:r[1],g:r[2],b:r[3],a:r[4]}}if(r=X.hsl.exec(e)){return{h:r[1],s:r[2],l:r[3]}}if(r=X.hsla.exec(e)){return{h:r[1],s:r[2],l:r[3],a:r[4]}}if(r=X.hsv.exec(e)){return{h:r[1],s:r[2],v:r[3]}}if(r=X.hsva.exec(e)){return{h:r[1],s:r[2],v:r[3],a:r[4]}}if(r=X.hex8.exec(e)){return{a:q(r[1]),r:N(r[2]),g:N(r[3]),b:N(r[4]),format:t?"name":"hex8"}}if(r=X.hex6.exec(e)){return{r:N(r[1]),g:N(r[2]),b:N(r[3]),format:t?"name":"hex"}}if(r=X.hex3.exec(e)){return{r:N(r[1]+""+r[1]),g:N(r[2]+""+r[2]),b:N(r[3]+""+r[3]),format:t?"name":"hex"}}return false}function K(e){var t,r;e=e||{level:"AA",size:"small"};t=(e.level||"AA").toUpperCase();r=(e.size||"small").toLowerCase();if(t!=="AA"&&t!=="AAA"){t="AA"}if(r!=="small"&&r!=="large"){r="small"}return{level:t,size:r}}if(typeof e!=="undefined"&&e.exports){e.exports=h}else if(true){!(n=function(){return h}.call(t,r,t,e),n!==undefined&&(e.exports=n))}else{window.tinycolor=h}})()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ChromePointer=undefined;var n=function(){function e(e,t){for(var r=0;r0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;e.current[e.currentIndex++]=r;e.current[e.currentIndex++]=n;e.current[e.currentIndex++]=i;return e.elementCount++}e.add4=r;function n(e,t,r,n){if(e.currentIndex>=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;e.current[e.currentIndex++]=r;e.current[e.currentIndex++]=n;return e.elementCount++}e.add3=n;function i(e,t,r){if(e.currentIndex>=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;e.current[e.currentIndex++]=r;return e.elementCount++}e.add2=i;function a(e,t){if(e.currentIndex>=e.chunkSize){e.currentIndex=0;e.current=e.creator(e.chunkSize);e.parts[e.parts.length]=e.current}e.current[e.currentIndex++]=t;return e.elementCount++}e.add=a;function o(e){var t=e.creator(e.elementSize*e.elementCount),r=(e.parts.length-1)*e.chunkSize,n=0,i;if(e.parts.length===1&&e.chunkSize===e.elementCount){return e.parts[0]}if(e.parts.length>1){if(e.parts[0].buffer){for(var a=0;a=e.chunkSize){t.set(e.current,e.chunkSize*(e.parts.length-1))}else{for(var a=0;a0)return t+"h"+r+"m"+n+"."+i+"s";if(r>0)return r+"m"+n+"."+i+"s";if(n>0)return n+"."+i+"s";return e.toFixed(0)+"ms"};r.prototype.formatTime=function(e){return r.format(this.time(e))};r.prototype.formatTimeSum=function(){var e=[];for(var t=0;t=0){return"[Line "+this.line+"] "+this.message}return this.message};return e}();e.ParserError=n;var i=function(){function e(e,t){this.result=e;this.warnings=t;this.isError=false}return e}();e.ParserSuccess=i;var a;(function(e){function t(e){var t=new Int32Array(Math.round(1.61*e.tokens.length));t.set(e.tokens);e.tokens=t;e.tokensLenMinus2=t.length-2}function r(e,r,n){if(e.count>=e.tokensLenMinus2){t(e)}e.tokens[e.count++]=r;e.tokens[e.count++]=n}e.addToken=r;function n(e){return{tokensLenMinus2:Math.round(e)-2,count:0,tokens:new Int32Array(e)}}e.create=n})(a=e.TokenIndexBuilder||(e.TokenIndexBuilder={}));var o;(function(e){function t(){return Object.create(null)}e.create=t;function r(e,t){if(t.length>6)return t;var r=e[t];if(r!==void 0)return r;e[t]=t;return t}e.get=r})(o=e.ShortStringPool||(e.ShortStringPool={}))})(t=e.Formats||(e.Formats={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){var r;(function(t){var r;(function(t){"use strict";var r;(function(e){e.ElementSymbol="X";e.ResidueName="UNK";e.AsymId="";e.EntityId="1";e.ModelId="1"})(r||(r={}));function n(t,r,n,i){var a=e.Geometry.LinearAlgebra.Matrix4.identity(),o,s;for(o=1;o<=3;o++){for(s=1;s<=3;s++){e.Geometry.LinearAlgebra.Matrix4.setValue(a,o-1,s-1,t.getColumn(r+"["+o+"]["+s+"]").getFloat(i))}e.Geometry.LinearAlgebra.Matrix4.setValue(a,o-1,3,t.getColumn(n+"["+o+"]").getFloat(i))}return a}function i(e,t,r){var n=0;if(!r||!r.isDefined)return t;for(n=e+1;n=3){return true}}return false}function p(t,r,n,i,a,o){var s=r.asymId,u=r.entityIndex,l=0,c=i,f=i,p=a;while(c=0&&p.startResidueIndex>=0)v[v.length]=p}v.sort(function(e,t){return e.startResidueIndex-t.startResidueIndex});for(var m=0;me.endResidueIndex){e.endResidueIndex=t.endResidueIndex}}function g(t,r,n){var i=[],a=[];var o=t.getCategory("_struct_conf"),s=t.getCategory("_struct_sheet_range"),u;if(o){var l=o.getColumn("conf_type_id");if(l){var f=o.getColumn("beg_label_asym_id");var h=o.getColumn("beg_label_seq_id");var d=o.getColumn("pdbx_beg_PDB_ins_code");var y=o.getColumn("end_label_asym_id");var g=o.getColumn("end_label_seq_id");var b=o.getColumn("pdbx_end_PDB_ins_code");var x=o.getColumn("pdbx_PDB_helix_class");for(u=0;u0?v(i,n):[];var T=n.residues,M=T.count;if(S.length===0){p(r,T,n.entities,0,M,a);return m(T,a)}var A=S.length-1;if(S[0].startResidueIndex>0){p(r,T,n.entities,0,S[0].startResidueIndex,a)}for(u=0;u0){p(r,T,n.entities,S[u].endResidueIndex,S[u+1].startResidueIndex,a)}}a[a.length]=S[A];if(S[A].endResidueIndex0){var n=parseInt(e.substring(0,r)),i=parseInt(e.substr(r+1));for(var a=n;a<=i;a++)t[t.length]=a.toString()}else{t[t.length]=e.trim()}});i[i.length]=t});return i}function S(t){var r=t.getCategory("_pdbx_struct_assembly"),i=t.getCategory("_pdbx_struct_assembly_gen"),a=t.getCategory("_pdbx_struct_oper_list");if(!r||!i||!a){return void 0}var o,s={},u=[],l=e.Utils.FastMap.create();var c=i.getColumn("assembly_id");var f=i.getColumn("oper_expression");var h=i.getColumn("asym_id_list");for(o=0;o=0;a--){if(n.charCodeAt(a+e)!==r.charCodeAt(a)){return false}}return true};t.prototype.getEntityType=function(e,t){var r=e*14;if(this.tokenEquals(this.atomTokens[2*r],this.atomTokens[2*r+1],"HETATM",t)){var n=this.atomTokens[2*(r+4)],i=this.atomTokens[2*(r+4)+1];if(this.tokenEquals(n,i,"HOH",t)||this.tokenEquals(n,i,"WTR",t)||this.tokenEquals(n,i,"SOL",t)){return 3}return 2}else{return 1}};t.prototype.writeCifTokens=function(e,t,r){var n={RECORD:0,SERIAL:1,ATOM_NAME:2,ALT_LOC:3,RES_NAME:4,CHAIN_ID:5,RES_SEQN:6,INS_CODE:7,X:8,Y:9,Z:10,OCCUPANCY:11,TEMP_FACTOR:12,ELEMENT:13};var i=14;for(var a=0;a=0;r--){if(this.data.charCodeAt(r+e)!==t.charCodeAt(r)){return false}}return true};e.prototype.trim=function(e,t){while(ee&&this.data.charCodeAt(t-1)===32)t--;this.trimmedToken.start=e;this.trimmedToken.end=t};e.prototype.tokenizeAtomRecord=function(e){var r=this.position;var n=this.position;var i=this.moveToEndOfLine();var a=i-n;if(a<60)return false;this.trim(n,n+6);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);n=r+6;this.trim(n,n+5);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);n=r+12;this.trim(n,n+4);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);if(this.data.charCodeAt(r+16)===32){t.TokenIndexBuilder.addToken(e,0,0)}else{t.TokenIndexBuilder.addToken(e,r+16,r+17)}n=r+17;this.trim(n,n+3);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);t.TokenIndexBuilder.addToken(e,r+21,r+22);n=r+22;this.trim(n,n+4);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);if(this.data.charCodeAt(r+26)===32){t.TokenIndexBuilder.addToken(e,0,0)}else{t.TokenIndexBuilder.addToken(e,r+26,r+27)}n=r+30;this.trim(n,n+8);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);n=r+38;this.trim(n,n+8);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);n=r+46;this.trim(n,n+8);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);n=r+54;this.trim(n,n+6);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end);if(a>=66){n=r+60;this.trim(n,n+6);t.TokenIndexBuilder.addToken(e,this.trimmedToken.start,this.trimmedToken.end)}else{t.TokenIndexBuilder.addToken(e,0,0)}if(a>=78){n=r+76;this.trim(n,n+2);if(this.trimmedToken.start0){if(c.length===0){h={start:a.length+3,end:a.length+4}}if(u){c.push(new r.ModelData(h,u.tokens,l))}l=0;u=null}else if(o.startsWith(o.position,"END")){var m=o.position;var v=o.moveToEndOfLine();o.trim(m,v);if(o.trimmedToken.end-o.trimmedToken.start===3){d=false}}break;case 72:if(o.startsWith(o.position,"HETATM")){if(!u){u=t.TokenIndexBuilder.create(4096)}var p=i.tokenizeAtom(u,o);l++;if(p)return p}break;case 77:if(o.startsWith(o.position,"MODEL")){if(l>0){if(c.length===0){h={start:a.length+3,end:a.length+4}}if(u){c.push(new r.ModelData(h,u.tokens,l))}}var m=o.position+6;var v=o.moveToEndOfLine();o.trim(m,v);h={start:o.trimmedToken.start,end:o.trimmedToken.end};if(l>0||!u){u=t.TokenIndexBuilder.create(4096)}l=0}break}o.moveToNextLine();if(!d)break}var y=a+".?0123";if(l>0){if(c.length===0){h={start:a.length+3,end:a.length+4}}if(u){c.push(new r.ModelData(h,u.tokens,l))}}return new r.MoleculeData(new r.Header(e),f,new r.ModelsData(c),y)};i.getDotRange=function(e){return{start:e-6,end:e-5}};i.getNumberRanges=function(t){var r=e.Utils.FastMap.create();for(var n=0;n<4;n++){r.set(n,{start:t-4+n,end:t-3+n})}return r};i.getQuestionmarkRange=function(e){return{start:e-5,end:e-4}};i.parse=function(e,r){var n=i.tokenize(e,r);if(n instanceof t.ParserError){return t.ParserResult.error(n.message,n.line)}else{return t.ParserResult.success(n.toCifFile())}};return i}();r.Parser=i;function a(e,t){return i.parse(e,t)}r.toCifFile=a})(n=r.PDB||(r.PDB={}))})(r=t.Molecule||(t.Molecule={}))})(t=e.Formats||(e.Formats={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){var r;(function(r){var n;(function(r){function n(r,n){var i=r.split(/\r?\n/g);var a=i[0].trim();if(!a.length)a="SDF";var o=i[3];var s=+o.substr(0,3);var u=+o.substr(3,3);return{id:n?n:a,atomCount:s,bondCount:u,atoms:e.Utils.DataTable.ofDefinition(e.Structure.Tables.Atoms,s),positions:e.Utils.DataTable.ofDefinition(e.Structure.Tables.Positions,s),bonds:e.Utils.DataTable.ofDefinition(e.Structure.Tables.Bonds,u),lines:i,currentLine:4,error:void 0,stringPool:t.ShortStringPool.create()}}function i(r,n){var i=n.lines[n.currentLine];var a=n.atoms,o=n.positions;var s=t.ShortStringPool.get(n.stringPool,i.substr(31,3).trim());a.id[r]=r;a.elementSymbol[r]=s;a.name[r]=s;a.authName[r]=s;a.occupancy[r]=1;a.rowIndex[r]=n.currentLine;o.x[r]=e.Utils.FastNumberParsers.parseFloatSkipTrailingWhitespace(i,0,10);o.y[r]=e.Utils.FastNumberParsers.parseFloatSkipTrailingWhitespace(i,10,20);o.z[r]=e.Utils.FastNumberParsers.parseFloatSkipTrailingWhitespace(i,20,30)}function a(e){for(var t=0;t1?["The input data contains multiple data blocks, only the first one was parsed. To parse all data blocks, use the function 'mmCIF.ofDataBlock' separately for each block."]:void 0)]}})})})}}var i;(function(i){var a=this;i.mmCIF={name:"mmCIF",shortcuts:["mmcif","cif"],extensions:[".cif"],parse:n("CIF",t.CIF.Text.parse)};i.mmBCIF={name:"mmCIF (Binary)",shortcuts:["mmbcif","bcif","binarycif"],extensions:[".bcif"],isBinary:true,parse:n("BinaryCIF",t.CIF.Binary.parse)};i.PDB={name:"PDB",shortcuts:["pdb","ent"],extensions:[".pdb",".ent"],parse:n("PDB",function(e,t){return r.PDB.toCifFile(t&&t.id||"PDB",e)})};i.SDF={name:"SDF",shortcuts:["sdf","mol"],extensions:[".sdf",".mol"],parse:function(n,i){return e.computation(function(e){return m(a,void 0,void 0,function(){var a;return v(this,function(o){switch(o.label){case 0:return[4,e.updateProgress("Parsing...")];case 1:o.sent();a=r.SDF.parse(n,i&&i.id||undefined);if(a.isError)throw a.toString();return[2,t.ParserResult.success(a.result)]}})})})}};i.All=[i.mmCIF,i.mmBCIF,i.PDB,i.SDF]})(i=r.SupportedFormats||(r.SupportedFormats={}))})(r=t.Molecule||(t.Molecule={}))})(t=e.Formats||(e.Formats={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(e){var t;(function(e){"use strict";function t(e,t){var r=e.length;for(var n=0;ni&&p<1024*1024){p=i+d.symBytes;u.push("File is larger than expected and doesn't match header. Continuing file load, good luck!")}else{return e.ParserResult.error("File is MUCH larger than expected and doesn't match header.")}}if(d.grid[0]===0&&d.extent[0]>0){d.grid[0]=d.extent[0]-1;u.push("Fixed X interval count.")}if(d.grid[1]===0&&d.extent[1]>0){d.grid[1]=d.extent[1]-1;u.push("Fixed Y interval count.")}if(d.grid[2]===0&&d.extent[2]>0){d.grid[2]=d.extent[2]-1;u.push("Fixed Z interval count.")}if(d.crs2xyz[0]===0&&d.crs2xyz[1]===0&&d.crs2xyz[2]===0){u.push("All crs2xyz records are zero. Setting crs2xyz to 1, 2, 3.");d.crs2xyz=[1,2,3]}if(d.cellSize[0]===0&&d.cellSize[1]===0&&d.cellSize[2]===0){u.push("Cell dimensions are all zero. Setting to 1.0, 1.0, 1.0. Map file will not align with other structures.");d.cellSize[0]=1;d.cellSize[1]=1;d.cellSize[2]=1}var m=[0,0,0];m[d.crs2xyz[0]-1]=0;m[d.crs2xyz[1]-1]=1;m[d.crs2xyz[2]-1]=2;var v;if(d.origin2k[0]===0&&d.origin2k[1]===0&&d.origin2k[2]===0){v=[d.nxyzStart[m[0]],d.nxyzStart[m[1]],d.nxyzStart[m[2]]]}else{v=[d.origin2k[m[0]],d.origin2k[m[1]],d.origin2k[m[2]]]}var y=[d.extent[m[0]],d.extent[m[1]],d.extent[m[2]]];var g=new Uint16Array(new Uint8Array([18,52]).buffer)[0]===13330;var b=l===g?a(new Float32Array(r,i+d.symBytes,y[0]*y[1]*y[2]),l,y,d.extent,m,d.mean):o(new DataView(r,i+d.symBytes),l,y,d.extent,m,d.mean);var x=new t.Field3DZYX(b.data,y);var _={spacegroup:t.createSpacegroup(d.spacegroupNumber,d.cellSize,d.cellAngles),box:{origin:[v[0]/d.grid[0],v[1]/d.grid[1],v[2]/d.grid[2]],dimensions:[y[0]/d.grid[0],y[1]/d.grid[1],y[2]/d.grid[2]],sampleCount:y},data:x,valuesInfo:{min:d.min,max:d.max,mean:d.mean,sigma:b.sigma}};return e.ParserResult.success(_,u)}r.parse=i;function a(e,t,r,n,i,a){var o=new Float32Array(r[0]*r[1]*r[2]),s=[0,0,0],u,l,c,f,h,d,p,m,v=0,y=.1,g=0,b=.1,x=i[0],_=i[1],w=i[2];u=n[0];l=n[1];c=n[2];p=r[0];m=r[0]*r[1];for(d=0;dv)v=x}}}return{data:i,min:m,max:v}}})(i||(i={}))})(r=t.CIF||(t.CIF={}))})(t=e.Density||(e.Density={}))})(t=e.Formats||(e.Formats={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){var r;(function(t){function r(t,r,n){var i=this;return e.computation(function(e){return m(i,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,e.updateProgress("Parsing "+r+"...")];case 1:i.sent();return[2,n(t)]}})})})}var n;(function(e){e.CCP4={name:"CCP4",shortcuts:["ccp4","map"],extensions:[".ccp4",".map"],isBinary:true,parse:function(e){return r(e,"CCP4",function(e){return t.CCP4.parse(e)})}};e.All=[e.CCP4]})(n=t.SupportedFormats||(t.SupportedFormats={}))})(r=t.Density||(t.Density={}))})(t=e.Formats||(e.Formats={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(e){var t;(function(e){/* - * This code has been modified from https://github.com/toji/gl-matrix/, - * copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - */ -function t(){return t.zero()}e.Matrix4=t;(function(e){function t(){var e=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];e[0]=0;return e}e.zero=t;function r(){var e=t();e[0]=1;e[1]=0;e[2]=0;e[3]=0;e[4]=0;e[5]=1;e[6]=0;e[7]=0;e[8]=0;e[9]=0;e[10]=1;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return e}e.identity=r;function n(e){e[0]=1;e[1]=0;e[2]=0;e[3]=0;e[4]=0;e[5]=1;e[6]=0;e[7]=0;e[8]=0;e[9]=0;e[10]=1;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return e}e.fromIdentity=n;function i(e){var r=t(),n,i,a;for(n=0;n<4;n++){a=e[n];for(i=0;i<4;i++){r[4*i+n]=a[i]}}return r}e.ofRows=i;function a(e,t,r){for(var n=0;n<16;n++){if(Math.abs(e[n]-t[n])>r){return false}}return true}e.areEqual=a;function o(e,t,r,n){e[4*r+t]=n}e.setValue=o;function s(e,t){e[0]=t[0];e[1]=t[1];e[2]=t[2];e[3]=t[3];e[4]=t[4];e[5]=t[5];e[6]=t[6];e[7]=t[7];e[8]=t[8];e[9]=t[9];e[10]=t[10];e[11]=t[11];e[12]=t[12];e[13]=t[13];e[14]=t[14];e[15]=t[15];return e}e.copy=s;function u(t){return e.copy(e.zero(),t)}e.clone=u;function l(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],c=t[8],f=t[9],h=t[10],d=t[11],p=t[12],m=t[13],v=t[14],y=t[15],g=r*s-n*o,b=r*u-i*o,x=r*l-a*o,_=n*u-i*s,w=n*l-a*s,C=i*l-a*u,E=c*m-f*p,S=c*v-h*p,T=c*y-d*p,M=f*v-h*m,A=f*y-d*m,P=h*y-d*v,R=g*P-b*A+x*M+_*T-w*S+C*E;if(!R){return null}R=1/R;e[0]=(s*P-u*A+l*M)*R;e[1]=(i*A-n*P-a*M)*R;e[2]=(m*C-v*w+y*_)*R;e[3]=(h*w-f*C-d*_)*R;e[4]=(u*T-o*P-l*S)*R;e[5]=(r*P-i*T+a*S)*R;e[6]=(v*x-p*C-y*b)*R;e[7]=(c*C-h*x+d*b)*R;e[8]=(o*A-s*T+l*E)*R;e[9]=(n*T-r*A-a*E)*R;e[10]=(p*w-m*x+y*g)*R;e[11]=(f*x-c*w-d*g)*R;e[12]=(s*S-o*M-u*E)*R;e[13]=(r*M-n*S+i*E)*R;e[14]=(m*b-p*_-v*g)*R;e[15]=(c*_-f*b+h*g)*R;return e}e.invert=l;function c(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=t[9],d=t[10],p=t[11],m=t[12],v=t[13],y=t[14],g=t[15];var b=r[0],x=r[1],_=r[2],w=r[3];e[0]=b*n+x*s+_*f+w*m;e[1]=b*i+x*u+_*h+w*v;e[2]=b*a+x*l+_*d+w*y;e[3]=b*o+x*c+_*p+w*g;b=r[4];x=r[5];_=r[6];w=r[7];e[4]=b*n+x*s+_*f+w*m;e[5]=b*i+x*u+_*h+w*v;e[6]=b*a+x*l+_*d+w*y;e[7]=b*o+x*c+_*p+w*g;b=r[8];x=r[9];_=r[10];w=r[11];e[8]=b*n+x*s+_*f+w*m;e[9]=b*i+x*u+_*h+w*v;e[10]=b*a+x*l+_*d+w*y;e[11]=b*o+x*c+_*p+w*g;b=r[12];x=r[13];_=r[14];w=r[15];e[12]=b*n+x*s+_*f+w*m;e[13]=b*i+x*u+_*h+w*v;e[14]=b*a+x*l+_*d+w*y;e[15]=b*o+x*c+_*p+w*g;return e}e.mul=c;function f(e,t,r,n){return c(e,c(e,t,r),n)}e.mul3=f;function h(e,t,r){var n=r[0],i=r[1],a=r[2],o,s,u,l,c,f,h,d,p,m,v,y;if(t===e){e[12]=t[0]*n+t[4]*i+t[8]*a+t[12];e[13]=t[1]*n+t[5]*i+t[9]*a+t[13];e[14]=t[2]*n+t[6]*i+t[10]*a+t[14];e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]}else{o=t[0];s=t[1];u=t[2];l=t[3];c=t[4];f=t[5];h=t[6];d=t[7];p=t[8];m=t[9];v=t[10];y=t[11];e[0]=o;e[1]=s;e[2]=u;e[3]=l;e[4]=c;e[5]=f;e[6]=h;e[7]=d;e[8]=p;e[9]=m;e[10]=v;e[11]=y;e[12]=o*n+c*i+p*a+t[12];e[13]=s*n+f*i+m*a+t[13];e[14]=u*n+h*i+v*a+t[14];e[15]=l*n+d*i+y*a+t[15]}return e}e.translate=h;function d(e,t){e[0]=1;e[1]=0;e[2]=0;e[3]=0;e[4]=0;e[5]=1;e[6]=0;e[7]=0;e[8]=0;e[9]=0;e[10]=1;e[11]=0;e[12]=t[0];e[13]=t[1];e[14]=t[2];e[15]=1;return e}e.fromTranslation=d;function p(e,t,r,n){var i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,l,c,f,h,d,p,m,v,y,g,b,x,_,w,C,E,S,T,M,A,P,R,k;if(Math.abs(s)<1e-6){return null}s=1/s;i*=s;a*=s;o*=s;u=Math.sin(r);l=Math.cos(r);c=1-l;f=t[0];h=t[1];d=t[2];p=t[3];m=t[4];v=t[5];y=t[6];g=t[7];b=t[8];x=t[9];_=t[10];w=t[11];C=i*i*c+l;E=a*i*c+o*u;S=o*i*c-a*u;T=i*a*c-o*u;M=a*a*c+l;A=o*a*c+i*u;P=i*o*c+a*u;R=a*o*c-i*u;k=o*o*c+l;e[0]=f*C+m*E+b*S;e[1]=h*C+v*E+x*S;e[2]=d*C+y*E+_*S;e[3]=p*C+g*E+w*S;e[4]=f*T+m*M+b*A;e[5]=h*T+v*M+x*A;e[6]=d*T+y*M+_*A;e[7]=p*T+g*M+w*A;e[8]=f*P+m*R+b*k;e[9]=h*P+v*R+x*k;e[10]=d*P+y*R+_*k;e[11]=p*P+g*R+w*k;if(t!==e){e[12]=t[12];e[13]=t[13];e[14]=t[14];e[15]=t[15]}return e}e.rotate=p;function m(e,t,r){var i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),u,l,c;if(Math.abs(s)<1e-6){return n(e)}s=1/s;i*=s;a*=s;o*=s;u=Math.sin(t);l=Math.cos(t);c=1-l;e[0]=i*i*c+l;e[1]=a*i*c+o*u;e[2]=o*i*c-a*u;e[3]=0;e[4]=i*a*c-o*u;e[5]=a*a*c+l;e[6]=o*a*c+i*u;e[7]=0;e[8]=i*o*c+a*u;e[9]=a*o*c-i*u;e[10]=o*o*c+l;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return e}e.fromRotation=m;function v(e,t,r){var n=r[0],i=r[1],a=r[2];e[0]=t[0]*n;e[1]=t[1]*n;e[2]=t[2]*n;e[3]=t[3]*n;e[4]=t[4]*i;e[5]=t[5]*i;e[6]=t[6]*i;e[7]=t[7]*i;e[8]=t[8]*a;e[9]=t[9]*a;e[10]=t[10]*a;e[11]=t[11]*a;e[12]=t[12];e[13]=t[13];e[14]=t[14];e[15]=t[15];return e}e.scale=v;function y(e,t){e[0]=t[0];e[1]=0;e[2]=0;e[3]=0;e[4]=0;e[5]=t[1];e[6]=0;e[7]=0;e[8]=0;e[9]=0;e[10]=t[2];e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return e}e.fromScaling=y;function g(e){var t="";for(var r=0;r<4;r++){for(var n=0;n<4;n++){t+=e[4*n+r].toString();if(n<3)t+=" "}if(r<3)t+="\n"}return t}e.makeTable=g;function b(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],f=e[10],h=e[11],d=e[12],p=e[13],m=e[14],v=e[15],y=t*o-r*a,g=t*s-n*a,b=t*u-i*a,x=r*s-n*o,_=r*u-i*o,w=n*u-i*s,C=l*p-c*d,E=l*m-f*d,S=l*v-h*d,T=c*m-f*p,M=c*v-h*p,A=f*v-h*m;return y*A-g*M+b*T+x*S-_*E+w*C}e.determinant=b})(t=e.Matrix4||(e.Matrix4={}));function r(e,t,n){return r.fromValues(e||0,t||0,n||0)}e.Vector3=r;(function(e){function r(){var e=[.1,0,0];e[0]=0;return e}e.zero=r;function n(e){var t=r();t[0]=e[0];t[1]=e[1];t[2]=e[2];return t}e.clone=n;function i(e){return o(e.x,e.y,e.z)}e.fromObj=i;function a(e){return{x:e[0],y:e[1],z:e[2]}}e.toObj=a;function o(e,t,n){var i=r();i[0]=e;i[1]=t;i[2]=n;return i}e.fromValues=o;function s(e,t,r,n){e[0]=t;e[1]=r;e[2]=n;return e}e.set=s;function u(e,t){e[0]=t[0];e[1]=t[1];e[2]=t[2];return e}e.copy=u;function l(e,t,r){e[0]=t[0]+r[0];e[1]=t[1]+r[1];e[2]=t[2]+r[2];return e}e.add=l;function c(e,t,r){e[0]=t[0]-r[0];e[1]=t[1]-r[1];e[2]=t[2]-r[2];return e}e.sub=c;function f(e,t,r){e[0]=t[0]*r;e[1]=t[1]*r;e[2]=t[2]*r;return e}e.scale=f;function h(e,t,r,n){e[0]=t[0]+r[0]*n;e[1]=t[1]+r[1]*n;e[2]=t[2]+r[2]*n;return e}e.scaleAndAdd=h;function d(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}e.distance=d;function p(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}e.squaredDistance=p;function m(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}e.magnitude=m;function v(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}e.squaredMagnitude=v;function y(e,t){var r=t[0],n=t[1],i=t[2];var a=r*r+n*n+i*i;if(a>0){a=1/Math.sqrt(a);e[0]=t[0]*a;e[1]=t[1]*a;e[2]=t[2]*a}return e}e.normalize=y;function g(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}e.dot=g;function b(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];e[0]=i*u-a*s;e[1]=a*o-n*u;e[2]=n*s-i*o;return e}e.cross=b;function x(e,t,r,n){var i=t[0],a=t[1],o=t[2];e[0]=i+n*(r[0]-i);e[1]=a+n*(r[1]-a);e[2]=o+n*(r[2]-o);return e}e.lerp=x;function _(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];o=o||1;e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o;e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o;e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o;return e}e.transformMat4=_;var w=r(),C=r();function E(e,t){u(w,e);u(C,t);y(w,w);y(C,C);var r=g(w,C);if(r>1){return 0}else if(r<-1){return Math.PI}else{return Math.acos(r)}}e.angle=E;var S=r();function T(e,r,n){var i=E(r,n);if(Math.abs(i)<1e-4){return t.fromIdentity(e)}var a=b(S,r,n);var o=v(a);if(o<1e-4){if(Math.abs(w[0]-1)<1e-6)s(a,0,1,0);else s(a,1,0,0)}return t.fromRotation(e,i,a)}e.makeRotation=T})(r=e.Vector3||(e.Vector3={}));function n(e,t,r,i){return n.fromValues(e||0,t||0,r||0,i||0)}e.Vector4=n;(function(e){function t(){var e=[.1,0,0,0];e[0]=0;return e}e.zero=t;function r(e){var r=t();r[0]=e[0];r[1]=e[1];r[2]=e[2];r[3]=e[3];return r}e.clone=r;function n(e,r,n,i){var a=t();a[0]=e;a[1]=r;a[2]=n;a[3]=i;return a}e.fromValues=n;function i(e,t,r,n,i){e[0]=t;e[1]=r;e[2]=n;e[3]=i;return e}e.set=i;function a(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}e.distance=a;function o(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}e.squaredDistance=o;function s(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}e.norm=s;function u(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}e.squaredNorm=u;function l(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o;e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o;e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o;e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o;return e}e.transform=l})(n=e.Vector4||(e.Vector4={}))})(t=e.LinearAlgebra||(e.LinearAlgebra={}))})(t=e.Geometry||(e.Geometry={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r;(function(r){var n=t.LinearAlgebra.Vector3;function i(e){if(e.normals)return;var t=new Float32Array(e.vertices.length),r=e.vertices,i=e.triangleIndices;var a=n.zero(),o=n.zero(),s=n.zero(),u=n.zero(),l=n.zero(),c=n.zero();for(var f=0;f0){for(h=0,d=c.length;he.Computation.UpdateProgressDelta))return[3,5];f=m;return[4,t.updateProgress("Smoothing surface...",true,l+1,n)];case 4:v.sent();v.label=5;case 5:l++;return[3,3];case 6:return[2,r]}})})}function l(t,r,n){var i=this;if(r===void 0){r=1}if(n===void 0){n=1}if(r<1)r=0;if(r===0)return e.Computation.resolve(t);return e.computation(function(e){return m(i,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,u(e,t,r,1.1*n/1.1)];case 1:return[2,i.sent()]}})})})}r.laplacianSmooth=l;function c(r){var n=this;return e.computation(function(e){return m(n,void 0,void 0,function(){var n,i,a,o,s,u,l,s,u,c,f,h;return v(this,function(d){switch(d.label){case 0:if(r.boundingSphere){return[2,r]}return[4,e.updateProgress("Computing bounding sphere...")];case 1:d.sent();n=r.vertices;i=0,a=0,o=0;for(s=0,u=r.vertices.length;se.splitValue:n-t.radius=n&&e.positions[3*e.indices[h]+a]>l)h--}c=f-1;e.bounds.max[a]=l;p=r(e,n,c,(a+1)%3);e.bounds.max[a]=u;e.bounds.min[a]=l;m=r(e,c+1,i,(a+1)%3);e.bounds.min[a]=s;return t.create(l,n,i+1,p,m)}function n(e,n){var i=e.elements,a=e.positions,o=e.bounds,s=e.indices;var u={bounds:o,positions:a,leafSize:n,indices:s,emptyNode:t.create(NaN,-1,-1,void 0,void 0)};var l=r(u,0,s.length-1,0);return{root:l,indices:s,positions:a}}e.build=n})(r||(r={}));function n(n,i){if(i===void 0){i=32}var a=r.build(n,i);return function(){var r=e.QueryContext.create(a,n.elements);return function(n,i,o,s){e.QueryContext.update(r,n,i,o,s);t.nearest(a.root,r,0);return r.buffer}}}e.createSubdivisionTree=n})(t=e.Query3D||(e.Query3D={}))})(t=e.Geometry||(e.Geometry={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2017 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(e){var t;(function(e){/** - * Adapted from https://github.com/arose/ngl - * MIT License Copyright (C) 2014+ Alexander Rose - */ -function t(t){var r=t.structure,n=r.min,i=n[0],a=n[1],o=n[2],s=r.size,u=s[0],l=s[1],c=s[2],f=r.bucketOffset,h=r.bucketCounts,d=r.bucketArray,p=r.grid,m=r.positions;var v=t.radius,y=t.radiusSq,g=t.pivot,b=g[0],x=g[1],_=g[2];var w=Math.max(0,b-v-i>>3);var C=Math.max(0,x-v-a>>3);var E=Math.max(0,_-v-o>>3);var S=Math.min(u,b+v-i>>3);var T=Math.min(l,x+v-a>>3);var M=Math.min(c,_+v-o>>3);for(var A=w;A<=S;A++){for(var P=C;P<=T;P++){for(var R=E;R<=M;R++){var k=(A*l+P)*c+R;var I=p[k];if(I>0){var D=I-1;var B=f[D];var L=h[D];var F=B+L;for(var V=B;V>3;var b=o[3*y+1]-h>>3;var x=o[3*y+2]-d>>3;var _=(g*i+b)*a+x;if((m[_]+=1)===1){p+=1}v[y]=_}var w=new Int32Array(p);for(var y=0,C=0;y0){m[y]=C+1;w[C]=E;C+=1}}var S=new Uint32Array(l);for(var y=1;y0){var P=A-1;M[S[P]+T[P]]=y;T[P]+=1}}return{size:e.size,bucketArray:M,bucketCounts:w,bucketOffset:S,grid:m,min:e.bounds.min,positions:o}}function n(e){var t=e.elements,n=e.positions,i=e.bounds,a=e.indices;var o=[(i.max[0]-i.min[0]>>3)+1,(i.max[1]-i.min[1]>>3)+1,(i.max[2]-i.min[2]>>3)+1];var s={size:o,positions:n,indices:a,bounds:i};return r(s)}function i(r){var i=n(r);return function(){var n=e.QueryContext.create(i,r.elements);return function(r,i,a,o){e.QueryContext.update(n,r,i,a,o);t(n);return n.buffer}}}e.createSpatialHash=i})(t=e.Query3D||(e.Query3D={}))})(t=e.Geometry||(e.Geometry={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){var r;(function(t){"use strict";function r(t){var r=this;return e.computation(function(e){return m(r,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:r=new n(t,e);return[4,r.run()];case 1:return[2,i.sent()]}})})})}t.compute=r;var n=function(){function t(t,r){this.ctx=r;this.minX=0;this.minY=0;this.minZ=0;this.maxX=0;this.maxY=0;this.maxZ=0;var n=e.Utils.extend({},t);if(!n.bottomLeft)n.bottomLeft=[0,0,0];if(!n.topRight)n.topRight=n.scalarField.dimensions;this.state=new i(n),this.minX=n.bottomLeft[0];this.minY=n.bottomLeft[1];this.minZ=n.bottomLeft[2];this.maxX=n.topRight[0]-1;this.maxY=n.topRight[1]-1;this.maxZ=n.topRight[2]-1;this.size=(this.maxX-this.minX)*(this.maxY-this.minY)*(this.maxZ-this.minZ);this.sliceSize=(this.maxX-this.minX)*(this.maxY-this.minY)}t.prototype.doSlices=function(){return m(this,void 0,void 0,function(){var t,r,n,i;return v(this,function(a){switch(a.label){case 0:t=0;r=e.Utils.PerformanceMonitor.currentTime();n=this.minZ;a.label=1;case 1:if(!(ne.Computation.UpdateProgressDelta))return[3,3];return[4,this.ctx.updateProgress("Computing surface...",true,t,this.size)];case 2:a.sent();r=i;a.label=3;case 3:n++;return[3,1];case 4:return[2]}})})};t.prototype.slice=function(e){for(var t=this.minY;t0)return a-1|0;var o=t.CubeEdges[r];var s=o.a,u=o.b;var l=s.i+this.i,c=s.j+this.j,f=s.k+this.k;var h=u.i+this.i,d=u.j+this.j,p=u.k+this.k;var m=this.scalarField.get(l,c,f),v=this.scalarField.get(h,d,p);var y=(this.isoLevel-m)/(m-v);var g=e.Utils.ChunkedArray.add3(this.vertexBuffer,l+y*(l-h),c+y*(c-d),f+y*(f-p))|0;this.verticesOnEdges[i]=g+1;if(this.annotate){var b=y<.5?this.annotationField.get(l,c,f):this.annotationField.get(h,d,p);if(b<0)b=y<.5?this.annotationField.get(h,d,p):this.annotationField.get(l,c,f);e.Utils.ChunkedArray.add(this.annotationBuffer,b)}return g};r.prototype.processCell=function(r,n,i){var a=0;if(this.scalarField.get(r,n,i)0)this.vertList[0]=this.interpolate(0);if((o&2)>0)this.vertList[1]=this.interpolate(1);if((o&4)>0)this.vertList[2]=this.interpolate(2);if((o&8)>0)this.vertList[3]=this.interpolate(3);if((o&16)>0)this.vertList[4]=this.interpolate(4);if((o&32)>0)this.vertList[5]=this.interpolate(5);if((o&64)>0)this.vertList[6]=this.interpolate(6);if((o&128)>0)this.vertList[7]=this.interpolate(7);if((o&256)>0)this.vertList[8]=this.interpolate(8);if((o&512)>0)this.vertList[9]=this.interpolate(9);if((o&1024)>0)this.vertList[10]=this.interpolate(10);if((o&2048)>0)this.vertList[11]=this.interpolate(11);var s=t.TriTable[a];for(var u=0;u=.99){this.vdwScaleFactor=1.000000001}else{this.vdwScaleFactor=1+(1-this.parameters.density*this.parameters.density)}}r.prototype.findBounds=function(){for(var e=0,t=this.atomIndices;e0){this.field[C]+=E}}}}};r.prototype.processChunks=function(){return m(this,void 0,void 0,function(){var t,r,n,i,a,o,s;return v(this,function(u){switch(u.label){case 0:t=1e4;r=e.Utils.PerformanceMonitor.currentTime();return[4,this.ctx.updateProgress("Creating field...",true)];case 1:u.sent();n=0,i=this.atomIndices.length;u.label=2;case 2:if(!(n=0){this.addBall(a,o)}if(!((n+1)%t===0))return[3,4];s=e.Utils.PerformanceMonitor.currentTime();if(!(s-r>e.Computation.UpdateProgressDelta))return[3,4];r=s;return[4,this.ctx.updateProgress("Creating field...",true,n,i)];case 3:u.sent();u.label=4;case 4:n++;return[3,2];case 5:return[2]}})})};r.prototype.finish=function(){var r=t.LinearAlgebra.Matrix4.zero();t.LinearAlgebra.Matrix4.fromTranslation(r,[this.minX,this.minY,this.minZ]);r[0]=this.dX;r[5]=this.dY;r[10]=this.dZ;var n={data:{scalarField:new e.Formats.Density.Field3DZYX(this.field,[this.nX,this.nY,this.nZ]),annotationField:this.parameters.interactive?new e.Formats.Density.Field3DZYX(this.proximityMap,[this.nX,this.nY,this.nZ]):void 0,isoLevel:.05},bottomLeft:t.LinearAlgebra.Vector3.fromValues(this.minX,this.minY,this.minZ),topRight:t.LinearAlgebra.Vector3.fromValues(this.maxX,this.maxY,this.maxZ),transform:r,inputParameters:this.inputParameters,parameters:this.parameters};this.distanceField=null;this.proximityMap=null;return n};r.prototype.run=function(){return m(this,void 0,void 0,function(){return v(this,function(e){switch(e.label){case 0:return[4,this.ctx.updateProgress("Initializing...")];case 1:e.sent();this.findBounds();this.initData();return[4,this.processChunks()];case 2:e.sent();return[4,this.ctx.updateProgress("Finalizing...",void 0,this.atomIndices.length,this.atomIndices.length)];case 3:e.sent();return[2,this.finish()]}})})};return r}();function a(t){var r=this;return e.computation(function(e){return m(r,void 0,void 0,function(){var r;return v(this,function(n){switch(n.label){case 0:r=new i(t,e);return[4,r.run()];case 1:return[2,n.sent()]}})})})}r.createMolecularIsoFieldAsync=a;function o(r){var n=this;return e.computation(function(e){return m(n,void 0,void 0,function(){var n,i,o,s;return v(this,function(u){switch(u.label){case 0:return[4,a(r).run(e)];case 1:n=u.sent();return[4,t.MarchingCubes.compute(n.data).run(e)];case 2:i=u.sent();return[4,t.Surface.transform(i,n.transform).run(e)];case 3:i=u.sent();o=r.parameters&&r.parameters.smoothingIterations||1;s=1;if(r.parameters&&r.parameters.density<1){s=2/r.parameters.density}return[4,t.Surface.laplacianSmooth(i,o,s).run(e)];case 4:i=u.sent();return[2,{surface:i,usedParameters:n.parameters}]}})})})}r.computeMolecularSurfaceAsync=o})(r=t.MolecularSurface||(t.MolecularSurface={}))})(t=e.Geometry||(e.Geometry={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r=e.Utils.DataTable;var n=function(){function t(t){this.id=t;this.map=e.Utils.FastMap.create()}t.prototype.add=function(t,r,n,i){if(i===void 0){i=true}var a=this.map.get(t);if(a!==void 0){var o=a.get(r);if(o===void 0){a.set(r,n)}}else{var s=e.Utils.FastMap.create();s.set(r,n);this.map.set(t,s)}if(i)this.add(r,t,n,false)};return t}();t.ComponentBondInfoEntry=n;var i=function(){function t(){this.entries=e.Utils.FastMap.create()}t.prototype.newEntry=function(e){var t=new n(e);this.entries.set(e,t);return t};return t}();t.ComponentBondInfo=i;var a=function(){function e(e,t,r){this.asymId=e;this.seqNumber=t;this.insCode=r}e.areEqual=function(e,t,r,n,i){return e.asymId===r[t]&&e.seqNumber===n[t]&&e.insCode===i[t]};e.compare=function(e,t){if(e.asymId===t.asymId){if(e.seqNumber===t.seqNumber){if(e.insCode===t.insCode)return 0;if(e.insCode===void 0)return-1;if(t.insCode===void 0)return 1;return e.insCode=0&&e<=5}t.isBondTypeCovalent=r;var n={H:0,h:0,D:0,d:0,T:0,t:0,He:2,HE:2,he:2,Li:3,LI:3,li:3,Be:4,BE:4,be:4,B:5,b:5,C:6,c:6,N:7,n:7,O:8,o:8,F:9,f:9,Ne:10,NE:10,ne:10,Na:11,NA:11,na:11,Mg:12,MG:12,mg:12,Al:13,AL:13,al:13,Si:14,SI:14,si:14,P:15,p:15,S:16,s:16,Cl:17,CL:17,cl:17,Ar:18,AR:18,ar:18,K:19,k:19,Ca:20,CA:20,ca:20,Sc:21,SC:21,sc:21,Ti:22,TI:22,ti:22,V:23,v:23,Cr:24,CR:24,cr:24,Mn:25,MN:25,mn:25,Fe:26,FE:26,fe:26,Co:27,CO:27,co:27,Ni:28,NI:28,ni:28,Cu:29,CU:29,cu:29,Zn:30,ZN:30,zn:30,Ga:31,GA:31,ga:31,Ge:32,GE:32,ge:32,As:33,AS:33,as:33,Se:34,SE:34,se:34,Br:35,BR:35,br:35,Kr:36,KR:36,kr:36,Rb:37,RB:37,rb:37,Sr:38,SR:38,sr:38,Y:39,y:39,Zr:40,ZR:40,zr:40,Nb:41,NB:41,nb:41,Mo:42,MO:42,mo:42,Tc:43,TC:43,tc:43,Ru:44,RU:44,ru:44,Rh:45,RH:45,rh:45,Pd:46,PD:46,pd:46,Ag:47,AG:47,ag:47,Cd:48,CD:48,cd:48,In:49,IN:49,in:49,Sn:50,SN:50,sn:50,Sb:51,SB:51,sb:51,Te:52,TE:52,te:52,I:53,i:53,Xe:54,XE:54,xe:54,Cs:55,CS:55,cs:55,Ba:56,BA:56,ba:56,La:57,LA:57,la:57,Ce:58,CE:58,ce:58,Pr:59,PR:59,pr:59,Nd:60,ND:60,nd:60,Pm:61,PM:61,pm:61,Sm:62,SM:62,sm:62,Eu:63,EU:63,eu:63,Gd:64,GD:64,gd:64,Tb:65,TB:65,tb:65,Dy:66,DY:66,dy:66,Ho:67,HO:67,ho:67,Er:68,ER:68,er:68,Tm:69,TM:69,tm:69,Yb:70,YB:70,yb:70,Lu:71,LU:71,lu:71,Hf:72,HF:72,hf:72,Ta:73,TA:73,ta:73,W:74,w:74,Re:75,RE:75,re:75,Os:76,OS:76,os:76,Ir:77,IR:77,ir:77,Pt:78,PT:78,pt:78,Au:79,AU:79,au:79,Hg:80,HG:80,hg:80,Tl:81,TL:81,tl:81,Pb:82,PB:82,pb:82,Bi:83,BI:83,bi:83,Po:84,PO:84,po:84,At:85,AT:85,at:85,Rn:86,RN:86,rn:86,Fr:87,FR:87,fr:87,Ra:88,RA:88,ra:88,Ac:89,AC:89,ac:89,Th:90,TH:90,th:90,Pa:91,PA:91,pa:91,U:92,u:92,Np:93,NP:93,np:93,Pu:94,PU:94,pu:94,Am:95,AM:95,am:95,Cm:96,CM:96,cm:96,Bk:97,BK:97,bk:97,Cf:98,CF:98,cf:98,Es:99,ES:99,es:99,Fm:100,FM:100,fm:100,Md:101,MD:101,md:101,No:102,NO:102,no:102,Lr:103,LR:103,lr:103,Rf:104,RF:104,rf:104,Db:105,DB:105,db:105,Sg:106,SG:106,sg:106,Bh:107,BH:107,bh:107,Hs:108,HS:108,hs:108,Mt:109,MT:109,mt:109};var i={0:1.42,1:1.42,3:2.7,4:2.7,6:1.75,7:1.6,8:1.52,11:2.7,12:2.7,13:2.7,14:1.9,15:1.9,16:1.9,17:1.8,19:2.7,20:2.7,21:2.7,22:2.7,23:2.7,24:2.7,25:2.7,26:2.7,27:2.7,28:2.7,29:2.7,30:2.7,31:2.7,33:2.68,37:2.7,38:2.7,39:2.7,40:2.7,41:2.7,42:2.7,43:2.7,44:2.7,45:2.7,46:2.7,47:2.7,48:2.7,49:2.7,50:2.7,55:2.7,56:2.7,57:2.7,58:2.7,59:2.7,60:2.7,61:2.7,62:2.7,63:2.7,64:2.7,65:2.7,66:2.7,67:2.7,68:2.7,69:2.7,70:2.7,71:2.7,72:2.7,73:2.7,74:2.7,75:2.7,76:2.7,77:2.7,78:2.7,79:2.7,80:2.7,81:2.7,82:2.7,83:2.7,87:2.7,88:2.7,89:2.7,90:2.7,91:2.7,92:2.7,93:2.7,94:2.7,95:2.7,96:2.7,97:2.7,98:2.7,99:2.7,100:2.7,101:2.7,102:2.7,103:2.7,104:2.7,105:2.7,106:2.7,107:2.7,108:2.7,109:2.88};var a={0:.8,20:1.31,27:1.3,35:1.3,44:1.05,54:1,60:1.84,72:1.88,84:1.75,85:1.56,86:1.76,98:1.6,99:1.68,100:1.63,112:1.55,113:1.59,114:1.36,129:1.45,144:1.6,170:1.4,180:1.55,202:2.4,222:2.24,224:1.91,225:1.98,243:2.02,269:2,293:1.9,480:2.3,512:2.3,544:2.3,612:2.1,629:1.54,665:1,813:2.6,854:2.27,894:1.93,896:2.1,937:2.05,938:2.06,981:1.62,1258:2.68,1309:2.33,1484:1,1763:2.14,1823:2.48,1882:2.1,1944:1.72,2380:2.34,3367:2.44,3733:2.11,3819:2.6,3821:2.36,4736:2.75,5724:2.73,5959:2.63,6519:2.84,6750:2.87,8991:2.81};var o=2.001;var s=function(){var t=["LI","NA","K","RB","CS","FR","BE","MG","CA","SR","BA","RA","AL","GA","IN","SN","TL","PB","BI","SC","TI","V","CR","MN","FE","CO","NI","CU","ZN","Y","ZR","NB","MO","TC","RU","RH","PD","AG","CD","LA","HF","TA","W","RE","OS","IR","PT","AU","HG","AC","RF","DB","SG","BH","HS","MT","CE","PR","ND","PM","SM","EU","GD","TB","DY","HO","ER","TM","YB","LU","TH","PA","U","NP","PU","AM","CM","BK","CF","ES","FM","MD","NO","LR"];var r=e.Utils.FastSet.create();for(var i=0,a=t;i0?oe:Q<0?H:Math.max(H,f(Q));var ue=s.has(Q);if(J<=se){v(S,B);v(T,X);v(M,G||ue?6:1)}}}var le=e.Utils.DataTable.builder(S.elementCount);le.addRawColumn("atomAIndex",function(e){return new Int32Array(e)},e.Utils.ChunkedArray.compact(S));le.addRawColumn("atomBIndex",function(e){return new Int32Array(e)},e.Utils.ChunkedArray.compact(T));le.addRawColumn("type",function(e){return new Uint8Array(e)},e.Utils.ChunkedArray.compact(M));var ce=le.seal();return ce}function b(e,t,r){if(e.data.bonds.input)return m(e,t);return g(e,t,{maxHbondLength:r&&r.maxHbondLength||1.15,forceCompute:!!(r&&r.forceCompute)})}t.computeBonds=b})(t=e.Structure||(e.Structure={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r=e.Geometry.LinearAlgebra.Matrix4;var n=e.Geometry.LinearAlgebra.Vector4;var i=function(){function e(e){this.info=e;this.temp=r.zero();this.tempV=new Float64Array(4);if(a.Spacegroup[e.spacegroupName]===void 0){throw"'"+e.spacegroupName+"' is not a spacegroup recognized by the library."}this.space=this.getSpace();this.operators=this.getOperators()}Object.defineProperty(e.prototype,"operatorCount",{get:function(){return this.operators.length},enumerable:true,configurable:true});e.prototype.getOperatorMatrix=function(e,t,n,i,a){this.tempV[0]=t;this.tempV[1]=n;this.tempV[2]=i;r.fromTranslation(this.temp,this.tempV);r.mul(a,r.mul(a,r.mul(a,this.space.fromFrac,this.temp),this.operators[e]),this.space.toFrac);return a};e.prototype.getSpace=function(){var e=this.info.toFracTransform,t=r.zero();r.invert(t,e);return{toFrac:e,fromFrac:t,baseX:n.transform(n.zero(),n.fromValues(1,0,0,1),e),baseY:n.transform(n.zero(),n.fromValues(0,1,0,1),e),baseZ:n.transform(n.zero(),n.fromValues(0,0,1,1),e)}};e.getOperator=function(e){var t=a.Transform[e[0]],n=a.Transform[e[1]],i=a.Transform[e[2]];return r.ofRows([t,n,i,[0,0,0,1]])};e.prototype.getOperators=function(){var t=a.Group[a.Spacegroup[this.info.spacegroupName]];return t.map(function(t){return e.getOperator(a.Operator[t])})};return e}();t.Spacegroup=i;var a;(function(e){e.Transform=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[-1,0,0,0],[0,-1,0,0],[0,0,-1,0],[0,1,0,.5],[1,0,0,.5],[-1,0,0,.5],[0,0,1,.5],[0,-1,0,.5],[0,0,-1,.5],[1,0,0,.25],[0,-1,0,.25],[0,0,1,.25],[-1,0,0,.25],[0,1,0,.25],[0,-1,0,.75],[0,0,1,.75],[0,1,0,.75],[1,0,0,.75],[-1,0,0,.75],[0,0,-1,.25],[0,0,-1,.75],[1,-1,0,0],[-1,1,0,0],[0,0,1,.333333333333333],[0,0,1,.666666666666667],[1,0,0,.666666666666667],[0,1,0,.333333333333333],[0,-1,0,.666666666666667],[1,-1,0,.333333333333333],[-1,1,0,.666666666666667],[-1,0,0,.333333333333333],[1,0,0,.333333333333333],[0,1,0,.666666666666667],[0,-1,0,.333333333333333],[1,-1,0,.666666666666667],[-1,1,0,.333333333333333],[-1,0,0,.666666666666667],[0,0,-1,.333333333333333],[0,0,-1,.666666666666667],[0,0,1,.833333333333333],[0,0,1,.166666666666667],[0,0,-1,.833333333333333],[0,0,-1,.166666666666667]];e.Operator=[[0,1,2],[3,4,5],[3,1,5],[3,6,5],[7,6,2],[8,6,5],[0,4,2],[0,4,9],[7,10,2],[7,10,9],[0,10,2],[8,10,5],[3,1,11],[3,6,11],[0,10,9],[8,6,11],[3,4,2],[0,4,5],[3,4,9],[7,10,5],[8,4,9],[8,10,9],[8,10,2],[0,6,9],[3,10,9],[0,10,11],[7,1,9],[8,1,11],[7,4,11],[7,6,9],[7,10,11],[3,10,2],[8,1,5],[0,4,11],[3,1,2],[3,1,9],[7,4,2],[8,1,2],[8,1,9],[3,6,9],[7,4,9],[8,6,2],[8,6,9],[3,6,2],[12,13,14],[15,16,14],[12,17,18],[15,19,18],[20,13,18],[21,16,18],[20,17,14],[21,19,14],[0,1,5],[8,10,11],[7,6,11],[7,6,5],[8,4,2],[7,4,5],[7,1,5],[7,1,11],[0,10,5],[0,1,11],[0,6,11],[0,6,5],[3,10,11],[8,4,11],[15,13,22],[12,16,22],[15,17,23],[12,19,23],[21,13,23],[20,16,23],[21,17,22],[20,19,22],[4,0,2],[1,3,2],[4,0,14],[1,3,18],[4,0,9],[1,3,9],[4,0,18],[1,3,14],[10,7,9],[6,8,9],[4,7,14],[6,3,18],[10,0,18],[1,8,14],[1,3,5],[4,0,5],[6,8,11],[10,7,11],[1,3,11],[4,0,11],[10,7,2],[6,8,2],[3,10,22],[7,1,23],[8,4,23],[0,6,22],[1,0,5],[4,3,5],[1,0,23],[4,3,22],[10,7,14],[6,8,18],[8,6,22],[7,10,23],[4,3,11],[1,0,11],[1,0,22],[4,3,23],[10,7,18],[6,8,14],[8,6,23],[7,10,22],[6,7,11],[10,8,11],[8,1,23],[0,10,22],[3,6,22],[7,4,23],[4,3,2],[1,0,2],[10,8,2],[6,7,2],[4,3,9],[1,0,9],[10,8,9],[6,7,9],[4,8,14],[6,0,18],[10,3,18],[1,7,14],[4,8,18],[6,0,14],[10,3,14],[1,7,18],[6,7,5],[10,8,5],[6,8,5],[10,7,5],[8,1,22],[0,10,23],[3,6,23],[7,4,22],[4,24,2],[25,3,2],[4,24,26],[25,3,27],[4,24,27],[25,3,26],[28,29,26],[30,31,26],[32,33,26],[34,35,27],[36,37,27],[38,39,27],[2,0,1],[1,2,0],[1,25,5],[24,0,5],[39,36,40],[35,38,40],[37,34,40],[33,30,41],[29,32,41],[31,28,41],[5,3,4],[4,5,3],[25,1,5],[0,24,5],[24,4,5],[3,25,5],[4,3,41],[25,1,40],[24,4,41],[3,25,40],[4,3,40],[25,1,41],[24,4,40],[3,25,41],[35,34,40],[37,36,40],[39,38,40],[29,28,41],[31,30,41],[33,32,41],[3,5,4],[5,4,3],[25,1,2],[0,24,2],[24,4,2],[3,25,2],[25,1,9],[0,24,9],[24,4,9],[3,25,9],[30,33,26],[32,29,26],[28,31,26],[36,39,27],[38,35,27],[34,37,27],[0,2,1],[2,1,0],[30,33,42],[32,29,42],[28,31,42],[36,39,43],[38,35,43],[34,37,43],[7,9,6],[9,6,7],[25,1,11],[0,24,11],[24,4,11],[3,25,11],[35,34,44],[37,36,44],[39,38,44],[29,28,45],[31,30,45],[33,32,45],[8,11,10],[11,10,8],[1,25,2],[24,0,2],[1,25,42],[24,0,43],[1,25,43],[24,0,42],[1,25,27],[24,0,26],[1,25,26],[24,0,27],[1,25,9],[24,0,9],[4,24,5],[25,3,5],[4,24,11],[25,3,11],[1,0,40],[4,3,44],[0,24,45],[1,0,41],[4,3,45],[0,24,44],[0,24,40],[0,24,41],[2,3,4],[5,3,1],[5,0,4],[4,2,3],[1,5,3],[4,5,0],[2,7,6],[2,8,10],[5,8,6],[5,7,10],[1,9,7],[4,9,8],[1,11,8],[4,11,7],[9,0,6],[9,3,10],[11,3,6],[11,0,10],[6,2,7],[10,2,8],[6,5,8],[10,5,7],[9,7,1],[9,8,4],[11,8,1],[11,7,4],[6,9,0],[10,9,3],[6,11,3],[10,11,0],[9,7,6],[9,8,10],[11,8,6],[11,7,10],[6,9,7],[10,9,8],[6,11,8],[10,11,7],[2,3,10],[5,8,1],[11,0,4],[10,2,3],[1,5,8],[4,11,0],[5,0,1],[2,0,4],[2,3,1],[1,5,0],[4,2,0],[1,2,3],[11,8,10],[11,7,6],[9,7,10],[9,8,6],[10,11,8],[6,11,7],[10,9,7],[6,9,8],[5,8,10],[5,7,6],[2,7,10],[2,8,6],[4,11,8],[1,11,7],[4,9,7],[1,9,8],[11,3,10],[11,0,6],[9,0,10],[9,3,6],[10,5,8],[6,5,7],[10,2,7],[6,2,8],[11,8,4],[11,7,1],[9,7,4],[9,8,1],[10,11,3],[6,11,0],[10,9,0],[6,9,3],[22,15,13],[22,12,16],[14,12,13],[14,15,16],[13,22,15],[16,22,12],[13,14,12],[16,14,15],[22,21,17],[22,20,19],[14,20,17],[14,21,19],[13,23,21],[16,23,20],[13,18,20],[16,18,21],[23,15,17],[23,12,19],[18,12,17],[18,15,19],[17,22,21],[19,22,20],[17,14,20],[19,14,21],[23,21,13],[23,20,16],[18,20,13],[18,21,16],[17,23,15],[19,23,12],[17,18,12],[19,18,15],[5,0,6],[2,7,4],[9,3,1],[6,5,0],[4,2,7],[1,9,3],[0,2,4],[3,2,1],[0,5,1],[2,1,3],[2,4,0],[5,1,0],[7,9,10],[8,9,6],[7,11,6],[9,6,8],[9,10,7],[11,6,7],[1,7,11],[4,8,11],[1,8,9],[4,7,9],[0,9,10],[3,9,6],[3,11,10],[0,11,6],[2,6,8],[2,10,7],[5,6,7],[5,10,8],[6,0,11],[10,3,11],[6,3,9],[10,0,9],[7,2,10],[8,2,6],[8,5,10],[7,5,6],[9,1,8],[9,4,7],[11,1,7],[11,4,8],[7,9,4],[8,9,1],[8,11,4],[7,11,1],[9,6,3],[9,10,0],[11,6,0],[11,10,3],[19,12,23],[13,15,22],[16,21,18],[17,20,14],[20,14,17],[21,18,16],[15,22,13],[12,23,19],[18,16,21],[14,17,20],[23,19,12],[22,13,15],[19,20,22],[13,21,23],[16,15,14],[17,12,18],[20,18,13],[21,14,19],[15,23,17],[12,22,16],[18,19,15],[14,13,12],[23,16,20],[22,17,21],[16,12,22],[17,15,23],[19,21,14],[13,20,18],[12,14,13],[15,18,19],[21,22,17],[20,23,16],[14,16,15],[18,17,12],[22,19,20],[23,13,21],[16,20,23],[17,21,22],[19,15,18],[13,12,14],[12,18,17],[15,14,16],[21,23,13],[20,22,19],[14,19,21],[18,13,20],[22,16,12],[23,17,15],[19,12,22],[17,21,23],[16,15,18],[13,20,14],[20,14,13],[15,18,16],[21,23,17],[12,22,19],[18,16,15],[14,13,20],[22,19,12],[23,17,21],[3,2,4],[3,5,1],[0,5,4],[2,4,3],[5,1,3],[5,4,0],[1,7,9],[4,8,9],[1,8,11],[4,7,11],[0,9,6],[3,9,10],[3,11,6],[0,11,10],[2,6,7],[2,10,8],[5,6,8],[5,10,7],[6,0,9],[10,3,9],[6,3,11],[10,0,11],[7,2,6],[8,2,10],[8,5,6],[7,5,10],[9,1,7],[9,4,8],[11,1,8],[11,4,7],[7,9,1],[8,9,4],[8,11,1],[7,11,4],[9,6,0],[9,10,3],[11,6,3],[11,10,0],[8,9,10],[8,11,6],[7,11,10],[9,10,8],[11,6,8],[11,10,7],[6,0,2],[10,3,2],[6,3,5],[10,0,5],[7,2,1],[8,2,4],[8,5,1],[7,5,4],[9,1,0],[9,4,3],[11,1,3],[11,4,0],[1,7,2],[4,8,2],[1,8,5],[4,7,5],[0,9,1],[3,9,4],[3,11,1],[0,11,4],[2,6,0],[2,10,3],[5,6,3],[5,10,0],[0,2,6],[3,2,10],[3,5,6],[0,5,10],[2,1,7],[2,4,8],[5,1,8],[5,4,7],[16,12,14],[13,21,18],[19,15,23],[17,20,22],[12,14,16],[21,18,13],[15,23,19],[20,22,17],[14,16,12],[18,13,21],[23,19,15],[22,17,20],[19,20,18],[17,15,14],[16,21,22],[13,12,23],[20,18,19],[15,14,17],[21,22,16],[12,23,13],[18,19,20],[14,17,15],[22,16,21],[23,13,12],[6,0,5],[10,3,5],[6,3,2],[10,0,2],[7,2,4],[8,2,1],[8,5,4],[7,5,1],[9,1,3],[9,4,0],[11,1,0],[11,4,3],[1,7,5],[4,8,5],[1,8,2],[4,7,2],[0,9,4],[3,9,1],[3,11,4],[0,11,1],[2,6,3],[2,10,0],[5,6,0],[5,10,3],[0,2,10],[3,2,6],[3,5,10],[0,5,6],[2,1,8],[2,4,7],[5,1,7],[5,4,8],[21,17,23],[20,16,22],[12,13,18],[15,19,14],[23,21,17],[22,20,16],[18,12,13],[14,15,19],[17,23,21],[16,22,20],[13,18,12],[19,14,15],[21,13,22],[20,19,23],[12,17,14],[15,16,18],[23,15,13],[22,12,19],[18,20,17],[14,21,16],[17,22,15],[16,23,12],[13,14,20],[19,18,21],[15,17,22],[12,16,23],[20,13,14],[21,19,18],[22,21,13],[23,20,19],[14,12,17],[18,15,16],[13,23,15],[19,22,12],[17,18,20],[16,14,21],[15,13,23],[12,19,22],[20,17,18],[21,16,14],[22,15,17],[23,12,16],[14,20,13],[18,21,19],[13,22,21],[19,23,20],[17,14,12],[16,18,15],[6,5,3],[4,9,3],[9,3,4],[5,7,4],[4,5,7],[5,3,6]];e.Group=[[0],[0,1],[0,2],[0,3],[0,2,4,5],[0,6],[0,7],[0,6,4,8],[0,7,4,9],[0,6,2,1],[0,3,1,10],[0,6,2,1,4,8,5,11],[0,12,1,7],[0,1,13,14],[0,12,1,7,4,15,11,9],[0,16,2,17],[0,18,12,17],[0,16,5,19],[0,20,13,19],[0,18,12,17,4,21,15,19],[0,16,2,17,4,22,5,19],[0,16,2,17,23,24,13,25,26,20,27,28,4,22,5,19],[0,16,17,2,29,21,30,15],[0,20,13,19,29,31,32,33],[0,16,6,34],[0,18,7,34],[0,16,7,35],[0,16,36,37],[0,18,36,38],[0,16,14,39],[0,20,40,34],[0,16,8,41],[0,18,8,42],[0,16,9,42],[0,16,6,34,4,22,8,41],[0,18,7,34,4,21,9,41],[0,16,7,35,4,22,9,42],[0,16,6,34,23,24,14,39],[0,16,10,43,23,24,7,35],[0,16,36,37,23,24,9,42],[0,16,8,41,23,24,40,38],[0,16,6,34,23,24,14,39,26,20,40,38,4,22,8,41],[0,16,44,45,23,24,46,47,26,20,48,49,4,22,50,51],[0,16,6,34,29,21,9,42],[0,16,8,41,29,21,7,35],[0,16,36,37,29,21,14,39],[0,16,2,17,1,52,6,34],[0,16,2,17,53,54,9,42],[0,16,12,33,1,52,7,35],[0,16,2,17,11,55,8,41],[0,56,2,57,1,58,6,37],[0,56,15,25,1,58,9,39],[0,20,27,17,1,59,40,34],[0,56,12,28,1,58,7,38],[0,16,5,19,1,52,8,41],[0,22,13,28,1,55,14,38],[0,18,13,60,1,61,14,43],[0,16,15,30,1,52,9,42],[0,16,5,19,11,55,6,34],[0,21,12,19,1,54,7,41],[0,20,13,19,1,59,14,41],[0,20,3,30,1,59,10,42],[0,18,12,17,1,61,7,34,4,21,15,19,11,54,9,41],[0,24,13,17,1,62,14,34,4,20,27,19,11,59,40,41],[0,16,2,17,1,52,6,34,4,22,5,19,11,55,8,41],[0,16,12,33,1,52,7,35,4,22,15,30,11,55,9,42],[0,31,3,17,1,63,10,34,4,56,32,19,11,58,36,41],[0,22,2,19,64,59,14,38,4,16,5,17,65,62,40,39],[0,16,2,17,1,52,6,34,23,24,13,25,64,62,14,39,26,20,27,28,65,59,40,38,4,22,5,19,11,55,8,41],[0,16,2,17,66,67,44,45,23,24,13,25,68,69,46,47,26,20,27,28,70,71,48,49,4,22,5,19,72,73,50,51],[0,16,2,17,1,52,6,34,29,21,15,30,53,54,9,42],[0,16,5,19,1,52,8,41,29,21,12,33,53,54,7,35],[0,20,13,19,1,59,14,41,29,31,32,33,53,63,36,35],[0,31,3,17,1,63,10,34,29,20,27,30,53,59,40,42],[0,16,74,75],[0,18,76,77],[0,16,78,79],[0,18,80,81],[0,16,74,75,29,21,82,83],[0,21,84,85,29,16,86,87],[0,16,88,89],[0,16,88,89,29,21,90,91],[0,16,74,75,1,52,88,89],[0,16,78,79,1,52,92,93],[0,16,94,95,11,55,88,89],[0,16,82,83,53,54,88,89],[0,16,74,75,1,52,88,89,29,21,82,83,53,54,90,91],[0,21,84,85,96,97,88,91,29,16,86,87,98,99,90,89],[0,16,74,75,2,17,100,101],[0,16,94,95,5,19,100,101],[0,18,76,77,2,33,102,103],[0,18,104,105,106,107,100,108],[0,16,78,79,2,17,109,108],[0,16,82,83,15,30,100,101],[0,18,80,81,2,33,110,111],[0,18,112,113,114,115,100,108],[0,16,74,75,2,17,100,101,29,21,82,83,15,30,116,117],[0,21,84,85,118,119,116,101,29,16,86,87,120,121,100,117],[0,16,74,75,6,34,122,123],[0,16,74,75,8,41,124,125],[0,16,78,79,7,35,122,123],[0,16,82,83,9,42,122,123],[0,16,74,75,7,35,126,127],[0,16,74,75,9,42,128,129],[0,16,78,79,6,34,126,127],[0,16,78,79,8,41,128,129],[0,16,74,75,6,34,122,123,29,21,82,83,9,42,128,129],[0,16,74,75,7,35,126,127,29,21,82,83,8,41,124,125],[0,21,84,85,6,42,130,131,29,16,86,87,9,34,132,133],[0,21,84,85,7,41,134,135,29,16,86,87,8,35,136,137],[0,16,89,88,2,17,122,123],[0,16,89,88,12,33,126,127],[0,16,89,88,5,19,124,125],[0,16,89,88,15,30,128,129],[0,16,88,89,6,34,100,101],[0,16,89,88,7,35,109,108],[0,16,89,88,8,41,138,139],[0,16,89,88,9,42,116,117],[0,16,89,88,6,34,100,101,29,21,91,90,9,42,116,117],[0,16,89,88,7,35,109,108,29,21,91,90,8,41,138,139],[0,16,89,88,2,17,122,123,29,21,91,90,15,30,128,129],[0,16,89,88,118,121,132,131,29,21,91,90,120,119,130,133],[0,16,74,75,2,17,100,101,1,52,88,89,6,34,122,123],[0,16,74,75,12,33,109,108,1,52,88,89,7,35,126,127],[0,16,74,75,2,17,100,101,11,55,140,141,8,41,124,125],[0,16,74,75,2,17,100,101,53,54,90,91,9,42,128,129],[0,16,74,75,5,19,138,139,1,52,88,89,8,41,124,125],[0,16,74,75,15,30,116,117,1,52,88,89,9,42,128,129],[0,16,94,95,5,19,100,101,11,55,88,89,6,34,124,125],[0,16,94,95,15,30,109,108,11,55,88,89,7,35,128,129],[0,16,78,79,2,17,109,108,1,52,92,93,6,34,126,127],[0,16,78,79,12,33,100,101,1,52,92,93,7,35,122,123],[0,16,82,83,12,33,138,139,53,54,88,89,8,41,126,127],[0,16,82,83,2,17,116,117,53,54,88,89,9,42,122,123],[0,16,78,79,5,19,116,117,1,52,92,93,8,41,128,129],[0,16,82,83,15,30,100,101,1,52,90,91,9,42,122,123],[0,16,82,83,15,30,100,101,53,54,88,89,6,34,128,129],[0,16,82,83,5,19,109,108,53,54,88,89,7,35,124,125],[0,16,74,75,2,17,100,101,1,52,88,89,6,34,122,123,29,21,82,83,15,30,116,117,53,54,90,91,9,42,128,129],[0,16,74,75,12,33,109,108,1,52,88,89,7,35,126,127,29,21,82,83,5,19,138,139,53,54,90,91,8,41,124,125],[0,21,84,85,118,119,116,101,96,97,88,91,9,34,132,133,29,16,86,87,120,121,100,117,98,99,90,89,6,42,130,131],[0,21,84,85,142,143,138,108,96,97,88,91,8,35,136,137,29,16,86,87,144,145,109,139,98,99,90,89,7,41,134,135],[0,146,147],[0,148,149],[0,150,151],[0,146,147,152,153,154,155,156,157],[0,158,159],[0,146,147,1,160,161],[0,146,147,1,160,161,152,153,154,162,163,164,155,156,157,165,166,167],[0,158,159,1,168,169],[0,146,147,101,170,171],[0,146,147,100,172,173],[0,148,149,174,175,171],[0,148,149,100,176,177],[0,150,151,178,179,171],[0,150,151,100,180,181],[0,146,147,100,172,173,152,153,154,182,183,184,155,156,157,185,186,187],[0,158,159,101,188,189],[0,146,147,122,190,191],[0,146,147,123,192,193],[0,146,147,126,194,195],[0,146,147,127,196,197],[0,146,147,122,190,191,152,153,154,198,199,200,155,156,157,201,202,203],[0,158,159,123,204,205],[0,146,147,126,194,195,152,153,154,206,207,208,155,156,157,209,210,211],[0,158,159,129,212,213],[0,146,147,101,170,171,1,160,161,123,192,193],[0,146,147,108,214,215,1,160,161,127,196,197],[0,146,147,100,172,173,1,160,161,122,190,191],[0,146,147,109,216,217,1,160,161,126,194,195],[0,146,147,100,172,173,1,160,161,122,190,191,152,153,154,182,183,184,162,163,164,198,199,200,155,156,157,185,186,187,165,166,167,201,202,203],[0,158,159,101,188,189,1,168,169,123,204,205],[0,146,147,109,216,217,1,160,161,126,194,195,152,153,154,218,219,220,162,163,164,206,207,208,155,156,157,221,222,223,165,166,167,209,210,211],[0,158,159,117,224,225,1,168,169,129,212,213],[0,146,147,16,226,227],[0,148,149,18,228,229],[0,150,151,18,230,231],[0,150,151,16,232,233],[0,148,149,16,234,235],[0,146,147,18,236,237],[0,146,147,52,238,239],[0,146,147,16,226,227,1,160,161,52,238,239],[0,146,147,18,236,237,1,160,161,61,240,241],[0,146,147,16,226,227,100,172,173,101,170,171],[0,148,149,18,228,229,242,172,181,243,214,244],[0,150,151,18,230,231,245,172,177,246,214,247],[0,150,151,16,232,233,245,172,177,174,170,248],[0,148,149,16,234,235,242,172,181,178,170,249],[0,146,147,18,236,237,100,172,173,108,214,215],[0,146,147,16,226,227,122,190,191,123,192,193],[0,146,147,16,226,227,126,194,195,127,196,197],[0,146,147,18,236,237,126,194,195,123,192,193],[0,146,147,18,236,237,122,190,191,127,196,197],[0,146,147,52,238,239,122,190,191,101,170,171],[0,146,147,61,240,241,126,194,195,101,170,171],[0,146,147,52,238,239,100,172,173,123,192,193],[0,146,147,61,240,241,100,172,173,127,196,197],[0,146,147,16,226,227,100,172,173,101,170,171,1,160,161,52,239,238,122,190,191,123,192,193],[0,146,147,16,226,227,109,216,217,108,214,215,1,160,161,52,239,238,126,194,195,127,196,197],[0,146,147,18,236,237,109,216,217,101,170,171,1,160,161,61,241,240,126,194,195,123,192,193],[0,146,147,18,236,237,100,172,173,108,214,215,1,160,161,61,241,240,122,190,191,127,196,197],[0,16,2,17,158,250,251,252,159,253,254,255],[0,16,2,17,158,250,251,252,159,253,254,255,23,24,13,25,256,257,258,259,260,261,262,263,26,20,27,28,264,265,266,267,268,269,270,271,4,22,5,19,272,273,274,275,276,277,278,279],[0,16,2,17,158,250,251,252,159,253,254,255,29,21,15,30,280,281,282,283,284,285,286,287],[0,20,13,19,158,273,266,259,159,261,278,271],[0,20,13,19,158,273,266,259,159,261,278,271,29,31,32,33,280,288,289,290,284,291,292,293],[0,16,2,17,158,250,251,252,159,253,254,255,1,52,6,34,168,294,295,296,169,297,298,299],[0,16,2,17,158,250,251,252,159,253,254,255,53,54,9,42,300,301,302,303,304,305,306,307],[0,16,2,17,158,250,251,252,159,253,254,255,1,52,6,34,168,294,295,296,169,297,298,299,23,24,13,25,256,257,258,259,260,261,262,263,64,62,14,39,308,309,310,311,312,313,314,315,26,20,27,28,264,265,266,267,268,269,270,271,65,59,40,38,316,317,318,319,320,321,322,323,4,22,5,19,272,273,274,275,276,277,278,279,11,55,8,41,324,325,326,327,328,329,330,331],[0,16,2,17,158,250,251,252,159,253,254,255,66,67,44,45,332,333,334,335,336,337,338,339,23,24,13,25,256,257,258,259,260,261,262,263,68,69,46,47,340,341,342,343,344,345,346,347,26,20,27,28,264,265,266,267,268,269,270,271,70,71,48,49,348,349,350,351,352,353,354,355,4,22,5,19,272,273,274,275,276,277,278,279,72,73,50,51,356,357,358,359,360,361,362,363],[0,16,2,17,158,250,251,252,159,253,254,255,1,52,6,34,168,294,295,296,169,297,298,299,29,21,15,30,280,281,282,283,284,285,286,287,53,54,9,42,300,301,302,303,304,305,306,307],[0,20,13,19,158,273,266,259,159,261,278,271,1,59,14,41,168,325,318,311,169,313,330,323],[0,20,13,19,158,273,266,259,159,261,278,271,1,59,14,41,168,325,318,311,169,313,330,323,29,31,32,33,280,288,289,290,284,291,292,293,53,63,36,35,300,364,365,366,304,367,368,369],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,23,24,13,25,256,257,258,259,260,261,262,263,382,383,384,385,386,387,388,389,390,391,392,393,26,20,27,28,264,265,266,267,268,269,270,271,394,395,396,397,398,399,400,401,402,403,404,405,4,22,5,19,272,273,274,275,276,277,278,279,138,139,95,94,406,407,408,409,410,411,412,413],[0,24,5,28,158,265,258,275,159,277,270,263,414,415,416,417,418,419,420,421,422,423,424,425,23,16,27,19,256,273,251,267,260,269,278,255,426,427,428,429,430,431,432,433,434,435,436,437,26,22,13,17,264,250,274,259,268,261,254,279,438,439,440,441,442,443,444,445,446,447,448,449,4,20,2,25,272,257,266,252,276,253,262,271,450,451,452,453,454,455,456,457,458,459,460,461],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,29,21,15,30,280,281,282,283,284,285,286,287,116,117,83,82,376,377,224,378,379,380,381,225],[0,20,13,19,158,273,266,259,159,261,278,271,450,415,440,429,454,431,420,445,458,447,436,425],[0,20,13,19,158,273,266,259,159,261,278,271,462,463,464,465,466,467,468,469,470,471,472,473],[0,20,13,19,158,273,266,259,159,261,278,271,462,463,464,465,466,467,468,469,470,471,472,473,29,31,32,33,280,288,289,290,284,291,292,293,450,415,440,429,454,431,420,445,458,447,436,425],[0,16,2,17,158,250,251,252,159,253,254,255,123,122,88,89,204,474,475,476,205,477,478,479],[0,16,2,17,158,250,251,252,159,253,254,255,123,122,88,89,204,474,475,476,205,477,478,479,23,24,13,25,256,257,258,259,260,261,262,263,480,481,482,483,484,485,486,487,488,489,490,491,26,20,27,28,264,265,266,267,268,269,270,271,492,493,494,495,496,497,498,499,500,501,502,503,4,22,5,19,272,273,274,275,276,277,278,279,125,124,140,141,504,505,506,507,508,509,510,511],[0,16,2,17,158,250,251,252,159,253,254,255,123,122,88,89,204,474,475,476,205,477,478,479,29,21,15,30,280,281,282,283,284,285,286,287,129,128,90,91,212,512,513,514,213,515,516,517],[0,16,2,17,158,250,251,252,159,253,254,255,129,128,90,91,212,512,513,514,213,515,516,517],[0,16,2,17,158,250,251,252,159,253,254,255,129,128,90,91,212,512,513,514,213,515,516,517,23,24,13,25,256,257,258,259,260,261,262,263,518,519,520,521,522,523,524,525,526,527,528,529,26,20,27,28,264,265,266,267,268,269,270,271,530,531,532,533,534,535,536,537,538,539,540,541,4,22,5,19,272,273,274,275,276,277,278,279,127,126,92,93,542,543,544,545,546,547,548,549],[0,20,13,19,158,273,266,259,159,261,278,271,550,551,552,553,554,555,556,557,558,559,560,561,29,31,32,33,280,288,289,290,284,291,292,293,562,563,564,565,566,567,568,569,570,571,572,573],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,1,52,6,34,168,294,295,296,169,297,298,299,122,123,89,88,475,476,204,474,479,478,477,205],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,53,54,9,42,300,301,302,303,304,305,306,307,128,129,91,90,513,514,212,512,517,516,515,213],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225,1,52,6,34,168,294,295,296,169,297,298,299,128,129,91,90,513,514,212,512,517,516,515,213],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225,53,54,9,42,300,301,302,303,304,305,306,307,122,123,89,88,475,476,204,474,479,478,477,205],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,1,52,6,34,168,294,295,296,169,297,298,299,122,123,89,88,475,476,204,474,479,478,477,205,23,24,13,25,256,257,258,259,260,261,262,263,382,383,384,385,386,387,388,389,390,391,392,393,64,62,14,39,308,309,310,311,312,313,314,315,481,480,483,482,486,487,484,485,491,490,489,488,26,20,27,28,264,265,266,267,268,269,270,271,394,395,396,397,398,399,400,401,402,403,404,405,65,59,40,38,316,317,318,319,320,321,322,323,493,492,495,494,498,499,496,497,503,502,501,500,4,22,5,19,272,273,274,275,276,277,278,279,138,139,95,94,406,407,408,409,410,411,412,413,11,55,8,41,324,325,326,327,328,329,330,331,124,125,141,140,506,507,504,505,511,510,509,508],[0,16,2,17,158,250,251,252,159,253,254,255,116,117,83,82,376,377,224,378,379,380,381,225,1,52,6,34,168,294,295,296,169,297,298,299,128,129,91,90,513,514,212,512,517,516,515,213,23,24,13,25,256,257,258,259,260,261,262,263,574,575,576,577,578,579,580,581,582,583,584,585,64,62,14,39,308,309,310,311,312,313,314,315,519,518,521,520,524,525,522,523,529,528,527,526,26,20,27,28,264,265,266,267,268,269,270,271,586,587,588,589,590,591,592,593,594,595,596,597,65,59,40,38,316,317,318,319,320,321,322,323,531,530,533,532,536,537,534,535,541,540,539,538,4,22,5,19,272,273,274,275,276,277,278,279,109,108,79,78,598,599,600,601,602,603,604,605,11,55,8,41,324,325,326,327,328,329,330,331,126,127,93,92,544,545,542,543,549,548,547,546],[0,24,5,28,158,265,258,275,159,277,270,263,414,415,416,417,418,419,420,421,422,423,424,425,66,69,50,49,332,349,342,359,336,361,354,347,493,123,483,140,498,507,204,485,503,490,509,205,23,16,27,19,256,273,251,267,260,269,278,255,426,427,428,429,430,431,432,433,434,435,436,437,68,67,48,51,340,357,334,351,344,353,362,339,124,480,89,494,506,499,484,474,511,478,501,488,26,22,13,17,264,250,274,259,268,261,254,279,438,439,440,441,442,443,444,445,446,447,448,449,70,73,46,45,348,333,358,343,352,345,338,363,122,492,141,482,475,487,496,505,479,510,489,500,4,20,2,25,272,257,266,252,276,253,262,271,450,451,452,453,454,455,456,457,458,459,460,461,72,71,44,47,356,341,350,335,360,337,346,355,481,125,495,88,486,476,504,497,491,502,477,508],[0,24,5,28,158,265,258,275,159,277,270,263,414,415,416,417,418,419,420,421,422,423,424,425,606,607,608,609,610,611,612,613,614,615,616,617,531,129,521,92,536,545,212,523,541,528,547,213,23,16,27,19,256,273,251,267,260,269,278,255,426,427,428,429,430,431,432,433,434,435,436,437,618,619,620,621,622,623,624,625,626,627,628,629,126,518,91,532,544,537,522,512,549,516,539,526,26,22,13,17,264,250,274,259,268,261,254,279,438,439,440,441,442,443,444,445,446,447,448,449,630,631,632,633,634,635,636,637,638,639,640,641,128,530,93,520,513,525,534,543,517,548,527,538,4,20,2,25,272,257,266,252,276,253,262,271,450,451,452,453,454,455,456,457,458,459,460,461,642,643,644,645,646,647,648,649,650,651,652,653,519,127,533,90,524,514,542,535,529,540,515,546],[0,16,2,17,158,250,251,252,159,253,254,255,100,101,75,74,370,371,188,372,373,374,375,189,1,52,6,34,168,294,295,296,169,297,298,299,122,123,89,88,475,476,204,474,479,478,477,205,29,21,15,30,280,281,282,283,284,285,286,287,116,117,83,82,376,377,224,378,379,380,381,225,53,54,9,42,300,301,302,303,304,305,306,307,128,129,91,90,513,514,212,512,517,516,515,213],[0,20,13,19,158,273,266,259,159,261,278,271,462,463,464,465,466,467,468,469,470,471,472,473,1,59,14,41,168,325,318,311,169,313,330,323,551,550,553,552,556,557,554,555,561,560,559,558,29,31,32,33,280,288,289,290,284,291,292,293,450,415,440,429,454,431,420,445,458,447,436,425,53,63,36,35,300,364,365,366,304,367,368,369,563,562,565,564,568,569,566,567,573,572,571,570],[0,16],[0,18],[0,16,26,20],[0,2,23,13],[0,3,4,32],[0,2,29,15],[0,3,29,27],[0,52],[0,63],[0,52,26,59],[0,63,26,54],[0,52,16,1],[0,18,1,61],[0,52,16,1,26,59,20,65],[0,31,1,63],[0,1,24,62],[0,31,1,63,26,21,65,54],[0,2,57,56],[0,60,3,16],[0,22,57,3],[0,2,28,20],[0,17,13,24],[0,20,19,13,4,24,17,27],[0,22,57,3,4,16,60,32],[0,22,57,3,23,20,30,12,26,24,33,15,4,16,60,32],[0,22,57,3,29,18,27,25],[0,22,3,57,1,55,10,37],[0,22,385,396,3,57,109,117],[0,22,57,3,159,279,654,655,158,274,656,657,29,18,25,27,284,658,262,269,280,659,257,267]];e.Spacegroup={"P 1":0,"P -1":1,"P 1 2 1":2,"P 1 21 1":3,"C 1 2 1":4,"P 1 m 1":5,"P 1 c 1":6,"C 1 m 1":7,"C 1 c 1":8,"P 1 2/m 1":9,"P 1 21/m 1":10,"C 1 2/m 1":11,"P 1 2/c 1":12,"P 1 21/c 1":13,"C 1 2/c 1":14,"P 2 2 2":15,"P 2 2 21":16,"P 21 21 2":17,"P 21 21 21":18,"C 2 2 21":19,"C 2 2 2":20,"F 2 2 2":21,"I 2 2 2":22,"I 21 21 21":23,"P m m 2":24,"P m c 21":25,"P c c 2":26,"P m a 2":27,"P c a 21":28,"P n c 2":29,"P m n 21":30,"P b a 2":31,"P n a 21":32,"P n n 2":33,"C m m 2":34,"C m c 21":35,"C c c 2":36,"A m m 2":37,"A b m 2":38,"A m a 2":39,"A b a 2":40,"F m m 2":41,"F d d 2":42,"I m m 2":43,"I b a 2":44,"I m a 2":45,"P 2/m 2/m 2/m":46,"P m m m":46,"P 2/n 2/n 2/n":47,"P n n n":47,"P 2/c 2/c 2/m":48,"P c c m":48,"P 2/b 2/a 2/n":49,"P b a n":49,"P 21/m 2/m 2/a":50,"P m m a":50,"P 2/n 21/n 2/a":51,"P n n a":51,"P 2/m 2/n 21/a":52,"P m n a":52,"P 21/c 2/c 2/a":53,"P c c a":53,"P 21/b 21/a 2/m":54,"P b a m":54,"P 21/c 21/c 2/n":55,"P c c n":55,"P 2/b 21/c 21/m":56,"P b c m":56,"P 21/n 21/n 2/m":57,"P n n m":57,"P 21/m 21/m 2/n":58,"P m m n":58,"P 21/b 2/c 21/n":59,"P b c n":59,"P 21/b 21/c 21/a":60,"P b c a":60,"P 21/n 21/m 21/a":61,"P n m a":61,"C 2/m 2/c 21/m":62,"C m c m":62,"C 2/m 2/c 21/a":63,"C m c a":63,"C 2/m 2/m 2/m":64,"C m m m":64,"C 2/c 2/c 2/m":65,"C c c m":65,"C 2/m 2/m 2/a":66,"C m m a":66,"C 2/c 2/c 2/a":67,"C c c a":67,"F 2/m 2/m 2/m":68,"F m m m":68,"F 2/d 2/d 2/d":69,"F d d d":69,"I 2/m 2/m 2/m":70,"I m m m":70,"I 2/b 2/a 2/m":71,"I b a m":71,"I 21/b 21/c 21/a":72,"I b c a":72,"I 21/m 21/m 21/a":73,"I m m a":73,"P 4":74,"P 41":75,"P 42":76,"P 43":77,"I 4":78,"I 41":79,"P -4":80,"I -4":81,"P 4/m":82,"P 42/m":83,"P 4/n":84,"P 42/n":85,"I 4/m":86,"I 41/a":87,"P 4 2 2":88,"P 4 21 2":89,"P 41 2 2":90,"P 41 21 2":91,"P 42 2 2":92,"P 42 21 2":93,"P 43 2 2":94,"P 43 21 2":95,"I 4 2 2":96,"I 41 2 2":97,"P 4 m m":98,"P 4 b m":99,"P 42 c m":100,"P 42 n m":101,"P 4 c c":102,"P 4 n c":103,"P 42 m c":104,"P 42 b c":105,"I 4 m m":106,"I 4 c m":107,"I 41 m d":108,"I 41 c d":109,"P -4 2 m":110,"P -4 2 c":111,"P -4 21 m":112,"P -4 21 c":113,"P -4 m 2":114,"P -4 c 2":115,"P -4 b 2":116,"P -4 n 2":117,"I -4 m 2":118,"I -4 c 2":119,"I -4 2 m":120,"I -4 2 d":121,"P 4/m 2/m 2/m":122,"P4/m m m":122,"P 4/m 2/c 2/c":123,"P4/m c c":123,"P 4/n 2/b 2/m":124,"P4/n b m":124,"P 4/n 2/n 2/c":125,"P4/n n c":125,"P 4/m 21/b 2/m":126,"P4/m b m":126,"P 4/m 21/n 2/c":127,"P4/m n c":127,"P 4/n 21/m 2/m":128,"P4/n m m":128,"P 4/n 2/c 2/c":129,"P4/n c c":129,"P 42/m 2/m 2/c":130,"P42/m m c":130,"P 42/m 2/c 2/m":131,"P42/m c m":131,"P 42/n 2/b 2/c":132,"P42/n b c":132,"P 42/n 2/n 2/m":133,"P42/n n m":133,"P 42/m 21/b 2/c":134,"P42/m b c":134,"P 42/m 21/n 2/m":135,"P42/m n m":135,"P 42/n 21/m 2/c":136,"P42/n m c":136,"P 42/n 21/c 2/m":137,"P42/n c m":137,"I 4/m 2/m 2/m":138,"I4/m m m":138,"I 4/m 2/c 2/m":139,"I4/m c m":139,"I 41/a 2/m 2/d":140,"I41/a m d":140,"I 41/a 2/c 2/d":141,"I41/a c d":141,"P 3":142,"P 31":143,"P 32":144,"H 3":145,"R 3":146,"P -3":147,"H -3":148,"R -3":149,"P 3 1 2":150,"P 3 2 1":151,"P 31 1 2":152,"P 31 2 1":153,"P 32 1 2":154,"P 32 2 1":155,"H 3 2":156,"R 3 2":157,"P 3 m 1":158,"P 3 1 m":159,"P 3 c 1":160,"P 3 1 c":161,"H 3 m":162,"R 3 m":163,"H 3 c":164,"R 3 c":165,"P -3 1 2/m":166,"P -3 1 m":166,"P -3 1 2/c":167,"P -3 1 c":167,"P -3 2/m 1":168,"P -3 m 1":168,"P -3 2/c 1":169,"P -3 c 1":169,"H -3 2/m":170,"H -3 m":170,"R -3 2/m":171,"R -3 m":171,"H -3 2/c":172,"H -3 c":172,"R -3 2/c":173,"R -3 c":173,"P 6":174,"P 61":175,"P 65":176,"P 62":177,"P 64":178,"P 63":179,"P -6":180,"P 6/m":181,"P 63/m":182,"P 6 2 2":183,"P 61 2 2":184,"P 65 2 2":185,"P 62 2 2":186,"P 64 2 2":187,"P 63 2 2":188,"P 6 m m":189,"P 6 c c":190,"P 63 c m":191,"P 63 m c":192,"P -6 m 2":193,"P -6 c 2":194,"P -6 2 m":195,"P -6 2 c":196,"P 6/m 2/m 2/m":197,"P 6/m m m":197,"P 6/m 2/c 2/c":198,"P 6/m c c":198,"P 63/m 2/c 2/m":199,"P 63/m c m":199,"P 63/m 2/m 2/c":200,"P 63/m m c":200,"P 2 3":201,"F 2 3":202,"I 2 3":203,"P 21 3":204,"I 21 3":205,"P 2/m -3":206,"P m -3":206,"P 2/n -3":207,"P n -3":207,"F 2/m -3":208,"F m -3":208,"F 2/d -3":209,"F d -3":209,"I 2/m -3":210,"I m -3":210,"P 21/a -3":211,"P a -3":211,"I 21/a -3":212,"I a -3":212,"P 4 3 2":213,"P 42 3 2":214,"F 4 3 2":215,"F 41 3 2":216,"I 4 3 2":217,"P 43 3 2":218,"P 41 3 2":219,"I 41 3 2":220,"P -4 3 m":221,"F -4 3 m":222,"I -4 3 m":223,"P -4 3 n":224,"F -4 3 c":225,"I -4 3 d":226,"P 4/m -3 2/m":227,"P m -3 m":227,"P 4/n -3 2/n":228,"P n -3 n":228,"P 42/m -3 2/n":229,"P m -3 n":229,"P 42/n -3 2/m":230,"P n -3 m":230,"F 4/m -3 2/m":231,"F m -3 m":231,"F 4/m -3 2/c":232,"F m -3 c":232,"F 41/d -3 2/m":233,"F d -3 m":233,"F 41/d -3 2/c":234,"F d -3 c":234,"I 4/m -3 2/m":235,"I m -3 m":235,"I 41/a -3 2/d":236,"I a -3 d":236,"P 1 1 2":237,"P 1 1 21":238,"B 1 1 2":239,"B 2":239,"A 1 2 1":240,"C 1 21 1":241,"I 1 2 1":242,"I 2":242,"I 1 21 1":243,"P 1 1 m":244,"P 1 1 b":245,"B 1 1 m":246,"B 1 1 b":247,"P 1 1 2/m":248,"P 1 1 21/m":249,"B 1 1 2/m":250,"P 1 1 2/b":251,"P 1 1 21/b":252,"B 1 1 2/b":253,"P 21 2 2":254,"P 2 21 2":255,"P 21 21 2 (a)":256,"P 21 2 21":257,"P 2 21 21":258,"C 2 2 21a)":259,"C 2 2 2a":260,"F 2 2 2a":261,"I 2 2 2a":262,"P 21/m 21/m 2/n a":263,"P 42 21 2a":264,"I 2 3a":265}})(a=t.SpacegroupTables||(t.SpacegroupTables={}))})(t=e.Structure||(e.Structure={}))})(t=e.Core||(e.Core={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r=e.Utils.DataTable;var n;(function(n){var i=e.Geometry.LinearAlgebra.Matrix4;var a=e.Geometry.LinearAlgebra.Vector3;function o(e,t){var r=e.x,n=e.y,i=e.z;var o=a.zero();for(var s=0,u=t;s0?t.length:1;o[0]/=f;o[1]/=f;o[2]/=f;var h=0;for(var d=0,p=t;d1e-7){r=false;break}}else if(Math.abs(a)>1e-7){r=false;break}}if(!r)break}return{isIdentity:r,id:e.toString(),transform:t}}function v(e,t){var n=e.data.atoms,i=e.data.residues,o=e.data.chains,s=e.data.entities,u=e.positions,f=u.x,h=u.y,d=u.z;var p=r.builder(s.count),m=p.addColumn("x",function(e){return new Float64Array(e)}),v=p.addColumn("y",function(e){return new Float64Array(e)}),y=p.addColumn("z",function(e){return new Float64Array(e)}),g=p.addColumn("r",function(e){return new Float64Array(e)}),b=r.builder(o.count),x=b.addColumn("x",function(e){return new Float64Array(e)}),_=b.addColumn("y",function(e){return new Float64Array(e)}),w=b.addColumn("z",function(e){return new Float64Array(e)}),C=b.addColumn("r",function(e){return new Float64Array(e)}),E=r.builder(i.count),S=E.addColumn("x",function(e){return new Float64Array(e)}),T=E.addColumn("y",function(e){return new Float64Array(e)}),M=E.addColumn("z",function(e){return new Float64Array(e)}),A=E.addColumn("r",function(e){return new Float64Array(e)});var P=a.zero(),R=0,k=a.zero(),I=0,D=0,B=a.zero(),L=0,F=a.zero(),V=0,O=a.zero(),U=0;for(var N=0,z=s.count;N0?t.length:1;k[0]/=Q;k[1]/=Q;k[2]/=Q;var Z={x:f,y:h,z:d,cX:m,cY:v,cZ:y},J={x:f,y:h,z:d,cX:x,cY:_,cZ:w},$={x:f,y:h,z:d,cX:S,cY:T,cZ:M};for(var N=0,z=s.count;Nr)continue;var y=i.zero();i.copy(y,l);f.push(p(h,d,m,v,y))}}}}return f}function S(t,r){var n=t.data,i=n.atoms,a=n.chains,o=n.entities,s=n.residues;var u=e.Utils.ArrayBuilder.create(function(e){return new Int32Array(e)},s.count*r.length,1),l=e.Utils.ArrayBuilder.create(function(e){return new Int32Array(e)},s.count*r.length,1);var c=r.length*i.count;var f=r.length*a.count;var h=o.count;for(var d=0,p=o.count;d=M&&T[R]<=A){if(!!n.insCode&&h[R]!==n.insCode)continue;I=R;break}}if(R<0||R===k)continue;for(R=I;R=A){if(!!a.insCode&&T[R]===A&&h[R]!==a.insCode)continue;break}}D=R;if(o.hasRange(d[I],p[D])){b.add(t.Fragment.ofIndexRange(o,d[I],p[D]))}}return b.getSeq()}}n.compileSequence=f;function h(){return function(e){var r=e.structure.data.residues,n=r.atomStartIndex,i=r.atomEndIndex,a=r.isHet,o=r.entityIndex,s=r.count,u=e.structure.data.entities.type,l="water",c=new t.FragmentSeqBuilder(e);for(var f=0;f=e.x&&f<=r.x&&h>=e.y&&h<=r.y&&d>=e.z&&d<=r.z){l[l.length]=c}}if(!l.length)return t.FragmentSeq.empty(n);return new t.FragmentSeq(n,[new t.Fragment(n,l[0],l)])}}n.compileAtomsInBox=p;function m(e,n){var i=r.toQuery(e);var a=r.toQuery(n);return function(e){return new t.FragmentSeq(e,i(t.Context.ofFragments(a(e))).fragments)}}n.compileInside=m;function v(e,r,n){var i=0;for(var a=0,o=r.atomIndices;at});r.lesser=o(function(e,t){return e=t});r.lesserEqual=o(function(e,t){return e<=t});function s(e,t,r){return function(n,i){var a=e(n,i);return a>=t&&a<=r}}r.inRange=s;function u(e){return function(){return e}}r.value=u;function l(e,t,r){return function(n,i){var a=n.structure;return r(t(a))[e(a.data.atoms)[i]]}}r.residueSeqNumber=l(function(e){return e.residueIndex},function(e){return e.data.residues},function(e){return e.seqNumber});r.residueName=l(function(e){return e.residueIndex},function(e){return e.data.residues},function(e){return e.name});r.elementSymbol=l(function(e){return e.indices},function(e){return e.data.atoms},function(e){return e.elementSymbol});r.atomName=l(function(e){return e.indices},function(e){return e.data.atoms},function(e){return e.name});r.entityType=l(function(e){return e.entityIndex},function(e){return e.data.entities},function(e){return e.type});function c(e){return t.Builder.build(function(){return function(r){var n=[];for(var i=0,a=r.structure.data.atoms.count;i100||r===10){e.previous=n;return n}}};e.randomMix=function(e,t,r,n){var i=Math.floor(Math.random()*3)|0;var a=i===0?Math.random()*n:Math.random();var o=i===1?Math.random()*n:Math.random();var s=i===2?Math.random()*n:Math.random();var u=a+o+s;a/=u;o/=u;s/=u;return{r:a*e.r+o*t.r+s*r.r,g:a*e.g+o*t.g+s*r.g,b:a*e.b+o*t.b+s*r.b}};e.interpolate=function(e,t,r,n,i,a){var o=a!==void 0?a:{r:.1,g:.1,b:.1};var s=(i-e)/(r-e);o.r=t.r+(n.r-t.r)*s;o.g=t.g+(n.g-t.g)*s;o.b=t.b+(n.b-t.b)*s;return o};e.previous=e.randomMix({r:.75,g:0,b:.25},{r:1,g:.5,b:0},{r:0,g:.35,b:1},.5);return e}();e.Palette=t})(t=e.Utils||(e.Utils={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){function t(){var e=document.createElement("canvas");try{var t=e.getContext("webgl")||e.getContext("experimental-webgl");return!!t}catch(e){console.log(e);return false}}e.checkWebGL=t;var r=function(){function t(){}t.setPickBase=function(e,t,r,n){var i=24,a=e<>16&255,s=a>>8&255,u=a&255;n.r=o/255;n.g=s/255;n.b=u/255};t.setPickColor=function(e,t,r,n,i){var a=24,o=e<>16&255,u=o>>8&255,l=o&255;n[i]=s/255;n[i+1]=u/255;n[i+2]=l/255};t.toSurface=function(e){var t=e.vertices.length*3,r=new Float32Array(t),n=new Float32Array(t),i=new Uint32Array(e.faces.length*3),a=Array(e.vertices.length);for(var o=0;o1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*(2/3-r)*6;return e}function u(e,t,r){var n,i,a;if(t==0){n=i=a=r}else{var o=r<.5?r*(1+t):r+t-r*t;var u=2*r-o;n=s(u,o,e+1/3);i=s(u,o,e);a=s(u,o,e-1/3)}return{r:n,g:i,b:a}}e.fromHsl=u;function l(e,t,r){var n,i,a=[];if(t===0){n=[r,r,r]}else{e=e/60;i=Math.floor(e);a=[r*(1-t),r*(1-t*(e-i)),r*(1-t*(1-(e-i)))];switch(i){case 0:n=[r,a[2],a[0]];break;case 1:n=[a[1],r,a[0]];break;case 2:n=[a[0],r,a[2]];break;case 3:n=[a[0],a[1],r];break;case 4:n=[a[2],a[0],r];break;default:n=[r,a[0],a[1]];break}}return{r:n[0],g:n[1],b:n[2]}}e.fromHsv=l;function c(){return t.Utils.Palette.getRandomColor()}e.random=c;function f(e){return{r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255}}e.fromHex=f;function h(e){if(e[0]!=="#")return f(0);if(e.length===4){return h("#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3])}else if(e.length===7){return f(parseInt(e.substr(1),16))}return f(0)}e.fromHexString=h;function d(e,t,r,n){n.r=e.r+(t.r-e.r)*r;n.g=e.g+(t.g-e.g)*r;n.b=e.b+(t.b-e.b)*r}e.interpolate=d;function p(e){return e.r!==void 0&&e.g!==void 0&&e.b!==void 0}e.isColor=p})(r=t.Color||(t.Color={}));var n;(function(t){var n;(function(e){e.HighlightColor={r:1,g:1,b:0};e.SelectionColor={r:171/255,g:71/255,b:183/255};e.UniformColor={r:68/255,g:130/255,b:255};e.Transparency={alpha:1,writeDepth:false}})(n=t.Default||(t.Default={}));function i(e){var t=+e.transparency.alpha;if(isNaN(t))t=1;return t<=.999}t.isTransparent=i;function a(e,t,r){var n=e.colors.get(t);if(!n)return r;return n}t.getColor=a;function o(t){if(t===void 0){t={}}var i=t.colors,a=t.variables,o=a===void 0?e.Core.Utils.FastMap.create():a,s=t.transparency,u=s===void 0?n.Transparency:s,l=t.interactive,c=l===void 0?true:l,f=t.disableFog,h=f===void 0?false:f,d=t.isSticky,p=d===void 0?false:d;var m=e.Core.Utils.FastMap.create();if(i){i.forEach(function(e,t){return m.set(t,e)})}var v=m.get("Uniform");if(!v){m.set("Uniform",n.UniformColor);v=n.UniformColor}return{colors:m,variables:o,transparency:u,interactive:c,disableFog:h,isSticky:p,setElementColor:function(e,t){r.copy(v,t)}}}t.createUniform=o;function s(t,r){if(r===void 0){r={}}var i=r.colors,a=i===void 0?e.Core.Utils.FastMap.create():i,o=r.variables,s=o===void 0?e.Core.Utils.FastMap.create():o,u=r.transparency,l=u===void 0?n.Transparency:u,c=r.interactive,f=c===void 0?true:c,h=r.disableFog,d=h===void 0?false:h,p=r.isSticky,m=p===void 0?false:p;return{colors:a,variables:s,transparency:l?l:n.Transparency,interactive:f,disableFog:d,isSticky:m,setElementColor:function(e,r){t.setColor(t.getProperty(e),r)}}}t.createMapping=s;function u(e,t,r){var n=new d(t,r);return{getProperty:e,setColor:function(e,t){return n.setColor(e,t)}}}t.createColorMapMapping=u;function l(e,t){var r=new h(t);return{getProperty:e,setColor:function(e,t){return r.setColor(e,t)}}}t.createPalleteMapping=l;function c(e,t){var r=new f(t);return{getProperty:e,setColor:function(e,t){return r.setColor(e,t)}}}t.createPalleteIndexMapping=c;var f=function(){function e(e){this.pallete=e}e.prototype.setColor=function(e,t){var n=this.pallete[e];r.copy(n,t)};return e}();var h=function(){function t(t){this.pallete=t;this.colorIndex=0;this.colorMap=e.Core.Utils.FastMap.create()}t.prototype.setColor=function(e,t){var n=this.colorMap.get(e);if(!n){this.colorIndex=(this.colorIndex+1)%this.pallete.length|0;n=this.pallete[this.colorIndex];this.colorMap.set(e,n)}r.copy(n,t)};return t}();var d=function(){function e(e,t){this.map=e;this.fallbackColor=t}e.prototype.setColor=function(e,t){var n=this.map.get(e);if(!n){n=this.fallbackColor}r.copy(n,t)};return e}()})(n=t.Theme||(t.Theme={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t=function(){function t(){}t.getPickMaterial=function(){return new e.THREE.ShaderMaterial({attributes:{pColor:{type:"v4",value:[]}},vertexShader:t.pickVertexShader,fragmentShader:t.pickFragmentShader,blending:e.THREE.NoBlending,shading:e.THREE.FlatShading,side:e.THREE.DoubleSide})};t.getPickExcludeMaterial=function(){return new e.THREE.MeshBasicMaterial({color:e.THREE.ColorKeywords.white,side:e.THREE.DoubleSide})};t.compareVectorAndColor=function(e,t){return e.x===t.r&&e.y===t.g&&e.z===t.b};t.updateMaterial=function(r,n,i){var a=false;if(t.updateTransparencyAndFog(r,n,i))a=true;if(r instanceof e.THREE.ShaderMaterial&&t.updateHighlightColor(r,n))a=true;if(a)r.needsUpdate=true};t.updateHighlightColor=function(r,n){var i=false;var a=r.uniforms.selectionColor.value;var o=e.Theme.getColor(n,"Selection",e.Theme.Default.SelectionColor);if(!t.compareVectorAndColor(a,o)){r.uniforms.selectionColor.value=e.Color.toVector(o);i=true}a=r.uniforms.highlightColor.value;var s=e.Theme.getColor(n,"Highlight",e.Theme.Default.HighlightColor);if(!t.compareVectorAndColor(a,s)){r.uniforms.highlightColor.value=e.Color.toVector(s);i=true}return i};t.updateTransparencyAndFog=function(t,r,n){var i=r.transparency;var a=+i.alpha;if(isNaN(a))a=1;var o=a<=.999;var s=!!i.writeDepth;if(!o){a=1;s=true}if(n)n.renderOrder=o?1:0;var u=false;if(t instanceof e.THREE.MeshPhongMaterial||t instanceof e.THREE.MeshBasicMaterial||t instanceof e.THREE.ShaderMaterial){if(t.transparent!==o){t.transparent=o;u=true}if(t.depthWrite!==s){t.depthWrite=s;u=true}if(t.opacity!==a){t.opacity=a;u=true}if(t.fog!==!r.disableFog){t.fog=!r.disableFog;u=true}if(t instanceof e.THREE.ShaderMaterial){if(t.uniforms.opacity){t.uniforms.opacity.value=a}}}return u};t.getMeshMaterial=function(r,n){if(r===void 0){r=e.THREE.SmoothShading}if(n===void 0){n=false}var i=t.shader;var a=new e.THREE.ShaderMaterial({uniforms:e.THREE.UniformsUtils.clone(i.uniforms),attributes:{vState:{type:"f",value:[]}},lights:true,fog:true,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,shading:r,side:e.THREE.DoubleSide,vertexColors:e.THREE.VertexColors,blending:e.THREE.NormalBlending,wireframe:n,linewidth:1});return a};t.getPhongVertexColorMaterial=function(){return new e.THREE.MeshPhongMaterial({specular:11184810,shininess:2,shading:e.THREE.SmoothShading,vertexColors:e.THREE.VertexColors,side:e.THREE.DoubleSide,metal:true})};t.getDefaultHighlightMaterial=function(){return new e.THREE.MeshPhongMaterial({color:16777215,specular:11184810,shininess:2,shading:e.THREE.SmoothShading,side:e.THREE.DoubleSide,metal:true})};t.applyColorToBuffer=function(e,t){var r=e.array;for(var n=0,i=r.length;n 0.33) { diffuseColor = vec4(highlightColor, opacity); }","\telse { diffuseColor = vec4(selectionColor, opacity); }",e.THREE.ShaderChunk["logdepthbuf_fragment"],e.THREE.ShaderChunk["map_fragment"],e.THREE.ShaderChunk["alphamap_fragment"],e.THREE.ShaderChunk["alphatest_fragment"],e.THREE.ShaderChunk["specularmap_fragment"],e.THREE.ShaderChunk["lights_phong_fragment"],e.THREE.ShaderChunk["lightmap_fragment"],e.THREE.ShaderChunk["envmap_fragment"],e.THREE.ShaderChunk["shadowmap_fragment"],e.THREE.ShaderChunk["linear_to_gamma_fragment"],e.THREE.ShaderChunk["fog_fragment"],"#ifdef USE_FOG"," if (diffuseColor.a > 0.99) { gl_FragColor = vec4( outgoingLight, diffuseColor.a ); }"," else { gl_FragColor = vec4( outgoingLight, (1.0 - fogFactor) * diffuseColor.a ); }","#else","\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","#endif","}"].join("\n")};return t}();e.MaterialsHelper=t})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t=function(){function e(){}return e}();e.GeometryBase=t;var r=function(){function t(){this.id=-1;this.entity=void 0;this.centroid=new e.THREE.Vector3;this.radius=0;this.object=void 0;this.theme=void 0;this.disposeList=[];this.pickObject=void 0;this.pickBufferAttributes=[];this.dirty=false;this.props={};this.tag=void 0}t.prototype.updateVisibility=function(e){this.dirty=true;this.object.visible=e;if(this.pickObject){this.pickObject.visible=this.getPickObjectVisibility(e)}};t.prototype.getVisibility=function(){return this.object.visible};t.prototype.applyTheme=function(e){this.dirty=true;this.theme=e;if(!e.interactive){if(this.pickObject)this.pickObject.visible=false}else{if(this.pickObject)this.pickObject.visible=this.object.visible}this.applyThemeInternal(e)};t.prototype.updateId=function(t,r){this.id=t;for(var n=0,i=this.pickBufferAttributes;n15)this.enableWheel=true};t.prototype.mouseOut=function(){this.mouseMoveDelta=0;this.lastMousePosition=void 0;this.enableWheel=false};return t}();t.SlabControls=i;var a=function(){function e(e,r){this.scene=e;this.domElement=r;this.fog=new t.THREE.Fog(0,0,500);this.focusPoint=new t.THREE.Vector3(0,0,0);this.focusRadius=0;this.targetDistance=0;this.nearPlaneDistance=0;this.nearPlaneDelta=0;this.fogEnabled=true;this.fogDelta=0;this.fogFactor=1;this.observers=[];this.setup()}e.shouldInUpdateInclude=function(e){return!isNaN(e.centroid.x)&&e.getVisibility()};e.prototype.updateFocus=function(r){if(!r.length)return;var n=r.filter(function(t){return e.shouldInUpdateInclude(t)}).sort(function(e,t){return t.radius-e.radius});if(!n.length)return;var i=[n[0]];var a=new t.THREE.Vector3;for(var o=1;o0&&r>this.targetDistance)e=0;if(e<0&&r<.01)e=0;this.nearPlaneDelta+=e;this.fogDelta+=e;this.cameraUpdated()};e.prototype.computeNearDistance=function(){var e=this.controls.target.distanceTo(this.camera.position);if(e>this.focusRadius)return e-this.focusRadius;return 0};e.prototype.cameraUpdated=function(){var e=this.scene.options;this.fogEnabled=!!e.enableFog;var r=this.camera;if(r instanceof t.THREE.PerspectiveCamera){r.fov=e.cameraFOV}this.targetDistance=this.controls.target.distanceTo(this.camera.position);var n=this.computeNearDistance()+this.nearPlaneDelta;this.camera.near=Math.max(.01,Math.min(n,this.targetDistance-.5));if(e.enableFog){var i=this.targetDistance-this.camera.near+this.fogFactor*1*this.focusRadius-this.nearPlaneDelta;var a=this.targetDistance-this.camera.near+this.fogFactor*2*this.focusRadius-this.nearPlaneDelta;this.fog.near=Math.max(i,.1);this.fog.far=Math.max(a,.2)}else{this.fog.far=1000001;this.fog.near=1e6}this.camera.updateProjectionMatrix();this.scene.forceRender();for(var o=0,s=this.observers;o1)r.fogFactor=1;var n=r.cameraType!==this.options.cameraType;var i=r.clearColor;this.renderer.setClearColor(new t.THREE.Color(i.r,i.g,i.b));this.renderer.setClearAlpha(r.alpha?0:1);this.camera.fog.color.setRGB(i.r,i.g,i.b);this.camera.fogFactor=r.fogFactor;if(this.camera.controls){this.camera.controls.rotateSpeed=r.cameraSpeed;this.camera.controls.zoomSpeed=r.cameraSpeed}this.options=r;if(n)this.camera.createCamera();this.camera.cameraUpdated();this.forceRender()};a.prototype.setupMouse=function(){var e=this;var t=function(t){if(!e.mouseInfo.isInside){e.mouseInfo.updateRect()}e.mouseInfo.updatePosition(t.clientX,t.clientY);e.mouseInfo.isInside=true};var r=this.renderer.domElement;r.addEventListener("mousemove",t);this.unbindEvents.push(function(){return r.removeEventListener("mousemove",t)});var n=function(t){e.mouseInfo.isInside=false;e.clearHighlights()};r.addEventListener("mouseleave",n);this.unbindEvents.push(function(){return r.removeEventListener("mouseleave",n)});var i=function(t){if(e.mouseInfo.isInside){e.mouseInfo.updateRect();e.handleSelectStart(t.clientX,t.clientY)}else{}e.mouseInfo.isButtonDown=true;e.clearHighlights()};r.addEventListener("mousedown",i);this.unbindEvents.push(function(){return r.removeEventListener("mousedown",i)});var a=function(t){e.mouseInfo.isButtonDown=false;e.needsRender();e.handleSelectEnd(t.clientX,t.clientY);e.clearHighlights(true)};window.addEventListener("mouseup",a);this.unbindEvents.push(function(){return window.removeEventListener("mouseup",a)});var o=function(t){e.mouseInfo.updateRect()};window.addEventListener("mousewheel",o);window.addEventListener("DOMMouseScroll",o);this.unbindEvents.push(function(){return window.removeEventListener("mousewheel",o)});this.unbindEvents.push(function(){return window.removeEventListener("DOMMouseScroll",o)});r.addEventListener("touchstart",o,false);this.unbindEvents.push(function(){return r.removeEventListener("touchstart",o,false)});var s=function(t){var r=t.touches;if(!r.length){r=t.changedTouches}if(r.length===1){e.handleSelectEnd(r[0].clientX,r[0].clientY)}setTimeout(e.clearHighlightsCall,1e3/15)};r.addEventListener("touchend",s,false);this.unbindEvents.push(function(){return r.removeEventListener("touchend",s,false)});try{r.addEventListener("touchcancel",s,false);this.unbindEvents.push(function(){return r.removeEventListener("touchcancel",s,false)})}catch(e){}};a.prototype.handleSelectStart=function(e,t){this.pickInfo.selectStart(e,t)};a.prototype.handleSelectEnd=function(e,t){if(this.pickInfo.selectEnd(e,t)){var r=this.handlePick(true);this.dispatchSelectEvent(r)}};a.prototype.handleResize=function(){var e=this.parentElement.clientWidth,r=this.parentElement.clientHeight;this.camera.updateSize(e,r);if(this.renderState.height===r&&this.renderState.width===e){this.renderState.resizing=false;return}this.renderState.width=e;this.renderState.height=r;this.renderer.setSize(e,r);this.pickTarget=new t.THREE.WebGLRenderTarget(e,r,{format:t.THREE.RGBAFormat,minFilter:t.THREE.LinearFilter});this.pickTarget.generateMipmaps=false;this.renderState.resizing=false;this.mouseInfo.updateRect();this.needsRender()};a.prototype.needsRender=function(){this.renderState.rendered=false};a.prototype.checkDirty=function(){var e=false;for(var t=0,r=this.models.all;t33.3333333){this.renderState.pickDelta=this.renderState.pickDelta%33.3333333;this.handlePick(false)}var r=this.checkDirty();if(r)this.renderState.rendered=false;if(!this.renderState.rendered){this.lighting.update(this.camera.position);this.renderer.sortObjects=true;this.renderer.render(this.scene,this.camera.object);this.renderer.sortObjects=false;this.renderState.rendered=true;if(!this.mouseInfo.isButtonDown){this.renderer.setClearAlpha(1);this.renderer.render(this.pickScene,this.camera.object,this.pickTarget);this.renderer.setClearAlpha(this.options.alpha?0:1)}}this.renderState.animationFrame=requestAnimationFrame(this.renderFunc)};a.prototype.dispatchHoverEvent=function(){this.events.dispatchEvent({type:a.hoverEvent,target:null,data:this.pickInfo.getPickInfo()})};a.prototype.dispatchSelectEvent=function(e){if(e){this.events.dispatchEvent({type:a.selectEvent,target:null,data:e})}};a.prototype.clearHighlights=function(e){if(e===void 0){e=true}var t=this.pickInfo,r=this.models.getBySceneId(t.currentPickId),n=false;if(r){n=r.highlightElement(t.currentPickElementId,false)}if(n&&e)this.needsRender();if(this.pickInfo.reset()){this.dispatchHoverEvent()}return n};a.prototype.handlePick=function(e){if(!e&&(!this.mouseInfo.update()||this.mouseInfo.isButtonDown)||this.renderState.resizing){return}if(!this.mouseInfo.isInside){return void 0}this.mouseInfo.setExactPosition();var r=this.mouseInfo.exactPosition;var n=this.pickTarget.height-r.y;if(this.pickTarget.width1){this._mouseOnBall.normalize()}else{this._mouseOnBall.z=Math.sqrt(1-o*o)}this._eye.copy(this.camera.position).sub(this.target);this._mouseOnBallProjection.copy(this.camera.up).setLength(this._mouseOnBall.y);this._mouseOnBallProjection.add(this._objectUp.copy(this.camera.up).cross(this._eye).setLength(this._mouseOnBall.x));this._mouseOnBallProjection.add(this._eye.setLength(this._mouseOnBall.z));return this._mouseOnBallProjection};t.prototype.rotateCamera=function(){var e=Math.acos(this._rotateStart.dot(this._rotateEnd)/this._rotateStart.length()/this._rotateEnd.length());if(e){this._rotationAxis.crossVectors(this._rotateStart,this._rotateEnd).normalize();e*=this.rotateSpeed;this._rotationQuaternion.setFromAxisAngle(this._rotationAxis,-e);this._eye.applyQuaternion(this._rotationQuaternion);this.camera.up.applyQuaternion(this._rotationQuaternion);this._rotateEnd.applyQuaternion(this._rotationQuaternion);if(this.staticMoving){this._rotateStart.copy(this._rotateEnd)}else{this._rotationQuaternion.setFromAxisAngle(this._rotationAxis,e*(this.dynamicDampingFactor-1));this._rotateStart.applyQuaternion(this._rotationQuaternion)}}};t.prototype.zoomCamera=function(){if(this._state===4){var e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd;this._touchZoomDistanceStart=this._touchZoomDistanceEnd;this._eye.multiplyScalar(e)}else{var e=1-(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed;if(e!==1&&e>0){this._eye.multiplyScalar(e);if(this.staticMoving){this._zoomStart.copy(this._zoomEnd)}else{this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor}}}};t.prototype.panCamera=function(){this._panMouseChange.copy(this._panEnd).sub(this._panStart);if(this._panMouseChange.lengthSq()){this._panMouseChange.multiplyScalar(this._eye.length()*this.panSpeed);this._panPan.copy(this._eye).cross(this.camera.up).setLength(this._panMouseChange.x);this._panPan.add(this._panObjectUp.copy(this.camera.up).setLength(this._panMouseChange.y));this.camera.position.add(this._panPan);this.target.add(this._panPan);if(this.staticMoving){this._panStart.copy(this._panEnd)}else{this._panStart.add(this._panMouseChange.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}};t.prototype.panTo=function(e){var t=e.x,r=e.y,n=e.z;this._panToVector.set(t,r,n);this._panToDelta.subVectors(this._panToVector,this.target);this.camera.position.add(this._panToDelta);this.camera.lookAt(this._panToVector);this.target.copy(this._panToVector);this._eye.subVectors(this.camera.position,this.target);this.lastPosition.copy(this.camera.position);if(this._panToDelta.lengthSq()>this.EPS){this.events.dispatchEvent(this.changeEvent)}};t.prototype.panAndMoveToDistance=function(e,t){var r=e.x,n=e.y,i=e.z;this._panToVector.set(r,n,i);this._panToDelta.subVectors(this._panToVector,this.target);this.camera.position.add(this._panToDelta);this.camera.lookAt(this._panToVector);this.target.copy(this._panToVector);this._eye.subVectors(this.camera.position,this.target);this._eye.setLength(t);this.camera.position.addVectors(this.target,this._eye);this.checkDistances();this.lastPosition.copy(this.camera.position);this.events.dispatchEvent(this.changeEvent)};t.prototype.checkDistances=function(){if(!this.noZoom||!this.noPan){if(this._eye.lengthSq()>this.maxDistance*this.maxDistance){this.camera.position.addVectors(this.target,this._eye.setLength(this.maxDistance))}if(this._eye.lengthSq()this.EPS){this.events.dispatchEvent(this.changeEvent);this.lastPosition.copy(this.camera.position)}};t.prototype.reset=function(){this._state=-1;this._prevState=-1;this.target.copy(this.target0);this.camera.position.copy(this.position0);this.camera.up.copy(this.up0);this._eye.subVectors(this.camera.position,this.target);this.camera.lookAt(this.target);this.events.dispatchEvent(this.changeEvent);this.lastPosition.copy(this.camera.position)};t.prototype.getState=function(){return{state:this._state,prevState:this._prevState,target:this.target.clone(),objPos:this.camera.position.clone(),objUp:this.camera.up.clone(),eye:this._eye.clone(),lastPosition:this.lastPosition.clone()}};t.prototype.setState=function(e){this._state=e.state;this._prevState=e.prevState;this.target.copy(e.target);this.camera.position.copy(e.objPos);this.camera.up.copy(e.objUp);this._eye.copy(e.eye);this.camera.lookAt(this.target);this.events.dispatchEvent(this.changeEvent);this.lastPosition.copy(e.lastPosition)};t.prototype.keydown=function(e){if(this.enabled===false)return;window.removeEventListener("keydown",this.eventHandlers.keydown,false);window.addEventListener("keyup",this.eventHandlers.keyup,false);this._prevState=this._state;if(this._state!==-1){return}else if(e.keyCode===this.keys[0]&&!this.noRotate){this._state=0}else if(e.keyCode===this.keys[2]&&!this.noZoom){this._state=2}else if(e.keyCode===this.keys[1]&&!this.noPan){this._state=1}this._keyDownState=this._state};t.prototype.keyup=function(e){if(this.enabled===false)return;this._state=this._prevState;this._keyDownState=-1;window.removeEventListener("keyup",this.eventHandlers.keyup,false);window.addEventListener("keydown",this.eventHandlers.keydown,false)};t.prototype.mousedown=function(e){if(this.enabled===false)return;e.preventDefault();this.scene.mouseInfo.updatePosition(e.clientX,e.clientY);if(this._keyDownState!==-1){this._state=this._keyDownState}if(this._state===-1){this._state=e.button}if(this._state===0&&!this.noRotate){this._rotateStart.copy(this.getMouseProjectionOnBall());this._rotateEnd.copy(this._rotateStart)}else if(this._state===2&&!this.noZoom){this._zoomStart.copy(this.getMouseOnScreen());this._zoomEnd.copy(this._zoomStart)}else if(this._state===1&&!this.noPan){this._panStart.copy(this.getMouseOnScreen());this._panEnd.copy(this._panStart)}window.addEventListener("mousemove",this.eventHandlers.mousemove,false);window.addEventListener("mouseup",this.eventHandlers.mouseup,false);this.events.dispatchEvent(this.startEvent)};t.prototype.mousemove=function(e){if(this.enabled===false)return;e.preventDefault();this.scene.mouseInfo.updatePosition(e.clientX,e.clientY);if(this._state===0&&!this.noRotate){this._rotateEnd.copy(this.getMouseProjectionOnBall())}else if(this._state===2&&!this.noZoom){this._zoomEnd.copy(this.getMouseOnScreen())}else if(this._state===1&&!this.noPan){this._panEnd.copy(this.getMouseOnScreen())}this.update()};t.prototype.mouseup=function(e){if(this.enabled===false)return;e.preventDefault();this._state=-1;window.removeEventListener("mousemove",this.eventHandlers.mousemove,false);window.removeEventListener("mouseup",this.eventHandlers.mouseup,false);this.events.dispatchEvent(this.endEvent)};t.prototype.touchstart=function(e){if(this.enabled===false)return;switch(e.touches.length){case 1:this._state=3;this.scene.mouseInfo.updatePosition(e.touches[0].clientX,e.touches[0].clientY);this._rotateStart.copy(this.getMouseProjectionOnBall());this._rotateEnd.copy(this._rotateStart);break;case 2:this._state=4;var t=e.touches[0].clientX-e.touches[1].clientX;var r=e.touches[0].clientY-e.touches[1].clientY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+r*r);var n=(e.touches[0].clientX+e.touches[1].clientX)/2;var i=(e.touches[0].clientY+e.touches[1].clientY)/2;this.scene.mouseInfo.updatePosition(n,i);this._panStart.copy(this.getMouseOnScreen());this._panEnd.copy(this._panStart);break;default:this._state=-1}this.events.dispatchEvent(this.startEvent)};t.prototype.touchmove=function(e){if(this.enabled===false)return;e.preventDefault();e.stopPropagation();switch(e.touches.length){case 1:this.scene.mouseInfo.updatePosition(e.touches[0].clientX,e.touches[0].clientY);this._rotateEnd.copy(this.getMouseProjectionOnBall());this.update();break;case 2:var t=e.touches[0].clientX-e.touches[1].clientX;var r=e.touches[0].clientY-e.touches[1].clientY;this._touchZoomDistanceEnd=Math.sqrt(t*t+r*r);var n=(e.touches[0].clientX+e.touches[1].clientX)/2;var i=(e.touches[0].clientY+e.touches[1].clientY)/2;this.scene.mouseInfo.updatePosition(n,i);this._panEnd.copy(this.getMouseOnScreen());this.update();break;default:this._state=-1}};t.prototype.touchend=function(e){if(this.enabled===false)return;var t=e.touches;if(!t.length){t=e.changedTouches}switch(t.length){case 1:this.scene.mouseInfo.updatePosition(t[0].clientX,t[0].clientY);this._rotateEnd.copy(this.getMouseProjectionOnBall());this._rotateStart.copy(this._rotateEnd);break;case 2:this._touchZoomDistanceStart=this._touchZoomDistanceEnd=0;var r=(t[0].clientX+t[1].clientX)/2;var n=(t[0].clientY+t[1].clientY)/2;this.scene.mouseInfo.updatePosition(r,n);this._panEnd.copy(this.getMouseOnScreen());this._panStart.copy(this._panEnd);break}this._state=-1;this.events.dispatchEvent(this.endEvent)};t.prototype.preventContextMenu=function(e){e.preventDefault()};t.prototype.init=function(){this.domElement.addEventListener("contextmenu",this.preventContextMenu,false);this.domElement.addEventListener("mousedown",this.eventHandlers.mousedown,false);this.domElement.addEventListener("touchstart",this.eventHandlers.touchstart,false);this.domElement.addEventListener("touchend",this.eventHandlers.touchend,false);this.domElement.addEventListener("touchmove",this.eventHandlers.touchmove,false);window.addEventListener("keydown",this.eventHandlers.keydown,false);this.update()};t.prototype.destroy=function(){this.domElement.removeEventListener("contextmenu",this.preventContextMenu,false);this.domElement.removeEventListener("mousedown",this.eventHandlers.mousedown,false);window.removeEventListener("keydown",this.eventHandlers.keydown,false);this.domElement.removeEventListener("touchstart",this.eventHandlers.touchstart,false);this.domElement.removeEventListener("touchend",this.eventHandlers.touchend,false);this.domElement.removeEventListener("touchmove",this.eventHandlers.touchmove,false);this.camera=void 0;this.domElement=void 0};return t}();e.CameraControls=t})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(t){var r=function(){function e(){this.current=null;this.currentPickId=-1;this.currentPickElementId=-1;this.selectPos={x:0,y:0}}e.prototype.getPickInfo=function(){if(!this.current)return this.current;if(this.current.elements&&!this.current.elements.length)return null;return{model:this.current.model,elements:this.current.elements}};e.prototype.reset=function(){var e=this.current!==null;this.currentPickId=-1;this.currentPickElementId=-1;this.current=null;return e};e.prototype.selectStart=function(e,t){this.selectPos.x=e;this.selectPos.y=t};e.prototype.selectEnd=function(e,t){var r=e-this.selectPos.x,n=t-this.selectPos.y;return r*r+n*n<4.5};return e}();t.Pick=r;var n;(function(e){function t(e,t){var r=e>>16&255,n=e>>8&255,i=e&255;t.r=i/255;t.g=n/255;t.b=r/255}e.assignPickColor=t;function r(e,t,r){r[t+3]=e/255}e.applySceneIdFast=r;function n(e,t,r,n){var i=(t&(1<>e;n[r+3]=a/255;var o=n[r+2]*255|0;n[r+2]=(o|i)/255}e.applySceneIdSlow=n;function i(e,t){var r=(1<<16-e)-1;return t[0]|t[1]<<8|(t[2]&r)<<16}e.getElementId=i;function a(e,t){var r=e-8;var n=t[2]&(1<>8-r;var i=t[3]<.33){e[a]=s;i=true}}}else if(n===1){for(var a=t;a.75){var o=e[a]-1;if(o<0)o=0;e[a]=o;i=true}}}else{for(var a=t;as)u[0]=s-p;M(e,c,u,f,l);d.add(f,f,o)}}n.addDashedLine=z;function H(e){return e.array}function j(e){return o.compact(e)}function G(e){var t=e.type==="Static"?H:j;return r.toBufferGeometry({vertices:t(e.vertices),vertexCount:e.vertices.elementCount,normals:e.normals&&t(e.normals),indices:t(e.indices),indexCount:e.indices.elementCount,elementSize:e.elementSize})}n.toBufferGeometry=G})(u=r.Builder||(r.Builder={}))})(r=t.Geometry||(t.Geometry={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var y=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n=e.Core.Utils.ChunkedArray;function i(e){var t=new Int32Array(e.data.annotation.length);var r=e.data.annotation;for(var n=0,i=t.length;ne.Core.Computation.UpdateProgressDelta))return[3,3];r=i;return[4,t.computation.updateProgress("Creating selection geometry...",true,n,t.triCount)];case 2:a.sent();a.label=3;case 3:c(n,t);a.label=4;case 4:n+=l;return[3,1];case 5:return[2]}})})}function h(e){var r={r:.45,g:.45,b:.45},i=e.data.annotation;e.pickTris=n.forIndexBuffer(e.triCount);var a=e.pickColorBuffer;for(var o=0,s=e.vertexCount;o=0){t.Selection.Picking.assignPickColor(u+1,r);a[o*4]=r.r;a[o*4+1]=r.g;a[o*4+2]=r.b}}}function d(e,r){var n=new t.THREE.BufferGeometry;n.addAttribute("position",e.position);n.addAttribute("index",e.index);n.addAttribute("pColor",new t.THREE.BufferAttribute(r.pickColorBuffer,4));r.geom.pickGeometry=n;n=new t.THREE.BufferGeometry;n.addAttribute("position",new t.THREE.BufferAttribute(new Float32Array(0),3));n.addAttribute("index",new t.THREE.BufferAttribute(new Uint32Array(0),1));n.addAttribute("pColor",new t.THREE.BufferAttribute(new Float32Array(0),4));r.geom.pickPlatesGeometry=n}function p(e,r){var i=new t.THREE.BufferGeometry;i.addAttribute("position",e.position);i.addAttribute("index",e.index);i.addAttribute("pColor",new t.THREE.BufferAttribute(r.pickColorBuffer,4));r.geom.pickGeometry=i;i=new t.THREE.BufferGeometry;i.addAttribute("position",new t.THREE.BufferAttribute(n.compact(r.pickPlatesVertices),3));i.addAttribute("index",new t.THREE.BufferAttribute(n.compact(r.pickPlatesTris),1));i.addAttribute("pColor",new t.THREE.BufferAttribute(n.compact(r.pickPlatesColors),4));r.geom.pickPlatesGeometry=i}function g(e,t,r,i){if(r>i){var a=r;r=i;i=a}if(t.add((r+i)*(r+i+1)/2+i)){n.add2(e,r,i)}}function b(r){var i=r.data.triangleIndices;var a=n.create(function(e){return new Uint32Array(e)},1.5*r.triCount|0,2);var o=e.Core.Utils.FastSet.create();for(var s=0,u=i.length;su)u=h}u=Math.sqrt(u);var d=new e.THREE.BufferGeometry;d.addAttribute("position",new e.THREE.BufferAttribute(t,3));d.addAttribute("index",new e.THREE.BufferAttribute(n,1));i.geometry=d;i.center=a;i.radius=u;return i};return r}(e.GeometryBase);t.Geometry=r})(t=e.Lines||(e.Lines={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.applySelectionInternal=function(e,t){return false};n.prototype.highlightElement=function(e,t){return this.applySelection([e],t?3:4)};n.prototype.highlightInternal=function(e){return false};n.prototype.getPickElements=function(e){return[e]};n.prototype.applyThemeInternal=function(e){var r=e.colors.get("Uniform");this.material.color=new t.THREE.Color(r.r,r.g,r.b);this.material.needsUpdate=true};n.prototype.getPickObjectVisibility=function(e){return false};n.prototype.createObjects=function(){return{main:new t.THREE.Mesh(this.geometry.geometry,this.material),pick:void 0}};n.create=function(r,i){var a=this;var o=i.geometry,s=i.theme,u=i.props;return e.Core.computation(function(e){return m(a,void 0,void 0,function(){var e,i;return v(this,function(a){e=new n;e.material=new t.THREE.MeshBasicMaterial({wireframe:true});e.geometry=o;e.entity=r;e.centroid=o.center;e.radius=o.radius;if(u)e.props=u;e.disposeList.push(e.geometry,e.material);i=e.createObjects();e.object=i.main;e.pickObject=void 0;e.applyTheme(s);e.pickBufferAttributes=[];return[2,e]})})})};return n}(t.Model);r.Model=n})(r=t.Lines||(t.Lines={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2017 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";r.DefaultTextAtlasParams={font:["sans-serif"],size:36,style:"normal",variant:"normal",weight:"normal",outline:0,width:2048,height:2048};var n=e.Core.Utils.FastMap.create();function i(e){var t=JSON.stringify(e);if(n.has(t))return n.get(t);var r=new a(e);n.set(t,r);return r}r.getTextAtlas=i;var a=function(){function n(n){this.gamma=1;this.mapped=e.Core.Utils.FastMap.create();this.state={scratchW:0,scratchH:0,currentX:0,currentY:0};this.lineHeight=0;this.params=e.Core.Utils.extend({},n,r.DefaultTextAtlasParams);if(typeof navigator!=="undefined"){var i=navigator.userAgent;if(i.match(/Chrome/)&&i.match(/OS X/)){this.gamma=.5}}this.build();this.populate();this.texture=new t.THREE.Texture(this.canvas.canvas2);this.texture.flipY=false;this.texture.needsUpdate=true;this.canvas=void 0}n.prototype.build=function(){var e=this.params;var t=e.size+2*e.outline+Math.round(e.size/4);var r=e.width/4;var n=document.createElement("canvas");n.width=r;n.height=t;var i=n.getContext("2d");i.font=e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.font;i.fillStyle="#FF0000";i.textAlign="left";i.textBaseline="bottom";i.lineJoin="round";var a=[];var o=e.outline*3;for(var s=0;sthis.params.width){t.currentX=0;t.currentY+=t.scratchH}if(t.currentY+t.scratchH>this.params.height){console.warn("TextAtlas canvas to small")}var r={x:t.currentX,y:t.currentY,w:t.scratchW,h:t.scratchH};this.mapped.set(e,r);this.canvas.ctx2.drawImage(this.canvas.canvas,0,0,t.scratchW,t.scratchH,t.currentX,t.currentY,t.scratchW,t.scratchH);t.currentX+=t.scratchW;return r};n.prototype.getTextMetrics=function(e){return this.mapped.has(e)?this.mapped.get(e):this.placeholder};n.prototype.draw=function(e){var t=this,r=t.params,n=t.canvas;var i=this.lineHeight;var a=r.outline;var o=n.ctx;var s=n.scratch;var u=n.maxWidth;var l=n.colors;var c=a;var f=i-r.outline;var h=o.measureText(e);var d=Math.min(u,Math.ceil(h.width+2*c+1));o.clearRect(0,0,d,i);var p,m,v,y,g;if(r.outline===0){o.fillText(e,c,f);y=o.getImageData(0,0,d,i);g=y.data;v=3;for(p=0,m=g.length/4;p0;--p){v=p>1?p*2-2:p;o.strokeStyle=l[v-1];o.lineWidth=v;o.strokeText(e,c,f)}o.globalCompositeOperation="multiply";o.fillStyle="#FF00FF";o.fillText(e,c,f);y=o.getImageData(0,0,d,i);g=y.data;v=0;var b=this.gamma;for(p=0,m=g.length/4;p0){v=d}else if(n.indexOf("center")>0){v=d/2}else{v=0}v+=i;y+=i;f=l*2*4;u[f+0]=-a/6-v-o;u[f+1]=a-y+o;u[f+2]=-a/6-v-o;u[f+3]=0-1.2*y-o;u[f+4]=d+a/6-v+2*i+o;u[f+5]=a-y+o;u[f+6]=d+a/6-v+2*i+o;u[f+7]=0-1.2*y-o;s[f+0]=10;s[f+2]=10;s[f+4]=10;s[f+6]=10;l+=1;d=0;for(p=0;p 1.0 ){\n if (backgroundOpacity < 0.05) discard;\n finalColor = vec4( backgroundColor, backgroundOpacity );\n }else{\n // retrieve signed distance\n float sdf = texture2D( fontTexture, texCoord ).a + outlineWidth;\n\n // perform adaptive anti-aliasing of the edges\n float w = clamp(\n smoothness * ( abs( dFdx( texCoord.x ) ) + abs( dFdy( texCoord.y ) ) ),\n 0.0,\n 0.5\n );\n float a = smoothstep( 0.5 - w, 0.5 + w, sdf );\n\n // gamma correction for linear attenuation\n a = pow( a, 1.0 / gamma );\n if( a < 0.2 ) discard;\n //a *= opacity;\n\n vec3 outgoingLight = vColor;\n if( outlineWidth > 0.0 && sdf < ( 0.5 + outlineWidth ) ){\n outgoingLight = outlineColor;\n }\n\n finalColor = vec4( outgoingLight, a ); \n }\n\n //gl_FragColor = finalColor;\n vec3 outgoingLight = finalColor.rgb;\n\n "+e.THREE.ShaderChunk["fog_fragment"]+"\n \n #ifdef USE_FOG\n float alpha = (1.0 - fogFactor) * finalColor.a;\n if (alpha < 0.05) discard;\n gl_FragColor = vec4( outgoingLight.rgb, alpha );\n #else\n gl_FragColor = finalColor;\n #endif\n}\n"})(r=t.Material||(t.Material={}))})(t=e.Labels||(e.Labels={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2017 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){var r;(function(t){"use strict";function r(r){var n=e.THREE.UniformsUtils.merge([e.THREE.UniformsLib["common"],e.THREE.UniformsLib["fog"],{fontTexture:{type:"t",value:r},xOffset:{type:"f",value:0},yOffset:{type:"f",value:0},zOffset:{type:"f",value:0},sizeFactor:{type:"f",value:1},outlineWidth:{type:"f",value:0},outlineColor:{type:"v3",value:new e.THREE.Vector3(0,0,0)},backgroundColor:{type:"v3",value:new e.THREE.Vector3(0,0,0)},backgroundOpacity:{type:"f",value:.5}}]);n.fontTexture.value=r;var i=new e.THREE.ShaderMaterial({uniforms:n,attributes:{mapping:{type:"v2",value:null},inputTexCoord:{type:"v2",value:null},inputSize:{type:"f",value:null}},lights:false,fog:true,vertexShader:t.VERTEX_SHADER,fragmentShader:t.FRAGMENT_SHADER,shading:e.THREE.NoShading,side:e.THREE.DoubleSide,vertexColors:e.THREE.VertexColors,blending:e.THREE.NormalBlending,transparent:false,wireframe:false,linewidth:1});return i}t.create=r})(r=t.Material||(t.Material={}))})(t=e.Labels||(e.Labels={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2017 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";r.DefaultLabelsOptions={fontFamily:"sans-serif",fontSize:32,fontStyle:"normal",fontWeight:"normal",useSDF:true,attachment:"middle-center",backgroundMargin:1};var n=function(n){y(i,n);function i(){return n!==null&&n.apply(this,arguments)||this}i.prototype.applySelectionInternal=function(e,t){return false};i.prototype.getPickElements=function(e){return[]};i.prototype.highlightElement=function(e,t){return false};i.prototype.highlightInternal=function(e){return false};i.prototype.applyColoring=function(e){var t=this.geometry.attributes.color.array;var r=0,n={r:.1,g:.1,b:.1};var i=0;for(var a=0,o=this.labels;a=1&&x<=4)l+=x;else if(x===6||x===7||x===8){var C=v[_]-v[w],E=y[_]-y[w],S=g[_]-g[w];var T=Math.sqrt(C*C+E*E+S*S);c+=Math.ceil(a*T)}}return{bonds:i,covalentStickCount:l,dashPartCount:c}}var c=function(){function e(e,t){this.bondTemplate=e;this.builder=t;this.bondUpVector=i.fromValues(1,0,0);this.dir=i.zero();this.scale=i.zero();this.rotation=a.zero();this.offset=i.zero();this.a=i.zero();this.b=i.zero()}return e}();var f;(function(e){var r={};function n(e){if(r[e])return r[e];var n;switch(e){case 0:n=2;break;case 1:n=4;break;case 2:n=6;break;case 3:n=8;break;case 4:n=10;break;case 5:n=12;break;default:n=14;break}var i=new t.THREE.TubeGeometry(new t.THREE.LineCurve3(new t.THREE.Vector3(0,0,0),new t.THREE.Vector3(1,0,0)),2,1,n);var a=t.GeometryHelper.toRawGeometry(i);r[e]=a;return a}e.getBond=n;var i={};function a(e){if(i[e])return i[e];var r,n=1;switch(e){case 0:r=new t.THREE.OctahedronGeometry(n,0);break;case 1:r=new t.THREE.OctahedronGeometry(n,1);break;case 2:r=new t.THREE.IcosahedronGeometry(n,0);break;case 3:r=new t.THREE.IcosahedronGeometry(n,1);break;case 4:r=new t.THREE.IcosahedronGeometry(n,2);break;case 5:r=new t.THREE.OctahedronGeometry(n,3);break;default:r=new t.THREE.IcosahedronGeometry(n,3);break}var a=t.GeometryHelper.toRawGeometry(r);i[e]=a;return a}e.getAtom=a})(f||(f={}));var h=function(){function e(e,r,n){this.model=e;this.atomIndices=r;this.params=n;this.tessalation=this.params.tessalation;this.atomRadius=this.params.atomRadius;this.bondRadius=this.params.bondRadius;this.hideBonds=this.params.hideBonds;this.bondTemplate=f.getBond(this.tessalation);this.atomTemplate=f.getAtom(this.tessalation);this.dashTemplate=o.getDashTemplate();this.atomCount=u(this.model,this.atomIndices,this.params);this.atomVertexCount=this.atomTemplate.vertexCount*this.atomCount;this.atomBuilder=o.createStatic(this.atomVertexCount,this.atomTemplate.indexCount*this.atomCount);this.atomColors=new Float32Array(this.atomVertexCount*3);this.atomPickColors=new Float32Array(this.atomVertexCount*4);this.atoms=this.model.data.atoms;this.positions=this.model.positions;this.cX=this.positions.x;this.cY=this.positions.y;this.cZ=this.positions.z;this.atomSymbols=this.atoms.elementSymbol;this.residueIndex=this.atoms.residueIndex;this.scale=i.zero();this.translation=i.zero();this.pickColor={r:.1,g:.1,b:.1};this.pickOffset=0;this.atomMapBuilder=new t.Selection.VertexMapBuilder(this.atomIndices.length);this.bs=void 0}return e}();var d=function(){function e(e){this.state=e;this.info=l(this.state.model,this.state.atomIndices,this.state.params);this.bondVertexCount=this.state.bondTemplate.vertexCount*this.info.covalentStickCount+this.state.dashTemplate.vertexCount*this.info.dashPartCount;this.bondBuilder=o.createStatic(this.bondVertexCount,this.state.bondTemplate.indexCount*this.info.covalentStickCount+this.state.dashTemplate.indexCount*this.info.dashPartCount);this.bondColors=new Float32Array(this.bondVertexCount*3);this.bondRadius=this.state.params.bondRadius;this.bondState=new c(this.state.bondTemplate,this.bondBuilder);this.bondCount=this.info.bonds.count}return e}();var p=function(){function n(){}n.prototype.dispose=function(){this.atomsGeometry.dispose();this.bondsGeometry.dispose();this.pickGeometry.dispose()};n.addAtom=function(e,r){r.atomMapBuilder.startElement(e);var n=r.atomRadius(e);i.set(r.scale,n,n,n);i.set(r.translation,r.cX[e],r.cY[e],r.cZ[e]);var a=r.atomBuilder.vertices.elementCount;o.addRawTransformed(r.atomBuilder,r.atomTemplate,r.scale,r.translation,void 0);t.Selection.Picking.assignPickColor(e,r.pickColor);for(var s=0,u=r.atomTemplate.vertexCount;se.Core.Computation.UpdateProgressDelta))return[3,3];a=p;return[4,r.updateProgress("Adding atoms...",true,l,c)];case 2:m.sent();m.label=3;case 3:l+=i;return[3,1];case 4:return[2]}})})};n.addBondsChunks=function(t,r,i){return m(this,void 0,void 0,function(){var a,o,s,u,l,c;return v(this,function(f){switch(f.label){case 0:a=2500;o=e.Core.Utils.PerformanceMonitor.currentTime();s=0;f.label=1;case 1:if(!(se.Core.Computation.UpdateProgressDelta))return[3,3];o=c;return[4,i.updateProgress("Adding bonds...",true,s,r.bondCount)];case 2:f.sent();f.label=3;case 3:s+=a;return[3,1];case 4:return[2]}})})};n.addBonds=function(e,t){return m(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:if(e.params.hideBonds){return[2]}return[4,t.updateProgress("Computing bonds...",true)];case 1:i.sent();r=new d(e);e.bs=r;return[4,n.addBondsChunks(e,r,t)];case 2:i.sent();return[2]}})})};n.build=function(t,i,a,o){return m(this,void 0,void 0,function(){var s,u,l;return v(this,function(c){switch(c.label){case 0:return[4,o.updateProgress("Creating atoms...")];case 1:c.sent();s=new h(t,a,e.Core.Utils.extend({},i,r.DefaultBallsAndSticksModelParameters));return[4,n.addAtoms(s,o)];case 2:c.sent();return[4,n.addBonds(s,o)];case 3:c.sent();return[4,o.updateProgress("Finalizing...")];case 4:c.sent();u=new b;if(s.bs){u.bondsGeometry=n.getBondsGeometry(s.bs)}else{u.bondsGeometry=n.getEmptyBondsGeometry()}l=n.getAtomsGeometry(s);u.vertexStateBuffer=l.vertexStateBuffer;u.atomsGeometry=l.atomsGeometry;u.pickGeometry=l.atomsPickGeometry;u.atomVertexMap=l.atomVertexMap;return[2,u]}})})};return n}();function g(e,t,r,n){return p.build(e,t,r,n)}r.buildGeometry=g;var b=function(e){y(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.atomsGeometry=void 0;t.bondsGeometry=void 0;t.pickGeometry=void 0;t.atomVertexMap=void 0;t.vertexStateBuffer=void 0;return t}t.prototype.dispose=function(){this.atomsGeometry.dispose();this.bondsGeometry.dispose();this.pickGeometry.dispose()};return t}(t.GeometryBase);r.BallsAndSticksGeometry=b})(n=r.BallsAndSticks||(r.BallsAndSticks={}))})(r=t.Molecule||(t.Molecule={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){var n;(function(r){var n;(function(r){var n=function(e){y(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=void 0;t.pickGeometry=void 0;t.gapsGeometry=void 0;t.directionConesGeometry=void 0;t.vertexMap=void 0;t.vertexStateBuffer=void 0;return t}t.prototype.dispose=function(){this.geometry.dispose();this.pickGeometry.dispose();if(this.gapsGeometry){this.gapsGeometry.dispose()}if(this.directionConesGeometry){this.directionConesGeometry.dispose()}};return t}(t.GeometryBase);r.Data=n;function i(t,i,a,o,s,u){return m(this,void 0,void 0,function(){var l,c,f,h,d,p;return v(this,function(m){switch(m.label){case 0:l=e.Core.Utils.extend({},o,r.CartoonsGeometryParams.Default);c={computation:u,model:t,atomIndices:i,linearSegments:a,parameters:o,isTrace:s,params:l,state:new r.CartoonsGeometryState(l,t.data.residues.count),units:void 0,strandArrays:{startIndex:t.data.residues.atomStartIndex,endIndex:t.data.residues.atomEndIndex,x:t.positions.x,y:t.positions.y,z:t.positions.z,name:t.data.atoms.name},strandTemplate:void 0,builder:new r.Builder,geom:new n};return[4,c.computation.updateProgress("Building units...")];case 1:m.sent();c.units=r.CartoonAsymUnit.buildUnits(c.model,c.atomIndices,c.linearSegments);return[4,r.buildUnitsAsync(c)];case 2:m.sent();if(c.strandTemplate)c.strandTemplate.geometry.dispose();c.geom.vertexMap=c.state.vertexMap.getMap();return[4,c.computation.updateProgress("Creating geometry...")];case 3:m.sent();r.createGeometry(c);f=c.geom;for(h=0,d=Object.keys(c);hl/4-1;this.residueIndex=new Int32Array(this.residueCount);for(var p=0,m=this.elements;p2){var y=2,g=3,b=4;if(e.residueType[0]!==5){this.reflectPositions(e.uPositions,0,1,y,g,g,b,.4,.6);this.reflectPositions(e.vPositions,0,1,y,g,g,b,.4,.6)}else{this.reflectPositions(e.uPositions,1,0,y,g,g,b,.5,.5);this.reflectPositions(e.vPositions,1,0,y,g,g,b,.5,.5)}y=v+1;g=v;b=v-1;if(e.residueType[v-1]!==5){this.reflectPositions(e.uPositions,v+2,v+3,y,g,g,b,.4,.6);this.reflectPositions(e.vPositions,v+2,v+3,y,g,g,b,.4,.6)}else{this.reflectPositions(e.uPositions,v+2,v+3,y,g,g,b,.5,.5);this.reflectPositions(e.vPositions,v+2,v+3,y,g,g,b,.5,.5)}}else if(v===2){for(s=0;s<2;s++){e.uPositions[3*s]=e.uPositions[6];e.uPositions[3*s+1]=e.uPositions[7];e.uPositions[3*s+2]=e.uPositions[8];e.vPositions[3*s]=e.vPositions[6];e.vPositions[3*s+1]=e.vPositions[7];e.vPositions[3*s+2]=e.vPositions[8];e.uPositions[(v+2)*3+3*s]=e.uPositions[(v+1)*3];e.uPositions[(v+2)*3+3*s+1]=e.uPositions[(v+1)*3+1];e.uPositions[(v+2)*3+3*s+2]=e.uPositions[(v+1)*3+2];e.vPositions[(v+2)*3+3*s]=e.vPositions[(v+1)*3];e.vPositions[(v+2)*3+3*s+1]=e.vPositions[(v+1)*3+1];e.vPositions[(v+2)*3+3*s+2]=e.vPositions[(v+1)*3+2]}}else{var x=[e.uPositions[6]-e.vPositions[6],e.uPositions[7]-e.vPositions[7],e.uPositions[8]-e.vPositions[8]];for(var _=0;_<2;_++){for(var w=0;w<3;w++){e.uPositions[3*_+w]=e.uPositions[6+w]-.5*(_+1)*x[w];e.uPositions[9+3*_+w]=e.uPositions[6+w]+.5*(_+1)*x[w];e.vPositions[3*_+w]=e.vPositions[6+w]+.5*(_+1)*x[w];e.vPositions[9+3*_+w]=e.vPositions[6+w]-.5*(_+1)*x[w]}}}};r.prototype.initControlsPoints=function(e){var r=new t.THREE.Vector3,n=e.uvLength-1,i=new t.THREE.Vector3,a=new t.THREE.Vector3,o=new t.THREE.Vector3,s=new t.THREE.Vector3,u=new t.THREE.Vector3,l=new t.THREE.Vector3,c=new t.THREE.Vector3,f=new t.THREE.Vector3,h=1;for(var d=0;d0&&s.angleTo(r)>Math.PI/2){s.negate()}r.copy(s);i.addVectors(f,s);e.addControlPoint(f,i)}e.finishContols()};r.prototype.computeSplines=function(e){var n=new t.THREE.Vector3,i=new t.THREE.Vector3,a=new t.THREE.Vector3,o=e.residueCount,s=e.pPositions,u=e.dPositions,l=new t.THREE.Vector3,c=new t.THREE.Vector3,f=new t.THREE.Vector3,h=new t.THREE.Vector3,d=new t.THREE.Vector3,p=new t.THREE.Vector3,m=new t.THREE.Vector3,v=new t.THREE.Vector3,y=new t.THREE.Vector3,g=new t.THREE.Vector3;for(var b=0;b1){u=m-1;continue}for(var v=u;v=a){continue}var v=t[h],y=t[h+d];c.set(s[v],u[v],l[v]);f.set(s[y],u[y],l[y]);if(Math.abs(c.distanceTo(f)-n[d-2])>i){return false}}}return true}function g(e){if(e.length===0){throw"Cartoons cannot be constructred from this model/selection."}}function b(e,t,n){var i=s(e,t);var a=[];var o=u(e);for(var c=0,f=e.data.secondaryStructure;c0){w.push(new r(e,_,n))}y=null;_=[]}else{if(y===null)y=h;if(b[y.endResidueIndex-1]!==b[h.startResidueIndex]||y!==h&&x[h.startResidueIndex]-x[y.endResidueIndex-1]>1||y.startResidueIndex!==h.startResidueIndex&&h.startResidueIndex-y.endResidueIndex>0){if(_.length>0){w.push(new r(e,_,n))}else if(y!==null){w.push(new r(e,[y],n))}y=null;_=[h]}else{_[_.length]=h}}y=h}if(_.length>0){w.push(new r(e,_,n))}return w}r.buildUnits=b})(i=r.CartoonAsymUnit||(r.CartoonAsymUnit={}));var a=function(){function e(e){this.typeBuilder=n.forArray(1e4);this.residueType=[];this.uPositions=new Float32Array(0);this.vPositions=new Float32Array(0);this.pPositions=new Float32Array(0);this.dPositions=new Float32Array(0);this.uvLength=0;this.residueCount=0;this.typeBuilder=n.forArray(e+4);this.uPositionsBuilder=n.forVertex3D(e+4);this.vPositionsBuilder=n.forVertex3D(e+4);this.pPositionsBuilder=n.forVertex3D(e+4);this.dPositionsBuilder=n.forVertex3D(e+4);n.add(this.typeBuilder,0);n.add(this.typeBuilder,0);n.add3(this.uPositionsBuilder,0,0,0);n.add3(this.uPositionsBuilder,0,0,0);n.add3(this.vPositionsBuilder,0,0,0);n.add3(this.vPositionsBuilder,0,0,0)}e.prototype.addResidue=function(e,t,r){var i=t.atomStartIndex[e],a=t.atomEndIndex[e],o=false,s=false;var u=t.name;if(r!==5){for(var l=i;l=0){n.add3(this.uPositionsBuilder,t.x[c],t.y[c],t.z[c]);o=true}}}var f=false;if(!s){var h=this.uPositionsBuilder.array,d=h.length;n.add3(this.vPositionsBuilder,h[d-3],h[d-2],h[d-1]);f=true}else if(!o){var h=this.vPositionsBuilder.array,d=h.length;n.add3(this.uPositionsBuilder,h[d-3],h[d-2],h[d-1]);f=true}n.add(this.typeBuilder,r);return f};e.prototype.finishResidues=function(){n.add(this.typeBuilder,0);n.add(this.typeBuilder,0);n.add3(this.uPositionsBuilder,0,0,0);n.add3(this.uPositionsBuilder,0,0,0);n.add3(this.vPositionsBuilder,0,0,0);n.add3(this.vPositionsBuilder,0,0,0);this.residueType=this.typeBuilder.array;this.uPositions=this.uPositionsBuilder.array;this.vPositions=this.vPositionsBuilder.array;this.typeBuilder=null;this.uPositionsBuilder=null;this.vPositionsBuilder=null;this.uvLength=this.residueType.length;this.residueCount=this.uvLength-4};e.prototype.addControlPoint=function(e,t){n.add3(this.pPositionsBuilder,e.x,e.y,e.z);n.add3(this.dPositionsBuilder,t.x,t.y,t.z)};e.prototype.finishContols=function(){this.pPositions=this.pPositionsBuilder.array;this.dPositions=this.dPositionsBuilder.array;this.pPositionsBuilder=null;this.dPositionsBuilder=null};return e}()})(n=r.Geometry||(r.Geometry={}))})(n=r.Cartoons||(r.Cartoons={}))})(r=t.Molecule||(t.Molecule={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){var n;(function(r){var n;(function(r){var n=function(){function e(){this.radialSegmentCount=10;this.turnWidth=.1;this.strandWidth=.15;this.nucleotideStrandLineWidth=.15;this.nucleotideStrandFactor=3;this.helixWidth=1.1;this.helixHeight=.1;this.sheetWidth=1.1;this.sheetHeight=.1;this.arrowWidth=1.7;this.tessalation=2}e.Default=new e;return e}();r.CartoonsGeometryParams=n;var i=t.Geometry.Builder;var a=function(){function e(e,r){this.params=e;this.residueCount=r;this.residueIndex=0;this.builder=i.createDynamic(this.residueCount*8,this.residueCount*16);this.vs=this.builder.vertices;this.is=this.builder.indices;this.gapsBuilder=i.createDynamic(256,512);this.dCones=i.createDynamic(1,1);this.dConesInit=false;this.translationMatrix=new t.THREE.Matrix4;this.scaleMatrix=new t.THREE.Matrix4;this.rotationMatrix=new t.THREE.Matrix4;this.invMatrix=new t.THREE.Matrix4;this.vertexMap=new t.Selection.VertexMapBuilder(r)}Object.defineProperty(e.prototype,"verticesDone",{get:function(){return this.vs.elementCount},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"trianglesDone",{get:function(){return this.is.elementCount},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"directionConesBuilder",{get:function(){if(this.dConesInit)return this.dCones;this.dConesInit=true;this.dCones=i.createDynamic(this.residueCount,this.residueCount);return this.dCones},enumerable:true,configurable:true});e.prototype.addVertex=function(e,t){i.addVertex3d(this.builder,e.x,e.y,e.z);i.addNormal3d(this.builder,t.x,t.y,t.z)};e.prototype.addTriangle=function(e,t,r){i.addIndex3d(this.builder,e,t,r)};e.prototype.addTriangles=function(e,t,r,n,a,o){i.addIndex3d(this.builder,e,t,r);i.addIndex3d(this.builder,n,a,o)};return e}();r.CartoonsGeometryState=a;function o(e){var r=e.params.nucleotideStrandLineWidth,n=e.params.tessalation;var i=0,a=0,o;switch(n){case 0:a=2;i=1;break;case 1:a=3;i=2;break;case 2:a=4;i=2;break;case 3:a=8;i=4;break;case 4:a=10;i=6;break;case 5:a=14;i=6;break;default:a=16;i=8;break}var s=[],u=Math.PI/2/i;for(var l=0;l<=i;l++){s[l]=new t.THREE.Vector3(0,r*Math.cos(l*u),.1*Math.sin(l*u));s[l].z+=.9}o=new t.THREE.LatheGeometry([new t.THREE.Vector3(0,r,0)].concat(s),a,Math.PI);var c=t.GeometryHelper.getIndexedBufferGeometry(o);e.strandTemplate={vertex:c.attributes.position.array,normal:c.attributes.normal.array,index:c.attributes.index.array,geometry:c}}function s(e,t){var r=t.state,n=t.params;var i=t.builder;for(var a=0,s=e.residueCount;aa.length)return;l.set(b,a[3*o],a[3*o+1],a[3*o+2]);l.set(y,a[3*o],a[3*o+1],a[3*o+2]);l.set(g,a[3*s],a[3*s+1],a[3*s+2]);l.sub(y,g,y);var u=l.magnitude(y);if(u<=.1)return;l.set(x,2*r,u,2*r);l.normalize(y,y);l.makeRotation(_,p,y);i.addRawTransformed(e.state.directionConesBuilder,h,x,b,_)}function C(t){return m(this,void 0,void 0,function(){var r,n,i,a,o,l;return v(this,function(c){switch(c.label){case 0:r=1e4;n=e.Core.Utils.PerformanceMonitor.currentTime();i=0;c.label=1;case 1:if(!(ie.Core.Computation.UpdateProgressDelta))return[3,3];n=o;return[4,t.computation.updateProgress("Building units...",true,i,t.units.length)];case 2:c.sent();c.label=3;case 3:return[3,1];case 4:for(l=0;l1?e:e.children[0],pick:new t.THREE.Mesh(this.cartoons.pickGeometry,this.pickMaterial)}};a.create=function(i,o){var s=this;var u=o.model,l=o.queryContext,c=o.atomIndices,f=o.theme,h=o.params,d=o.props;return e.Core.computation(function(o){return m(s,void 0,void 0,function(){var s,p,m,y,g;return v(this,function(v){switch(v.label){case 0:s=0,p=0;return[4,o.updateProgress("Computing cartoons...")];case 1:v.sent();h=e.Core.Utils.extend({},h,r.DefaultCartoonsModelParameters);switch(h.tessalation){case 0:s=2;p=2;break;case 1:s=4;p=3;break;case 2:s=6;p=5;break;case 3:s=10;p=8;break;case 4:s=12;p=10;break;case 5:s=16;p=14;break;default:s=18;p=16;break}return[4,r.Geometry.create(u,c,s,{radialSegmentCount:p,tessalation:+h.tessalation,showDirectionCones:!!h.showDirectionCones},h.drawingType===n.AlphaTrace,o)];case 2:m=v.sent();y=new a;y.cartoons=m;y.queryContext=l;y.material=t.MaterialsHelper.getMeshMaterial();y.gapMaterial=new t.THREE.MeshPhongMaterial({color:7829367,shading:t.THREE.FlatShading});y.directionConeMaterial=new t.THREE.MeshPhongMaterial({color:10066329,shading:t.THREE.FlatShading});y.pickMaterial=t.MaterialsHelper.getPickMaterial();if(d)y.props=d;y.entity=i;y.cartoons.geometry.computeBoundingSphere();y.centroid=y.cartoons.geometry.boundingSphere.center;y.radius=y.cartoons.geometry.boundingSphere.radius;g=y.createObjects();y.object=g.main;y.pickObject=g.pick;y.pickBufferAttributes=[y.cartoons.pickGeometry.attributes.pColor];y.model=u;y.applyTheme(f);y.disposeList.push(y.cartoons,y.material,y.pickMaterial,y.gapMaterial,y.directionConeMaterial);return[2,y]}})})})};return a}(t.Model);r.Model=i})(n=r.Cartoons||(r.Cartoons={}))})(r=t.Molecule||(t.Molecule={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(t){var r;(function(t){t.DefaultBondColor={r:.6,g:.6,b:.6};t.DefaultCartoonDirectionConeColor={r:.85,g:.85,b:.85};t.DefaultElementColor={r:.6,g:.6,b:.6};t.DefaultElementColorMap=e.Core.Utils.FastMap.create();t.DefaultPallete=[];(function(){var e=[["Ac",.43921,.67058,.98039],["Al",.74901,.65098,.65098],["Am",.32941,.36078,.94901],["Sb",.6196,.38823,.7098],["Ar",.50196,.8196,.89019],["As",.74117,.50196,.89019],["At",.45882,.3098,.27058],["Ba",0,.78823,0],["Bk",.54117,.3098,.89019],["Be",.76078,1,0],["Bi",.6196,.3098,.7098],["Bh",.87843,0,.2196],["B",1,.7098,.7098],["Br",.65098,.16078,.16078],["Cd",1,.85098,.56078],["Ca",.23921,1,0],["Cf",.63137,.21176,.83137],["C",.45,.45,.45],["Ce",1,1,.78039],["Cs",.34117,.09019,.56078],["Cl",.12156,.94117,.12156],["Cr",.54117,.6,.78039],["Co",.94117,.5647,.62745],["Cu",.78431,.50196,.2],["Cm",.47058,.36078,.89019],["D",.9,.9,.9],["Db",.8196,0,.3098],["Dy",.12156,1,.78039],["Es",.70196,.12156,.83137],["Er",0,.90196,.45882],["Eu",.38039,1,.78039],["Fm",.70196,.12156,.72941],["F",.70196,1,1],["Fr",.25882,0,.4],["Gd",.27058,1,.78039],["Ga",.76078,.56078,.56078],["Ge",.4,.56078,.56078],["Au",1,.8196,.13725],["Hf",.30196,.76078,1],["Hs",.90196,0,.18039],["He",.85098,1,1],["Ho",0,1,.61176],["H",.9,.9,.9],["In",.65098,.45882,.45098],["I",.58039,0,.58039],["Ir",.09019,.32941,.52941],["Fe",.698,.13,.13],["Kr",.36078,.72156,.8196],["La",.43921,.83137,1],["Lr",.78039,0,.4],["Pb",.34117,.34901,.38039],["Li",.8,.50196,1],["Lu",0,.67058,.14117],["Mg",.54117,1,0],["Mn",.61176,.47843,.78039],["Mt",.92156,0,.14901],["Md",.70196,.05098,.65098],["Hg",.72156,.72156,.81568],["Mo",.32941,.7098,.7098],["Nd",.78039,1,.78039],["Ne",.70196,.89019,.96078],["Np",0,.50196,1],["Ni",.31372,.81568,.31372],["Nb",.45098,.76078,.78823],["N",0,.5,1],["No",.74117,.05098,.52941],["Os",.14901,.4,.58823],["O",1,.3,.3],["Pd",0,.41176,.52156],["P",1,.50196,0],["Pt",.81568,.81568,.87843],["Pu",0,.4196,1],["Po",.67058,.36078,0],["K",.56078,.25098,.83137],["Pr",.85098,1,.78039],["Pm",.63921,1,.78039],["Pa",0,.63137,1],["Ra",0,.49019,0],["Rn",.25882,.5098,.58823],["Re",.14901,.49019,.67058],["Rh",.03921,.49019,.54901],["Rb",.43921,.18039,.69019],["Ru",.14117,.56078,.56078],["Rf",.8,0,.34901],["Sm",.56078,1,.78039],["Sc",.90196,.90196,.90196],["Sg",.85098,0,.27058],["Se",1,.63137,0],["Si",.94117,.78431,.62745],["Ag",.75294,.75294,.75294],["Na",.67058,.36078,.94901],["Sr",0,1,0],["S",.9,.775,.25],["Ta",.30196,.65098,1],["Tc",.23137,.6196,.6196],["Te",.83137,.47843,0],["Tb",.18823,1,.78039],["Tl",.65098,.32941,.30196],["Th",0,.72941,1],["Tm",0,.83137,.32156],["Sn",.4,.50196,.50196],["Ti",.74901,.76078,.78039],["W",.12941,.58039,.83921],["U",0,.56078,1],["V",.65098,.65098,.67058],["Xe",.25882,.6196,.69019],["Yb",0,.74901,.2196],["Y",.58039,1,1],["Zn",.49019,.50196,.69019],["Zr",.58039,.87843,.87843]];for(var r=0,n=e;ru)f=n.Vector3.fromValues(a,a,u-y);m.push({type:"Surface",id:t,surface:h,rotation:p,scale:f,translation:n.Vector3.clone(v)});n.Vector3.add(v,v,c)}return m}r.createDashes=d})(r=t.Primitive||(t.Primitive={}))})(t=e.Visualization||(e.Visualization={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(t){"use strict";var r=e.Core.Geometry.LinearAlgebra;var n=e.Core.Geometry.Surface;function i(i){var a=this;return e.Core.computation(function(o){return m(a,void 0,void 0,function(){var a,s,u,l,c,f,h,d,p,m,c,y,g,b,x,_,w,C,E,S,T,M,A,P,R,k,I,D,c,B,L,F,V,O,F,V,F,V,O,F,V,F,V,O,F,V,F,V,O,F,V,U,F,V,F,V,N;return v(this,function(v){switch(v.label){case 0:return[4,o.updateProgress("Building surface...")];case 1:v.sent();a=e.Core.Utils.FastMap.create();s=[];for(u=0,l=i;u=e.capacity){e.entries.remove(e.entries.first)}e.entries.addLast(r(t,n));return n}t.set=a})(t=e.LRUCache||(e.LRUCache={}))})(t=e.Utils||(e.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n;(function(e){e[e["None"]=0]="None";e[e["Gzip"]=1]="Gzip"})(n=r.DataCompressionMethod||(r.DataCompressionMethod={}));function i(e){return p(e,false)}r.readStringFromFile=i;function a(e){return p(e,true)}r.readArrayBufferFromFile=a;function o(e,t){return p(e,t==="Binary")}r.readFromFile=o;function s(e,t){return b(t,e,false,false)}r.ajaxGetString=s;function u(e,t){return b(t,e,true,false)}r.ajaxGetArrayBuffer=u;function l(e){return b(e.title,e.url,e.type==="Binary",e.compression===n.Gzip)}r.ajaxGet=l;function f(e){var t=new c.Gunzip(new Uint8Array(e));return t.decompress()}function h(t,r,n,i){return m(this,void 0,void 0,function(){var a,o;return v(this,function(s){switch(s.label){case 0:a=i.target.result;if(!n)return[3,2];return[4,t.updateProgress("Decompressing...")];case 1:s.sent();o=f(a);if(r){return[2,o.buffer]}else{return[2,e.Core.Formats.CIF.Binary.MessagePack.utf8Read(o,0,o.length)]}return[3,3];case 2:return[2,a];case 3:return[2]}})})}function d(t,r,n,i){return new e.Promise(function(i,a){n.onerror=function(e){var t=e.target.error;a(t?t:"Failed.")};n.onabort=function(){return a(e.Core.Computation.Aborted)};n.onprogress=function(e){if(e.lengthComputable){t.updateProgress(r,true,e.loaded,e.total)}else{t.updateProgress(r+" "+(e.loaded/1024/1024).toFixed(2)+" MB",true)}};n.onload=function(e){return i(e)}})}function p(r,n){var i=this;return t.Task.fromComputation("Open File","Background",e.Core.computation(function(e){return m(i,void 0,void 0,function(){var t,i,a,o;return v(this,function(s){switch(s.label){case 0:t=new FileReader;i=/\.gz$/i.test(r.name);if(i||n)t.readAsArrayBuffer(r);else t.readAsBinaryString(r);e.updateProgress("Opening file...",function(){return t.abort()});return[4,d(e,"Reading...",t,n)];case 1:a=s.sent();o=h(e,n,i,a);return[2,o]}})})}))}var y=function(){function e(){}e.get=function(){if(this.pool.length){return this.pool.pop()}return new XMLHttpRequest};e.emptyFunc=function(){};e.deposit=function(t){if(this.pool.length=200&&i.status<400))return[3,6];if(!t)return[3,4];a=n.target.response;y.deposit(n.target);if(!r)return[3,2];return[4,e.updateProgress("Decompressing...")];case 1:f.sent();o=new c.Gunzip(new Uint8Array(a));s=o.decompress();return[2,s.buffer];case 2:return[2,a];case 3:return[3,5];case 4:u=n.target.responseText;y.deposit(n.target);return[2,u];case 5:return[3,7];case 6:l=i.statusText;y.deposit(n.target);throw l;case 7:return[2]}})})}function b(r,n,i,a){var o=this;return t.Task.fromComputation(r?r:"Download","Background",e.Core.computation(function(e){return m(o,void 0,void 0,function(){var t,r,o;return v(this,function(s){switch(s.label){case 0:if(!i&&a){throw"Decompress is only available when downloading binary data."}t=y.get();t.open("get",n,true);t.responseType=i?"arraybuffer":"text";t.send();e.updateProgress("Waiting for server...",function(){return t.abort()});return[4,d(e,"Downloading...",t,i)];case 1:r=s.sent();return[4,g(e,i,a,r)];case 2:o=s.sent();return[2,o]}})})}))}})(r=t.Utils||(t.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(t){var r;(function(t){"use strict";var r=/^\s*([1-9][0-9]*)\s+([_.;:""&<>()\/\{}'`~!@#$%A-Za-z0-9*|+-]+)(?:\s+i[:]([.]|[a-zA-Z0-9]))?(?:\s+e[:]([.]|[a-zA-Z0-9]+))?/;function n(e){if(!e||e==="."||e==="?")return null;return e}function i(e){var t=e.match(r);if(!t)return void 0;var i=+t[1]|0;var a=n(t[2]);var o=n(t[3]);var s=n(t[4]);return{entityId:s,authSeqNumber:i,authAsymId:a,insCode:o}}function a(t,r){if(r===void 0){r=","}var n;var a=t.split(r).map(function(e){return i(e)}).filter(function(e){return!!e});return e.Core.Structure.Query.Builder.toQuery((n=e.Core.Structure.Query).residues.apply(n,a))}t.parseAuthResidueId=a})(r=t.Query||(t.Query={}))})(r=t.Utils||(t.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(e){var t;(function(e){"use strict";var t=function(){function e(e,t,r){this.isError=e;this.value=t;this.error=r}e.prototype.bind=function(e){if(this.isError)return this;return e(this.value)};return e}();e.ValueOrError=t;(function(e){function t(t){return new e(true,void 0,t)}e.error=t;function r(t){return new e(true,t)}e.value=r})(t=e.ValueOrError||(e.ValueOrError={}))})(t=e.Query||(e.Query={}))})(t=e.Utils||(e.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(e){"use strict";var t=function(){function e(){this.count=0;this.first=null;this.last=null}e.prototype.addFirst=function(e){e.inList=true;if(this.first)this.first.previous=e;e.next=this.first;this.first=e;this.count++};e.prototype.addLast=function(e){if(this.last!=null){this.last.next=e}e.previous=this.last;this.last=e;if(this.first==null){this.first=e}e.inList=true;this.count++};e.prototype.remove=function(e){if(!e.inList)return;e.inList=false;if(e.previous!==null){e.previous.next=e.next}else if(e.previous===null){this.first=e.next}if(e.next!==null){e.next.previous=e.previous}else if(e.next===null){this.last=e.previous}e.next=null;e.previous=null;this.count--};return e}();e.LinkedList=t})(t=e.Utils||(e.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(e){"use strict";function t(e){return(e<10?"0":"")+e}function r(e){var r=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return r+":"+t(n)+":"+t(i)}e.formatTime=r;function n(e,t){var r=Math.pow(10,t);return Math.round(r*e)/r}e.round=n;function i(e){if(e.isIndeterminate)return e.message;var t=(100*e.current/e.max).toFixed(2);return e.message+" "+t+"%"}e.formatProgress=i;function a(){var e=(new Date).getTime();if(window.performance&&typeof window.performance.now==="function"){e+=performance.now()}var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=(e+Math.random()*16)%16|0;e=Math.floor(e/16);return(t=="x"?r:r&3|8).toString(16)});return t}e.generateUUID=a})(t=e.Utils||(e.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(t){"use strict";var r=void 0;function n(e){if(!r)r=i();return function(e,t){return function(r){var n=t.get(e[r]);if(n!==void 0)return n;return 1}}(e.data.atoms.elementSymbol,r)}t.vdwRadiusFromElementSymbol=n;function i(){var t={H:1.1,He:1.4,Li:1.81,Be:1.53,B:1.92,C:1.7,N:1.55,O:1.52,F:1.47,Ne:1.54,Na:2.27,Mg:1.73,Al:1.84,Si:2.1,P:1.8,S:1.8,Cl:1.75,Ar:1.88,K:2.75,Ca:2.31,Sc:2.16,Ti:1.87,V:1.79,Cr:1.89,Mn:1.97,Fe:1.94,Co:1.92,Ni:1.84,Cu:1.86,Zn:2.1,Ga:1.87,Ge:2.11,As:1.85,Se:1.9,Br:1.83,Kr:2.02,Rb:3.03,Sr:2.49,Y:2.19,Zr:1.86,Nb:2.07,Mo:2.09,Tc:2.09,Ru:2.07,Rh:1.95,Pd:2.02,Ag:2.03,Cd:2.3,In:1.93,Sn:2.17,Sb:2.06,Te:2.06,I:1.98,Xe:2.16,Cs:3.43,Ba:2.68,La:2.4,Ce:2.35,Pr:2.39,Nd:2.29,Pm:2.36,Sm:2.29,Eu:2.33,Gd:2.37,Tb:2.21,Dy:2.29,Ho:2.16,Er:2.35,Tm:2.27,Yb:2.42,Lu:2.21,Hf:2.12,Ta:2.17,W:2.1,Re:2.17,Os:2.16,Ir:2.02,Pt:2.09,Au:2.17,Hg:2.09,Tl:1.96,Pb:2.02,Bi:2.07,Po:1.97,At:2.02,Rn:2.2,Fr:3.48,Ra:2.83,Ac:2.6,Th:2.37,Pa:2.43,U:2.4,Np:2.21,Pu:2.43,Am:2.44,Cm:2.45,Bk:2.44,Cf:2.45,Es:2.45,Fm:2.45,Md:2.46,No:2.46,Lr:2.46};var r=e.Core.Utils.FastMap.create();for(var n in t){r.set(n,t[n]);r.set(n.toUpperCase(),t[n]);r.set(n.toLowerCase(),t[n])}return r}})(r=t.Utils||(t.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(t){"use strict";var r=Object.prototype.hasOwnProperty;function n(t){return e.Core.Utils.extend({},t)}t.shallowClone=n;function i(e,t){if(!e){if(!t)return true;return false}if(!t)return false;var n=Object.keys(e);if(Object.keys(t).length!==n.length)return false;for(var i=0,a=n;i=0)this.context.logger.info(this.info.name+": Aborted.");else this.context.logger.error("Error ("+this.info.name+"): "+e)}}}catch(r){console.error(r)}finally{t.Event.Task.Completed.dispatch(this.context,this.info.id)}};i.prototype.run=function(){var e=this;this.computationCtx=r.createContext();this.computationCtx.progress.subscribe(function(t){return e.progressUpdated(t)});t.Event.Task.Started.dispatch(this.context,this.info);this.context.performance.start("task"+this.info.id);this.result=this.computation.run(this.computationCtx);this.result.then(function(){return e.resolved()}).catch(function(t){return e.rejected(t)})};return i}();n.Running=i;function a(t,r,i){return new n(t,r,e.Core.computation(i))}n.create=a;function o(e,t,i){return new n(e,t,r.resolve(i))}n.resolve=o;function s(e,t,i){return new n(e,t,r.reject(i))}n.reject=s;function u(e,t,r){return new n(e,t,r)}n.fromComputation=u;function l(e){return e.then&&e.catch}n.isPromise=l})(n=t.Task||(t.Task={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){"use strict";var t;(function(e){var t={dispatch:function(e,t){e.dispatcher.dispatch({type:this,data:t})},getStream:function(e){return e.dispatcher.getStream(this)}};function r(e,r){return Object.create(t,{name:{writable:false,configurable:false,value:e},lane:{writable:false,configurable:false,value:r}})}e.create=r})(t=e.Event||(e.Event={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r=e.Service.Dispatcher.Lane;t.Log=t.create("bs.Log",r.Log);var n;(function(e){e.LayoutChanged=t.create("bs.Common.LayoutChanged",r.Slow);e.ComponentsChanged=t.create("bs.Common.ComponentsChanged",r.Slow)})(n=t.Common||(t.Common={}));var i;(function(e){e.Started=t.create("bs.Tasks.Started",r.Task);e.Completed=t.create("bs.Tasks.Completed",r.Task);e.StateUpdated=t.create("bs.Tasks.StateUpdated",r.Busy)})(i=t.Task||(t.Task={}));var a;(function(e){e.NodeUpdated=t.create("bs.Tree.NodeUpdated",r.Slow);e.NodeAdded=t.create("bs.Tree.NodeAdded",r.Slow);e.NodeRemoved=t.create("bs.Tree.NodeRemoved",r.Slow);e.TransformStarted=t.create("bs.Tree.TransformStarted",r.Slow);e.TransformFinished=t.create("bs.Tree.TransformFinished",r.Slow);e.TransformerApply=t.create("bs.Tree.TransformerApplied",r.Transformer)})(a=t.Tree||(t.Tree={}));var o;(function(e){e.CurrentChanged=t.create("bs.Entity.CurrentChanged",r.Slow)})(o=t.Entity||(t.Entity={}));var s;(function(e){e.Highlight=t.create("bs.Visuals.HoverElement",r.Fast)})(s=t.Interactivity||(t.Interactivity={}));var u;(function(e){e.VisualHoverElement=t.create("bs.Visual.HoverElement",r.Fast);e.VisualSelectElement=t.create("bs.Visual.SelectElement",r.Fast);e.CameraChanged=t.create("bs.Visual.CameraChanged",r.Fast)})(u=t.Visual||(t.Visual={}));var l;(function(e){e.ModelHighlight=t.create("bs.Molecule.ModelHighlight",r.Fast);e.ModelSelect=t.create("bs.Molecule.ModelSelect",r.Fast)})(l=t.Molecule||(t.Molecule={}))})(t=e.Event||(e.Event={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n=t.Service.Dispatcher.Lane;var i=t.Event.create;var a;(function(e){e.RemoveNode=i("bs.cmd.Tree.RemoveNode",n.Slow);e.ApplyTransform=i("bs.cmd.Tree.ApplyTransform",n.Slow)})(a=r.Tree||(r.Tree={}));var o;(function(e){e.SetCurrent=i("bs.cmd.Entity.SetCurrentNode",n.Slow);e.ToggleExpanded=i("bs.cmd.Entity.ToggleExpanded",n.Slow);e.SetVisibility=i("bs.cmd.Entity.SetVisibility",n.Slow);e.Focus=i("bs.cmd.Entity.Focus",n.Slow);e.Highlight=i("bs.cmd.Entity.Highlight",n.Slow)})(o=r.Entity||(r.Entity={}));var s;(function(t){t.SetState=e.Bootstrap.Event.create("lm.cmd.Layout.SetState",n.Slow);t.SetViewportOptions=i("bs.cmd.Layout.SetViewportOptions",n.Slow)})(s=r.Layout||(r.Layout={}));var u;(function(e){e.FocusQuery=i("bs.cmd.Molecule.FocusQuery",n.Slow);e.Highlight=i("bs.cmd.Molecule.Highlight",n.Slow);e.CreateSelectInteraction=i("bs.cmd.Molecule.CreateSelectInteraction",n.Slow)})(u=r.Molecule||(r.Molecule={}));var l;(function(e){e.ResetScene=i("bs.cmd.Visual.ResetScene",n.Slow);e.ResetTheme=i("bs.cmd.Visual.ResetTheme",n.Slow);e.UpdateBasicTheme=i("bs.cmd.Visual.UpdateBasicTheme",n.Slow)})(l=r.Visual||(r.Visual={}));var c;(function(e){e.Show=i("bs.cmd.Toast.Show",n.Slow);e.Hide=i("bs.cmd.Toast.Hide",n.Slow)})(c=r.Toast||(r.Toast={}))})(r=t.Command||(t.Command={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){"use strict";var r;(function(r){function n(t,r){var n={version:0,refs:e.Core.Utils.FastMap.create(),nodes:e.Core.Utils.FastSet.create(),root:r,context:t};r.parent=r;r.tree=n;return n}r.create=n;function i(e){if(!e.tree)return;var t=e.tree.refs.get(e.ref);if(!t){e.tree.refs.set(e.ref,[e])}else{t.push(e)}}function a(e){r.Node.forEach(e,function(e){return i(e)})}function o(e,t){var r=e.refs.get(t.ref);if(!r)return;var n=r.indexOf(t);if(n<0)return;r[n]=r[r.length-1];r.pop();if(!r.length)e.refs.delete(t.ref)}function s(e){if(!e.parent)throw"Cannot add a node without a parent.";var n=e.parent.tree;r.Node.forEach(e,function(e){return e.tree=n});r.Node.addChild(e.parent,e);a(e);t.Entity.nodeUpdated(e.parent);u(e)}r.add=s;function u(e){var n=e.tree.context;r.Node.forEachPreorder(e,function(e){t.Event.Tree.NodeAdded.dispatch(n,e)})}function l(e,n,i){r.Node.replaceChild(n.parent,n,i);h(e.context,n);r.Node.forEach(i,function(t){return t.tree=e});a(i);for(var o=0,s=i.children;o=0;l--){if(a.children[l]&&!r.Node.isHidden(a.children[l])){t.Command.Entity.SetCurrent.dispatch(o,a.children[l]);u=true;break}}if(!u){t.Command.Entity.SetCurrent.dispatch(o,a)}}if(e.transform.props.isBinding&&!a.children.length){d(e.parent)}}r.remove=d})(r=t.Tree||(t.Tree={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r;(function(t){t.Null={};function r(e,t){return e&&e.type===t}t.is=r;function n(e,t){if(!t)return false;while(true){if(e===t)return true;e=e.parent;if(!e||e===e.parent)return false}}t.hasAncestor=n;function i(e,t){if(!e)return void 0;var n=e.parent;while(true){if(r(n,t))return n;n=n.parent;if(n.parent===n)return void 0}}t.findAncestor=i;function a(e,t){if(!e)return void 0;var r=e;while(true){if(t.indexOf(r.type)>=0)return r;r=r.parent;if(r.parent===r){return t.indexOf(r.type)>=0?r:void 0}}}t.findClosestNodeOfType=a;var o=0;function s(){return o++}t.createId=s;function u(e){e.version++;return e}t.update=u;function l(t,r){var n=e.Utils.merge(t.props,r);if(n===t.props)return t;return u(t)}t.withProps=l;function c(t,r){var n=e.Utils.merge(t.state,r);if(n===t.state)return t;t.state=n;return u(t)}t.withState=c;function f(e,t){t.index=e.children.length;e.children.push(t);return u(e)}t.addChild=f;function h(e,t){var r=e.children;for(var n=t.index,i=r.length-1;n0){return"Invalid params: "+r.join(", ")+"."}}return void 0};e.prototype.validate=function(e,r){var n=this.info;if(!e)return t.Task.reject(n.name,"Normal","Could not find a suitable node to apply the transformer to.");var i=this.checkTypes(e,r);if(i)return t.Task.reject(n.name,"Normal",i);var a=this.validateParams(r);if(a)return t.Task.reject(n.name,"Normal",a);return void 0};e.prototype.apply=function(e,r,n){if(this.info.isComposed)return this.transform(e,r,n);var i=this.getTarget(r);var a=this.validate(i,n);if(a)return a;t.Event.Tree.TransformerApply.dispatch(e,{a:i,t:n});return this.transform(e,i,n)};e.prototype.update=function(e,r,n){var i=r.parent;if(this.info.isComposed&&!this.updater)return this.transform(e,i,n);if(this.updater){var a=this.validateParams(n);if(a)return t.Task.reject(this.info.name,"Normal",a);var o=this.updater(e,r,n);if(o)return o}t.Event.Tree.TransformerApply.dispatch(e,{a:r.parent,t:n});return this.transform(e,i,n)};e.prototype.create=function(e,t){return r.Transform.create(e,t?t:{},this)};return e}();function a(e,t,r){return new i(e,t,r)}n.create=a;function o(e,t,r,n){return a({id:e,name:e,description:"",from:t,to:r,validateParams:function(){return void 0},defaultParams:function(){return{}}},n)}n.internal=o;function s(e,t,r,n,i){try{n(t)}finally{if(i){if(typeof i==="string"){r.logger.error(i)}else{setTimeout(function(){return i.call(null,r,e,t)},0)}}}}function u(e,t,n,i,a,o){return m(this,void 0,void 0,function(){var s,u;return v(this,function(l){switch(l.label){case 0:s=false;l.label=1;case 1:l.trys.push([1,3,,4]);return[4,r.Transform.apply(t,e.action).run()];case 2:l.sent();try{n(r.Node.Null)}finally{if(a){if(typeof a==="string"){if(!s)t.logger.message(a)}else{setTimeout(function(){return a.call(null,t,e.context)},0)}}}return[3,4];case 3:u=l.sent();s=true;try{i(u)}finally{if(o){if(typeof o==="string"){t.logger.error(o)}else{setTimeout(function(){return o.call(null,t,e.context,u)},0)}}}return[3,4];case 4:return[2]}})})}function l(r,n,i,o){return a(r,function(a,s,l){return t.Task.create(r.name,"Background",function(t){return new e.Promise(function(e,t){try{var r=n(a,s,l);u({action:r,context:void 0},a,e,t,i,o)}catch(e){t(e)}})})})}n.action=l;function c(r,n,i,o){return a(r,function(a,l,c){return t.Task.create(r.name,"Background",function(r){return new e.Promise(function(e,r){try{var f=n(a,l,c);if(t.Task.isPromise(f)){f.then(function(t){return u(t,a,e,r,i,o)}).catch(function(e){return s(void 0,e,a,r,o)})}else{u(f,a,e,r,i,o)}}catch(e){r(e)}})})})}n.actionWithContext=c})(n=r.Transformer||(r.Transformer={}))})(r=t.Tree||(t.Tree={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n;(function(n){var i=function(){function n(e,t,r){this.params=e;this.props=t;this.transformer=r;this.isUpdate=false}n.prototype.resolveAdd=function(e,t){if(t===r.Node.Null){return t}t.ref=this.props.ref;if(this.props.isHidden)t.isHidden=true;if(!t.tree){t.parent=e;r.add(t)}return t};n.prototype.resolveUpdate=function(e,t,n){if(n===r.Node.Null){return n}var i=t.parent;n.ref=this.props.ref;n.parent=i;n.tag=t.tag;n.state=t.state;if(this.props.isHidden)n.isHidden=true;r.update(e.tree,t,n);return n};n.prototype.apply=function(r,n){var i=this;return e.Core.computation(function(a){return new e.Promise(function(e,a){return m(i,void 0,void 0,function(){var i=this;return v(this,function(o){t.Event.Tree.TransformStarted.dispatch(r,this);this.transformer.apply(r,n,this).run(r).then(function(a){e(i.resolveAdd(n,a));t.Event.Tree.TransformFinished.dispatch(r,{transform:i})}).catch(function(e){a(e);t.Event.Tree.TransformFinished.dispatch(r,{transform:i,error:e})});return[2]})})})})};n.prototype.update=function(r,n){var i=this;return e.Core.computation(function(a){return new e.Promise(function(e,a){i.isUpdate=true;i.props.ref=n.transform.props.ref;t.Event.Tree.TransformStarted.dispatch(r,i);if(n.transform.props.isBinding)i.props.isBinding=true;i.transformer.update(r,n,i).run(r).then(function(a){e(i.resolveUpdate(r,n,a));t.Event.Tree.TransformFinished.dispatch(r,{transform:i})}).catch(function(e){a(e);t.Event.Tree.TransformFinished.dispatch(r,{transform:i,error:e})})})})};return n}();function a(e,r,n){var a=t.Utils.shallowClone(r);if(!a.ref)a.ref=t.Utils.generateUUID();return new i(e,a,n)}n.create=a;function o(e){return!!e.selector}function s(e){return!!e.compile}function u(t,r,n){var i=this;var a;try{if(o(r))a=[r];else if(s(r))a=r.compile();else a=r}catch(t){return e.Core.Computation.reject(t)}return e.Core.computation(function(){return m(i,void 0,void 0,function(){var e,r,i,o,s,u,l,c;return v(this,function(f){switch(f.label){case 0:e=0,r=a;f.label=1;case 1:if(!(e["+r.join(", ")+"]"}function o(t){return""+t.name+" "+t.elementSymbol+" "+t.id+""+a(t)+" at ("+e.Utils.round(t.x,1)+", "+e.Utils.round(t.y,1)+", "+e.Utils.round(t.z,1)+")"}function s(e){return""+e.name+" "+e.elementSymbol+" "+e.id+a(e)+""}function u(e){return""+e.authName+" "+e.chain.authAsymId+" "+e.authSeqNumber+(e.insCode!==null?" i: "+e.insCode:"")+""}function l(e){if(e.modelId==="1"){return"["+e.moleculeId+"]"}return"["+e.moleculeId+":"+e.modelId+"]"}function c(e){if(!e||!e.atoms.length)return"";if(e.atoms.length===1){return""+o(e.atoms[0])+" on "+u(e.residues[0])+" "+l(e)+""}else if(e.residues.length===1){return""+u(e.residues[0])+" "+l(e)+""}else{return""+e.atoms.length+" atoms on "+e.residues.length+" residues "+l(e)+""}}r.formatInfo=c;function f(e){if(!e||!e.atoms.length)return"";if(e.atoms.length===1){return""+s(e.atoms[0])+" "+l(e)+""}else if(e.residues.length===1){return""+u(e.residues[0])+" "+l(e)+""}else{return""+e.residues.length+" residues "+l(e)+""}}r.formatInfoShort=f;function h(r){if(t.isEmpty(r))return false;if(r.source.type.info.typeClass===e.Entity.VisualClass&&r.source.type!==e.Entity.Molecule.Visual)return false;var n=e.Utils.Molecule.findModelOrSelection(r.source);if(!n)return false;return true}r.isMoleculeModelInteractivity=h})(r=t.Molecule||(t.Molecule={}))})(t=e.Interactivity||(e.Interactivity={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n=function(){function e(e,r){var n=this;this.context=e;this.scene=r;this.entries=new Map;this.originalThemes=new Map;this.lastParent=NaN;t.Event.Tree.NodeAdded.getStream(e).subscribe(function(e){if(!t.Entity.isClass(e.data,t.Entity.VisualClass))return;n.add(e.data)});t.Event.Tree.NodeRemoved.getStream(e).subscribe(function(e){if(!t.Entity.isClass(e.data,t.Entity.VisualClass))return;n.remove(e.data)});t.Event.Tree.NodeUpdated.getStream(e).subscribe(function(e){if(!t.Entity.isVisual(e.data))return;var r=n.entries.get(e.data.id);if(!r)return;var i=r.visual.state.visibility!==2;if(r.visual.props.model.getVisibility()!==i){r.visual.props.model.updateVisibility(i)}});t.Command.Visual.UpdateBasicTheme.getStream(e).subscribe(function(e){if(!n.entries.get(e.data.visual.id)||!t.Entity.isVisual(e.data.visual))return;var r=e.data.visual;if(e.data.theme.isSticky){n.originalThemes.set(r.id,e.data.theme)}else if(!n.originalThemes.get(r.id)){n.originalThemes.set(r.id,r.props.model.theme)}r.props.model.applyTheme(e.data.theme)});t.Command.Molecule.Highlight.getStream(e).subscribe(function(e){return n.highlightMoleculeModel(e.data)});t.Command.Visual.ResetTheme.getStream(e).subscribe(function(e){return n.resetThemesAndHighlight(e.data&&e.data.selection)})}e.prototype.isEmpty=function(){return!this.entries.size};e.prototype.add=function(e){if(this.entries.has(e.id)||!e.props.model)return false;var t=e.parent.id;this.entries.set(e.id,{visual:e,parentId:t});this.scene.scene.models.add(e.props.model,this.entries.size===1&&this.lastParent!==t);var r=e.state.visibility!==2;if(e.props.model.getVisibility()!==r){e.props.model.updateVisibility(r)}e.props.model.tag=e;return true};e.prototype.remove=function(e){if(!this.entries.has(e.id))return false;this.lastParent=this.entries.get(e.id).parentId;this.entries.delete(e.id);this.originalThemes.delete(e.id);this.scene.scene.models.removeAndDispose(e.props.model);e.props.model.tag=void 0;e.props.model=void 0;return true};e.prototype.get=function(e){return this.entries.get(e)};e.prototype.resetThemesAndHighlight=function(e){var r=this;if(!e){this.originalThemes.forEach(function(e,t){var n=r.entries.get(t).visual.props.model;if(!n.theme.isSticky){n.applyTheme(e);r.originalThemes.delete(t)}else{r.originalThemes.set(t,n.theme)}});this.entries.forEach(function(e){return e.visual.props.model.highlight(false)});this.scene.scene.forceRender();return}var n=this.context.select(e);for(var i=0,a=n;i1.2)return 1.2;if(l<.1)return.1;return l}if(r.density!==void 0)return+r.density;return 1}function u(e,t,r){return{tessalation:e,drawingType:t?a.Cartoons.CartoonsModelType.AlphaTrace:a.Cartoons.CartoonsModelType.Default,showDirectionCones:r}}function l(e,r){if(typeof r.vdwScaling==="undefined")r.vdwScaling=n.Default.BallsAndSticksParams.vdwScaling;if(typeof r.atomRadius==="undefined")r.atomRadius=n.Default.BallsAndSticksParams.atomRadius;if(!r.useVDW){return function(e){return function(){return e}}(r.atomRadius)}var i=t.Utils.vdwRadiusFromElementSymbol(e);return function(e,t){return function(r){return e*t(r)}}(r.vdwScaling,i)}function c(t,r,n){var i=void 0;if(n.customMaxBondLengths){var a=Object.getOwnPropertyNames(n.customMaxBondLengths);if(a.length>0)i=e.Core.Utils.FastMap.create();for(var o=0,s=a;o0){for(o=0,s=a.warnings;o=0?e.Core.Structure.Query.residues():e.Core.Structure.Query.allAtoms();var s=o.compile()(a);var u=b(r,a.structure);var l=e.Core.Utils.DataTable.ofDefinition(e.Core.Structure.Tables.Positions,s.length);var c=l.x,h=l.y,d=l.z;var p=[];var m=new Float32Array(s.length);var v=i.Vector3.zero();var y=0;for(var x=0,_=s.fragments;x<_.length;x++){var w=_[x];var C=u(w.atomIndices[0]);g(a.structure,w.atomIndices,v);c[y]=v[0];h[y]=v[1];d[y]=v[2];p[p.length]=C;m[y]=1;y++}return{labels:p,options:r.labelsOptions,positions:l,sizes:m,theme:n}}r.create3DLabelsParams=x})(n=r.Molecule||(r.Molecule={}))})(r=t.Utils||(t.Utils={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r=function(){function t(t){this.context=t;this.subjects={select:new e.Rx.BehaviorSubject(e.Interactivity.Info.empty),click:new e.Rx.BehaviorSubject(e.Interactivity.Info.empty),currentEntity:new e.Rx.BehaviorSubject(void 0)};this.select=this.subjects.select.distinctUntilChanged(function(e){return e},e.Interactivity.interactivityInfoEqual);this.click=this.subjects.click.distinctUntilChanged(function(e){return e},e.Interactivity.interactivityInfoEqual);this.currentEntity=this.subjects.currentEntity;this.init()}t.prototype.init=function(){var t=this;var r=e.Interactivity.Info.empty;e.Event.Tree.NodeRemoved.getStream(this.context).subscribe(function(n){if(e.Interactivity.isSelection(r)&&r.source===n.data){r=e.Interactivity.Info.empty;e.Event.Visual.VisualSelectElement.dispatch(t.context,r)}});e.Event.Visual.VisualSelectElement.getStream(this.context).subscribe(function(n){r=n.data;t.subjects.click.onNext(r);if(e.Interactivity.isSelection(r)&&e.Entity.isVisual(r.source)&&!r.source.props.isSelectable)return;t.subjects.select.onNext(r)});e.Event.Entity.CurrentChanged.getStream(this.context).subscribe(function(e){return t.subjects.currentEntity.onNext(e.data)})};return t}();t.Streams=r})(t=e.Behaviour||(e.Behaviour={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";function n(e){t.Event.Tree.NodeAdded.getStream(e).subscribe(function(r){var n=r.data;if(n&&(n.transform.isUpdate||n.type.info.traits.isSilent))return;t.Command.Entity.SetCurrent.dispatch(e,n)})}r.SetEntityToCurrentWhenAdded=n;r.SuppressCreateVisualWhenModelIsAdded=false;function i(e){t.Event.Tree.NodeAdded.getStream(e).subscribe(function(n){if(r.SuppressCreateVisualWhenModelIsAdded||!t.Tree.Node.is(n.data,t.Entity.Molecule.Model)||n.data.isHidden){return}var i=t.Entity.Transformer.Molecule.CreateMacromoleculeVisual.info.defaultParams(e,n.data);t.Command.Tree.ApplyTransform.dispatch(e,{node:n.data,transform:t.Entity.Transformer.Molecule.CreateMacromoleculeVisual.create(i)})})}r.CreateVisualWhenModelIsAdded=i;function a(e){t.Event.Tree.NodeAdded.getStream(e).subscribe(function(e){var r=e.data;if(t.Entity.isMoleculeSelection(r)&&t.Entity.isVisual(r.parent)){var n=r;var i=r.parent;i.props.model.applySelection(n.props.indices,1)}});t.Event.Tree.NodeRemoved.getStream(e).subscribe(function(e){var r=e.data;if(t.Entity.isMoleculeSelection(r)&&t.Entity.isVisual(r.parent)){var n=r;var i=r.parent;i.props.model.applySelection(n.props.indices,2)}})}r.ApplySelectionToVisual=a;function o(e,r){var n=void 0;var i=void 0;e.subscribe(function(e){if(i){i.applySelection(n,2);i=void 0;n=void 0}if(t.Interactivity.isEmpty(e)||!t.Entity.isVisual(e.source))return;i=e.source.props.model;n=e.elements;i.applySelection(n,1)})}function s(e){o(e.behaviours.click,e)}r.ApplyInteractivitySelection=s;function u(e){return function(t){o(t.behaviours.click.filter(function(r){return e(r,t)}),t)}}r.FilteredApplyInteractivitySelection=u;function l(e){var r=t.Interactivity.Info.empty;t.Event.Visual.VisualSelectElement.getStream(e).subscribe(function(n){if(t.Interactivity.isEmpty(n.data)||t.Interactivity.isEmpty(r)){r=n.data;return}if((t.Tree.Node.hasAncestor(r.source,n.data.source)||t.Tree.Node.hasAncestor(n.data.source,r.source))&&t.Interactivity.interactivitySelectionElementsEqual(n.data,r)){r=t.Interactivity.Info.empty;setTimeout(function(){return t.Event.Visual.VisualSelectElement.dispatch(e,t.Interactivity.Info.empty)},0)}else{r=n.data}})}r.UnselectElementOnRepeatedClick=l;var c=e.Core.Geometry.LinearAlgebra.Vector3.zero();function f(r,n){var i=t.Utils.Molecule.findModel(n.source).props.model;if(!i)return;var a=n.elements;if(n.elements.length===1){a=t.Utils.Molecule.getResidueIndices(i,n.elements[0])}var o=t.Utils.Molecule.getCentroidAndRadius(i,a,c);if(n.elements.length===1){var s=n.elements[0];c[0]=i.positions.x[s];c[1]=i.positions.y[s];c[2]=i.positions.z[s]}r.scene.camera.focusOnPoint(e.Core.Geometry.LinearAlgebra.Vector3.toObj(c),Math.max(o,7))}function h(r,n){if(t.Interactivity.isEmpty(n)||n.source.type.info.typeClass!=="Visual")return;var i=n.source;var a=i.props.model;if(!a)return;var o=a.getBoundingSphereOfSelection(n.elements);if(o){r.scene.camera.focusOnPoint(e.Core.Geometry.LinearAlgebra.Vector3.toObj(o.center),Math.max(o.radius,7))}else{r.scene.camera.focusOnModel(a)}}function d(e,r){e.subscribe(function(e){if(t.Interactivity.Molecule.isMoleculeModelInteractivity(e))f(r,e);else h(r,e)})}function p(e){d(e.behaviours.click,e)}r.FocusCameraOnSelect=p;function m(e){return function(t){d(t.behaviours.click.filter(function(r){return e(r,t)}),t)}}r.FilteredFocusCameraOnSelect=m})(r=t.Behaviour||(t.Behaviour={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){var n;(function(r){"use strict";var n=e.Core.Structure.Query;var i=t.Entity.Transformer;r.SuppressShowInteractionOnSelect=false;function a(a){return function(o){var s=void 0;var u=void 0;var l={type:"BallsAndSticks",taskType:"Silent",params:{useVDW:true,vdwScaling:.25,bondRadius:.13,detail:"Automatic"},theme:{template:t.Visualization.Molecule.Default.ElementSymbolThemeTemplate,colors:t.Visualization.Molecule.Default.ElementSymbolThemeTemplate.colors.set("Bond",e.Visualization.Theme.Default.SelectionColor),transparency:{alpha:.4}},isNotSelectable:true};var c={type:"BallsAndSticks",taskType:"Silent",params:{useVDW:false,atomRadius:.15,bondRadius:.07,detail:"Automatic"},theme:{template:t.Visualization.Molecule.Default.UniformThemeTemplate,colors:t.Visualization.Molecule.Default.UniformThemeTemplate.colors.set("Uniform",{r:.4,g:.4,b:.4}),transparency:{alpha:.75}},isNotSelectable:true};function f(){if(s){t.Command.Tree.RemoveNode.dispatch(o,s);s=void 0;u=void 0}}o.behaviours.click.subscribe(function(e){if(r.SuppressShowInteractionOnSelect||t.Interactivity.isEmpty(e)){f();return}if(e.source.ref===u){var h=t.Utils.Molecule.findModel(e.source);if(!h)return;var d=n.atomsFromIndices(e.elements);setTimeout(t.Command.Molecule.CreateSelectInteraction.dispatch(o,{entity:h,query:d}),0);return}var p=t.Entity.isVisual(e.source)?e.source.props.isSelectable:true;if(!p)return;f();if(t.Interactivity.isEmpty(e)||!t.Utils.Molecule.findModelOrSelection(e.source))return;var m=n.atomsFromIndices(e.elements).wholeResidues();var v=n.atomsFromIndices(e.elements).wholeResidues().ambientResidues(a);var y=t.Utils.generateUUID();var g=t.Tree.Transform.build().add(e.source,i.Basic.CreateGroup,{label:"Interaction"},{ref:y,isHidden:true});s=y;u=t.Utils.generateUUID();g.then(i.Molecule.CreateSelectionFromQuery,{query:v,name:"Ambience",silent:true,inFullContext:true},{isBinding:true}).then(i.Molecule.CreateVisual,{style:c},{ref:u});g.then(i.Molecule.CreateSelectionFromQuery,{query:m,name:"Ligand",silent:true,inFullContext:true},{isBinding:true}).then(i.Molecule.CreateVisual,{style:l});t.Tree.Transform.apply(o,g).run()})}}r.ShowInteractionOnSelect=a;function o(e){e.highlight.addProvider(function(e){if(!t.Interactivity.Molecule.isMoleculeModelInteractivity(e))return void 0;var r=t.Interactivity.Molecule.transformInteraction(e);return t.Interactivity.Molecule.formatInfo(r)})}r.HighlightElementInfo=o;function s(e){var r=t.Interactivity.Info.empty;var n=void 0;var i=void 0;e.behaviours.click.subscribe(function(e){if(!t.Interactivity.Molecule.isMoleculeModelInteractivity(e)){r=t.Interactivity.Info.empty;i=void 0;n=void 0}else{r=e;var a=t.Utils.Molecule.findModel(e.source);if(!a){r=t.Interactivity.Info.empty;i=void 0;n=void 0}else{i=a.props.model;n=t.Interactivity.Molecule.formatInfoShort(t.Interactivity.Molecule.transformInteraction(e))}}});e.highlight.addProvider(function(e){if(!t.Interactivity.Molecule.isMoleculeModelInteractivity(e))return void 0;if(t.Interactivity.isEmpty(r))return void 0;var a=t.Utils.Molecule.findModel(e.source);if(!a)return void 0;var o=t.Utils.Molecule.getDistanceSet(i,r.elements,a.props.model,e.elements);if(o<1e-4)return void 0;return""+t.Utils.round(o,2)+" Å from "+n+""})}r.DistanceToLastClickedElement=s})(n=r.Molecule||(r.Molecule={}))})(r=t.Behaviour||(t.Behaviour={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){var r;(function(t){"use strict";var r="__ShowDynamicDensity-toast";var n=function(){function t(t,r){this.context=t;this.params=r;this.obs=[];this.ref=e.Utils.generateUUID()}t.prototype.remove=function(){var t=this.getVisual();if(t){e.Tree.remove(t)}};t.prototype.getVisual=function(){return this.context.select(this.ref)[0]};t.prototype.update=function(t){if(!this.params.showFull&&!e.Interactivity.Molecule.isMoleculeModelInteractivity(t)){this.remove();return}e.Command.Toast.Hide.dispatch(this.context,{key:r});var n=e.Utils.shallowClone(this.params.style);n.params=e.Utils.shallowClone(n.params);if(this.params.showFull){n.params.bottomLeft=void 0;n.params.topRight=void 0;n.taskType="Normal"}else{var i=t;var a=e.Utils.Molecule.findModel(i.source);var o=i.elements;var s=a.props.model;if(i.elements.length===1){o=e.Utils.Molecule.getResidueIndices(s,i.elements[0])}var u=e.Utils.Molecule.getBox(s,o,this.params.radius);n.params.bottomLeft=u.bottomLeft;n.params.topRight=u.topRight;n.taskType="Silent"}var l;var c=this.getVisual();if(!c){var f=e.Entity.Transformer.Density.CreateVisual.create({style:n},{ref:this.ref,isHidden:true});f.isUpdate=true;l=f.apply(this.context,this.behaviour)}else l=e.Entity.Transformer.Density.CreateVisual.create({style:n},{ref:this.ref,isHidden:true}).update(this.context,c);l.run()};t.prototype.updateTheme=function(t){this.params.style.theme=t;if(!this.behaviour)return;var r=this.getVisual();if(!r)return;var n=e.Tree.Node.findClosestNodeOfType(this.behaviour,[e.Entity.Density.Data]);var i=t.template.provider(n,e.Visualization.Theme.getProps(t));r.props.model.applyTheme(i)};t.prototype.dispose=function(){this.remove();e.Command.Toast.Hide.dispatch(this.context,{key:r});for(var t=0,n=this.obs;t0)return e.substr(0,e.length-1);return e}e.normalizeServerName=t;function r(e,r){return t(r)+"/"+e.trim().toLocaleLowerCase()+"/cartoon?encoding=bcif&lowPrecisionCoords=1"}e.getBaseUrl=r})(i=r.CoordinateStreaming||(r.CoordinateStreaming={}))})(n=r.Molecule||(r.Molecule={}))})(r=t.Behaviour||(t.Behaviour={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";function r(e,t,r,n,i,a,o){if(i.transformer!==r)return;try{var s=window[o];var u=a(i.params,n);if(s&&typeof u!=="undefined"){s("send","event",t,u,e.id)}}catch(e){}}function n(e,t){return e.format.name}function i(e){return e.url}function a(e){return e.queryString}function o(t,r){if(e.Tree.Node.isHidden(r))return void 0;var n=e.Utils.Molecule.findModel(r);if(!n)return void 0;return n.props.model.id+" $(name)$ "+t.name}function s(t,r){if(e.Tree.Node.isHidden(r))return void 0;var n=e.Utils.Molecule.findModel(r);if(!n)return void 0;return n.props.model.id+" $(type)$ "+t.type+" $(radius)$ "+t.radius}function u(t,r){var n=e.Utils.Molecule.findModel(r);if(!n)return void 0;return n.props.model.id+" $(server)$ "+t.server}function l(t,r){if(e.Tree.Node.isHidden(r))return void 0;return t.style.type}function c(e){return"$(format)$ "+e.format}function f(e,t){return e.queryString}function h(t,h){if(h===void 0){h="default"}return function(d){var p="ga-"+d.id+"-"+h;try{(function(e,t,r,n,i,a,o){e["GoogleAnalyticsObject"]=i;e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},e[i].l=1*+new Date;a=t.createElement(r),o=t.getElementsByTagName(r)[0];a.async=1;a.src=n;o.parentNode.insertBefore(a,o)})(window,document,"script","https://www.google-analytics.com/analytics.js",p);window[p]("create",t,"auto");setTimeout(function(){try{var e=window[p];if(e)e("send","event","Loaded","contextId",d.id)}catch(e){}},1e3)}catch(e){}e.Event.Tree.TransformerApply.getStream(d).subscribe(function(t){r(d,"Download",e.Entity.Transformer.Data.Download,t.data.a,t.data.t,i,p);r(d,"Create Molecule From Data",e.Entity.Transformer.Molecule.CreateFromData,t.data.a,t.data.t,n,p);r(d,"Create Model Selecion",e.Entity.Transformer.Molecule.CreateSelection,t.data.a,t.data.t,a,p);r(d,"Create Assembly",e.Entity.Transformer.Molecule.CreateAssembly,t.data.a,t.data.t,o,p);r(d,"Create Symmetry",e.Entity.Transformer.Molecule.CreateSymmetryMates,t.data.a,t.data.t,s,p);r(d,"Create Visual",e.Entity.Transformer.Molecule.CreateVisual,t.data.a,t.data.t,l,p);r(d,"Coordinate Streaming",e.Entity.Transformer.Molecule.CoordinateStreaming.CreateBehaviour,t.data.a,t.data.t,u,p);r(d,"Parse Density",e.Entity.Transformer.Density.ParseData,t.data.a,t.data.t,c,p);r(d,"Create Model Selection",e.Entity.Transformer.Molecule.CreateSelection,t.data.a,t.data.t,f,p)})}}t.GoogleAnalytics=h})(t=e.Behaviour||(e.Behaviour={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";var r=function(){function t(t,r){this.context=t;this._state=new e.Rx.Subject;this._latestState=void 0;this._latestState=r}Object.defineProperty(t.prototype,"dispatcher",{get:function(){return this.context.dispatcher},enumerable:true,configurable:true});t.prototype.setState=function(){var t=[];for(var r=0;r0){this.setState({params:r,issues:n,canApply:false});return}}var i=!t.Utils.deepEqual(this.anchorParams,r);this.setState({params:r,isDirty:i,issues:void 0,canApply:true})};n.prototype.updateParams=function(e){this._reset();this._updateParams(e)};n.prototype.autoUpdateParams=function(e){this._update();this._updateParams(e)};Object.defineProperty(n.prototype,"isUpdate",{get:function(){return this.transformer===this.entity.transform.transformer},enumerable:true,configurable:true});n.prototype.apply=function(){var t=this;this._reset();if(this.latestState.isBusy)return;var r=this.transformer.create(this.latestState.params);this.anchorParams=this.latestState.params;this.setState({isDirty:false,isBusy:true});try{var n=this.isUpdate?r.update(this.context,this.entity):r.apply(this.context,this.entity);var i=n.run();i.then(function(){return t.setState({isBusy:false})}).catch(function(){return t.setState({isBusy:false})});return i}catch(t){this.setState({isBusy:false});return e.Core.Computation.reject(t)}};n.prototype.setParams=function(e){this._reset();this.anchorParams=e;this.updateParams(e)};return n}(r.Component);n.Controller=i})(n=r.Transform||(r.Transform={}))})(r=t.Components||(t.Components={}))})(t=e.Bootstrap||(e.Bootstrap={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){var r;(function(r){"use strict";var n=function(t){y(r,t);function r(r){var n=t.call(this,r,{update:void 0,transforms:[]})||this;n.update();e.Event.Entity.CurrentChanged.getStream(r).subscribe(function(){return n.update()});return n}r.prototype.update=function(){if(!this.context.currentEntity){this.setState({transforms:[]});return}var e=this.context.currentEntity;var t=this.context.transforms;var r=void 0;if(e.transform.transformer&&e.transform.transformer.info.isUpdatable){r=t.getController(e.transform.transformer,e)}var n=[];for(var i=0,a=this.context.transforms.getBySourceType(e.type);i0?t.expander:void 0,t.options.length>0?e.React.createElement("div",{style:{display:t.isExpanded?"block":"none"},className:"lm-control-subgroup"},t.options):void 0)}})(t=e.Controls||(e.Controls={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var g=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;rthis.props.max){t=this.props.max;e=""+t}this.setState({value:e})};n.prototype.fire=function(){var e=+this.state.value;if(isNaN(e)){e=this.props.value}if(e!==this.props.value){if(this.firedValue!==e){this.firedValue=e;this.props.onChange.call(null,e)}}};n.prototype.render=function(){var r=this;var n=this.props.step;if(n===void 0)n=1;return e.React.createElement("div",{className:"lm-control-row lm-slider",title:this.props.title},e.React.createElement("span",null,this.props.label),e.React.createElement("div",null,e.React.createElement("div",null,e.React.createElement("div",null,e.React.createElement(f,{min:this.props.min,max:this.props.max,step:n,value:+this.state.value,onChange:function(e){return r.setState({value:""+e})},onAfterChange:function(e){return r.fire()}}))),e.React.createElement("div",null,e.React.createElement(t.TextBox,{value:this.state.value,onChange:function(e){return r.updateValue(e)},onBlur:function(){return r.fire()},onKeyPress:function(e){if(t.isEnter(e))r.fire()}}))))};return n}(e.React.Component);t.Slider=r;/** - * The following code was adapted from react-components/slider library. - * - * The MIT License (MIT) - * Copyright (c) 2015-present Alipay.com, https://www.alipay.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -function n(e){var t=[];var r={}.hasOwnProperty;for(var i=0;i1||e.type.toLowerCase()==="touchend"&&e.touches.length>0}function o(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function s(e,t){return e?t.clientY:t.pageX}function u(e,t){var r=t.getBoundingClientRect();return e?r.top+r.height*.5:r.left+r.width*.5}function l(e){e.stopPropagation();e.preventDefault()}var c=function(t){y(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.prototype.render=function(){var t=this.props,r=t.className,n=t.tipFormatter,i=t.vertical,a=t.offset,o=t.value,s=t.index;var u=i?{bottom:a+"%"}:{left:a+"%"};return e.React.createElement("div",{className:r,style:u,title:n(o,s)})};return r}(e.React.Component);t.Handle=c;var f=function(t){y(r,t);function r(e){var r=t.call(this,e)||this;r.sliderElement=void 0;r.handleElements=[];r.dragOffset=0;r.startPosition=0;r.startValue=0;r._getPointsCache=void 0;r.eventHandlers={touchmove:function(e){return r.onTouchMove(e)},touchend:function(e){return r.end("touch")},mousemove:function(e){return r.onMouseMove(e)},mouseup:function(e){return r.end("mouse")}};var n=e.range,i=e.min,a=e.max;var o=n?Array.apply(null,Array(+n+1)).map(function(){return i}):i;var s="defaultValue"in e?e.defaultValue:o;var u=e.value!==undefined?e.value:s;var l=(n?u:[i,u]).map(function(e){return r.trimAlignValue(e)});var c;if(n&&l[0]===l[l.length-1]&&l[0]===a){c=0}else{c=l.length-1}r.state={handle:null,recent:c,bounds:l};return r}r.prototype.componentWillReceiveProps=function(e){var t=this;if(!("value"in e||"min"in e||"max"in e))return;var r=this.state.bounds;if(e.range){var n=e.value||r;var i=n.map(function(r){return t.trimAlignValue(r,e)});if(i.every(function(e,t){return e===r[t]}))return;this.setState({bounds:i});if(r.some(function(r){return t.isValueOutOfBounds(r,e)})){this.props.onChange(i)}}else{var n=e.value!==undefined?e.value:r[1];var a=this.trimAlignValue(n,e);if(a===r[1]&&r[0]===e.min)return;this.setState({bounds:[e.min,a]});if(this.isValueOutOfBounds(r[1],e)){this.props.onChange(a)}}};r.prototype.onChange=function(e){var t=this.props;var r=!("value"in t);if(r){this.setState(e)}else if(e.handle!==undefined){this.setState({handle:e.handle})}var n=g({},this.state,e);var i=t.range?n.bounds:n.bounds[1];t.onChange(i)};r.prototype.onMouseDown=function(e){if(e.button!==0){return}var t=s(this.props.vertical,e);if(!this.isEventFromHandle(e)){this.dragOffset=0}else{var r=u(this.props.vertical,e.target);this.dragOffset=t-r;t=r}this.onStart(t);this.addDocumentEvents("mouse");l(e)};r.prototype.onMouseMove=function(e){var t=s(this.props.vertical,e);this.onMove(e,t-this.dragOffset)};r.prototype.onMove=function(e,t){l(e);var r=this.props;var n=this.state;var i=t-this.startPosition;i=this.props.vertical?-i:i;var a=i/this.getSliderLength()*(r.max-r.min);var o=this.trimAlignValue(this.startValue+a);var s=n.bounds[n.handle];if(o===s)return;var u=n.bounds.slice();u[n.handle]=o;var c=n.handle;if(r.pushable!==false){var f=n.bounds[c];this.pushSurroundingHandles(u,c,f)}else if(r.allowCross){u.sort(function(e,t){return e-t});c=u.indexOf(o)}this.onChange({handle:c,bounds:u})};r.prototype.onStart=function(e){var t=this.props;t.onBeforeChange(this.getValue());var r=this.calcValueByPos(e);this.startValue=r;this.startPosition=e;var n=this.state;var i=n.bounds;var a=1;if(this.props.range){var o=0;for(var s=1;si[s]){o=s}}if(Math.abs(i[o+1]-r)=0){r=t.length-t.indexOf(".")-1}return r};r.prototype.getSliderLength=function(){var e=this.sliderElement;if(!e){return 0}return this.props.vertical?e.clientHeight:e.clientWidth};r.prototype.getSliderStart=function(){var e=this.sliderElement;var t=e.getBoundingClientRect();return this.props.vertical?t.top:t.left};r.prototype.getValue=function(){var e=this.state.bounds;return this.props.range?e:e[1]};r.prototype.addDocumentEvents=function(e){if(e==="touch"){document.addEventListener("touchmove",this.eventHandlers.touchmove);document.addEventListener("touchend",this.eventHandlers.touchend)}else if(e==="mouse"){document.addEventListener("mousemove",this.eventHandlers.mousemove);document.addEventListener("mouseup",this.eventHandlers.mouseup)}};r.prototype.calcOffset=function(e){var t=this.props,r=t.min,n=t.max;var i=(e-r)/(n-r);return i*100};r.prototype.calcValue=function(e){var t=this.props,r=t.vertical,n=t.min,i=t.max;var a=Math.abs(e/this.getSliderLength());var o=r?(1-a)*(i-n)+n:a*(i-n)+n;return o};r.prototype.calcValueByPos=function(e){var t=e-this.getSliderStart();var r=this.trimAlignValue(this.calcValue(t));return r};r.prototype.end=function(e){this.removeEvents(e);this.props.onAfterChange(this.getValue());this.setState({handle:null})};r.prototype.isEventFromHandle=function(e){for(var t=0,r=this.handleElements;tt.max};r.prototype.pushHandle=function(e,t,r,n){var i=e[t];var a=e[t];while(r*(a-i)=n.length||a<0){return false}var o=t+r;var s=n[a];var u=this.props.pushable;var l=r*(e[o]-s);if(!this.pushHandle(e,o,r,+u-l)){return false}e[t]=s;return true};r.prototype.pushSurroundingHandles=function(e,t,r){var n=this.props.pushable;var i=e[t];var a=0;if(e[t+1]-i=l){f=l}if(!c&&n!=null&&n>0&&f<=i[n-1]){f=i[n-1]}if(!c&&n!=null&&n=i[n+1]){f=i[n+1]}var h=Object.keys(o).map(parseFloat);if(s!==null){var d=Math.round((f-u)/s)*s+u;h.push(d)}var p=h.map(function(e){return Math.abs(f-e)});var m=h[p.indexOf(Math.min.apply(Math,p))];return s!==null?parseFloat(m.toFixed(this.getPrecision(s))):m};r.prototype.render=function(){var t=this;var r;var a=this.state,o=a.handle,s=a.bounds;var u=this.props,l=u.className,c=u.prefixCls,f=u.disabled,d=u.vertical,m=u.dots,v=u.included,y=u.range,b=u.step,x=u.marks,_=u.max,w=u.min,C=u.tipFormatter,E=u.children;var S=this.props.handle;var T=s.map(function(e){return t.calcOffset(e)});var M=c+"-handle";var A=s.map(function(e,t){var r;return n((r={},r[M]=true,r[M+"-"+(t+1)]=true,r[M+"-lower"]=t===0,r[M+"-upper"]=t===s.length-1,r))});var P=b===null||C===null;var R={prefixCls:c,noTip:P,tipFormatter:C,vertical:d};this.handleElements=[];var k=s.map(function(r,n){return e.React.cloneElement(S,g({},R,{className:A[n],value:r,offset:T[n],dragging:o===n,index:n,key:n,ref:function(e){return t.handleElements.push(e)}}))});if(!y){k.shift()}var I=v||y;var D=[];var B=n((r={},r[c]=true,r[c+"-with-marks"]=Object.keys(x).length,r[c+"-disabled"]=f,r[c+"-vertical"]=this.props.vertical,r[l]=!!l,r));return e.React.createElement("div",{ref:function(e){return t.sliderElement=e},className:B,onTouchStart:f?i:this.onTouchStart.bind(this),onMouseDown:f?i:this.onMouseDown.bind(this)},e.React.createElement("div",{className:c+"-rail"}),D,e.React.createElement(p,{prefixCls:c,vertical:d,marks:x,dots:m,step:b,included:I,lowerBound:s[0],upperBound:s[s.length-1],max:_,min:w}),k,e.React.createElement(h,{className:c+"-mark",vertical:d,marks:x,included:I,lowerBound:s[0],upperBound:s[s.length-1],max:_,min:w}),E)};r.defaultProps={prefixCls:"lm-slider-base",className:"",min:0,max:100,step:1,marks:{},handle:e.React.createElement(c,{className:"",vertical:false,offset:0,tipFormatter:function(e){return e},value:0,index:0}),onBeforeChange:i,onChange:i,onAfterChange:i,tipFormatter:function(e,t){return e},included:true,disabled:false,dots:false,range:false,vertical:false,allowCross:true,pushable:false};return r}(e.React.Component);t.SliderBase=f;var h=function(t){var r=t.className,i=t.vertical,a=t.marks,o=t.included,s=t.upperBound,u=t.lowerBound,l=t.max,c=t.min;var f=Object.keys(a);var h=f.length;var d=100/(h-1);var p=d*.9;var m=l-c;var v=f.map(parseFloat).sort(function(e,t){return e-t}).map(function(t){var l;var f=!o&&t===s||o&&t<=s&&t>=u;var h=n((l={},l[r+"-text"]=true,l[r+"-text-active"]=f,l));var d={marginBottom:"-50%",bottom:(t-c)/m*100+"%"};var v={width:p+"%",marginLeft:-p/2+"%",left:(t-c)/m*100+"%"};var y=i?d:v;var b=a[t];var x=typeof b==="object"&&!e.React.isValidElement(b);var _=x?b.label:b;var w=x?g({},y,b.style):y;return e.React.createElement("span",{className:h,style:w,key:t},_)});return e.React.createElement("div",{className:r},v)};function d(e,t,r,n,i,a){var o=Object.keys(t).map(parseFloat);if(r){for(var s=i;s<=a;s=s+n){if(o.indexOf(s)>=0)continue;o.push(s)}}return o}var p=function(t){var r=t.prefixCls,i=t.vertical,a=t.marks,o=t.dots,s=t.step,u=t.included,l=t.lowerBound,c=t.upperBound,f=t.max,h=t.min;var p=f-h;var m=d(i,a,o,s,h,f).map(function(t){var a;var o=Math.abs(t-h)/p*100+"%";var s=i?{bottom:o}:{left:o};var f=!u&&t===c||u&&t<=c&&t>=l;var d=n((a={},a[r+"-dot"]=true,a[r+"-dot-active"]=f,a));return e.React.createElement("span",{className:d,style:s,key:t})});return e.React.createElement("div",{className:r+"-step"},m)}})(t=e.Controls||(e.Controls={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n=e.Bootstrap.Utils.shallowEqual;var i=function(e){y(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.prototype.shouldComponentUpdate=function(e,t,r){return!n(this.props,e)};i.prototype.render=function(){var e=this;var n=this.props.color,i=n.r,a=i===void 0?1:i,o=n.g,s=o===void 0?1:o,u=n.b,l=u===void 0?1:u;var c={a:1,r:255*a,g:255*s,b:255*l};var f=function(t){return e.props.onChange({r:t.rgb.r/255,g:t.rgb.g/255,b:t.rgb.b/255})};var h=t.React.createElement(r.ChromePickerHelper,{color:c,onChangeComplete:f});return t.React.createElement("div",{className:"lm-color-picker"},h)};return i}(t.React.Component);r.ColorPicker=i;var a=function(e){y(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;t.state={isExpanded:false};return t}n.prototype.render=function(){var e=this;var n=this.state.isExpanded?t.React.createElement(i,g({},this.props)):void 0;var a=this.props.color;var o=this.props.position?this.props.position:"above";return t.React.createElement("div",{className:"lm-control-row lm-toggle-color-picker lm-toggle-color-picker-"+o,onMouseLeave:function(){return e.setState({isExpanded:false})}},t.React.createElement("span",null,this.props.label),t.React.createElement("div",null,t.React.createElement(r.Button,{onClick:function(){e.setState({isExpanded:!e.state.isExpanded})},asBlock:true,customStyle:{backgroundColor:"rgb("+(255*a.r|0)+", "+(255*a.g|0)+", "+(255*a.b|0)+")",color:"rgb("+(255*(1-a.r)|0)+","+(255*(1-a.g)|0)+","+(255*(1-a.b)|0)+")"}})),n)};return n}(t.React.Component);r.ToggleColorPicker=a})(r=t.Controls||(t.Controls={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(e){var t;(function(t){"use strict";function r(r){return e.React.createElement("div",{className:"lm-control-row"},e.React.createElement(t.TextBox,{placeholder:"Enter query...",onChange:r.onChange,value:r.value,onKeyPress:function(e){if(t.isEnter(e)&&r.onEnter)r.onEnter.call(null,e)}}))}t.QueryEditor=r})(t=e.Controls||(e.Controls={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){"use strict";var n=e.Bootstrap.Utils.shallowEqual;var i=function(t){y(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.prototype.update=function(t){var r=e.Bootstrap.Utils.merge(this.props.state,t);if(r!==this.props.state)this.props.onChange(r)};r.prototype.shouldComponentUpdate=function(e,t){return!n(this.props,e)||!n(this.state,t)};return r}(t.React.Component);r.PureView=i;var a=function(e){y(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.subs=[];return t}t.prototype.subscribe=function(e,t){var r=e.subscribe(t);this.subs.push(r);return r};t.prototype.unsubscribe=function(e){var t=this.subs.indexOf(e);for(var r=t;r0}else if(i&&i[t]==="Hidden"){o=false}else{o=a.components.length>0}if(o){r.regions.push(this.renderTarget(e,a))}else{r.layoutClass+=" lm-layout-hide-"+e}};i.prototype.render=function(){var r="";var i=this.controller.latestState;var a;if(i.isExpanded){a="lm-layout-expanded"}else{a="lm-layout-standard ";switch(i.collapsedControlsLayout){case e.Bootstrap.Components.CollapsedControlsLayout.Outside:a+="lm-layout-standard-outside";break;case e.Bootstrap.Components.CollapsedControlsLayout.Landscape:a+="lm-layout-standard-landscape";break;case e.Bootstrap.Components.CollapsedControlsLayout.Portrait:a+="lm-layout-standard-portrait";break;default:a+="lm-layout-standard-outside";break}}var o=this.controller.targets;var s=[this.renderTarget("main",o[n.Main])];var u={regions:s,layoutClass:r};this.updateTarget("top",n.Top,u);this.updateTarget("right",n.Right,u);this.updateTarget("bottom",n.Bottom,u);this.updateTarget("left",n.Left,u);r=u.layoutClass;var l=o[n.Root].components.map(function(e){return t.React.createElement(e.view,{key:e.key,controller:e.controller})});return t.React.createElement("div",{className:"lm-plugin"},t.React.createElement("div",{className:"lm-plugin-content "+a},t.React.createElement("div",{className:r},s,l)))};return i}(r.View);r.Layout=i})(r=t.Views||(t.Views={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){var n;(function(n){"use strict";var i=function(e){y(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(n.prototype,"params",{get:function(){return this.controller.latestState.params},enumerable:true,configurable:true});n.prototype.updateParams=function(e){this.controller.updateParams(e)};n.prototype.autoUpdateParams=function(e){this.controller.autoUpdateParams(e)};n.prototype.getPersistentState=function(e,t){return this.controller.context.transforms.getPersistentState(this.controller.transformer,this.transformSourceEntity,e,t)};n.prototype.setPersistentState=function(e,t){if(this.controller.context.transforms.setPersistentState(this.controller.transformer,this.transformSourceEntity,e,t)){this.forceUpdate()}};Object.defineProperty(n.prototype,"transformSourceEntity",{get:function(){return this.isUpdate?this.controller.entity.parent:this.controller.entity},enumerable:true,configurable:true});Object.defineProperty(n.prototype,"isUpdate",{get:function(){return this.controller.isUpdate},enumerable:true,configurable:true});Object.defineProperty(n.prototype,"canApply",{get:function(){var e=this.controller.latestState;var t=e.canApply&&(!this.isUpdate||e.isDirty)&&!e.isBusy;if(t&&this.isUpdate&&e.parametersAutoUpdating)return false;return t},enumerable:true,configurable:true});n.prototype.applyEnter=function(e){if(!this.canApply)return;e.target.blur();this.controller.apply()};n.prototype.render=function(){var e=this;var n=this.isUpdate;var i=this.controller.latestState;var a=i.issues;var o=a&&a.length;var s=i.isBusy;var u=s?"Working...":n&&!o?"Nothing to update":a?a[0]:void 0;var l=this.controller.transformer.info;var c=t.React.createElement(t.Controls.CommitButton,{action:function(){return e.controller.apply()},isOn:this.canApply,title:a&&a.length?a[0]:this.canApply?n?"An update will remove all child nodes.":void 0:void 0,on:n?"Update":this.props.isAction?"Apply":"Add",off:u});var f=this.canApply||o;var h=this.props.customHeader?this.props.customHeader:(n?"Update ":"")+l.name;var d=this.getPersistentState("isExpanded",true);return t.React.createElement("div",{className:"lm-transformer-wrapper"},t.React.createElement(t.Controls.Panel,{header:h,badge:this.props.hideBadge?void 0:t.React.createElement(r.Entity.Badge,{type:l.to[0].info}),className:"lm-control lm-transformer lm-panel-"+l.to[0].info.typeClass,key:l.id,title:l.description,isExpanded:d,onExpand:function(t){e.setPersistentState("isExpanded",t)},description:this.controller.transformer.info.description,topRightAction:this.props.showVisibilityIcon?t.React.createElement(r.Entity.VisibilityControl,{entity:this.controller.entity}):void 0},this.renderControls(),f?c:void 0))};return n}(r.View);n.ControllerBase=i;var a=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){return t.React.createElement("div",null)};return r}(n.ControllerBase);n.Empty=a;var o=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.render=function(){var e=this.controller.context;var r=e.plugin;var n=this.controller.latestState;var i=n.transforms;var a=i.map(function(e){var n=r.getTransformerInfo(e.transformer).view;return t.React.createElement(n,{controller:e,key:e.transformer.info.id+"-"+e.entity.id})});if(n.update){var o=r.getTransformerInfo(n.update.transformer).view;a.push(t.React.createElement(o,{controller:n.update,key:n.update.transformer.info.id+"-"+n.update.entity.id}))}return t.React.createElement("div",{className:"lm-transform-view"},a)};return r}(r.View);n.View=o;n.TransparencyControl=function(e){var r=e.definition.alpha;return t.React.createElement(t.Controls.Slider,{label:"Opacity",onChange:function(t){return e.onChange({alpha:t,writeDepth:e.definition.writeDepth})},min:0,max:1,step:.01,value:r})};var s=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.componentWillMount=function(){var t=this;r.prototype.componentWillMount.call(this);this.subscribe(e.Bootstrap.Event.Tree.NodeUpdated.getStream(this.controller.context),function(e){var r=t.controller.latestState.controller;var n=r&&r.entity;if(e.data===n)t.forceUpdate()})};n.prototype.render=function(){var e=this.controller.latestState.controller;if(!e)return t.React.createElement("div",{className:"lm-empty-control"});var r=this.controller.context;var n=r.plugin;var i=n.getTransformerInfo(e.transformer).view;if(!i){console.warn("Count not find view for updater ("+e.transformer.info.id+"), please register it.");return t.React.createElement("div",{className:"lm-empty-control"})}return t.React.createElement(i,{controller:e,key:e.transformer.info.id+"-"+e.entity.id,customHeader:this.controller.header,hideBadge:true,showVisibilityIcon:true})};return n}(r.View);n.Updater=s;var u=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.render=function(){var e=this.controller.latestState.controller;if(!e)return t.React.createElement("div",{className:"lm-empty-control"});var r=this.controller.context;var n=r.plugin;var i=n.getTransformerInfo(e.transformer).view;if(!i){console.warn("Count not find view for updater ("+e.transformer.info.id+"), please register it.");return t.React.createElement("div",{className:"lm-empty-control"})}return t.React.createElement(i,{controller:e,key:e.transformer.info.id+"-"+e.entity.id,customHeader:this.controller.header,hideBadge:true,isAction:true})};return r}(r.View);n.Action=u})(n=r.Transform||(r.Transform={}))})(r=t.Views||(t.Views={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){var n;(function(r){var n;(function(n){"use strict";var i=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.renderControls=function(){var r=this;var n=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.OptionsGroup,{options:e.Bootstrap.Entity.Data.Types,caption:function(e){return e},current:n.type,onChange:function(t){return r.updateParams({type:t,responseCompression:e.Bootstrap.Utils.DataCompressionMethod.None})},label:"Type"}),n.type==="Binary"?t.React.createElement(t.Controls.OptionsGroup,{options:["None","Gzip"],caption:function(e){return e},current:n.responseCompression===e.Bootstrap.Utils.DataCompressionMethod.Gzip?"Gzip":"None",onChange:function(t){return r.updateParams({responseCompression:t==="None"?e.Bootstrap.Utils.DataCompressionMethod.None:e.Bootstrap.Utils.DataCompressionMethod.Gzip})},label:"Compression",title:'Specify the compression of the data. Usually only appliable if you downloading "raw" files.'}):void 0,t.React.createElement(t.Controls.TextBoxGroup,{value:n.url,onChange:function(e){return r.updateParams({url:e})},label:"URL",onEnter:function(e){return r.applyEnter(e)},placeholder:"Enter URL..."}))};return n}(r.ControllerBase);n.Download=i;var a=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.renderControls=function(){var r=this;var n=this.params;var i=this.controller.latestState;return t.React.createElement("div",null,t.React.createElement(t.Controls.OptionsGroup,{options:e.Bootstrap.Entity.Data.Types,caption:function(e){return e},current:n.type,onChange:function(e){return r.updateParams({type:e})},label:"Type"}),t.React.createElement("div",{className:"lm-btn lm-btn-block lm-btn-action lm-loader-lm-btn-file",style:{marginTop:"1px"}},n.file?n.file.name:"Select a file..."," ",t.React.createElement("input",{disabled:i.isBusy,type:"file",onChange:function(e){return r.updateParams({file:e.target.files[0]})},multiple:false})))};return n}(r.ControllerBase);n.OpenFile=a;var o=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.TextBoxGroup,{value:r.id,onChange:function(t){return e.updateParams({id:t})},label:"Id",onEnter:function(t){return e.applyEnter(t)},placeholder:"Enter PDB id..."}))};return r}(r.ControllerBase);n.WithIdField=o;var s=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.TextBoxGroup,{value:r.id,onChange:function(t){return e.updateParams({id:t})},label:"URL",onEnter:function(t){return e.applyEnter(t)},placeholder:"Enter URL..."}))};return r}(r.ControllerBase);n.WithUrlIdField=s})(n=r.Data||(r.Data={}))})(n=r.Transform||(r.Transform={}))})(r=t.Views||(t.Views={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){var n;(function(r){var n;(function(n){"use strict";var i=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.renderControls=function(){var r=this;var n=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.OptionsGroup,{options:e.Core.Formats.Molecule.SupportedFormats.All,caption:function(e){return e.name},current:n.format,onChange:function(e){return r.updateParams({format:e})},label:"Format"}))};return n}(r.ControllerBase);n.CreateFromData=i;var a=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.renderControls=function(){var r=this;var n=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.OptionsGroup,{options:e.Core.Formats.Molecule.SupportedFormats.All,caption:function(e){return e.name},current:n.format,onChange:function(e){return r.updateParams({format:e})},label:"Format"}),t.React.createElement(t.Controls.TextBoxGroup,{value:n.id,onChange:function(e){return r.updateParams({id:e})},label:"URL",onEnter:function(e){return r.applyEnter(e)},placeholder:"Enter url..."}))};return n}(r.ControllerBase);n.DownloadFromUrl=a;var o=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.renderControls=function(){var r=this;var n=this.params;var i=this.controller.latestState;var a=e.Core.Formats.FormatInfo.formatFileFilters(e.Core.Formats.Molecule.SupportedFormats.All);return t.React.createElement("div",null,t.React.createElement("div",{className:"lm-btn lm-btn-block lm-btn-action lm-loader-lm-btn-file",style:{marginTop:"1px"}},n.file?n.file.name:"Select a file..."," ",t.React.createElement("input",{disabled:i.isBusy,type:"file",accept:a,onChange:function(e){return r.updateParams({file:e.target.files[0]})},multiple:false})))};return n}(r.ControllerBase);n.OpenFile=o;var s=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.TextBoxGroup,{value:r.id,onChange:function(t){return e.updateParams({id:t})},label:"Id",onEnter:function(t){return e.applyEnter(t)},placeholder:"Enter pdb id..."}),t.React.createElement(t.Controls.TextBoxGroup,{value:r.server,onChange:function(t){return e.updateParams({server:t})},label:"Server",onEnter:function(t){return e.applyEnter(t)},placeholder:"Server url..."}))};return r}(r.ControllerBase);n.InitCoordinateStreaming=s;var u=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.transformSourceEntity;var n=r.props.dictionary.dataBlocks.map(function(e,t){return{b:e.header,i:t}});return t.React.createElement("div",null,t.React.createElement(t.Controls.OptionsGroup,{options:n,caption:function(e){return e.b},current:n[this.params.blockIndex],onChange:function(t){return e.updateParams({blockIndex:t.i})},label:"Source"}))};return r}(r.ControllerBase);n.CreateFromMmCif=u;var l=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.transformSourceEntity.props.molecule.models.length;return t.React.createElement("div",null,t.React.createElement(t.Controls.Slider,{label:"Index",onChange:function(t){return e.updateParams({modelIndex:t-1})},min:1,max:r,step:1,value:(this.params.modelIndex|0)+1,title:"Index of the model."}))};return r}(r.ControllerBase);n.CreateModel=l;var c=function(r){y(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}n.prototype.renderControls=function(){var r=this;var n=this.params;var i=e.Bootstrap.Utils.Molecule.findModel(this.transformSourceEntity);var a=i.props.model.data.assemblyInfo;if(!a)return void 0;var o=a.assemblies.map(function(e){return e.name});return t.React.createElement("div",null,t.React.createElement(t.Controls.OptionsGroup,{options:o,current:n.name,onChange:function(e){return r.updateParams({name:e})},label:"Name"}))};return n}(r.ControllerBase);n.CreateAssembly=c;var f=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.params;var n=["Mates","Interaction"];return t.React.createElement("div",null,t.React.createElement(t.Controls.OptionsGroup,{options:n,current:r.type,onChange:function(t){return e.updateParams({type:t})},label:"Type",title:"Mates: copies whole asymetric unit. Interaction: Includes only residues that are no more than `radius` from the asymetric unit."}),t.React.createElement(t.Controls.Slider,{label:"Radius",onChange:function(t){return e.updateParams({radius:t})},min:0,max:25,step:.1,value:r.radius,title:"Interaction radius."}))};return r}(r.ControllerBase);n.CreateSymmetryMates=f;var h=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.TextBoxGroup,{value:r.name,onChange:function(t){return e.updateParams({name:t})},label:"Name",onEnter:function(t){return e.applyEnter(t)},placeholder:"Optional name..."}),t.React.createElement(t.Controls.QueryEditor,{value:r.queryString,onChange:function(t){return e.updateParams({queryString:t})},onEnter:function(t){return e.applyEnter(t)}}))};return r}(r.ControllerBase);n.CreateSelection=h;var d=function(e){y(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.renderControls=function(){var e=this;var r=this.params;return t.React.createElement("div",null,t.React.createElement(t.Controls.Toggle,{onChange:function(t){return e.updateParams({polymer:t})},value:r.polymer,label:"Polymer"}),t.React.createElement(t.Controls.Toggle,{onChange:function(t){return e.updateParams({het:t})},value:r.het,label:"HET"}),t.React.createElement(t.Controls.Toggle,{onChange:function(t){return e.updateParams({water:t})},value:r.water,label:"Water"}))};return r}(r.ControllerBase);n.CreateMacromoleculeVisual=d;var p=function(n){y(i,n);function i(){return n!==null&&n.apply(this,arguments)||this}i.prototype.detail=function(){var r=this;var n=this.params.style.params;return[t.React.createElement(t.Controls.OptionsGroup,{options:e.Bootstrap.Visualization.Molecule.DetailTypes,caption:function(e){return e},current:n.detail,onChange:function(e){return r.controller.updateStyleParams({detail:e})},label:"Detail"})]};i.prototype.cartoons=function(){var r=this;var n=this.params.style.params;return[t.React.createElement(t.Controls.Toggle,{key:0,onChange:function(e){return r.controller.updateStyleParams({showDirectionCone:e})},value:n.showDirectionCone,label:"Dir. Cones"}),t.React.createElement(t.Controls.OptionsGroup,{key:1,options:e.Bootstrap.Visualization.Molecule.DetailTypes,caption:function(e){return e},current:n.detail,onChange:function(e){return r.controller.updateStyleParams({detail:e})},label:"Detail"})]};i.prototype.ballsAndSticks=function(){var r=this;var n=this.params.style.params;var i=[];var a=0;i.push(t.React.createElement(t.Controls.Toggle,{title:"Scale atoms using their VDW radius.",onChange:function(e){return r.controller.updateStyleParams({useVDW:e})},value:n.useVDW,label:"VDW"}));if(n.useVDW){i.push(t.React.createElement(t.Controls.Slider,{key:a++,label:"Scale",onChange:function(e){return r.controller.updateStyleParams({vdwScaling:e})},min:.1,max:1,step:.01,value:n.vdwScaling,title:"VDW scale factor."}))}else{i.push(t.React.createElement(t.Controls.Slider,{key:a++,label:"Atom Rds",onChange:function(e){return r.controller.updateStyleParams({atomRadius:e})},min:.05,max:2,step:.01,value:n.atomRadius,title:"Atom Radius"}))}i.push(t.React.createElement(t.Controls.Slider,{key:a++,label:"Bond Rds",onChange:function(e){return r.controller.updateStyleParams({bondRadius:e})},min:.05,max:1,step:.01,value:n.bondRadius,title:"Bond Radius"}));var o=n.customMaxBondLengths&&n.customMaxBondLengths["H"]?n.customMaxBondLengths["H"]:1.15;i.push(t.React.createElement(t.Controls.Slider,{key:a++,label:"H Bond Len",onChange:function(e){return r.controller.updateStyleParams({customMaxBondLengths:g({},n.customMaxBondLengths,{H:e})})},min:.9,max:1.5,step:.01,value:o,title:"Maximum H bond length"}));i.push(t.React.createElement(t.Controls.Toggle,{key:a++,onChange:function(e){return r.controller.updateStyleParams({hideHydrogens:e})},value:n.hideHydrogens,label:"Hide H"}));i.push(t.React.createElement(t.Controls.OptionsGroup,{key:a++,options:e.Bootstrap.Visualization.Molecule.DetailTypes,caption:function(e){return e},current:n.detail,onChange:function(e){return r.controller.updateStyleParams({detail:e})},label:"Detail"}));return i};i.prototype.surface=function(){var e=this;var r=this.params.style.params;var n=0;return[t.React.createElement(t.Controls.Slider,{key:n++,label:"Probe Radius",onChange:function(t){return e.controller.updateStyleParams({probeRadius:t})},min:0,max:6,step:.1,value:r.probeRadius}),t.React.createElement(t.Controls.Slider,{key:n++,label:"Smoothing",onChange:function(t){return e.controller.updateStyleParams({smoothing:t})},min:0,max:20,step:1,value:r.smoothing,title:"Number of laplacian smoothing itrations."}),t.React.createElement(t.Controls.Toggle,{key:n++,onChange:function(t){return e.controller.updateStyleParams({automaticDensity:t})},value:r.automaticDensity,label:"Auto Detail"}),r.automaticDensity?void 0:t.React.createElement(t.Controls.Slider,{key:n++,label:"Detail",onChange:function(t){return e.controller.updateStyleParams({density:t})},min:.1,max:3,step:.1,value:r.density,title:"Determines the size of a grid cell (size = 1/detail)."}),t.React.createElement(t.Controls.Toggle,{key:n++,onChange:function(t){return e.controller.updateStyleParams({isWireframe:t})},value:r.isWireframe,label:"Wireframe"})]};i.prototype.createColors=function(){var e=this;var n=this.params.style.theme;var i=this.params.style.type==="BallsAndSticks";var a=n.colors.filter(function(e,t){return!i?t!=="Bond":true}).map(function(r,n){return t.React.createElement(t.Controls.ToggleColorPicker,{key:n,label:n,color:r,onChange:function(t){return e.controller.updateThemeColor(n,t)}})}).toArray();a.push(t.React.createElement(r.TransparencyControl,{definition:n.transparency,onChange:function(t){return e.controller.updateThemeTransparency(t)}}));return a};i.prototype.renderControls=function(){var r=this;var n=this.params;var i;switch(n.style.type){case"Surface":i=this.surface();break;case"BallsAndSticks":i=this.ballsAndSticks();break;case"Cartoons":i=this.cartoons();break;default:i=this.detail();break}var a=function(t){return e.Bootstrap.Visualization.Molecule.TypeDescriptions[t]};var o=this.getPersistentState("showTypeOptions",false);var s=this.getPersistentState("showThemeOptions",false);return t.React.createElement("div",null,t.React.createElement(t.Controls.ExpandableGroup,{select:t.React.createElement(t.Controls.OptionsGroup,{options:e.Bootstrap.Visualization.Molecule.Types,caption:function(e){return a(e).label},current:n.style.type,onChange:function(t){return r.controller.updateTemplate(t,e.Bootstrap.Visualization.Molecule.Default.ForType)},label:"Type"}),expander:t.React.createElement(t.Controls.ControlGroupExpander,{isExpanded:o,onChange:function(e){return r.setPersistentState("showTypeOptions",e)}}),options:i,isExpanded:o}),t.React.createElement(t.Controls.ExpandableGroup,{select:t.React.createElement(t.Controls.OptionsGroup,{options:e.Bootstrap.Visualization.Molecule.Default.Themes,caption:function(e){return e.name},current:n.style.theme.template,onChange:function(e){return r.controller.updateThemeDefinition(e)},label:"Coloring"}),expander:t.React.createElement(t.Controls.ControlGroupExpander,{isExpanded:s,onChange:function(e){return r.setPersistentState("showThemeOptions",e)}}),options:this.createColors(),isExpanded:s}))};return i}(r.ControllerBase);n.CreateVisual=p;var m=function(n){y(i,n);function i(){return n!==null&&n.apply(this,arguments)||this}i.prototype.renderControls=function(){var n=this;var i=this.controller.latestState.params.style;var a=t.React.createElement(t.Controls.OptionsGroup,{options:e.Bootstrap.Utils.Molecule.Labels3DKinds,caption:function(t){return e.Bootstrap.Utils.Molecule.Labels3DKindLabels[t]},current:i.params.kind,onChange:function(e){return n.controller.updateStyleParams({kind:e})},label:"Kind"});var o=this.getPersistentState("showOptions",false);return t.React.createElement("div",null,t.React.createElement(t.Controls.ExpandableGroup,{select:a,expander:t.React.createElement(t.Controls.ControlGroupExpander,{isExpanded:o,onChange:function(e){return n.setPersistentState("showOptions",e)}}),options:r.Labels.optionsControls(this.controller),isExpanded:o}))};return i}(r.ControllerBase);n.CreateLabels=m})(n=r.Molecule||(r.Molecule={}))})(n=r.Transform||(r.Transform={}))})(r=t.Views||(t.Views={}))})(t=e.Plugin||(e.Plugin={}))})(p||(p={}));/* - * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info. - */ -var p;(function(e){var t;(function(t){var r;(function(r){var n;(function(r){var n;(function(n){"use strict";var i=function(r){return t.React.createElement(t.Controls.ExpandableGroup,{select:t.React.createElement(t.Controls.Slider,{label:r.isSigma?"Iso Value (σ)":"Iso Value",onChange:r.onChangeValue,min:r.min,max:r.max,value:r.value,step:.001}),expander:t.React.createElement(t.Controls.ControlGroupExpander,{isExpanded:r.view.getPersistentState("showIsoValueType",false),onChange:function(e){return r.view.setPersistentState("showIsoValueType",e)}}),options:[t.React.createElement(t.Controls.Toggle,{onChange:function(t){return r.onChangeType(t?e.Bootstrap.Visualization.Density.IsoValueType.Sigma:e.Bootstrap.Visualization.Density.IsoValueType.Absolute)},value:r.isSigma,label:"Relative (\\u03C3)"})],isExpanded:r.view.getPersistentState("showIsoValueType",false)})};function a(e,t,r,n){var i=(t-e.valuesInfo.mean)/e.valuesInfo.sigma;if(i>n)return n;if(ie.valuesInfo.max)return e.valuesInfo.max;if(rr.bottom){var a=n.bottom-r.bottom;t.scrollTop=i+a}}catch(e){}};a.prototype.componentWillMount=function(){var t=this;var r=this.controller.context.tree.root;var n=r.tree.context;this.subscribe(e.Bootstrap.Event.Tree.NodeUpdated.getStream(n),function(e){if(e.data===r){if(r.version!==t.renderedVersion)t.forceUpdate()}})};a.prototype.render=function(){var e=this;var r=this.controller.context.tree.root;this.renderedVersion=r.version;var n=[];for(var a=0,o=r.children;a} CIF format structure data - * @throws {Error} If all endpoints fail - * @see https://www.rcsb.org/docs/programmatic-access/file-download-services - */ -async function getPDBbinary(id) { - const TIMEOUT = 15000 // 15 second timeout per request - - const endpoints = [ - { - name: "wwPDB", - url: `https://files.wwpdb.org/download/${id}.cif`, - }, - { - name: "RCSB", - url: `https://files.rcsb.org/download/${id}.cif`, - }, - { - name: "EBI", - url: `https://www.ebi.ac.uk/pdbe/static/entry/${id.toLowerCase()}_updated.cif`, - }, - ] - - const errors = [] - - // Try each endpoint in sequence - for (let i = 0; i < endpoints.length; i++) { - const { name, url } = endpoints[i] - const isLastEndpoint = i === endpoints.length - 1 - - try { - const response = await $.ajax({ url, timeout: TIMEOUT }) - return response - } catch (error) { - // Track the error - errors.push({ endpoint: name, error }) - - // Log to Sentry for monitoring - if (window.Sentry) { - window.Sentry.addBreadcrumb({ - message: `PDB fetch failed: ${name}`, - data: { - pdbId: id, - endpoint: name, - error: error.statusText, - attemptNumber: i + 1, - totalEndpoints: endpoints.length, - }, - level: "warning", - }) - } - - // If this was the last endpoint, throw with all error details - if (isLastEndpoint) { - const errorSummary = errors - .map((e) => `${e.endpoint}: ${e.error.statusText || "Network error"}`) - .join("; ") - - throw new Error(`Failed to fetch PDB ${id} from all sources. Errors: ${errorSummary}`) - } - } - } -} - /** * Load and display chemical information for a PDB entry. * @@ -161,88 +87,101 @@ function loadChemInfo(pdbid) { } /** - * Initialize LiteMol molecular visualization plugin. + * Initialize Mol* (pdbe-molstar) molecular visualization plugin. + * + * CORS & Data Source Notes: + * ------------------------- + * pdbe-molstar's default `moleculeId` option uses EBI's entry-files endpoint + * (https://www.ebi.ac.uk/pdbe/entry-files/download/{id}.bcif) which: + * - Returns 404 for many structures + * - Has NO CORS headers (Access-Control-Allow-Origin) + * - Was designed for same-origin usage on EBI's website + * + * Instead, we use `customData` with RCSB Models Server which provides: + * - Binary CIF (bcif) format for optimal performance + * - Full CORS support (access-control-allow-origin: *) + * - Reliable availability for all PDB structures + * - Source: https://models.rcsb.org/{id}.bcif + * + * Alternative CORS-enabled endpoints (CIF format): + * - https://files.wwpdb.org/download/{id}.cif + * - https://files.rcsb.org/download/{id}.cif * * @param {string} selection - CSS selector for the container element * @param {jQuery} changer - jQuery object for the PDB selector dropdown + * @see https://www.rcsb.org/docs/programmatic-access/file-download-services */ -function initLiteMol(selection, changer) { - const PluginSpec = LiteMol.Plugin.getDefaultSpecification() - const { LayoutRegion } = LiteMol.Bootstrap.Components - const { Components } = LiteMol.Plugin - PluginSpec.components = [ - Components.Visualization.HighlightInfo(LayoutRegion.Main, true), - Components.Entity.Current("LiteMol", LiteMol.Plugin.VERSION.number)(LayoutRegion.Right, true), - Components.Transform.View(LayoutRegion.Right), - Components.Context.Overlay(LayoutRegion.Root), - Components.Context.BackgroundTasks(LayoutRegion.Main, true), - ] +function initMolstar(selection, changer) { + const viewerContainer = document.querySelector(selection) + if (!viewerContainer) { + console.error(`Mol* viewer container not found: ${selection}`) + return + } - try { - const plugin = LiteMol.Plugin.create({ - customSpecification: PluginSpec, - target: selection, - viewportBackground: "#fff", - layoutState: { - hideControls: true, - isExpanded: false, - }, - allowAnalytics: true, - }) + // Create plugin instance + const plugin = new PDBeMolstarPlugin() - // Cache PDB data promises to avoid redundant fetches - const dataCache = new Map() - let currentRequest = null + let currentPluginInstance = null - changer.change(async function () { - const id = this.value - const requestId = Symbol("request") - currentRequest = requestId + changer.change(async function () { + const id = this.value + + // Clear previous structure + if (currentPluginInstance) { + // Clear the container for re-rendering + viewerContainer.innerHTML = "" + } - // Get or create cached promise - if (!dataCache.has(id)) { - dataCache.set(id, getPDBbinary(id)) + try { + // Use RCSB Models Server with bcif format for optimal performance and CORS support + // See: https://www.rcsb.org/docs/programmatic-access/file-download-services + const url = `https://models.rcsb.org/${id}.bcif` + + // Render the plugin with custom data URL + const options = { + customData: { url: url, format: "bcif", binary: true }, + bgColor: { r: 255, g: 255, b: 255 }, + hideControls: true, + sequencePanel: true, + hideStructure: ["het", "water", "carbs"], } - plugin.clear() + await plugin.render(viewerContainer, options) + + // Hide the axis helper (XYZ indicator) at bottom left + plugin.plugin.canvas3d?.setProps({ + camera: { + helper: { axes: { name: "off", params: {} } }, + }, + }) - try { - const data = await dataCache.get(id) + // Monitor layout state changes to enforce controls visibility rules + plugin.plugin.layout.events.updated.subscribe(() => { + const state = plugin.plugin.layout.state - // Only load if this is still the active request - if (currentRequest === requestId) { - plugin.loadMolecule({ data, id }) - } - } catch (error) { - // Only show error if this is still the active request - if (currentRequest === requestId) { - $(selection).html( - 'Failed to retrieve molecular structure. Please refresh.' - ) - if (window.Sentry) { - window.Sentry.captureException(error, { - tags: { pdbId: id, component: "litemol" }, - }) - } + // When entering expanded mode, automatically show controls + if (state.isExpanded && !state.showControls) { + plugin.canvas.toggleControls(true) } - } - }) - // Close side panel when clicking outside (use namespace to prevent leaks) - $("body") - .off("click.litemol") - .on("click.litemol", (e) => { - if ($(".lm-layout-right").length && $(e.target).closest("#litemol-viewer").length === 0) { - plugin.setLayoutState({ hideControls: true }) + // When exiting expanded mode, automatically hide controls + if (!state.isExpanded && state.showControls) { + plugin.canvas.toggleControls(false) } }) - } catch (err) { - if (window.Sentry) { - window.Sentry.captureException(err, { - tags: { component: "litemol-init" }, - }) + + currentPluginInstance = plugin + } catch (error) { + $(selection).html( + 'Failed to retrieve molecular structure. Please refresh.' + ) + if (window.Sentry) { + window.Sentry.captureException(error, { + tags: { pdbId: id, component: "molstar" }, + }) + } } - } + }) // Update external link and load metadata when selection changes changer @@ -389,7 +328,7 @@ function downloadPDBMeta(pdbIds) { } /** - * Fetch PDB metadata and initialize LiteMol viewer. + * Fetch PDB metadata and initialize Mol* viewer. * * @param {string[]} pdbIds - Array of PDB identifiers */ @@ -425,7 +364,7 @@ async function getPDBinfo(pdbIds) { select.append($("